public void Play() { Debug.WriteLine("PL:M: Play"); if (String.IsNullOrWhiteSpace(CurrentMedia)) { throw new InvalidOperationException("Media Source is not specified."); } Action playAction; if (State == PlaybackState.Playing || State == PlaybackState.Pausing) { return; } else if (State == PlaybackState.Paused) { playAction = new Action(() => { m_outputFilter.Play(); State = PlaybackState.Playing; }); } else// if (State == State.Stopped) { playAction = new Action(() => { m_pipeline = new Pipeline(); m_inputFilter = new FileSourceFilter(); m_inputFilter.MediaSource = this.CurrentMedia; m_outputFilter = new WaveSinkFilter(); m_outputFilter.PlaybackStopped += M_outputFilter_Stopped; //m_pipeline.AddFilter(m_inputFilter, 0); //m_pipeline.AddFilter(m_outputFilter, 1); m_pipeline.AddInputOutputFilters(m_inputFilter, m_outputFilter); m_positionAtLastPause = 0.0; NotifyPropertyChanged(nameof(Length)); m_outputFilter.Play(); State = PlaybackState.Playing; }); } m_threadDispatcher.Invoke(playAction); }