removed notion of next(). we'll just remove the current song

This commit is contained in:
Don Archer 2016-08-04 21:51:20 -07:00
parent 7d07f26bfa
commit e003e9c548
4 changed files with 4 additions and 30 deletions

View File

@ -26,10 +26,6 @@ namespace KaraokePlayer.Classes
{ {
get { return string.Format("controllers/{0}/state/", this.Id); } get { return string.Format("controllers/{0}/state/", this.Id); }
} }
private string PlayQueuePath
{
get { return string.Format("controllers/{0}/queue/", this.Id); }
}
private string CurrentSongPath private string CurrentSongPath
{ {
get { return string.Format("controllers/{0}/queue/0/", this.Id); } get { return string.Format("controllers/{0}/queue/0/", this.Id); }
@ -37,7 +33,6 @@ namespace KaraokePlayer.Classes
public string Id { get; set; } public string Id { get; set; }
public Song CurrentSong { get; set; } public Song CurrentSong { get; set; }
public List<Song> PlayQueue { get; set; }
public void SetState(PlayerState state) public void SetState(PlayerState state)
{ {
@ -49,18 +44,10 @@ namespace KaraokePlayer.Classes
Id = clientId; Id = clientId;
_stateChanged = stateChanged; _stateChanged = stateChanged;
_songChanged = songChanged; _songChanged = songChanged;
PlayQueue = new List<Song>();
_client = new FirebaseClient(config); _client = new FirebaseClient(config);
Reset();
SetupListener(); 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 }); } 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 Update(string path, object data) { _client.UpdateAsync(path, data); }
private void Reset()
{
Delete(PlayQueuePath);
Delete(CurrentSongPath);
}
private async void SetupListener() private async void SetupListener()
{ {
await _client.OnAsync(CurrentSongPath, await _client.OnAsync(CurrentSongPath,

View File

@ -38,7 +38,7 @@
this.karaokeCDGPlayer.isCDG = true; this.karaokeCDGPlayer.isCDG = true;
this.karaokeCDGPlayer.Location = new System.Drawing.Point(0, 0); this.karaokeCDGPlayer.Location = new System.Drawing.Point(0, 0);
this.karaokeCDGPlayer.Name = "karaokeCDGPlayer"; 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; this.karaokeCDGPlayer.TabIndex = 0;
// //
// karaokeMP4Player // karaokeMP4Player
@ -47,14 +47,14 @@
this.karaokeMP4Player.isCDG = false; this.karaokeMP4Player.isCDG = false;
this.karaokeMP4Player.Location = new System.Drawing.Point(0, 0); this.karaokeMP4Player.Location = new System.Drawing.Point(0, 0);
this.karaokeMP4Player.Name = "karaokeMP4Player"; 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; this.karaokeMP4Player.TabIndex = 0;
// //
// MainForm // MainForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 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.karaokeMP4Player);
this.Controls.Add(this.karaokeCDGPlayer); this.Controls.Add(this.karaokeCDGPlayer);
this.Name = "MainForm"; this.Name = "MainForm";

View File

@ -72,13 +72,9 @@ namespace KaraokePlayer
private void karaokePlayerSongEnded(object sender, EventArgs e) 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() private void stop()
{ {

View File

@ -117,7 +117,4 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </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> </root>