/// <summary>
    /// Initializes a new instance of the <see cref="Configure"/> class.
    /// </summary>
    public Configure()
    {
      InitializeComponent();
      try
      {
        fireDTV = new FireDTVControl((IntPtr)0);
        labelFireDTV.Text = "FireDTV API Version:"+fireDTV.APIVersion;
        if (fireDTV.OpenDrivers())
        {
          comboBoxDevice.DataSource = fireDTV.SourceFilters;
          comboBoxDevice.DisplayMember = "FriendlyName";
          comboBoxDevice.ValueMember = "Name";
        }
        if (!string.IsNullOrEmpty(_deviceName))
        {
          comboBoxDevice.SelectedValue = _deviceName;
        }
        comboBoxDevice.Enabled = true;
        buttonOK.Enabled = true;
        labelFireDTV.Visible = true;
      }
      catch (Exception e)
      {
        MessageBox.Show(e.ToString());
        labelFireDTV.Visible = false;
        comboBoxDevice.Enabled = false;
        buttonOK.Enabled = false;
      }

    }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Configure"/> class.
 /// </summary>
 public Configure()
 {
     InitializeComponent();
     try
     {
         fireDTV           = new FireDTVControl((IntPtr)0);
         labelFireDTV.Text = "FireDTV API Version:" + fireDTV.APIVersion;
         if (fireDTV.OpenDrivers())
         {
             comboBoxDevice.DataSource    = fireDTV.SourceFilters;
             comboBoxDevice.DisplayMember = "FriendlyName";
             comboBoxDevice.ValueMember   = "Name";
         }
         if (!string.IsNullOrEmpty(_deviceName))
         {
             comboBoxDevice.SelectedValue = _deviceName;
         }
         comboBoxDevice.Enabled = true;
         buttonOK.Enabled       = true;
         labelFireDTV.Visible   = true;
     }
     catch (Exception e)
     {
         MessageBox.Show(e.ToString());
         labelFireDTV.Visible   = false;
         comboBoxDevice.Enabled = false;
         buttonOK.Enabled       = false;
     }
 }
        /// <summary>
        /// Start the IR Server plugin.
        /// </summary>
        public override void Start()
        {
            if (!_running)
            {
                LoadSettings();

                _receiverWindow          = new ReceiverWindow("FireDTV Receiver");
                _receiverWindow.ProcMsg += WndProc;

                _fireDTV = new FireDTVControl(_receiverWindow.Handle);
                if (!_fireDTV.OpenDrivers())
                {
                    throw new InvalidOperationException("Failed to start FireDTV interface");
                }

                // Search for the named sourcefilter
                FireDTVSourceFilterInfo sourceFilter = string.IsNullOrEmpty(_deviceName) ? _fireDTV.SourceFilters.Item(0) : _fireDTV.SourceFilters.ItemByName(_deviceName);

                if (sourceFilter != null)
                {
                    sourceFilter.StartFireDTVRemoteControlSupport();
                    _running = true;
                }
                else
                {
                    throw new InvalidOperationException("Failed to start FireDTV interface");
                }
            }
        }
    /// <summary>
    /// Start the IR Server plugin.
    /// </summary>
    public override void Start()
    {
      if (!_running)
      {
        LoadSettings();

        _receiverWindow = new ReceiverWindow("FireDTV Receiver");
        _receiverWindow.ProcMsg += WndProc;

        _fireDTV = new FireDTVControl(_receiverWindow.Handle);
        if (!_fireDTV.OpenDrivers())
        {
          throw new InvalidOperationException("Failed to start FireDTV interface");
        }

        // Search for the named sourcefilter
        FireDTVSourceFilterInfo sourceFilter = string.IsNullOrEmpty(_deviceName) ? _fireDTV.SourceFilters.Item(0) : _fireDTV.SourceFilters.ItemByName(_deviceName);

        if (sourceFilter != null)
        {
          sourceFilter.StartFireDTVRemoteControlSupport();
          _running = true;
        }
        else
        {
          throw new InvalidOperationException("Failed to start FireDTV interface");
        }
      }
    }