Esempio n. 1
0
    private void Init()
    {
      try
      {
        _deviceClass = HidGuid;
        _doubleClickTime = GetDoubleClickTime();

        _deviceBuffer = new byte[256];

        _deviceWatcher = new DeviceWatcher();
        _deviceWatcher.Create();
        _deviceWatcher.Class = _deviceClass;
        _deviceWatcher.DeviceArrival += new DeviceEventHandler(OnDeviceArrival);
        _deviceWatcher.DeviceRemoval += new DeviceEventHandler(OnDeviceRemoval);
        _deviceWatcher.SettingsChanged += new SettingsChanged(OnSettingsChanged);
        _deviceWatcher.RegisterDeviceArrival();

        // Read if we use Master or Wave volume
        using (Settings reader = new MPSettings())
        {
          isDigital = reader.GetValueAsBool("volume", "digital", false);
        }

        Open();
      }
      catch (Exception e)
      {
        Log.Info("Remote.Init: {0}", e.Message);
      }
    }
Esempio n. 2
0
        private void Init()
        {
            try
            {
                _deviceClass     = HidGuid;
                _doubleClickTime = GetDoubleClickTime();

                _deviceBuffer = new byte[256];

                _deviceWatcher = new DeviceWatcher();
                _deviceWatcher.Create();
                _deviceWatcher.Class            = _deviceClass;
                _deviceWatcher.DeviceArrival   += new DeviceEventHandler(OnDeviceArrival);
                _deviceWatcher.DeviceRemoval   += new DeviceEventHandler(OnDeviceRemoval);
                _deviceWatcher.SettingsChanged += new SettingsChanged(OnSettingsChanged);
                _deviceWatcher.RegisterDeviceArrival();

                // Read if we use Master or Wave volume
                using (Settings reader = new MPSettings())
                {
                    isDigital = reader.GetValueAsBool("volume", "digital", false);
                }

                Open();
            }
            catch (Exception e)
            {
                Log.Info("Remote.Init: {0}", e.Message);
            }
        }
Esempio n. 3
0
    private void Init()
    {
      try
      {
        _deviceClass = HidGuid;
        _doubleClickTime = GetDoubleClickTime();

        _deviceBuffer = new byte[256];

        _deviceWatcher = new DeviceWatcher();
        _deviceWatcher.Create();
        _deviceWatcher.Class = _deviceClass;
        _deviceWatcher.DeviceArrival += new DeviceEventHandler(OnDeviceArrival);
        _deviceWatcher.DeviceRemoval += new DeviceEventHandler(OnDeviceRemoval);
        _deviceWatcher.SettingsChanged += new SettingsChanged(OnSettingsChanged);
        _deviceWatcher.RegisterDeviceArrival();

        Open();
      }
      catch (Exception e)
      {
        Log.Info("Remote.Init: {0}", e.Message);
      }
    }
Esempio n. 4
0
        private void Init()
        {
            try
            {
                _deviceClass     = HidGuid;
                _doubleClickTime = GetDoubleClickTime();

                _deviceBuffer = new byte[256];

                _deviceWatcher = new DeviceWatcher();
                _deviceWatcher.Create();
                _deviceWatcher.Class            = _deviceClass;
                _deviceWatcher.DeviceArrival   += new DeviceEventHandler(OnDeviceArrival);
                _deviceWatcher.DeviceRemoval   += new DeviceEventHandler(OnDeviceRemoval);
                _deviceWatcher.SettingsChanged += new SettingsChanged(OnSettingsChanged);
                _deviceWatcher.RegisterDeviceArrival();

                Open();
            }
            catch (Exception e)
            {
                Log.Info("Remote.Init: {0}", e.Message);
            }
        }