Пример #1
0
 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();
             }
         }
     }
 }
Пример #2
0
        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);
        }
Пример #3
0
 void buttonPrev_Click(object sender, EventArgs e)
 {
     server.SendCommand(RemoteCommand.PrevItem);
 }