private void Status_StatusChanged(object sender, StatusChangedEventArgs e) { // This will only fire when the status has changed, you can grab the new status string from e.Status; if (e.SystemBeingPolled == SystemPolling.Sonos) { // Parse the Sonos event here // Show the SONOS UI var tracktitletext = e.Status.currentTrack.title; var trackalbumtext = e.Status.currentTrack.album; var trackart = e.Status.currentTrack.absoluteAlbumArtURI; var volume = e.Status.rawvolume; } else { // Parse the Yamaha event here // Show the Yamaha UI var tracktitletext = e.Status.currentTrack.title; var trackalbumtext = e.Status.currentTrack.album; var trackart = e.Status.currentTrack.absoluteAlbumArtURI; var volume = e.Status.rawvolume; } }
protected virtual void OnStatusChanged(StatusChangedEventArgs e) { EventHandler<StatusChangedEventArgs> handler = StatusChanged; if (handler != null) { handler(this, e); } }