Exemplo n.º 1
0
        public int Pause()
        {
            Debug.WriteLine("Pause", _Name);

            //lock (_LockObj)
            //{
            // Notify all pins of the change to active state
            if (_State == FilterState.Stopped)
            {
                for (int i = 0; i < Pins.Count; i++)
                {
                    // Disconnected pins are not activated - this saves pins
                    // worrying about this state themselves
                    if (Pins[i].IsConnected)
                    {
                        HRESULT hr = (HRESULT)Pins[i].Active();
                        if (HR.FAILED(hr))
                        {
                            unchecked
                            {
                                return((int)hr);
                            }
                        }
                    }
                }
            }
            _State = FilterState.Paused;

            return(OnPause());
            // }
        }
Exemplo n.º 2
0
        public int Run(long tStart)
        {
            Debug.WriteLine("Run " + tStart, _Name);

            lock (_LockObj)
            {
                // Remember the stream time offset
                m_tStart = tStart;

                if (_State == FilterState.Stopped)
                {
                    HRESULT hr = (HRESULT)Pause();

                    unchecked
                    {
                        if (HR.FAILED(hr))
                        {
                            return((int)hr);
                        }
                    }
                }

                _State = FilterState.Running;

                return(OnRun(tStart));
            }
        }