Beispiel #1
0
        /// <summary>
        /// Open the communication channels with the FireDTV's.
        /// </summary>
        /// <returns>true if success</returns>
        public bool OpenDrivers()
        {
            if (!LibrayInitialized)
            {
                return(false);
            }

            int BDADriverCount = getBDACount();
            int WDMDriverCount = getWDMCount();

            Log.Info("FireDTV: BDA {0}, WMA {1}", BDADriverCount, WDMDriverCount);


            for (int BDACount = 0; BDACount < BDADriverCount; BDACount++)
            {
                FireDTVSourceFilterInfo bdaSourceFilter = new FireDTVSourceFilterInfo(OpenBDADevice(BDACount), _windowHandle);
                if (bdaSourceFilter != null)
                {
                    Log.Info("FireDTV: add BDA Source {0}", bdaSourceFilter.ToString());
                }

                _sourceFilterCollection.Add(bdaSourceFilter);
            }

            for (int WDMCount = 0; WDMCount < WDMDriverCount; WDMCount++)
            {
                FireDTVSourceFilterInfo wdmSourceFilter = new FireDTVSourceFilterInfo(OpenWDMDevice(WDMCount), _windowHandle);
                if (wdmSourceFilter != null)
                {
                    Log.Info("FireDTV: add WDM Source");
                }
                _sourceFilterCollection.Add(wdmSourceFilter);
            }
            return(true);
        }
Beispiel #2
0
 public void CloseDrivers()
 {
     for (int DeviceCount = 0; DeviceCount < SourceFilters.Count; DeviceCount++)
     {
         FireDTVSourceFilterInfo SourceFilter = SourceFilters.Item(DeviceCount);
         _sourceFilterCollection.RemoveAt(DeviceCount);
     }
 }
Beispiel #3
0
 public int IndexByHandle(uint deviceHandle)
 {
     for (int iIndex = 0; iIndex < List.Count; iIndex++)
     {
         FireDTVSourceFilterInfo SourceFilter = Item(iIndex);
         if (SourceFilter.Handle == deviceHandle)
         {
             return(iIndex);
         }
     }
     return(-1);
 }
Beispiel #4
0
 internal void CloseFireDTVHandle(FireDTVSourceFilterInfo currentSourceFilter)
 {
     try
     {
         uint returnCode = FireDTVAPI.FS_CloseDeviceHandle(currentSourceFilter.Handle);
         if ((FireDTVConstants.FireDTVStatusCodes)returnCode != FireDTVConstants.FireDTVStatusCodes.Success)
         {
             throw new FireDTVException((FireDTVConstants.FireDTVStatusCodes)returnCode, "Device Close Failure");
         }
     }
     catch (Exception) {}
 }
Beispiel #5
0
 public void Add(FireDTVSourceFilterInfo sourceFilter)
 {
     foreach (FireDTVSourceFilterInfo srcFilter in List)
     {
         if (srcFilter.Name == sourceFilter.Name)
         {
             sourceFilter.Close();
             return;
         }
     }
     List.Add(sourceFilter);
 }
Beispiel #6
0
 internal void CloseFireDTVHandle(FireDTVSourceFilterInfo currentSourceFilter)
 {
     try
     {
         uint returnCode = FireDTVAPI.FS_CloseDeviceHandle(currentSourceFilter.Handle);
         if ((FireDTVConstants.FireDTVStatusCodes)returnCode != FireDTVConstants.FireDTVStatusCodes.Success)
         {
             throw new FireDTVException((FireDTVConstants.FireDTVStatusCodes)returnCode, "Device Close Failure");
         }
     }
     catch (Exception ex)
     {
         Log.Error("FireSATControl:CloseFireDTVHandle {0}", ex.Message);
     }
 }
    /// <summary>
    /// Open the communication channels with the FireDTV's.
    /// </summary>
    /// <returns>true if success</returns>
    public bool OpenDrivers()
    {
      if (!LibrayInitialized)
      {
        return false;
      }

      int BDADriverCount = getBDACount();
      int WDMDriverCount = getWDMCount();

      Log.Info("FireDTV: BDA {0}, WMA {1}", BDADriverCount, WDMDriverCount);


      for (int BDACount = 0; BDACount < BDADriverCount; BDACount++)
      {
        FireDTVSourceFilterInfo bdaSourceFilter = new FireDTVSourceFilterInfo(OpenBDADevice(BDACount), _windowHandle);
        if (bdaSourceFilter != null)
        {
          Log.Info("FireDTV: add BDA Source {0}", bdaSourceFilter.ToString());
        }

        _sourceFilterCollection.Add(bdaSourceFilter);
      }

      for (int WDMCount = 0; WDMCount < WDMDriverCount; WDMCount++)
      {
        FireDTVSourceFilterInfo wdmSourceFilter = new FireDTVSourceFilterInfo(OpenWDMDevice(WDMCount), _windowHandle);
        if (wdmSourceFilter != null)
        {
          Log.Info("FireDTV: add WDM Source");
        }
        _sourceFilterCollection.Add(wdmSourceFilter);
      }
      return true;
    }
 internal void CloseFireDTVHandle(FireDTVSourceFilterInfo currentSourceFilter)
 {
   try
   {
     uint returnCode = FireDTVAPI.FS_CloseDeviceHandle(currentSourceFilter.Handle);
     if ((FireDTVConstants.FireDTVStatusCodes)returnCode != FireDTVConstants.FireDTVStatusCodes.Success)
     {
       throw new FireDTVException((FireDTVConstants.FireDTVStatusCodes)returnCode, "Device Close Failure");
     }
   }
   catch (Exception) {}
 }
Beispiel #9
0
 public FireDTVRemoteControlEventArgs(FireDTVSourceFilterInfo sourceFilter, IntPtr KeyValue)
     : base(sourceFilter)
 {
     keyValue = (FireDTVConstants.FireDTVRemoteControlKeyCodes)KeyValue.ToInt32();
 }
Beispiel #10
0
 public FireDTVEventArgs(FireDTVSourceFilterInfo sourceFilter)
     : base()
 {
     _sourceFilter = sourceFilter;
 }
Beispiel #11
0
 public FireDTVRemoteControlEventArgs(FireDTVSourceFilterInfo sourceFilter, IntPtr KeyValue)
   : base(sourceFilter)
 {
   keyValue = (FireDTVConstants.FireDTVRemoteControlKeyCodes)KeyValue.ToInt32();
 }
Beispiel #12
0
 public FireDTVEventArgs(FireDTVSourceFilterInfo sourceFilter)
   : base()
 {
   _sourceFilter = sourceFilter;
 }
 public void Add(FireDTVSourceFilterInfo sourceFilter)
 {
   foreach (FireDTVSourceFilterInfo srcFilter in List)
   {
     if (srcFilter.Name == sourceFilter.Name)
     {
       sourceFilter.Close();
       return;
     }
   }
   List.Add(sourceFilter);
 }