Example #1
0
        public void MPEI_OnConfigurationChanged(string guid)
        {
            // Check if message is for us
            if (guid == this.Guid)
            {
                Log.Debug("CecRemote: Settings changed from Extensions plugin, updating configuration.");

                _config = null;
                PrepareClient();

                _client.LoadConfig();
            }
        }
Example #2
0
        public void Stop()
        {
            Log.Info("CecRemote: Closing connection to client...");

            if (_client == null)
            {
                Log.Info("CecRemote: Client already closed. Plugin exit.");
                return;
            }

            _client.OnStop();

            _client = null;
            _config = null;

            Log.Info("CecRemote: Plugin exit.");
        }
Example #3
0
        public CecSettings()
        {
            // Read MediaPortal config
            _config = new CecConfig();

            try
            {
                _config.ReadConfig();
            }
            catch (Exception exp)
            {
                MessageBox.Show("Error while reading configuration from MediaPortal.xml" + exp.ToString());
            }

            InitializeComponent();

            AddBindings();
        }
Example #4
0
    public CecSettings()
    {
      // Read MediaPortal config 
      _config = new CecConfig();

      try
      {
        _config.ReadConfig();
      }
      catch (Exception exp)
      {
        MessageBox.Show("Error while reading configuration from MediaPortal.xml" + exp.ToString());
      }

      InitializeComponent();

      AddBindings();
      
    }
Example #5
0
        private void PrepareClient()
        {
            if (_client == null)
            {
                _client = new CecRemoteClient();
            }
            if (_config == null)
            {
                _config = new CecConfig();

                try
                {
                    _config.ReadConfig();
                    _client.SetConfig(_config);
                }
                catch (Exception ex)
                {
                    Log.Error("CecRemote: Error while reading config. " + ex.ToString());
                    // Defaults will be used automatically if config reading fails, so we can still try to connect.
                }
            }
        }
Example #6
0
 public CecConfig(CecConfig conf) : base((CecConfigBase)conf)
 {
 }
Example #7
0
 public CecConfig(CecConfig conf) : base((CecConfigBase)conf)
 {
 }
Example #8
0
        public void MPEI_OnConfigurationChanged(string guid)
        {
          // Check if message is for us
          if (guid == this.Guid)
          {
            Log.Debug("CecRemote: Settings changed from Extensions plugin, updating configuration.");

            _config = null;
            PrepareClient();

            _client.LoadConfig();
          }
        }
Example #9
0
 private void PrepareClient()
 {
   if (_client == null)
   {
     _client = new CecRemoteClient();
   }
   if (_config == null)
   {
     _config = new CecConfig();
     
     try
     {
       _config.ReadConfig();
       _client.SetConfig(_config);
     }
     catch (Exception ex)
     {
       Log.Error("CecRemote: Error while reading config. " + ex.ToString());
       // Defaults will be used automatically if config reading fails, so we can still try to connect.
     }
   }
 }
Example #10
0
        private void HandleResume(bool automatic)
        {
            if (_sleep)
            {
                _sleep = false;
                _away = false;

                // DeInitialize when resuming to make sure client is prepared properly.
                if (_client != null)
                {
                    _client.DeInit();
                    _client = null;
                }
            }

            if (_client == null)
            {
                _config = null;

                PrepareClient();
            }

            if (automatic)
            {
                Thread resumeThread = new Thread(new ThreadStart(_client.OnResumeByAutomatic));
                resumeThread.Name = "CECResA";
                resumeThread.Start();
            }
            else
            {
                Thread resumeThread = new Thread(new ThreadStart(_client.OnResumeByUser));
                resumeThread.Name = "CECResU";
                resumeThread.Start();
            }
        }
Example #11
0
        public void Stop()
        {
            Log.Info("CecRemote: Closing connection to client...");

            if (_client == null)
            {
              Log.Info("CecRemote: Client already closed. Plugin exit.");
              return;
            }

            _client.OnStop();

            _client = null;
            _config = null;

            Log.Info("CecRemote: Plugin exit.");

        }