Esempio n. 1
0
 private void Output_Stopped(object sender, PlaybackStoppedEventArgs e)
 {
     if (AudioStoppedEvent != null)
     {
         AudioStoppedEvent();
     }
 }
Esempio n. 2
0
 public void SoundOutStoppedHandler(object sender, PlaybackStoppedEventArgs e)
 {
     try
     {
         if (e.Exception != null)
         {
             if (PlaybackInterrupted != null)
             {
                 this.PlaybackInterrupted(this, new PlaybackInterruptedEventArgs {
                     Message = e.Exception.Message
                 });
             }
         }
         else
         {
             if (PlaybackFinished != null)
             {
                 this.PlaybackFinished(this, new EventArgs());
             }
         }
     }
     catch (Exception)
     {
         // Do nothing. It might be that we get in this handler when the application is closed.
     }
 }
Esempio n. 3
0
 /// <summary>
 /// 播放已停止
 /// </summary>
 private void Player_PlaybackStopped(object sender, PlaybackStoppedEventArgs e)
 {
     PlayStop.Data = continuedata;
     timer.Stop();
     //sliSong.Value = 0;
     //lblPosition.Content = "00:00 / 00:00";
 }
Esempio n. 4
0
 private void AudioEngine_AudioEnded(object sender, PlaybackStoppedEventArgs e)
 {
     if (nowPlayingMusic != null)
     {
         playNextSong(playOrder);
     }
 }
Esempio n. 5
0
 private void songFinished(object sender, PlaybackStoppedEventArgs e)
 {
     if (e.Exception == null && !e.HasError && source.Position >= source.Length)
     {
         //check if out of bounds
         ListSongName.SetSelected(ListSongName.SelectedIndex++, true);
     }
 }
Esempio n. 6
0
 private void _musicPlayer_PlaybackStopped(object sender, PlaybackStoppedEventArgs e)
 {
     PlayerState = PlayerState.loaded;
     UpdatePlayButton();
     try {
         ReportStatus?.Invoke(this, new StatusEventArgs("Playing " + SFX.ShortFileNameOnly, true));
     } catch { }
 }
Esempio n. 7
0
 private void Output_Stopped(object sender, PlaybackStoppedEventArgs e)
 {
     //System.Diagnostics.Debug.WriteLine((Environment.TickCount % 10000).ToString("00000") + "Driver stopped");
     if (AudioStoppedEvent != null)
     {
         AudioStoppedEvent();
     }
 }
Esempio n. 8
0
 private void DonePlaying(object sender, PlaybackStoppedEventArgs e)
 {
     state = SOUNDSTATE.STOPPED;
     manualReset.Set();
     if (compleated != null)
     {
         compleated.Invoke(Id);
     }
 }
Esempio n. 9
0
 void MusicPlayer_PlayerStopped(object sender, PlaybackStoppedEventArgs args)
 {
     if (currentTabItem != null)
     {
         Application.Current.Dispatcher.BeginInvoke(new Action(() =>
         {
             PlaySound(GetNextMusicItem());
         }), DispatcherPriority.Background);
     }
 }
Esempio n. 10
0
        private void _soundOut_Stopped(object sender, PlaybackStoppedEventArgs e)
        {
            if (_currentTrackIndex + 1 >= _queue.Count)
            {
                PlayState = PlayState.Stopped;
                Stopped?.Invoke();
                return;
            }

            NextTrack();
        }
Esempio n. 11
0
 private void SoundOut_Stopped(object sender, PlaybackStoppedEventArgs e)
 {
     CurrentStateChanged();
     if (e.HasError)
     {
         ErrorOccurred?.Invoke(this, new ErrorOccurredEventArgs(e.Exception.Message));
         _fadingService.Cancel();
         StopAndReset();
         _soundOut.Dispose();
         _soundOut = null;
     }
 }
Esempio n. 12
0
 private void OnStopped(object sender, PlaybackStoppedEventArgs e)
 {
     loadingTimer.Stop();
     if (e.HasError)
     {
         trayIcon.Icon = Resources.Error;
     }
     else
     {
         trayIcon.Icon = Resources.Idle;
     }
 }
Esempio n. 13
0
 private void OnSoundOutStopped(object sender, PlaybackStoppedEventArgs playbackStoppedEventArgs)
 {
     if (IsLooped)
     {
         _soundOut.Dispose();
         Play();
     }
     else
     {
         OnSoundStateChanged(new SoundStateChangedEventArgs(SoundState.Stopped));
     }
 }
Esempio n. 14
0
 private void SoundOut_Stopped(object sender, PlaybackStoppedEventArgs e)
 {
     if (AudioIndex < Audios.Count - 1)
     {
         this.AudioIndex++;
         this.NeedToStartAudio = true;
     }
     else
     {
         this.NeedToStopAudio   = true;
         this.NeedToDeleteAudio = true;
     }
 }
Esempio n. 15
0
 void soundOut_Stopped(object sender, PlaybackStoppedEventArgs e)
 {
     if (_isdisposing)
     {
         return;
     }
     if (_manualstop)
     {
         _manualstop = false; return;
     }
     OnTrackFinished();
     CurrentStateChanged();
 }
Esempio n. 16
0
 /// <summary>
 /// Wave finished playing.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void WaveEnded(object sender, PlaybackStoppedEventArgs e)
 {
     playNext = true;
 }
Esempio n. 17
0
 private void _PreviewPlayer_PlaybackStopped(object sender, PlaybackStoppedEventArgs e)
 {
     UpdatePlayerState(PlayerState);
 }
Esempio n. 18
0
 private void HandleWaveOutEventPlaybackStopped(object sender, PlaybackStoppedEventArgs e)
 {
     this.isPlaying          = false;
     this.CurrentPlayingSong = null;
     this.PlayNextSong();
 }
        //private void InitializePlayback(NoteViewModel noteViewModel, MMDevice device)
        //{
        //	_waveSource =
        //		CodecFactory.Instance.GetCodec(noteViewModel.FileName)
        //			.ToSampleSource()
        //			.ToMono()
        //			.ToWaveSource();
        //	_soundOut = new WasapiOut()
        //	{
        //		Latency = 100,
        //		Device = device
        //	};
        //	_soundOut.Initialize(_waveSource);
        //	_soundOut.Stopped += SoundOutOnStopped;
        //}

        //private void CleanupPlayback()
        //{
        //	if (_soundOut != null)
        //	{
        //		//_soundOut.Stopped -= SoundOutOnStopped;
        //		_soundOut.Dispose();
        //		_soundOut = null;
        //	}
        //	if (_waveSource != null)
        //	{
        //		_waveSource.Dispose();
        //		_waveSource = null;
        //	}
        //}

        private void SoundOutOnStopped(object sender, PlaybackStoppedEventArgs playbackStoppedEventArgs)
        {
            NotifyOfPropertyChange(() => PlayText);
        }
Esempio n. 20
0
 private void OnPlaybackStopped(object sender, PlaybackStoppedEventArgs e)
 {
     PlayedMedia = null;
     SetState(MediaPlayerState.Idle);
 }
Esempio n. 21
0
 private void SoundOut_Stopped(object sender, PlaybackStoppedEventArgs e)
 {
     TrackPosition = 0;
     OnPropertyChanged(nameof(IsPlaying));
 }