Beispiel #1
0
        public void StopClip()
        {
            int hr = 0;
            DsLong pos = new DsLong(0);
            dvdPlayRate = 0.0;
            commList = new List<double[]>();

            if ((this.mediaControl == null) || (this.mediaSeeking == null))
                return;
            // Stop and reset postion to beginning
            if ((this.currentState == PlayState.Paused) || (this.currentState == PlayState.Running))
            {
                hr = this.mediaControl.Pause();

                SaveBookmark();

                hr = this.mediaControl.Stop();
                this.currentState = PlayState.Stopped;

                // Seek to the beginning
                //hr = this.mediaSeeking.SetPositions(pos, AMSeekingSeekingFlags.AbsolutePositioning, null, AMSeekingSeekingFlags.NoPositioning);
                //hr = this.mediaControl.Run();
                //Thread.Sleep(100);
                hr = this.mediaControl.Pause();
            }
            //else if (this.currentState == PlayState.Stopped && wbSageServer.Url.ToString() != ABOUT_BLANK)
            //    wbSageServer.Visible = true;

            //UpdateMainTitle();

            StopDialog sd = new StopDialog();
            switch (sd.ShowDialog())
            {
                case DialogResult.OK:
                    PauseClip();
                    break;
                case DialogResult.Cancel:
                    container.Close();
                    Application.DoEvents();
                    break;
                case DialogResult.Retry:
                    hr = this.mediaSeeking.SetPositions(pos, AMSeekingSeekingFlags.AbsolutePositioning, null, AMSeekingSeekingFlags.NoPositioning);
                    PauseClip();
                    break;
            }
        }
Beispiel #2
0
        private void StopClip(object notUsed)
        {
            if (this.InvokeRequired)
                this.Invoke(new TFS(StopClip), new object[] { null });
            else
            {
                int hr = 0;
                DsLong pos = new DsLong(0);
                dvdPlayRate = 0.0;
                tmPosition.Enabled = false;
                commList = new List<double[]>();

                if ((this.mediaControl == null) || (this.mediaSeeking == null))
                    return;
                // Stop and reset postion to beginning
                if ((this.currentState == PlayState.Paused) || (this.currentState == PlayState.Running))
                {
                    hr = this.mediaControl.Pause();

                    SaveBookmark();

                    hr = this.mediaControl.Stop();
                    this.currentState = PlayState.Stopped;

                    // Seek to the beginning
                    //hr = this.mediaSeeking.SetPositions(pos, AMSeekingSeekingFlags.AbsolutePositioning, null, AMSeekingSeekingFlags.NoPositioning);
                    //hr = this.mediaControl.Run();
                    //Thread.Sleep(100);
                    hr = this.mediaControl.Pause();
                }
                //else if (this.currentState == PlayState.Stopped && wbSageServer.Url.ToString() != ABOUT_BLANK)
                //    wbSageServer.Visible = true;

                UpdateMainTitle();

                StopDialog sd = new StopDialog();
                switch (sd.ShowDialog())
                {
                    case DialogResult.OK:
                        PauseClip(null);
                        break;
                    case DialogResult.Cancel:
                        CloseClip();
                        //ToogleControls(true);
                        Application.DoEvents();
                        
                        //if (wbSageServer.Url.ToString() != ABOUT_BLANK)
                        //    wbSageServer.Visible = true;
                        //else
                        //{
                        //    wbSageServer.Navigate(ABOUT_BLANK);
                        //    wbSageServer.Hide();
                        //}
                        break;
                    case DialogResult.Retry:
                        hr = this.mediaSeeking.SetPositions(pos, AMSeekingSeekingFlags.AbsolutePositioning, null, AMSeekingSeekingFlags.NoPositioning);
                        PauseClip(null);
                        break;
                    case DialogResult.Abort:
                        CloseClip();
                        //ToogleControls(true);
                        this.Close();
                        break;
                }
            }
        }