got rid of all the async stuff. it was crashing the FB components
This commit is contained in:
parent
06b03558e6
commit
bd549b584c
@ -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<QueueItem>();
|
||||
var response = _client.Get(CurrentSongPath);
|
||||
var item = response.ResultAs<QueueItem>();
|
||||
if (item == null) return;
|
||||
if (CurrentSong == null || CurrentSong.Path != item.Song.Path)
|
||||
{
|
||||
|
||||
@ -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;
|
||||
}
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user