diff --git a/FirebaseKaraoke/FirebaseController.cs b/FirebaseKaraoke/FirebaseController.cs index 2507933..1cdc559 100644 --- a/FirebaseKaraoke/FirebaseController.cs +++ b/FirebaseKaraoke/FirebaseController.cs @@ -49,9 +49,9 @@ namespace KaraokePlayer.Classes SetupListener(); } - private async void SetupListener() + private void SetupListener() { - await _client.OnAsync(CurrentSongPath, + _client.OnAsync(CurrentSongPath, added: (s, args, obj) => { Console.WriteLine("added " + args.Path + " " + args.Data); @@ -63,7 +63,7 @@ namespace KaraokePlayer.Classes } ); - await _client.OnAsync(StatePath, + _client.OnAsync(StatePath, added: (s, args, obj) => { // do we need this? don't think so @@ -80,7 +80,8 @@ namespace KaraokePlayer.Classes private void CurrentSongDidChange() { - var item = _client.Get(CurrentSongPath).ResultAs(); + var response = _client.Get(CurrentSongPath); + var item = response.ResultAs(); if (item == null) return; if (CurrentSong == null || CurrentSong.Path != item.Song.Path) { diff --git a/KaraokePlayer/MainForm.cs b/KaraokePlayer/MainForm.cs index d816f21..69a8c2e 100644 --- a/KaraokePlayer/MainForm.cs +++ b/KaraokePlayer/MainForm.cs @@ -38,13 +38,16 @@ namespace KaraokePlayer switch (args.State) { case PlayerState.playing: - this.Invoke(new Action(() => { player.play(); })); + //this.Invoke(new Action(() => { player.play(); })); + player.play(); break; case PlayerState.paused: - this.Invoke(new Action(() => { player.pause(); })); + //this.Invoke(new Action(() => { player.pause(); })); + player.pause(); break; case PlayerState.stopped: - this.Invoke(new Action(() => { player.stop(); })); + //this.Invoke(new Action(() => { player.stop(); })); + player.stop(); break; } },