private void Output_Stopped(object sender, PlaybackStoppedEventArgs e) { if (AudioStoppedEvent != null) { AudioStoppedEvent(); } }
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. } }
/// <summary> /// 播放已停止 /// </summary> private void Player_PlaybackStopped(object sender, PlaybackStoppedEventArgs e) { PlayStop.Data = continuedata; timer.Stop(); //sliSong.Value = 0; //lblPosition.Content = "00:00 / 00:00"; }
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); } }
private void _musicPlayer_PlaybackStopped(object sender, PlaybackStoppedEventArgs e) { PlayerState = PlayerState.loaded; UpdatePlayButton(); try { ReportStatus?.Invoke(this, new StatusEventArgs("Playing " + SFX.ShortFileNameOnly, true)); } catch { } }
private void Output_Stopped(object sender, PlaybackStoppedEventArgs e) { //System.Diagnostics.Debug.WriteLine((Environment.TickCount % 10000).ToString("00000") + "Driver stopped"); if (AudioStoppedEvent != null) { AudioStoppedEvent(); } }
private void DonePlaying(object sender, PlaybackStoppedEventArgs e) { state = SOUNDSTATE.STOPPED; manualReset.Set(); if (compleated != null) { compleated.Invoke(Id); } }
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; } }
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)); } }
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; } }
void soundOut_Stopped(object sender, PlaybackStoppedEventArgs e) { if (_isdisposing) { return; } if (_manualstop) { _manualstop = false; return; } OnTrackFinished(); CurrentStateChanged(); }
/// <summary> /// Wave finished playing. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void WaveEnded(object sender, PlaybackStoppedEventArgs e) { playNext = true; }
private void _PreviewPlayer_PlaybackStopped(object sender, PlaybackStoppedEventArgs e) { UpdatePlayerState(PlayerState); }
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); }
private void OnPlaybackStopped(object sender, PlaybackStoppedEventArgs e) { PlayedMedia = null; SetState(MediaPlayerState.Idle); }
private void SoundOut_Stopped(object sender, PlaybackStoppedEventArgs e) { TrackPosition = 0; OnPropertyChanged(nameof(IsPlaying)); }