private void Output_Stopped(object sender, PlaybackStoppedEventArgs e)
 {
     if (AudioStoppedEvent != null)
     {
         AudioStoppedEvent();
     }
 }
Exemple #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.
     }
 }
Exemple #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";
 }
Exemple #4
0
 private void AudioEngine_AudioEnded(object sender, PlaybackStoppedEventArgs e)
 {
     if (nowPlayingMusic != null)
     {
         playNextSong(playOrder);
     }
 }
 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);
     }
 }
Exemple #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 { }
 }
Exemple #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();
     }
 }
Exemple #8
0
 private void DonePlaying(object sender, PlaybackStoppedEventArgs e)
 {
     state = SOUNDSTATE.STOPPED;
     manualReset.Set();
     if (compleated != null)
     {
         compleated.Invoke(Id);
     }
 }
Exemple #9
0
 void MusicPlayer_PlayerStopped(object sender, PlaybackStoppedEventArgs args)
 {
     if (currentTabItem != null)
     {
         Application.Current.Dispatcher.BeginInvoke(new Action(() =>
         {
             PlaySound(GetNextMusicItem());
         }), DispatcherPriority.Background);
     }
 }
        private void _soundOut_Stopped(object sender, PlaybackStoppedEventArgs e)
        {
            if (_currentTrackIndex + 1 >= _queue.Count)
            {
                PlayState = PlayState.Stopped;
                Stopped?.Invoke();
                return;
            }

            NextTrack();
        }
 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;
     }
 }
Exemple #12
0
 private void OnStopped(object sender, PlaybackStoppedEventArgs e)
 {
     loadingTimer.Stop();
     if (e.HasError)
     {
         trayIcon.Icon = Resources.Error;
     }
     else
     {
         trayIcon.Icon = Resources.Idle;
     }
 }
 private void OnSoundOutStopped(object sender, PlaybackStoppedEventArgs playbackStoppedEventArgs)
 {
     if (IsLooped)
     {
         _soundOut.Dispose();
         Play();
     }
     else
     {
         OnSoundStateChanged(new SoundStateChangedEventArgs(SoundState.Stopped));
     }
 }
Exemple #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;
     }
 }
Exemple #15
0
 void soundOut_Stopped(object sender, PlaybackStoppedEventArgs e)
 {
     if (_isdisposing)
     {
         return;
     }
     if (_manualstop)
     {
         _manualstop = false; return;
     }
     OnTrackFinished();
     CurrentStateChanged();
 }
Exemple #16
0
 /// <summary>
 /// Wave finished playing.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void WaveEnded(object sender, PlaybackStoppedEventArgs e)
 {
     playNext = true;
 }
Exemple #17
0
 private void _PreviewPlayer_PlaybackStopped(object sender, PlaybackStoppedEventArgs e)
 {
     UpdatePlayerState(PlayerState);
 }
Exemple #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);
        }
Exemple #20
0
 private void OnPlaybackStopped(object sender, PlaybackStoppedEventArgs e)
 {
     PlayedMedia = null;
     SetState(MediaPlayerState.Idle);
 }
Exemple #21
0
 private void SoundOut_Stopped(object sender, PlaybackStoppedEventArgs e)
 {
     TrackPosition = 0;
     OnPropertyChanged(nameof(IsPlaying));
 }