コード例 #1
0
        /// <summary>
        /// Initializes this attribute based on config values and generates subscriptions commands and adds commands to the parent's queue.
        /// </summary>
        /// <param name="config">Configuration Object</param>
        private void Initialize(TesiraRoomCombinerBlockConfig config)
        {
            if (config.Enabled)
            {
                DeviceManager.AddDevice(this);
            }

            Debug.Console(2, this, "Adding RoomCombiner '{0}'", Key);

            IsSubscribed = false;

            HasMute                     = config.HasMute;
            HasLevel                    = config.HasLevel;
            UseAbsoluteValue            = config.UseAbsoluteValue;
            Enabled                     = config.Enabled;
            Permissions                 = config.Permissions;
            IncrementAmount             = config.IncrementAmount;
            AutomaticUnmuteOnVolumeUp   = config.UnmuteOnVolChange;
            _volumeUpRepeatTimer        = new CTimer((o) => VolumeUpRepeat(), Timeout.Infinite);
            _volumeDownRepeatTimer      = new CTimer((o) => VolumeDownRepeat(), Timeout.Infinite);
            _volumeUpRepeatDelayTimer   = new CTimer((o) => VolumeUpRepeatDelay(), Timeout.Infinite);
            _volumeDownRepeatDelayTimer = new CTimer((o) => VolumeDownRepeatDelay(), Timeout.Infinite);

            _pollTimer = new CTimer((o) => DoPoll(), Timeout.Infinite);


            if (HasMute && HasLevel)
            {
                ControlType = 0;
            }
            else if (!HasMute && HasLevel)
            {
                ControlType = 1;
            }

            else if (HasMute && !HasLevel)
            {
                ControlType = 2;
            }

            MuteFeedback    = new BoolFeedback(Key + "-MuteFeedback", () => OutIsMuted);
            VisibleFeedback = new BoolFeedback(Key + "-VisibleFeedback", () => Enabled);

            RoomGroupFeedback   = new IntFeedback(Key + "-RoomGroupFeedback", () => RoomGroup);
            VolumeLevelFeedback = new IntFeedback(Key + "-LevelFeedback", () => OutVolumeLevel);
            ControlTypeFeedback = new IntFeedback(Key + "-ControlTypeFeedback", () => ControlType);
            PermissionsFeedback = new IntFeedback(Key + "-PermissionsFeedback", () => Permissions);

            Feedbacks.Add(MuteFeedback);
            Feedbacks.Add(VolumeLevelFeedback);
            Feedbacks.Add(NameFeedback);
            Feedbacks.Add(VisibleFeedback);
            Feedbacks.Add(ControlTypeFeedback);
            Feedbacks.Add(PermissionsFeedback);

            Parent.Feedbacks.AddRange(Feedbacks);
        }
コード例 #2
0
 /// <summary>
 /// Constructor for Tesira Dsp Room Combiner Component
 /// </summary>
 /// <param name="key">Unique Key</param>
 /// <param name="config">configuration object</param>
 /// <param name="parent">Parent Object</param>
 public TesiraDspRoomCombiner(string key, TesiraRoomCombinerBlockConfig config, TesiraDsp parent)
     : base(config.RoomCombinerInstanceTag, "", config.RoomIndex, 0, parent, string.Format(KeyFormatter, parent.Key, key), config.Label, config.BridgeIndex)
 {
     Initialize(config);
 }