コード例 #1
0
        void InitializeDisplay(DisplayBase disp)
        {
            if (disp != null)
            {
                // Link power, warming, cooling to display
                disp.PowerIsOnFeedback.OutputChange += (o, a) =>
                {
                    if (disp.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
                    {
                        if (!disp.PowerIsOnFeedback.BoolValue)
                        {
                            disp.CurrentSourceInfo = null;
                        }
                        OnFeedback.FireUpdate();
                    }
                    if (disp.PowerIsOnFeedback.BoolValue)
                    {
                        SetDefaultLevels();
                    }
                };

                disp.IsWarmingUpFeedback.OutputChange += (o, a) =>
                {
                    IsWarmingUpFeedback.FireUpdate();
                    if (!IsWarmingUpFeedback.BoolValue)
                    {
                        (CurrentVolumeControls as IBasicVolumeWithFeedback).SetVolume(DefaultVolume);
                    }
                };
                disp.IsCoolingDownFeedback.OutputChange += (o, a) =>
                {
                    IsCoolingDownFeedback.FireUpdate();
                };
            }
        }
コード例 #2
0
 void StartCoolingTimer()
 {
     _IsCoolingDown = true;
     IsCoolingDownFeedback.FireUpdate();
     new CTimer(o =>
     {
         _IsCoolingDown = false;
         IsCoolingDownFeedback.FireUpdate();
     }, 7000);
 }
コード例 #3
0
        private void displayEvent(GenericBase device, BaseEventArgs args)
        {
            switch (args.EventId)
            {
            case RoomViewConnectedDisplay.OnLineFeedbackEventId:
                // TODO: figure out what to do with OnLine event in BaseEvent
                // Read current state of the projector power and if differ from room state update room state accordingly without setters actions.
                foreach (var feeedback in Feedbacks)
                {
                    //feeedback.FireUpdate();
                }
                break;

            case RoomViewConnectedDisplay.PowerOffFeedbackEventId:
            case RoomViewConnectedDisplay.PowerOnFeedbackEventId:
                PowerIsOnFeedback.FireUpdate();
                break;

            case RoomViewConnectedDisplay.CoolingDownFeedbackEventId:
                IsCoolingDownFeedback.FireUpdate();
                break;

            case RoomViewConnectedDisplay.WarmingUpFeedbackEventId:
                IsWarmingUpFeedback.FireUpdate();
                break;

            case RoomViewConnectedDisplay.MuteOnFeedbackEventId:
                MuteFeedback.FireUpdate();
                break;

            case RoomViewConnectedDisplay.VolumeFeedbackEventId:
                VolumeLevelFeedback.FireUpdate();
                break;

            case RoomViewConnectedDisplay.SourceSelectFeedbackEventId:
                uint sourceSelectIndex = (uint)args.Index;
                if (_display.SourceSelectFeedbackSigs[sourceSelectIndex].BoolValue == true)
                {
                    RoutingInputPort newInputPort = (RoutingInputPort)_display.SourceSelectFeedbackSigs[sourceSelectIndex].UserObject;
                    CurrentInputFeedback.FireUpdate();
                    OnSwitchChange(new RoutingNumericEventArgs(null, newInputPort, eRoutingSignalType.AudioVideo));
                }
                break;

            case RoomViewConnectedDisplay.SourceNameTextFeedbackEventId:
                break;

            case RoomViewConnectedDisplay.LampHoursFeedbackEventId:
            case RoomViewConnectedDisplay.LampHoursTextFeedbackEventId:
                break;
            }
        }
コード例 #4
0
        void Initialize()
        {
            if (DefaultAudioDevice is IBasicVolumeControls)
            {
                DefaultVolumeControls = DefaultAudioDevice as IBasicVolumeControls;
            }
            else if (DefaultAudioDevice is IHasVolumeDevice)
            {
                DefaultVolumeControls = (DefaultAudioDevice as IHasVolumeDevice).VolumeDevice;
            }
            CurrentVolumeControls = DefaultVolumeControls;

            var disp = DefaultDisplay as DisplayBase;

            if (disp != null)
            {
                // Link power, warming, cooling to display
                disp.PowerIsOnFeedback.OutputChange += (o, a) =>
                {
                    if (disp.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
                    {
                        if (!disp.PowerIsOnFeedback.BoolValue)
                        {
                            CurrentSourceInfo = null;
                        }
                        OnFeedback.FireUpdate();
                    }
                };

                disp.IsWarmingUpFeedback.OutputChange += (o, a) =>
                {
                    IsWarmingUpFeedback.FireUpdate();
                    if (!IsWarmingUpFeedback.BoolValue)
                    {
                        (DefaultDisplay as IBasicVolumeWithFeedback).SetVolume(DefaultVolume);
                    }
                };
                disp.IsCoolingDownFeedback.OutputChange += (o, a) =>
                {
                    IsCoolingDownFeedback.FireUpdate();
                };
            }

            SourceListKey             = "default";
            EnablePowerOnToLastSource = true;
        }
コード例 #5
0
 public override void PowerOff()
 {
     // If a display has unreliable-power off feedback, just override this and
     // remove this check.
     if (PowerIsOnFeedback.BoolValue && !_IsWarmingUp && !_IsCoolingDown)
     {
         _IsCoolingDown = true;
         _PowerIsOn     = false;
         PowerIsOnFeedback.InvokeFireUpdate();
         IsCoolingDownFeedback.InvokeFireUpdate();
         // Fake cool-down cycle
         CooldownTimer = new CTimer(o =>
         {
             Debug.Console(2, this, "Cooldown timer ending");
             _IsCoolingDown = false;
             IsCoolingDownFeedback.InvokeFireUpdate();
         }, CooldownTime);
     }
 }
コード例 #6
0
 /// <summary>
 ///
 /// </summary>
 public override void PowerOff()
 {
     // If a display has unreliable-power off feedback, just override this and
     // remove this check.
     if (!_IsWarmingUp && !_IsCoolingDown) // PowerIsOnFeedback.BoolValue &&
     {
         //Send(PowerOffCmd);
         SendBytes(new byte[] { 0x07, ID, 0x02, 0x50, 0x4F, 0x57, 0x00, 0x08, 0x0d });
         _IsCoolingDown = true;
         _PowerIsOn     = false;
         PowerIsOnFeedback.FireUpdate();
         IsCoolingDownFeedback.FireUpdate();
         // Fake cool-down cycle
         CooldownTimer = new CTimer(o =>
         {
             _IsCoolingDown = false;
             IsCoolingDownFeedback.FireUpdate();
         }, CooldownTime);
     }
 }
コード例 #7
0
        /// <summary>
        ///
        /// </summary>
        public override void PowerOff()
        {
            Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Powering Off Display");

            IsPoweringOnIgnorePowerFb = false;
            // If a display has unreliable-power off feedback, just override this and
            // remove this check.
            if (!_IsWarmingUp && !_IsCoolingDown) // PowerIsOnFeedback.BoolValue &&
            {
                //Send(PowerOffCmd);
                SendBytes(new byte[] { 0xAA, 0x11, 0x00, 0x01, 0x00, 0x00 });
                _IsCoolingDown = true;
                _PowerIsOn     = false;
                PowerIsOnFeedback.FireUpdate();
                IsCoolingDownFeedback.FireUpdate();
                // Fake cool-down cycle
                CooldownTimer = new CTimer(o =>
                {
                    _IsCoolingDown = false;
                    IsCoolingDownFeedback.FireUpdate();
                }, CooldownTime);
            }
        }
コード例 #8
0
        void Initialize()
        {
            try
            {
                if (DefaultAudioDevice is IBasicVolumeControls)
                {
                    DefaultVolumeControls = DefaultAudioDevice as IBasicVolumeControls;
                }
                else if (DefaultAudioDevice is IHasVolumeDevice)
                {
                    DefaultVolumeControls = (DefaultAudioDevice as IHasVolumeDevice).VolumeDevice;
                }
                CurrentVolumeControls = DefaultVolumeControls;


                // Combines call feedback from both codecs if available
                InCallFeedback = new BoolFeedback(() =>
                {
                    bool inAudioCall = false;
                    bool inVideoCall = false;

                    if (AudioCodec != null)
                    {
                        inAudioCall = AudioCodec.IsInCall;
                    }

                    if (VideoCodec != null)
                    {
                        inVideoCall = VideoCodec.IsInCall;
                    }

                    if (inAudioCall || inVideoCall)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                });

                var disp = DefaultDisplay as DisplayBase;
                if (disp != null)
                {
                    // Link power, warming, cooling to display
                    disp.PowerIsOnFeedback.OutputChange += (o, a) =>
                    {
                        if (disp.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
                        {
                            if (!disp.PowerIsOnFeedback.BoolValue)
                            {
                                CurrentSourceInfo = null;
                            }
                            OnFeedback.FireUpdate();
                        }
                        if (disp.PowerIsOnFeedback.BoolValue)
                        {
                            SetDefaultLevels();
                        }
                    };

                    disp.IsWarmingUpFeedback.OutputChange += (o, a) =>
                    {
                        IsWarmingUpFeedback.FireUpdate();
                        if (!IsWarmingUpFeedback.BoolValue)
                        {
                            (CurrentVolumeControls as IBasicVolumeWithFeedback).SetVolume(DefaultVolume);
                        }
                    };
                    disp.IsCoolingDownFeedback.OutputChange += (o, a) =>
                    {
                        IsCoolingDownFeedback.FireUpdate();
                    };
                }



                // Get Microphone Privacy object, if any  MUST HAPPEN AFTER setting InCallFeedback
                this.MicrophonePrivacy = EssentialsRoomConfigHelper.GetMicrophonePrivacy(PropertiesConfig, this);

                Debug.Console(2, this, "Microphone Privacy Config evaluated.");

                // Get emergency object, if any
                this.Emergency = EssentialsRoomConfigHelper.GetEmergency(PropertiesConfig, this);

                Debug.Console(2, this, "Emergency Config evaluated.");


                VideoCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate();

                if (AudioCodec != null)
                {
                    AudioCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate();
                }

                IsSharingFeedback = new BoolFeedback(() => VideoCodec.SharingContentIsOnFeedback.BoolValue);
                VideoCodec.SharingContentIsOnFeedback.OutputChange += (o, a) => this.IsSharingFeedback.FireUpdate();

                // link privacy to VC (for now?)
                PrivacyModeIsOnFeedback = new BoolFeedback(() => VideoCodec.PrivacyModeIsOnFeedback.BoolValue);
                VideoCodec.PrivacyModeIsOnFeedback.OutputChange += (o, a) => this.PrivacyModeIsOnFeedback.FireUpdate();

                CallTypeFeedback = new IntFeedback(() => 0);

                SourceListKey             = "default";
                EnablePowerOnToLastSource = true;
            }
            catch (Exception e)
            {
                Debug.Console(0, this, "Error Initializing Room: {0}", e);
            }
        }