已點歌曲列表刪除
This commit is contained in:
parent
a4b397e812
commit
2d8e94704d
@ -9,10 +9,10 @@ namespace DBObj
|
|||||||
{
|
{
|
||||||
private static bool isWelcome = true;
|
private static bool isWelcome = true;
|
||||||
public static SongData welcome;
|
public static SongData welcome;
|
||||||
public static SongData close ;
|
public static SongData close;
|
||||||
private static SongData publicPlaying=null;
|
private static SongData publicPlaying = null;
|
||||||
private static List<SongData> publicSong = new();
|
private static List<SongData> publicSong = new();
|
||||||
private static SongData playing=null;
|
private static SongData playing = null;
|
||||||
private static List<SongData> not_played = new List<SongData>();
|
private static List<SongData> not_played = new List<SongData>();
|
||||||
private static List<SongData> played = new List<SongData>();
|
private static List<SongData> played = new List<SongData>();
|
||||||
public static List<SongData> PublicSong() => publicSong;
|
public static List<SongData> PublicSong() => publicSong;
|
||||||
@ -20,7 +20,7 @@ namespace DBObj
|
|||||||
public static SongData Current()
|
public static SongData Current()
|
||||||
{
|
{
|
||||||
Console.WriteLine(not_played.Count + " Current " + playing);
|
Console.WriteLine(not_played.Count + " Current " + playing);
|
||||||
return (playing ==null) ? publicPlaying : playing;
|
return (playing == null) ? publicPlaying : playing;
|
||||||
}
|
}
|
||||||
public static SongData Next()
|
public static SongData Next()
|
||||||
{
|
{
|
||||||
@ -58,17 +58,22 @@ namespace DBObj
|
|||||||
}
|
}
|
||||||
private static SongData NextPublicSong()
|
private static SongData NextPublicSong()
|
||||||
{
|
{
|
||||||
if (Program.room.IsClose()) {
|
if (Program.room.IsClose())
|
||||||
|
{
|
||||||
publicPlaying = close;
|
publicPlaying = close;
|
||||||
} else if(Program.room.IsOpen() && isWelcome){
|
}
|
||||||
|
else if (Program.room.IsOpen() && isWelcome)
|
||||||
|
{
|
||||||
isWelcome = false;
|
isWelcome = false;
|
||||||
publicPlaying = welcome;
|
publicPlaying = welcome;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
publicPlaying = publicSong[0];
|
publicPlaying = publicSong[0];
|
||||||
publicSong.RemoveAt(0);
|
publicSong.RemoveAt(0);
|
||||||
publicSong.Add(publicPlaying);
|
publicSong.Add(publicPlaying);
|
||||||
}
|
}
|
||||||
|
|
||||||
return publicPlaying;
|
return publicPlaying;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,31 +97,28 @@ namespace DBObj
|
|||||||
{
|
{
|
||||||
played.Add(new SongData(song, PlayState.NoFile));
|
played.Add(new SongData(song, PlayState.NoFile));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Cancel(SongData song)
|
public static void Cancel(SongData song)
|
||||||
{
|
{
|
||||||
//if (song.FileExistsInServers())
|
not_played.Remove(song);
|
||||||
//{
|
played.Remove(song);
|
||||||
not_played.Remove(song);
|
chkCut();
|
||||||
played.Remove(song);
|
|
||||||
// PrimaryForm.Instance.AddSongCount(songData.Number);
|
|
||||||
chkCut();
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Insert(SongData song)
|
public static void Insert(SongData song)
|
||||||
{
|
{
|
||||||
if (song.FileExistsInServers()) {
|
if (song.FileExistsInServers())
|
||||||
not_played.Insert(0, new SongData(song,PlayState.InsertPlayback));
|
{
|
||||||
|
not_played.Insert(0, new SongData(song, PlayState.InsertPlayback));
|
||||||
chkCut();
|
chkCut();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
played.Add(new SongData(song, PlayState.NoFile));
|
played.Add(new SongData(song, PlayState.NoFile));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
private static void chkCut()
|
private static void chkCut()
|
||||||
{
|
{
|
||||||
@ -126,21 +128,26 @@ namespace DBObj
|
|||||||
PrimaryForm.Instance.Invoke(new System.Action(() => PrimaryForm.Instance.videoPlayerForm.PlayNextSong()));
|
PrimaryForm.Instance.Invoke(new System.Action(() => PrimaryForm.Instance.videoPlayerForm.PlayNextSong()));
|
||||||
else
|
else
|
||||||
PrimaryForm.Instance.videoPlayerForm.PlayNextSong();
|
PrimaryForm.Instance.videoPlayerForm.PlayNextSong();
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
UpdateNextSongLabel();
|
UpdateNextSongLabel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void UpdateNextSongLabel()
|
public static void UpdateNextSongLabel()
|
||||||
{
|
{
|
||||||
if (Program.room.IsClose()) {
|
if (Program.room.IsClose())
|
||||||
|
{
|
||||||
VideoPlayerForm.overlayForm.UpdateTopLeftLabel(" ");
|
VideoPlayerForm.overlayForm.UpdateTopLeftLabel(" ");
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
VideoPlayerForm.overlayForm.UpdateTopLeftLabel(
|
VideoPlayerForm.overlayForm.UpdateTopLeftLabel(
|
||||||
(not_played.Count > 0) ? not_played[0].next_song_text() : "目前沒有下一首,請踴躍點歌!!!"
|
(not_played.Count > 0) ? not_played[0].next_song_text() : "目前沒有下一首,請踴躍點歌!!!"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
public static void roomClose()
|
public static void roomClose()
|
||||||
{
|
{
|
||||||
@ -160,6 +167,6 @@ namespace DBObj
|
|||||||
not_played.Clear();
|
not_played.Clear();
|
||||||
played.Clear();
|
played.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user