public ProPresenterDataAgent(IConfigManager configManager, ILogger logger)
        {
            _instances = new List <ProPresenterInstance>();

            _serviceBrowser = new ServiceBrowser();

            _serviceBrowser.ServiceAdded   += OnServiceAdded;
            _serviceBrowser.ServiceRemoved += OnServiceRemoved;

            _logger = logger;
            try
            {
                _password = configManager.GetConfig(ConfigKeys.ProPresenterPassword);
            }
            catch (Exception e)
            {
                _password = "";
                _logger.LogError("Error reading configuration file", e);

                configManager.EditConfig(ConfigKeys.ProPresenterPassword, _password);
                configManager.SaveConfig();
            }

            Connected     = false;
            Connecting    = false;
            StopListening = false;
        }
Exemple #2
0
        public VmixDataAgent(IConfigManager configManager, ILogger logger)
        {
            try
            {
                var ip   = configManager.GetConfig(ConfigKeys.VmixIp);
                var port = configManager.GetConfig(ConfigKeys.VmixPort);
                _inputNumber = configManager.GetConfig(ConfigKeys.VmixInputNumber);
                _baseAddress = new Uri($"http://{ip}:{port}");
            }
            catch (Exception e)
            {
                logger.LogError("Error while reading configuration file", e);

                const string ip   = "127.0.0.1";
                const string port = "8088";
                _inputNumber = "1";
                _baseAddress = new Uri($"http://{ip}:{port}");


                configManager.EditConfig(ConfigKeys.VmixIp, ip);
                configManager.EditConfig(ConfigKeys.VmixPort, port);
                configManager.EditConfig(ConfigKeys.VmixInputNumber, _inputNumber);
            }
        }