void onPlayerStopped(MediaItem mediaItem) { if (mediaItem is VideoItem) { lock (videoInfoSync) { if (currentVideoSessionId != null) { airplayServer.SetPlaybackState(currentVideoSessionId, PlaybackCategory.Video, ShairportSharp.Airplay.PlaybackState.Stopped); cleanupVideoPlayback(); } } } else if (mediaItem is ImageItem) { lock (photoInfoSync) photoSessionId = null; } else if (mediaItem is AudioItem) { lock (audioInfoSync) { if (isAudioPlaying) { airtunesServer.SendCommand(RemoteCommand.Stop); cleanupAudioPlayback(); } } } }
void airtunesServer_StreamReady(object sender, RaopEventArgs e) { AudioBufferStream input = airtunesServer.GetStream(StreamType.Wave); if (input == null) { return; } invoke(delegate() { if (!isAudioBuffering) { airtunesServer.SendCommand(RemoteCommand.Stop); return; } isAudioBuffering = false; GUIWaitCursor.Hide(); startPlayback(input); }, false); }
void buttonPrev_Click(object sender, EventArgs e) { server.SendCommand(RemoteCommand.PrevItem); }