コード例 #1
0
        public VolumeLevel Add(Room room, VolumeLevelType type, IVolumeDevice volumeDevice)
        {
            VolumeLevel level = new VolumeLevel(room, type, volumeDevice);

            this.Add(level);
            return(level);
        }
コード例 #2
0
 void volumeDevice_VolumeChanged(IVolumeDevice device, VolumeChangeEventArgs args)
 {
     if (VolumeChanged != null)
     {
         VolumeChanged(this, args);
     }
 }
コード例 #3
0
        protected virtual void OnVolumeChanged(IVolumeDevice device, VolumeChangeEventArgs args)
        {
            var handler = VolumeChanged;

            if (handler != null)
            {
                handler(device, args);
            }
        }
コード例 #4
0
        public VolumeLevel(VolumeLevelType levelType, IVolumeDevice volumeDevice)
        {
            this.Device                 = volumeDevice;
            this.LevelType              = levelType;
            volumeDevice.VolumeChanged += new VolumeDeviceChangeEventHandler(volumeDevice_VolumeChanged);

#if DEBUG
            CrestronConsole.PrintLine("Created new VolumeLevel {0}, {1}", levelType.ToString(), volumeDevice.Name);
#endif
        }
コード例 #5
0
        public void VolumeDown(string name)
        {
            IVolumeDevice volume = this.GetVolumeDevice(name);

            if (volume.IsOn)
            {
                volume.VolumeSystem.VolumeDown();
                this.Unit.SaveChanges();
            }
        }
コード例 #6
0
 void mic_VolumeChanged(IVolumeDevice device, VolumeChangeEventArgs args)
 {
     // Loop through all mics and check all mics are equal to the calling devices status
     // If not return so we don't call event for the group
     foreach (ShureCeilingMic mic in this)
     {
         if (device.VolumeMute != mic.VolumeMute)
         {
             return;
         }
     }
     if (VolumeChanged != null)
     {
         VolumeChanged(this, new VolumeChangeEventArgs(VolumeLevelChangeEventType.MuteChanged));
     }
 }