private void eventListener_OnXEventReceived(object sender, XEventType type, Dictionary <string, string> parameters) { try { osae.AddToLog("EventListener captured event : " + type.ToString() + " - " + sender.ToString() + " - " + _ip, false); switch (type) { case XEventType.PlaybackPaused: osae.ObjectStateSet(Name, "PAUSED"); break; case XEventType.PlaybackResumed: case XEventType.PlaybackStarted: //if (_connection.System.GetActivePlayers() == xbmc_json_async.Player.XPlayerType.VideoPlayer) // osae.ObjectPropertySet(Name, "Current Player", "Video"); //else if (_connection.System.GetActivePlayers() == xbmc_json_async.Player.XPlayerType.AudioPlayer) // osae.ObjectPropertySet(Name, "Current Player", "Audio"); //else // osae.ObjectPropertySet(Name, "Current Player", "Picture"); osae.ObjectStateSet(Name, "PLAYING"); break; case XEventType.PlaybackStopped: case XEventType.PlaybackEnded: osae.ObjectStateSet(Name, "STOPPED"); break; case XEventType.ConnectionSuccessful: _connected = true; break; case XEventType.ConnectionFailed: _connected = false; break; //case XEventType.ApplicationStop: // _connected = false; break; } } catch (Exception ex) { osae.AddToLog("Error receiving message: " + ex.Message, true); } }
void eventListener_OnXEventReceived(object sender, XEventType type, Dictionary <string, string> parameters) { MessageBox.Show("EventListener captured event : " + type.ToString()); }