public TimeShiftingEPGGrabber(IEpgEvents epgEvents, ITVCard card)
 {
   _card = card;
   _dbUpdater = new EpgDBUpdater(epgEvents, "TimeshiftingEpgGrabber", false);
   _updateThreadRunning = false;
   _epgTimer.Elapsed += _epgTimer_Elapsed;
 }
Пример #2
0
 public TimeShiftingEPGGrabber(IEpgEvents epgEvents, ITVCard card)
 {
     _card                = card;
     _dbUpdater           = new EpgDBUpdater(epgEvents, "TimeshiftingEpgGrabber", false);
     _updateThreadRunning = false;
     _epgTimer.Elapsed   += _epgTimer_Elapsed;
 }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RtspStream"/> class.
 /// </summary>
 /// <param name="streamName">Name of the stream.</param>
 /// <param name="fileName">Name of the file.</param>
 /// <param name="recording">The recording.</param>
 public RtspStream(string streamName, string fileName, string recording)
 {
     _streamName = streamName;
     _fileName   = fileName;
     _recording  = recording;
     _card       = null;
 }
Пример #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RtspStream"/> class.
 /// </summary>
 /// <param name="streamName">Name of the stream.</param>
 /// <param name="fileName">Name of the file.</param>
 /// <param name="recording">The recording.</param>
 public RtspStream(string streamName, string fileName, string recording)
 {
   _streamName = streamName;
   _fileName = fileName;
   _recording = recording;
   _card = null;
 }
Пример #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RtspStream"/> class.
 /// </summary>
 /// <param name="streamName">Name of the stream.</param>
 /// <param name="fileName">Name of the file.</param>
 /// <param name="card">The card.</param>
 /// <param name="bool">True if the stream originates from a tv channel, false for a radio channel</param>
 public RtspStream(string streamName, string fileName, ITVCard card, bool isTv)
 {
     _streamName = streamName;
     _fileName   = fileName;
     _recording  = "";
     _card       = card;
     _isTv       = isTv;
 }
Пример #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RtspStream"/> class.
 /// </summary>
 /// <param name="streamName">Name of the stream.</param>
 /// <param name="fileName">Name of the file.</param>
 /// <param name="card">The card.</param>
 /// <param name="bool">True if the stream originates from a tv channel, false for a radio channel</param>
 public RtspStream(string streamName, string fileName, ITVCard card, bool isTv)
 {
   _streamName = streamName;
   _fileName = fileName;
   _recording = "";
   _card = card;
   _isTv = isTv;
 }
Пример #7
0
 private void comboBoxCards_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (comboBoxCards.SelectedIndex < 0)
     {
         return;
     }
     _currentCard = _tvcards.Cards[comboBoxCards.SelectedIndex];
     listViewChannels.Items.Clear();
 }
 /// <summary>
 /// Adds the specified id card.
 /// </summary>
 /// <param name="idCard">The id card.</param>
 /// <param name="card">The card.</param>
 public HybridCard Add(int idCard, ITVCard card)
 {
   _idCards.Add(idCard);
   TvCardAnalog analogCard = card as TvCardAnalog;
   if (analogCard != null)
   {
     analogCard.CardId = idCard;
   }
   _cards.Add(card);
   return new HybridCard(this, card);
 }
Пример #9
0
        /// <summary>
        /// Adds the specified id card.
        /// </summary>
        /// <param name="idCard">The id card.</param>
        /// <param name="card">The card.</param>
        public HybridCard Add(int idCard, ITVCard card)
        {
            _idCards.Add(idCard);
            TvCardAnalog analogCard = card as TvCardAnalog;

            if (analogCard != null)
            {
                analogCard.CardId = idCard;
            }
            _cards.Add(card);
            return(new HybridCard(this, card));
        }
Пример #10
0
 private void Form1_Load(object sender, EventArgs e)
 {
   foreach (ITVCard card in _tvcards.Cards)
   {
     comboBoxCards.Items.Add(card);
   }
   if (_tvcards.Cards.Count > 0)
   {
     comboBoxCards.SelectedIndex = 0;
     _currentCard = _tvcards.Cards[0];
   }
   timer1.Tick += timer1_Tick;
   timer1.Enabled = true;
 }
Пример #11
0
 private void Form1_Load(object sender, EventArgs e)
 {
     foreach (ITVCard card in _tvcards.Cards)
     {
         comboBoxCards.Items.Add(card);
     }
     if (_tvcards.Cards.Count > 0)
     {
         comboBoxCards.SelectedIndex = 0;
         _currentCard = _tvcards.Cards[0];
     }
     timer1.Tick   += timer1_Tick;
     timer1.Enabled = true;
 }
Пример #12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ITVCard"/> class.
 /// </summary>
 public TvCardHandler(Card dbsCard, ITVCard card)
 {
   _dbsCard = dbsCard;
   Card = card;
   IsLocal = _card != null;
   _userManagement = new UserManagement(this);
   _disEqcManagement = new DisEqcManagement(this);
   _teletext = new TeletextManagement(this);
   _scanner = new ChannelScanning(this);
   _epgGrabbing = new EpgGrabbing(this);
   _audioStreams = new AudioStreams(this);
   _recorder = new Recorder(this);
   _timerShifter = new TimeShifter(this);
   _tuner = new CardTuner(this);
 }
Пример #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ITVCard"/> class.
 /// </summary>
 public TvCardHandler(Card dbsCard, ITVCard card)
 {
     _dbsCard          = dbsCard;
     Card              = card;
     IsLocal           = _card != null;
     _userManagement   = new UserManagement(this);
     _disEqcManagement = new DisEqcManagement(this);
     _teletext         = new TeletextManagement(this);
     _scanner          = new ChannelScanning(this);
     _epgGrabbing      = new EpgGrabbing(this);
     _audioStreams     = new AudioStreams(this);
     _tuner            = new CardTuner(this);
     _recorder         = new Recorder(this);
     _timerShifter     = new TimeShifter(this);
 }
Пример #14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ITVCard"/> class.
 /// </summary>
 public TvCardHandler(Card dbsCard, ITVCard card)
 {
   _dbsCard = dbsCard;
   _card = card;
   if (_card != null)
   {
     _card.Context = new TvCardContext();
     _isLocal = true;
   }
   else
   {
     _isLocal = false;
   }
   _userManagement = new UserManagement(this);
   _disEqcManagement = new DisEqcManagement(this);
   _teletext = new TeletextManagement(this);
   _scanner = new ChannelScanning(this);
   _epgGrabbing = new EpgGrabbing(this);
   _audioStreams = new AudioStreams(this);
   _tuner = new CardTuner(this);
   _recorder = new Recorder(this);            
   _timerShifter = new TimeShifter(this);
 }
Пример #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ITVCard"/> class.
 /// </summary>
 public TvCardHandler(Card dbsCard, ITVCard card)
 {
     _dbsCard = dbsCard;
     _card    = card;
     if (_card != null)
     {
         _card.Context = new TvCardContext();
         _isLocal      = true;
     }
     else
     {
         _isLocal = false;
     }
     _userManagement   = new UserManagement(this);
     _disEqcManagement = new DisEqcManagement(this);
     _teletext         = new TeletextManagement(this);
     _scanner          = new ChannelScanning(this);
     _epgGrabbing      = new EpgGrabbing(this);
     _audioStreams     = new AudioStreams(this);
     _tuner            = new CardTuner(this);
     _recorder         = new Recorder(this);
     _timerShifter     = new TimeShifter(this);
 }
Пример #16
0
        private void DetectSupportedBdaSourceDevices(ref HashSet <string> previouslyKnownDevices, ref HashSet <string> knownDevices)
        {
            Log.Log.Debug("Detect BDA source devices");

            // MS generic, MCE 2005 roll-up 2 or better
            bool isMsGenericNpAvailable = FilterGraphTools.IsThisComObjectInstalled(typeof(NetworkProvider).GUID);

            DsDevice[] connectedDevices = DsDevice.GetDevicesOfCat(FilterCategory.BDASourceFiltersCategory);
            foreach (DsDevice connectedDevice in connectedDevices)
            {
                string name       = connectedDevice.Name;
                string devicePath = connectedDevice.DevicePath;
                if (string.IsNullOrEmpty(name) || string.IsNullOrEmpty(devicePath))
                {
                    continue;
                }
                if (previouslyKnownDevices.Contains(devicePath))
                {
                    knownDevices.Add(devicePath);
                    continue;
                }

                // North American CableCARD tuners [PBDA].
                if (name.StartsWith("HDHomeRun Prime") || name.StartsWith("Ceton InfiniTV"))
                {
                    Log.Log.Info("Detected new PBDA CableCARD tuner device {0} {1}", name, devicePath);
                    TunerPbdaCableCard cableCardTuner = new TunerPbdaCableCard(connectedDevice);
                    knownDevices.Add(devicePath);
                    _deviceEventListener.OnDeviceAdded(cableCardTuner);
                    continue;
                }

                IBaseFilter tmpDeviceFilter;
                try
                {
                    _graphBuilder.AddSourceFilterForMoniker(connectedDevice.Mon, null, name, out tmpDeviceFilter);
                }
                catch (Exception ex)
                {
                    Log.Log.Error("Failed to add filter to detect device type for {0}!\r\n{1}", name, ex);
                    continue;
                }

                try
                {
                    // Silicondust regular (non-CableCARD) HDHomeRun. Workaround for tuner type
                    // detection issue. The MS generic provider would always detect DVB-T.
                    bool isCablePreferred = false;
                    if (name.StartsWith("Silicondust HDHomeRun Tuner"))
                    {
                        isCablePreferred = GetHdHomeRunSourceType(name).Equals("Digital Cable");
                    }

                    Log.Log.Info("Detected new digital BDA tuner device {0} {1}", name, devicePath);

                    // Try the MediaPortal network provider first.
                    ITVCard deviceToAdd = null;
                    if (_mpNp != null)
                    {
                        Log.Log.Debug("  check type with MP NP");
                        IDvbNetworkProvider interfaceNetworkProvider = (IDvbNetworkProvider)_mpNp;
                        string hash = GetHash(devicePath);
                        interfaceNetworkProvider.ConfigureLogging(GetFileName(devicePath), hash, LogLevelOption.Debug);
                        if (ConnectFilter(_graphBuilder, _mpNp, tmpDeviceFilter))
                        {
                            TuningType tuningTypes;
                            interfaceNetworkProvider.GetAvailableTuningTypes(out tuningTypes);
                            Log.Log.Debug("  tuning types = {0}, hash = {1}", tuningTypes, hash);
                            if ((tuningTypes & TuningType.DvbT) != 0 && !isCablePreferred)
                            {
                                deviceToAdd = new TvCardDVBT(connectedDevice);
                            }
                            else if ((tuningTypes & TuningType.DvbS) != 0 && !isCablePreferred)
                            {
                                deviceToAdd = new TvCardDVBS(connectedDevice);
                            }
                            else if ((tuningTypes & TuningType.DvbC) != 0)
                            {
                                deviceToAdd = new TvCardDVBC(connectedDevice);
                            }
                            else if ((tuningTypes & TuningType.Atsc) != 0)
                            {
                                deviceToAdd = new TvCardATSC(connectedDevice);
                            }
                            else
                            {
                                Log.Log.Debug("  connected to MP NP but type not recognised");
                            }
                        }
                        else
                        {
                            Log.Log.Debug("  failed to connect to MP NP");
                        }
                    }
                    // Try the Microsoft network provider next if the MP NP
                    // failed and the MS generic NP is available.
                    if (deviceToAdd == null && isMsGenericNpAvailable)
                    {
                        // Note: the MS NP must be added/removed to/from the graph for each
                        // device that is checked. If you don't do this, the networkTypes
                        // list gets longer and longer and longer.
                        Log.Log.Debug("  check type with MS NP");
                        IBaseFilter genericNp = null;
                        try
                        {
                            genericNp = FilterGraphTools.AddFilterFromClsid(_graphBuilder, typeof(NetworkProvider).GUID, "Microsoft Network Provider");
                        }
                        catch
                        {
                            genericNp = null;
                        }
                        if (genericNp == null)
                        {
                            Log.Log.Error(" failed to add MS NP to graph");
                        }
                        else
                        {
                            if (ConnectFilter(_graphBuilder, genericNp, tmpDeviceFilter))
                            {
                                int    networkTypesMax = 5;
                                int    networkTypeCount;
                                Guid[] networkTypes = new Guid[networkTypesMax];
                                int    hr           = (genericNp as ITunerCap).get_SupportedNetworkTypes(networkTypesMax, out networkTypeCount, networkTypes);
                                Log.Log.Debug("  network type count = {0}", networkTypeCount);
                                for (int n = 0; n < networkTypeCount; n++)
                                {
                                    Log.Log.Debug("  network type {0} = {1}", n, networkTypes[n]);
                                }
                                for (int n = 0; n < networkTypeCount; n++)
                                {
                                    if (networkTypes[n] == typeof(DVBTNetworkProvider).GUID && !isCablePreferred)
                                    {
                                        deviceToAdd = new TvCardDVBT(connectedDevice);
                                    }
                                    else if (networkTypes[n] == typeof(DVBSNetworkProvider).GUID && !isCablePreferred)
                                    {
                                        deviceToAdd = new TvCardDVBS(connectedDevice);
                                    }
                                    else if (networkTypes[n] == typeof(DVBCNetworkProvider).GUID)
                                    {
                                        deviceToAdd = new TvCardDVBC(connectedDevice);
                                    }
                                    else if (networkTypes[n] == typeof(ATSCNetworkProvider).GUID)
                                    {
                                        deviceToAdd = new TvCardATSC(connectedDevice);
                                    }
                                    if (deviceToAdd != null)
                                    {
                                        break;
                                    }
                                    else if (n == (networkTypeCount - 1))
                                    {
                                        Log.Log.Debug(" connected to MS NP but type not recognised");
                                    }
                                }
                            }
                            else
                            {
                                Log.Log.Debug("  failed to connect to MS NP");
                            }

                            _graphBuilder.RemoveFilter(genericNp);
                            Release.ComObject("device detection generic network provider", genericNp);
                            genericNp = null;
                        }
                    }
                    // Last shot is the old style Microsoft network providers.
                    if (deviceToAdd == null)
                    {
                        Log.Log.Debug("  check type with specific NPs");
                        if (ConnectFilter(_graphBuilder, _dvbtNp, tmpDeviceFilter))
                        {
                            deviceToAdd = new TvCardDVBT(connectedDevice);
                        }
                        else if (ConnectFilter(_graphBuilder, _dvbcNp, tmpDeviceFilter))
                        {
                            deviceToAdd = new TvCardDVBC(connectedDevice);
                        }
                        else if (ConnectFilter(_graphBuilder, _dvbsNp, tmpDeviceFilter))
                        {
                            deviceToAdd = new TvCardDVBS(connectedDevice);
                        }
                        else if (ConnectFilter(_graphBuilder, _atscNp, tmpDeviceFilter))
                        {
                            deviceToAdd = new TvCardATSC(connectedDevice);
                        }
                        else
                        {
                            Log.Log.Debug("  failed to connect to specific NP");
                        }
                    }

                    if (deviceToAdd != null)
                    {
                        Log.Log.Info("  tuner type = {0}", deviceToAdd.CardType);
                        knownDevices.Add(devicePath);
                        _deviceEventListener.OnDeviceAdded(deviceToAdd);
                    }
                }
                finally
                {
                    _graphBuilder.RemoveFilter(tmpDeviceFilter);
                    Release.ComObject("device detection device filter", tmpDeviceFilter);
                }
            }
        }
Пример #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HybridCard"/> class.
 /// </summary>
 /// <param name="group">The corresponding group for this card wrapper</param>
 /// <param name="internalCard">The internal card for this wrapper</param>
 public HybridCard(HybridCardGroup group, ITVCard internalCard)
 {
     _group        = group;
     _internalCard = internalCard;
 }
 public ChannelLinkageGrabber(ITVCard card)
 {
     _card = card;
 }
Пример #19
0
 public ChannelLinkageGrabber(ITVCard card)
 {
   _card = card;
 }
Пример #20
0
 private void comboBoxCards_SelectedIndexChanged(object sender, EventArgs e)
 {
   if (comboBoxCards.SelectedIndex < 0) return;
   _currentCard = _tvcards.Cards[comboBoxCards.SelectedIndex];
   listViewChannels.Items.Clear();
 }
Пример #21
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HybridCard"/> class.
 /// </summary>
 /// <param name="group">The corresponding group for this card wrapper</param>
 /// <param name="internalCard">The internal card for this wrapper</param>
 public HybridCard(HybridCardGroup group, ITVCard internalCard)
 {
   _group = group;
   _internalCard = internalCard;
 }