removed notion of next(). we'll just remove the current song
This commit is contained in:
parent
7d07f26bfa
commit
e003e9c548
@ -26,10 +26,6 @@ namespace KaraokePlayer.Classes
|
||||
{
|
||||
get { return string.Format("controllers/{0}/state/", this.Id); }
|
||||
}
|
||||
private string PlayQueuePath
|
||||
{
|
||||
get { return string.Format("controllers/{0}/queue/", this.Id); }
|
||||
}
|
||||
private string CurrentSongPath
|
||||
{
|
||||
get { return string.Format("controllers/{0}/queue/0/", this.Id); }
|
||||
@ -37,7 +33,6 @@ namespace KaraokePlayer.Classes
|
||||
|
||||
public string Id { get; set; }
|
||||
public Song CurrentSong { get; set; }
|
||||
public List<Song> PlayQueue { get; set; }
|
||||
|
||||
public void SetState(PlayerState state)
|
||||
{
|
||||
@ -49,18 +44,10 @@ namespace KaraokePlayer.Classes
|
||||
Id = clientId;
|
||||
_stateChanged = stateChanged;
|
||||
_songChanged = songChanged;
|
||||
PlayQueue = new List<Song>();
|
||||
_client = new FirebaseClient(config);
|
||||
Reset();
|
||||
SetupListener();
|
||||
}
|
||||
|
||||
public void NextSong()
|
||||
{
|
||||
Song song = PlayQueue.FirstOrDefault();
|
||||
if(song != null) { PlaySong(song); }
|
||||
}
|
||||
|
||||
public void PlaySong(Song song) { Update(string.Format("Controllers/{0}", this.Id), new { CurrentSong = song }); }
|
||||
|
||||
|
||||
@ -68,12 +55,6 @@ namespace KaraokePlayer.Classes
|
||||
|
||||
private void Update(string path, object data) { _client.UpdateAsync(path, data); }
|
||||
|
||||
private void Reset()
|
||||
{
|
||||
Delete(PlayQueuePath);
|
||||
Delete(CurrentSongPath);
|
||||
}
|
||||
|
||||
private async void SetupListener()
|
||||
{
|
||||
await _client.OnAsync(CurrentSongPath,
|
||||
|
||||
6
KaraokePlayer/MainForm.Designer.cs
generated
6
KaraokePlayer/MainForm.Designer.cs
generated
@ -38,7 +38,7 @@
|
||||
this.karaokeCDGPlayer.isCDG = true;
|
||||
this.karaokeCDGPlayer.Location = new System.Drawing.Point(0, 0);
|
||||
this.karaokeCDGPlayer.Name = "karaokeCDGPlayer";
|
||||
this.karaokeCDGPlayer.Size = new System.Drawing.Size(1024, 768);
|
||||
this.karaokeCDGPlayer.Size = new System.Drawing.Size(506, 296);
|
||||
this.karaokeCDGPlayer.TabIndex = 0;
|
||||
//
|
||||
// karaokeMP4Player
|
||||
@ -47,14 +47,14 @@
|
||||
this.karaokeMP4Player.isCDG = false;
|
||||
this.karaokeMP4Player.Location = new System.Drawing.Point(0, 0);
|
||||
this.karaokeMP4Player.Name = "karaokeMP4Player";
|
||||
this.karaokeMP4Player.Size = new System.Drawing.Size(1024, 768);
|
||||
this.karaokeMP4Player.Size = new System.Drawing.Size(506, 296);
|
||||
this.karaokeMP4Player.TabIndex = 0;
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1024, 768);
|
||||
this.ClientSize = new System.Drawing.Size(506, 296);
|
||||
this.Controls.Add(this.karaokeMP4Player);
|
||||
this.Controls.Add(this.karaokeCDGPlayer);
|
||||
this.Name = "MainForm";
|
||||
|
||||
@ -72,13 +72,9 @@ namespace KaraokePlayer
|
||||
|
||||
private void karaokePlayerSongEnded(object sender, EventArgs e)
|
||||
{
|
||||
next();
|
||||
//TODO: figure out how to play the next song. probably just delete the current one
|
||||
}
|
||||
|
||||
private void next()
|
||||
{
|
||||
controller.NextSong();
|
||||
}
|
||||
|
||||
private void stop()
|
||||
{
|
||||
|
||||
@ -117,7 +117,4 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="browseDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
Loading…
Reference in New Issue
Block a user