Inheritance: ArgusTV.Recorders.Common.WorkerThread
コード例 #1
0
ファイル: TvServerPlugin.cs プロジェクト: rob-opsi/ARGUS-TV
        public void Stop()
        {
            Log.Info("ArgusTV.Recorder.MediaPortalTvServer: Stop");

            if (GlobalServiceProvider.Instance.IsRegistered <ITvServerEvent>())
            {
                GlobalServiceProvider.Instance.Get <ITvServerEvent>().OnTvServerEvent -= events_OnTvServerEvent;
            }

            if (GlobalServiceProvider.Instance.IsRegistered <IPowerEventHandler>())
            {
                GlobalServiceProvider.Instance.Get <IPowerEventHandler>().RemovePowerEventHandler(_powerEventHandler);
                Log.Debug("ArgusTV.Recorder.MediaPortalTvServer: Unregistered OnPowerEvent with TV Server");
            }

            if (_dvbEpgThread != null)
            {
                _dvbEpgThread.Stop(true);
                _dvbEpgThread = null;
            }
            if (_recorderRestHost != null)
            {
                _recorderRestHost.Close(TimeSpan.FromSeconds(5));
                RecorderApiService.DisposeModule();
                _recorderRestHost = null;
            }
        }
コード例 #2
0
        public void Start(IController controller)
        {
            Log.Info("ArgusTV.Recorder.MediaPortalTvServer: Start");

            _controller = controller;
            LoadSettings();

            if (GlobalServiceProvider.Instance.IsRegistered <IPowerEventHandler>())
            {
                _powerEventHandler = new PowerEventHandler(OnPowerEvent);
                GlobalServiceProvider.Instance.Get <IPowerEventHandler>().AddPowerEventHandler(_powerEventHandler);
                Log.Debug("ArgusTV.Recorder.MediaPortalTvServer: Registered OnPowerEvent with TV Server");
            }
            else
            {
                Log.Error("ArgusTV.Recorder.MediaPortalTvServer: Failed to register OnPowerEvent with TV Server!");
            }

            GlobalServiceProvider.Instance.Get <ITvServerEvent>().OnTvServerEvent += events_OnTvServerEvent;
            Log.Debug("ArgusTV.Recorder.MediaPortalTvServer: Registered OnTvServerEvent with TV Server");

            _recorderTunerHost = new RecorderTunerServiceHost(typeof(MediaPortalRecorderTunerService), _recorderTunerTcpPort);
            _recorderTunerHost.Open();

            _dvbEpgThread = new DvbEpgThread();
            _dvbEpgThread.Start();
        }
コード例 #3
0
ファイル: TvServerPlugin.cs プロジェクト: rob-opsi/ARGUS-TV
        public void Start(IController controller)
        {
            Log.Info("ArgusTV.Recorder.MediaPortalTvServer: Start");

            AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;

            _controller = controller;
            LoadSettings();

            if (GlobalServiceProvider.Instance.IsRegistered <IPowerEventHandler>())
            {
                _powerEventHandler = new PowerEventHandler(OnPowerEvent);
                GlobalServiceProvider.Instance.Get <IPowerEventHandler>().AddPowerEventHandler(_powerEventHandler);
                Log.Debug("ArgusTV.Recorder.MediaPortalTvServer: Registered OnPowerEvent with TV Server");
            }
            else
            {
                Log.Error("ArgusTV.Recorder.MediaPortalTvServer: Failed to register OnPowerEvent with TV Server!");
            }

            GlobalServiceProvider.Instance.Get <ITvServerEvent>().OnTvServerEvent += events_OnTvServerEvent;
            Log.Debug("ArgusTV.Recorder.MediaPortalTvServer: Registered OnTvServerEvent with TV Server");

            string recorderUrl = String.Format("http://localhost:{0}/ArgusTV/Recorder", _recorderTunerTcpPort);

            _recorderRestHost = new ServiceHost(typeof(RecorderApiService), new Uri(recorderUrl));
            _recorderRestHost.AddServiceEndpoint(typeof(IRecorderApi), GetRestBinding(), "").Behaviors.Add(new WebHttpBehavior());
            _recorderRestHost.Open();

            Log.Debug("ArgusTV.Recorder.MediaPortalTvServer: Listening on " + recorderUrl);

            _dvbEpgThread = new DvbEpgThread();
            _dvbEpgThread.Start();
        }
コード例 #4
0
        public void Start(IController controller)
        {
            Log.Info("ArgusTV.Recorder.MediaPortalTvServer: Start");

            _controller = controller;
            LoadSettings();

            if (GlobalServiceProvider.Instance.IsRegistered <IPowerEventHandler>())
            {
                _powerEventHandler = new PowerEventHandler(OnPowerEvent);
                GlobalServiceProvider.Instance.Get <IPowerEventHandler>().AddPowerEventHandler(_powerEventHandler);
                Log.Debug("ArgusTV.Recorder.MediaPortalTvServer: Registered OnPowerEvent with TV Server");
            }
            else
            {
                Log.Error("ArgusTV.Recorder.MediaPortalTvServer: Failed to register OnPowerEvent with TV Server!");
            }

            GlobalServiceProvider.Instance.Get <ITvServerEvent>().OnTvServerEvent += events_OnTvServerEvent;
            Log.Debug("ArgusTV.Recorder.MediaPortalTvServer: Registered OnTvServerEvent with TV Server");

            HostConfiguration configuration = new HostConfiguration()
            {
                AllowChunkedEncoding     = true,
                EnableClientCertificates = false
            };
            string recorderUrl = String.Format("http://localhost:{0}/ArgusTV/", _recorderTunerTcpPort);

            _recorderRestHost = new NancyHost(configuration, new Uri(recorderUrl));
            _recorderRestHost.Start();
            Log.Debug("ArgusTV.Recorder.MediaPortalTvServer: Listening on " + recorderUrl + "Recorder/");

            _dvbEpgThread = new DvbEpgThread();
            _dvbEpgThread.Start();
        }
コード例 #5
0
        public void Stop()
        {
            Log.Info("ArgusTV.Recorder.MediaPortalTvServer: Stop");

            if (GlobalServiceProvider.Instance.IsRegistered<ITvServerEvent>())
            {
                GlobalServiceProvider.Instance.Get<ITvServerEvent>().OnTvServerEvent -= events_OnTvServerEvent;
            }

            if (GlobalServiceProvider.Instance.IsRegistered<IPowerEventHandler>())
            {
                GlobalServiceProvider.Instance.Get<IPowerEventHandler>().RemovePowerEventHandler(_powerEventHandler);
                Log.Debug("ArgusTV.Recorder.MediaPortalTvServer: Unregistered OnPowerEvent with TV Server");
            }

            if (_dvbEpgThread != null)
            {
                _dvbEpgThread.Stop(true);
                _dvbEpgThread = null;
            }
            if (_recorderTunerHost != null)
            {
                _recorderTunerHost.Close();
                _recorderTunerHost = null;
            }
        }
コード例 #6
0
        public void Start(IController controller)
        {
            Log.Info("ArgusTV.Recorder.MediaPortalTvServer: Start");

            _controller = controller;
            LoadSettings();

            if (GlobalServiceProvider.Instance.IsRegistered<IPowerEventHandler>())
            {
                _powerEventHandler = new PowerEventHandler(OnPowerEvent);
                GlobalServiceProvider.Instance.Get<IPowerEventHandler>().AddPowerEventHandler(_powerEventHandler);
                Log.Debug("ArgusTV.Recorder.MediaPortalTvServer: Registered OnPowerEvent with TV Server");
            }
            else
            {
                Log.Error("ArgusTV.Recorder.MediaPortalTvServer: Failed to register OnPowerEvent with TV Server!");
            }

            GlobalServiceProvider.Instance.Get<ITvServerEvent>().OnTvServerEvent += events_OnTvServerEvent;
            Log.Debug("ArgusTV.Recorder.MediaPortalTvServer: Registered OnTvServerEvent with TV Server");

            _recorderTunerHost = new RecorderTunerServiceHost(typeof(MediaPortalRecorderTunerService), _recorderTunerTcpPort);
            _recorderTunerHost.Open();

            _dvbEpgThread = new DvbEpgThread();
            _dvbEpgThread.Start();
        }
コード例 #7
0
ファイル: TvServerPlugin.cs プロジェクト: ElRakiti/ARGUS-TV
        public void Start(IController controller)
        {
            Log.Info("ArgusTV.Recorder.MediaPortalTvServer: Start");

            _controller = controller;
            LoadSettings();

            if (GlobalServiceProvider.Instance.IsRegistered<IPowerEventHandler>())
            {
                _powerEventHandler = new PowerEventHandler(OnPowerEvent);
                GlobalServiceProvider.Instance.Get<IPowerEventHandler>().AddPowerEventHandler(_powerEventHandler);
                Log.Debug("ArgusTV.Recorder.MediaPortalTvServer: Registered OnPowerEvent with TV Server");
            }
            else
            {
                Log.Error("ArgusTV.Recorder.MediaPortalTvServer: Failed to register OnPowerEvent with TV Server!");
            }

            GlobalServiceProvider.Instance.Get<ITvServerEvent>().OnTvServerEvent += events_OnTvServerEvent;
            Log.Debug("ArgusTV.Recorder.MediaPortalTvServer: Registered OnTvServerEvent with TV Server");

            HostConfiguration configuration = new HostConfiguration()
            {
                AllowChunkedEncoding = true,
                EnableClientCertificates = false
            };
            string recorderUrl = String.Format("http://localhost:{0}/ArgusTV/", _recorderTunerTcpPort);
            _recorderRestHost = new NancyHost(configuration, new Uri(recorderUrl));
            _recorderRestHost.Start();
            Log.Debug("ArgusTV.Recorder.MediaPortalTvServer: Listening on " + recorderUrl + "Recorder/");

            _dvbEpgThread = new DvbEpgThread();
            _dvbEpgThread.Start();
        }
コード例 #8
0
        public void Start(IController controller)
        {
            Log.Info("ArgusTV.Recorder.MediaPortalTvServer: Start");

            AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;

            _controller = controller;
            LoadSettings();

            if (GlobalServiceProvider.Instance.IsRegistered<IPowerEventHandler>())
            {
                _powerEventHandler = new PowerEventHandler(OnPowerEvent);
                GlobalServiceProvider.Instance.Get<IPowerEventHandler>().AddPowerEventHandler(_powerEventHandler);
                Log.Debug("ArgusTV.Recorder.MediaPortalTvServer: Registered OnPowerEvent with TV Server");
            }
            else
            {
                Log.Error("ArgusTV.Recorder.MediaPortalTvServer: Failed to register OnPowerEvent with TV Server!");
            }

            GlobalServiceProvider.Instance.Get<ITvServerEvent>().OnTvServerEvent += events_OnTvServerEvent;
            Log.Debug("ArgusTV.Recorder.MediaPortalTvServer: Registered OnTvServerEvent with TV Server");

            string recorderUrl = String.Format("http://localhost:{0}/ArgusTV/Recorder", _recorderTunerTcpPort);

            _recorderRestHost = new ServiceHost(typeof(RecorderApiService), new Uri(recorderUrl));
            _recorderRestHost.AddServiceEndpoint(typeof(IRecorderApi), GetRestBinding(), "").Behaviors.Add(new WebHttpBehavior());
            _recorderRestHost.Open();
            
            Log.Debug("ArgusTV.Recorder.MediaPortalTvServer: Listening on " + recorderUrl);

            _dvbEpgThread = new DvbEpgThread();
            _dvbEpgThread.Start();
        }