コード例 #1
0
 // sends events when the melody is stopped
 private void StoppedPlayerEventHandler(Object sender, StoppedPlayerEventArgs e)
 {
     if (e.type.Equals("EOF"))
     {
         if (e.nextSongType.Equals("NEXT"))
         {
             _currentSong = _playNext.NextSong(_currentSong, _playList.Size);
             _audioVisualizer.SetSong(_playList.GetSong(_currentSong));
             Play();
         }
         else if (e.nextSongType.Equals("PREV"))
         {
             _currentSong = _playNext.PrevSong(_currentSong, _playList.Size);
             _audioVisualizer.SetSong(_playList.GetSong(_currentSong));
             Play();
         }
         else
         {
         }
     }
     else if (e.type.Equals("USR"))
     {
     }
     StoppedPlayerNotification(new object(), e);
 }
コード例 #2
0
        private void DirectSoundOutput_PlaybackStopped(object sender, StoppedEventArgs sea)
        {
            StoppedPlayerEventArgs stoppedPlayerEventArgs = null;
            string nextSongTyp = "";

            if (_stopCause == StopCause.EofReached)
            {
                _audioPlayerState = AudioPlayerState.Stopped;
                if (_nextSongType == NextSongType.NextSong)
                {
                    nextSongTyp = "NEXT";
                }
                else if (_nextSongType == NextSongType.PrevSong)
                {
                    nextSongTyp = "PREV";
                }
                else
                {
                    nextSongTyp = "NONE";
                }
                _nextSongType          = NextSongType.NextSong;
                stoppedPlayerEventArgs = new StoppedPlayerEventArgs("EOF", nextSongTyp);
            }
            else if (_stopCause == StopCause.UserTriggered)
            {
                _audioPlayerState      = AudioPlayerState.Stopped;
                stoppedPlayerEventArgs = new StoppedPlayerEventArgs("USR", "NONE");
            }
            //else stoppedPlayerEventArgs = new StoppedPlayerEventArgs("UNK");
            StoppedPlayerNotification(new object(), stoppedPlayerEventArgs);
        }