/// <summary> /// Initializes a new instance of the <see cref="AnalogSubChannel"/> class. /// </summary> internal AnalogSubChannel(TvCardAnalog card, int subchnnelId, TvAudio tvAudio, bool hasTeletext, IBaseFilter mpFileWriter) { _card = card; _hasTeletext = hasTeletext; _tvAudio = tvAudio; _mpFileWriter = mpFileWriter; _mpRecord = (IMPRecord)_mpFileWriter; _mpRecord.AddChannel(ref _subChannelId); _subChannelId = subchnnelId; }
/// <summary> /// Initializes a new instance of the <see cref="AnalogSubChannel"/> class. /// </summary> internal AnalogSubChannel(TvCardAnalog card, int subchnnelId, TvAudio tvAudio, bool hasTeletext, IBaseFilter mpFileWriter) { _card = card; _hasTeletext = hasTeletext; _tvAudio = tvAudio; _mpFileWriter = mpFileWriter; _mpRecord = (IMPRecord)_mpFileWriter; _mpRecord.AddChannel(ref _subChannelId); _subChannelId = subchnnelId; }
/// <summary> /// Stops the current graph /// </summary> /// <returns></returns> public override void StopGraph() { if (!CheckThreadId()) { return; } FreeAllSubChannels(); FilterState state; if (_graphBuilder == null) { return; } IMediaControl mediaCtl = (_graphBuilder as IMediaControl); if (mediaCtl == null) { throw new TvException("Can not convert graphBuilder to IMediaControl"); } mediaCtl.GetState(10, out state); Log.Log.WriteFile("analog: StopGraph state:{0}", state); _isScanning = false; if (_tsFileSink != null) { IMPRecord record = _tsFileSink as IMPRecord; if (record != null) { record.StopTimeShifting(_subChannelId); record.StopRecord(_subChannelId); } } if (state == FilterState.Stopped) { _graphState = GraphState.Created; return; } int hr = mediaCtl.Stop(); if (hr < 0 || hr > 1) { Log.Log.WriteFile("analog: RunGraph returns:0x{0:X}", hr); throw new TvException("Unable to stop graph"); } Log.Log.WriteFile("analog: Graph stopped"); }