예제 #1
0
        /// <summary>
        /// Unload the osc server. This object holds all osc device controllers.
        /// </summary>
        private static void UnloadOscServer()
        {
            LogHelper.Log(LogLevel.Info, String.Format(">>> Unload the osc server..."));

            _oscServer.Stop();
            _oscServer = null;
        }
예제 #2
0
        /// <summary>
        /// Instantiates the osc server. This object holds all osc device controllers.
        /// </summary>
        private static void InstantiateOscServer()
        {
            LogHelper.Log(LogLevel.Info, String.Format(">>> Instantiating the osc server..."));

            List <OscDeviceController> oscDeviceControllers = new List <OscDeviceController>();

            foreach (Device device in _configurationService.SystemConfiguration.Hardware.Devices)
            {
                LogHelper.Log(LogLevel.Info, String.Format(">>>   device '{0}' loaded ...", device.Name));
                foreach (OSCDevice oscDevice in device.OscDevices)
                {
                    oscDeviceControllers.Add(new OscDeviceController(new Address(device.Id, oscDevice.DeviceId.ObjectId), oscDevice, _protocolDrivers[device.Id], _oscDrivers[oscDevice.DeviceId.ObjectId], device.ZoneDict, device.Sources));
                }
            }
            _oscServer = new OscServer.OscServer(oscDeviceControllers);
            _oscServer.Start();
        }