/// <summary>
 ///		Limpia los valores
 /// </summary>
 public void Clear()
 {
     Meters.Clear();
 }
예제 #2
0
        private void CreateDspObjects()
        {
            Debug.Console(2, "Creating DSP Objects");

            var props = JsonConvert.DeserializeObject <TesiraDspPropertiesConfig>(_dc.Properties.ToString());

            if (props == null)
            {
                return;
            }

            Debug.Console(2, this, "Props Exists");
            Debug.Console(2, this, "Here's the props string\n {0}", _dc.Properties.ToString());

            Faders.Clear();
            Presets.Clear();
            Dialers.Clear();
            States.Clear();
            Switchers.Clear();
            ControlPointList.Clear();
            Meters.Clear();
            RoomCombiners.Clear();

            if (props.FaderControlBlocks != null)
            {
                Debug.Console(2, this, "levelControlBlocks is not null - There are {0} of them", props.FaderControlBlocks.Count());
                foreach (var block in props.FaderControlBlocks)
                {
                    var key = block.Key;
                    Debug.Console(2, this, "LevelControlBlock Key - {0}", key);
                    var value = block.Value;

                    Faders.Add(key, new TesiraDspFaderControl(key, value, this));
                    Debug.Console(2, this, "Added LevelControlPoint {0} LevelTag: {1} MuteTag: {2}", key, value.LevelInstanceTag, value.MuteInstanceTag);
                    if (block.Value.Enabled)
                    {
                        //Add ControlPoint to the list for the watchdog
                        ControlPointList.Add(Faders[key]);
                    }
                }
            }

            if (props.SwitcherControlBlocks != null)
            {
                Debug.Console(2, this, "switcherControlBlocks is not null - There are {0} of them", props.FaderControlBlocks.Count());
                foreach (var block in props.SwitcherControlBlocks)
                {
                    var key = block.Key;
                    Debug.Console(2, this, "SwitcherControlBlock Key - {0}", key);
                    var value = block.Value;

                    Switchers.Add(key, new TesiraDspSwitcher(key, value, this));
                    Debug.Console(2, this, "Added TesiraSwitcher {0} InstanceTag {1}", key, value.SwitcherInstanceTag);

                    if (block.Value.Enabled)
                    {
                        //Add ControlPoint to the list for the watchdog

                        ControlPointList.Add(Switchers[key]);
                    }
                }
            }

            if (props.DialerControlBlocks != null)
            {
                Debug.Console(2, this, "DialerControlBlocks is not null - There are {0} of them", props.DialerControlBlocks.Count());
                foreach (var block in props.DialerControlBlocks)
                {
                    var key = block.Key;
                    Debug.Console(2, this, "LevelControlBlock Key - {0}", key);
                    var value = block.Value;
                    Dialers.Add(key, new TesiraDspDialer(key, value, this));
                    Debug.Console(2, this, "Added DspDialer {0} ControlStatusTag: {1} DialerTag: {2}", key, value.ControlStatusInstanceTag, value.DialerInstanceTag);

                    if (block.Value.Enabled)
                    {
                        ControlPointList.Add(Dialers[key]);
                    }
                }
            }

            if (props.StateControlBlocks != null)
            {
                Debug.Console(2, this, "stateControlBlocks is not null - There are {0} of them", props.StateControlBlocks.Count());
                foreach (var block in props.StateControlBlocks)
                {
                    var key   = block.Key;
                    var value = block.Value;
                    States.Add(key, new TesiraDspStateControl(key, value, this));
                    Debug.Console(2, this, "Added DspState {0} InstanceTag: {1}", key, value.StateInstanceTag);

                    if (block.Value.Enabled)
                    {
                        ControlPointList.Add(States[key]);
                    }
                }
            }

            if (props.Presets != null)
            {
                foreach (var preset in props.Presets)
                {
                    var value = preset.Value;
                    var key   = preset.Key;
                    Presets.Add(key, value);
                    Debug.Console(2, this, "Added Preset {0} {1}", value.Label, value.PresetName);
                }
            }

            if (props.MeterControlBlocks != null)
            {
                foreach (var meter in props.MeterControlBlocks)
                {
                    var key   = meter.Key;
                    var value = meter.Value;
                    Meters.Add(key, new TesiraDspMeter(key, value, this));
                    Debug.Console(2, this, "Adding Meter {0} InstanceTag: {1}", key, value.MeterInstanceTag);

                    if (value.Enabled)
                    {
                        ControlPointList.Add(Meters[key]);
                    }
                }
            }

            if (props.CrosspointStateControlBlocks != null)
            {
                foreach (var mixer in props.CrosspointStateControlBlocks)
                {
                    var key   = mixer.Key;
                    var value = mixer.Value;
                    CrosspointStates.Add(key, new TesiraDspCrosspointState(key, value, this));
                    Debug.Console(2, this, "Adding Mixer {0} InstanceTag: {1}", key, value.MatrixInstanceTag);

                    if (value.Enabled)
                    {
                        ControlPointList.Add(CrosspointStates[key]);
                    }
                }
            }
            if (props.RoomCombinerControlBlocks == null)
            {
                return;
            }
            foreach (var roomCombiner in props.RoomCombinerControlBlocks)
            {
                var key   = roomCombiner.Key;
                var value = roomCombiner.Value;
                RoomCombiners.Add(key, new TesiraDspRoomCombiner(key, value, this));
                Debug.Console(2, this, "Adding Mixer {0} InstanceTag: {1}", key, value.RoomCombinerInstanceTag);

                if (value.Enabled)
                {
                    ControlPointList.Add(RoomCombiners[key]);
                }
            }

            //Keep me at the end of this method!
            DeviceManager.AddDevice(new TesiraDspDeviceInfo(String.Format("{0}--DeviceInfo", Key), String.Format("{0}--DeviceInfo", Name, Presets), this, Presets));
        }
 /// <summary>
 ///		Inicializa la métrica
 /// </summary>
 public override void Reset()
 {
     Meters.Clear();
 }