/// <summary> /// Constructor /// </summary> /// <param name="oscDeviceId">The Id of this osc device.</param> /// <param name="oscDevice">The osc device configuration of this osc device.</param> /// <param name="protocolDriver">The associated protocol driver to command the device (NuvoEssentia) of the zone</param> /// <param name="oscDriver">The associated osc driver to command the osc device.</param> public OscDeviceController(Address oscDeviceId, OSCDevice oscDevice, IProtocol protocolDriver, IOscDriver oscDriver, Dictionary <Address, Zone> zones, List <Source> sources) { this._oscDeviceId = oscDeviceId; this._oscDevice = oscDevice; this._protocolDriver = protocolDriver; this._protocolDriver.onZoneStatusUpdate += new ProtocolZoneUpdatedEventHandler(_protocolDriver_onZoneStatusUpdate); this._protocolDriver.onDeviceStatusUpdate += new ProtocolDeviceUpdatedEventHandler(_protocolDriver_onDeviceStatusUpdate); this._oscDriver = oscDriver; this._oscDriver.onOscNuvoEventReceived += new OscEventReceivedEventHandler(_oscDriver_onOscNuvoEventReceived); this._zones = zones; this._sources = sources; // Init "static" text (configuration data) updateConfigurationDataOnOscClient(); }
/// <summary> /// Copy Constructor /// </summary> /// <param name="oscDeviceId">The Id of this osc device.</param> /// <param name="oscDevice">The osc device configuration of this osc device.</param> /// <param name="oscDeviceController">Controller to copy.</param> public OscDeviceController(Address oscDeviceId, OSCDevice oscDevice, OscDeviceController oscDeviceController) { this._oscDeviceId = oscDeviceId; this._oscDevice = oscDevice; this._protocolDriver = oscDeviceController._protocolDriver; this._protocolDriver.onZoneStatusUpdate += new ProtocolZoneUpdatedEventHandler(_protocolDriver_onZoneStatusUpdate); this._protocolDriver.onDeviceStatusUpdate += new ProtocolDeviceUpdatedEventHandler(_protocolDriver_onDeviceStatusUpdate); this._oscDriver = new TouchOscDriver(oscDevice); this._oscDriver.onOscNuvoEventReceived += new OscEventReceivedEventHandler(_oscDriver_onOscNuvoEventReceived); this._zones = oscDeviceController._zones; this._sources = oscDeviceController._sources; // Init "static" text (configuration data) updateConfigurationDataOnOscClient(); }