private void Form1_Load(object sender, EventArgs e) { m_objReader = new MFReaderClass(); m_objPrev = new MFPreviewClass(); m_objPrevResize = new MFPreviewClass(); m_objPrevResize.PreviewWindowSet("", panelThubNail.Handle.ToInt32()); m_objPrevResize.PreviewEnable("", 1, 1); m_objPrev.PreviewWindowSet("", panel1.Handle.ToInt32()); m_objPrev.PreviewEnable("", 1, 1); string a = " - MFormats SDK " + CheckVersionClass.GetVersion(); cancelSource = new CancellationTokenSource(); m_threadWorker = new Thread(() => thread_DoWork(cancelSource.Token)); m_threadWorker.Name = "thread_DoWork"; m_threadWorker.Start(); }
private void Form1_Load(object sender, EventArgs e) { try { this.Text += " - MPlatform SDK " + CheckVersionClass.GetVersion(); } catch { } try { m_objPlaylist = new MPlaylistClass(); } catch (Exception exception) { MessageBox.Show("Can't create a MPlatform's object: " + exception.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Application.Exit(); return; } try { m_objOverlayHTML = new MFOverlayHTMLClass(); } catch (Exception exception) { checkBoxHTML.Enabled = false; buttonHTMLProps.Enabled = false; textBoxHTMLURL.Enabled = false; } if (File.Exists(m_strDemoFile)) { m_strDemoURL = Path.GetFullPath(m_strDemoFile); textBoxHTMLURL.Text = "demo"; } m_objPlaylist.OnFrame += new IMEvents_OnFrameEventHandler(m_objPlaylist_OnFrame); m_objPlaylist.OnEvent += new IMEvents_OnEventEventHandler(m_objPlaylist_OnEvent); m_objPlaylist.ObjectStart(null); m_formCG = new FormCG(); m_formCG.m_pParentForm = this; mPersistControl1.SetControlledObject(m_objPlaylist); mPlaylistControl1.SetControlledObject(m_objPlaylist); mPreviewControl1.SetControlledObject(m_objPlaylist); mFormatControl1.SetControlledObject(m_objPlaylist); mFileStateControl1.SetControlledObject(m_objPlaylist); mRateControl1.SetControlledObject(m_objPlaylist); mPlaylistStatus1.SetControlledObject(m_objPlaylist); mRendererCheckList1.SetSourceObject(m_objPlaylist); mSeekControl1.SetControlledObject(m_objPlaylist); mPlaylistTimeline1.SetControlledObject(m_objPlaylist); mAudioMeter1.SetControlledObject(m_objPlaylist); mAudioMeter1.SizeChanged += new EventHandler(mAudioMeter1_SizeChanged); mPlaylistBackground1.SetControlledObject(m_objPlaylist); mPlaylistControl1.OnPlaylistSelChanged += new EventHandler(mPlaylistControl1_OnPlaylistSelChanged); mPlaylistControl1.OnPlaylistChanged += new EventHandler(mPlaylistControl1_OnPlaylistChanged); mRendererCheckList1.OnRenderingChange += new EventHandler(mRendererCheckList1_OnRenderingChange); mBreaksControl1.OnBreaksChanged += new EventHandler(mBreaksControl1_OnBreaksChanged); mPersistControl1.OnLoad += new EventHandler(mPersistControl1_OnLoad); mAudioMeter1_SizeChanged(null, null); }