void MarshalAll() { SendMes("ReleaseAll"); try { m_objMPlaylist.FilePlayStop(0); m_objMPlaylist.ObjectClose(); Marshal.ReleaseComObject(m_objMPlaylist); } catch { } try { m_objMFile.FilePlayStop(0); m_objMFile.ObjectClose(); Marshal.ReleaseComObject(m_objMFile); } catch { } try { m_objMixer.FilePlayStop(0); m_objMixer.ObjectClose(); Marshal.ReleaseComObject(m_objMixer); } catch { } Thread.Sleep(200); GC.Collect(); SendMes("----------------------------"); SendMes(""); }
private void Form1_FormClosed(object sender, FormClosedEventArgs e) { if (m_objPlaylist != null) { mRendererCheckList1.SetSourceObject(null); mPreviewControl1.SetControlledObject(null); m_objPlaylist.ObjectClose(); } }
private void MPlaylist_OnEventSafe(string bsChannelID, string bsEventName, string bsEventParam, object pEventObject) { if (bsEventName == "EOF") { count++; MWriter.ObjectClose(); MPlaylist.ObjectClose(); restart = true; } }
private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { if (m_objPlaylist != null) { m_objPlaylist.ObjectClose(); } if (m_objRenderer != null) { m_objRenderer.ObjectClose(); } }
public void Stop() { if (_mplaylist != null) { if (_nextItem != null) { throw new InvalidOperationException(); } if (_currentItem != null) { //if (IsMLSource(_currentItem.MediaSource)) //{ // M_StopCurrent(); //} OnCurrentItemStopped(); } if (_rendererManager != null) { _rendererManager.DetachVideoDevice(); _rendererManager.Dispose(); _rendererManager = null; } _preview.MObject = null; //_preview.SetPreviewUri(null); //GlobalEventAggregator.Instance.RaiseMPlaylistDestroying(); _cgManager.Dispose(); _cgManager = null; _mplaylist.ObjectClose(); _mplaylist.OnEvent -= MPlaylist_OnEvent; Marshal.ReleaseComObject(_mplaylist); _mplaylist = null; } }
public void Close() { if (_mplaylist != null && this.Status != PreviewPlayerStatus.Closed) { if (_mitem != null) { _mplaylist.FilePlayStop(0.0); _mplaylist.PlaylistRemove(_mitem); Marshal.ReleaseComObject(_mitem); _mitem = null; } _mplaylist.ObjectClose(); this.Duration = 0.0; this.Name = null; this.Status = PreviewPlayerStatus.Closed; OnClosed(); } }