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 ChnageGPUPipelineProperty_btn_Click(object sender, EventArgs e) { m_objFile.FilePlayStop(0); Marshal.ReleaseComObject(m_objFile); MFFactoryClass m_objMFFactory = new MFFactoryClass(); m_objMFFactory.PropsSet("gpu_pipeline", gpu_pipelineProperty); ChnageGPUPipelineProperty_btn.BackColor = ChnageGPUPipelineProperty_btn.BackColor == Color.Red ? Color.Green : Color.Red; gpu_pipelineProperty = gpu_pipelineProperty == "true" ? "false" : "true"; StartMFile(); }
void TurnOnGPU_Pipeline() { if (!gpu_p) { m_objMFFactory = new MFFactoryClass(); m_objMFFactory.PropsSet("gpu_pipeline", "true"); gpu_p = true; GpuPipilineOn_btn.Text = "GPU PIPELINE = ON"; GpuPipilineOn_btn.BackColor = Color.Green; Reset_btn.Enabled = true; PredifinedMatrix_txb.Enabled = true; ColorLevel_cmb.Enabled = true; Red_trb.Enabled = true; Green_trb.Enabled = true; Blue_trb.Enabled = true; Constant_trb.Enabled = true; RedChannel_txb.Enabled = true; GreenChannel_txb.Enabled = true; BlueChannel_txb.Enabled = true; ConstantChannel_txb.Enabled = true; //When we turn on the gpu_pipeline we need to recreate objects. //To continue playback from same position we take current and save it m_objMFile.FilePosGet(out double position); m_objMFile.FilePlayStop(0); Marshal.ReleaseComObject(m_objMFile); m_objMFile = new MFileClass(); m_objMFile.PreviewWindowSet("", panelPreview.Handle.ToInt32()); m_objMFile.PreviewEnable("", 1, 1); if (filePath.Length > 1) { m_objMFile.FileNameSet(filePath, "loop=true"); m_objMFile.FilePosSet(position, 0); m_objMFile.FilePlayStart(); } PredifinedMatrix_txb.SelectedIndex = 0; } }
private void button1_Click(object sender, EventArgs e) { m_objFile.FilePlayStop(0); m_objWriter.ObjectClose(); }