internal FireDTVSourceFilterInfo(uint deviceHandle, IntPtr activeWindow)
        {
            _windowHandle = activeWindow;
            _handle       = deviceHandle;

            StringBuilder displayName = new StringBuilder(256);
            uint          returnCode  = FireDTVAPI.FS_GetDisplayString(Handle, displayName);

            if ((FireDTVConstants.FireDTVStatusCodes)returnCode != FireDTVConstants.FireDTVStatusCodes.Success)
            {
                throw new FireDTVException((FireDTVConstants.FireDTVStatusCodes)returnCode,
                                           "Unable to get Device Display Name!");
            }
            _name = displayName.ToString();

            StringBuilder GuidString = new StringBuilder(256);

            returnCode = FireDTVAPI.FS_GetGUIDString(Handle, GuidString);
            if ((FireDTVConstants.FireDTVStatusCodes)returnCode != FireDTVConstants.FireDTVStatusCodes.Success)
            {
                throw new FireDTVException((FireDTVConstants.FireDTVStatusCodes)returnCode, "Unable to get GUID String!");
            }
            _GUID = GuidString.ToString();

            string DriverFriend;

            returnCode = FireDTVAPI.FS_GetFriendlyString(Handle, out DriverFriend);
            if ((FireDTVConstants.FireDTVStatusCodes)returnCode != FireDTVConstants.FireDTVStatusCodes.Success)
            {
                throw new FireDTVException((FireDTVConstants.FireDTVStatusCodes)returnCode,
                                           "Unable to get Device Friendly Name!");
            }
            _friendlyName = DriverFriend;

            FireDTVConstants.FireDTV_DRIVER_VERSION version = new FireDTVConstants.FireDTV_DRIVER_VERSION();
            returnCode = FireDTVAPI.FS_GetDriverVersion(Handle, ref version);
            if ((FireDTVConstants.FireDTVStatusCodes)returnCode != FireDTVConstants.FireDTVStatusCodes.Success)
            {
                throw new FireDTVException((FireDTVConstants.FireDTVStatusCodes)returnCode, "Unable to get Driver Version!");
            }
            _driverVersion = Encoding.ASCII.GetString(version.DriverVersion);

            returnCode = FireDTVAPI.FS_GetFirmwareVersion(Handle, ref _firmwareVersion);
            if ((FireDTVConstants.FireDTVStatusCodes)returnCode != FireDTVConstants.FireDTVStatusCodes.Success)
            {
                throw new FireDTVException((FireDTVConstants.FireDTVStatusCodes)returnCode,
                                           "Unable to get Firmware Hardware Version!");
            }

            returnCode = FireDTVAPI.FS_GetSystemInfo(Handle, ref _systemInfo);
            if ((FireDTVConstants.FireDTVStatusCodes)returnCode != FireDTVConstants.FireDTVStatusCodes.Success)
            {
                throw new FireDTVException((FireDTVConstants.FireDTVStatusCodes)returnCode, "Unable to get System Information!");
            }


            RegisterNotifications();
        }
        internal void StopFireDTVRemoteControlSupport()
        {
            uint returnCode = FireDTVAPI.FS_RemoteControl_Stop(Handle);

            if ((FireDTVConstants.FireDTVStatusCodes)returnCode != FireDTVConstants.FireDTVStatusCodes.Success)
            {
                throw new FireDTVException((FireDTVConstants.FireDTVStatusCodes)returnCode, "Unable to Stop RC Support");
            }
            _remoteRunning = true;
        }
        internal void UnRegisterNotifications()
        {
            uint returnCode = FireDTVAPI.FS_UnregisterNotifications(Handle);

            if ((FireDTVConstants.FireDTVStatusCodes)returnCode != FireDTVConstants.FireDTVStatusCodes.Success)
            {
                throw new FireDTVException((FireDTVConstants.FireDTVStatusCodes)returnCode, "Unable to unRegister Notifiations");
            }
            _notificationRegistered = false;
        }
        internal void RegisterNotifications()
        {
            uint returnCode = FireDTVAPI.FS_RegisterNotifications(Handle, (int)this.WindowHandle);

            if ((FireDTVConstants.FireDTVStatusCodes)returnCode != FireDTVConstants.FireDTVStatusCodes.Success)
            {
                throw new FireDTVException((FireDTVConstants.FireDTVStatusCodes)returnCode, "Unable to Register Notifiations");
            }
            _notificationRegistered = true;
        }
        internal void CloseFireDTVHandle()
        {
            uint returnCode = FireDTVAPI.FS_CloseDeviceHandle(Handle);

            if ((FireDTVConstants.FireDTVStatusCodes)returnCode != FireDTVConstants.FireDTVStatusCodes.Success)
            {
                throw new FireDTVException((FireDTVConstants.FireDTVStatusCodes)returnCode, "Device Close Failure");
            }
            _handle = 0;
        }
Example #6
0
        internal uint OpenBDADevice(int deviceIndex)
        {
            uint DeviceHandle;
            uint returnCode = FireDTVAPI.FS_OpenBDADeviceHandle((uint)deviceIndex, out DeviceHandle);

            if ((FireDTVConstants.FireDTVStatusCodes)returnCode != FireDTVConstants.FireDTVStatusCodes.Success)
            {
                throw new FireDTVDeviceOpenException((FireDTVConstants.FireDTVStatusCodes)returnCode, "Open BDA Device Error!");
            }
            return(DeviceHandle);
        }
Example #7
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)
     {
     }
 }
Example #8
0
 internal int getBDACount()
 {
     try
     {
         uint BDACount;
         uint returnCode = FireDTVAPI.FS_GetNumberOfBDADevices(out BDACount);
         if ((FireDTVConstants.FireDTVStatusCodes)returnCode != FireDTVConstants.FireDTVStatusCodes.Success)
         {
             throw new FireDTVException((FireDTVConstants.FireDTVStatusCodes)returnCode, "Unable to BDA Driver Count");
         }
         return((int)BDACount);
     }
     catch (Exception ex)
     {
         throw new InvalidOperationException("FireSATControl: Error getting BDA Devices " + ex.Message);
     }
 }
Example #9
0
 internal void RegisterGeneralNotifications()
 {
     if (!NotificationsRegistered)
     {
         try
         {
             uint returnCode = FireDTVAPI.FS_RegisterGeneralNotifications((int)WindowsHandle);
             if ((FireDTVConstants.FireDTVStatusCodes)returnCode != FireDTVConstants.FireDTVStatusCodes.Success)
             {
                 throw new FireDTVException((FireDTVConstants.FireDTVStatusCodes)returnCode,
                                            "Unable to Register General Notifiations");
             }
             NotificationsRegistered = true;
         }
         catch (Exception)
         {
         }
     }
 }
Example #10
0
 internal void InitializeLibrary()
 {
     if (!LibrayInitialized)
     {
         try
         {
             uint returnCode = FireDTVAPI.FS_Initialize();
             if ((FireDTVConstants.FireDTVStatusCodes)returnCode != FireDTVConstants.FireDTVStatusCodes.Success)
             {
                 throw new FireDTVInitializationException("Initilization Failure (" + returnCode.ToString() + ")");
             }
             LibrayInitialized = true;
         }
         catch (Exception e)
         {
             throw new InvalidOperationException("FireDTV: error initializing " + e.Message);
         }
     }
 }