/// <summary> /// Constructor for Tesira Dsp Switcher Component /// </summary> /// <param name="key">Unique Key</param> /// <param name="config">Sqitcher Config Object</param> /// <param name="parent">Parent Object</param> public TesiraDspSwitcher(string key, TesiraSwitcherControlBlockConfig config, TesiraDsp parent) : base(config.SwitcherInstanceTag, String.Empty, config.Index1, 0, parent, string.Format(KeyFormatter, parent.Key, key), config.Label, config.BridgeIndex) { SourceIndexFeedback = new IntFeedback(Key + "-SourceIndexFeedback", () => SourceIndex); InputPorts = new RoutingPortCollection <RoutingInputPort>(); OutputPorts = new RoutingPortCollection <RoutingOutputPort>(); Feedbacks.Add(SourceIndexFeedback); Feedbacks.Add(NameFeedback); parent.Feedbacks.AddRange(Feedbacks); Initialize(config); }
private void Initialize(TesiraSwitcherControlBlockConfig config) { Type = ""; //DeviceManager.AddDevice(this); Debug.Console(2, this, "Adding SourceSelector '{0}'", Key); IsSubscribed = false; Label = config.Label; if (config.Type != null) { Type = config.Type; } Enabled = config.Enabled; if (config.SwitcherInputs != null) { foreach ( var input in from input in config.SwitcherInputs let inputPort = input.Value let inputPortKey = input.Key select input) { InputPorts.Add(new RoutingInputPort(input.Value.Label, eRoutingSignalType.Audio, eRoutingPortConnectionType.BackplaneOnly, input.Key, this)); } } if (config.SwitcherOutputs == null) { return; } foreach ( var output in from output in config.SwitcherOutputs let outputPort = output.Value let outputPortKey = output.Key select output) { OutputPorts.Add(new RoutingOutputPort(output.Value.Label, eRoutingSignalType.Audio, eRoutingPortConnectionType.BackplaneOnly, output.Key, this)); } }