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 StartWarmingTimer()
 {
     _IsWarmingUp = true;
     IsWarmingUpFeedback.FireUpdate();
     new CTimer(o => {
         _IsWarmingUp = false;
         IsWarmingUpFeedback.FireUpdate();
     }, 10000);
 }
Пример #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
 public override void PowerOn()
 {
     if (!PowerIsOnFeedback.BoolValue && !_IsWarmingUp && !_IsCoolingDown)
     {
         _IsWarmingUp = true;
         IsWarmingUpFeedback.InvokeFireUpdate();
         // Fake power-up cycle
         WarmupTimer = new CTimer(o =>
         {
             _IsWarmingUp = false;
             _PowerIsOn   = true;
             IsWarmingUpFeedback.InvokeFireUpdate();
             PowerIsOnFeedback.InvokeFireUpdate();
         }, WarmupTime);
     }
 }
Пример #5
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;
        }
Пример #6
0
 /// <summary>
 /// Power on the display
 /// </summary>
 public override void PowerOn()
 {
     Send(PowerOnCmd);
     if (!PowerIsOnFeedback.BoolValue && !_IsWarmingUp && !_IsCoolingDown)
     {
         _IsWarmingUp = true;
         IsWarmingUpFeedback.FireUpdate();
         // Fake power-up cycle
         WarmupTimer = new Crestron.SimplSharp.CTimer(o =>
         {
             _IsWarmingUp = false;
             _PowerIsOn   = true;
             IsWarmingUpFeedback.FireUpdate();
             PowerIsOnFeedback.FireUpdate();
         }, WarmupTime);
     }
 }
Пример #7
0
 /// <summary>
 ///
 /// </summary>
 public override void PowerOn()
 {
     //Send(PowerOnCmd);
     SendBytes(new byte[] { 0x07, ID, 0x02, 0x50, 0x4F, 0x57, 0x01, 0x08, 0x0d });
     if (!PowerIsOnFeedback.BoolValue && !_IsWarmingUp && !_IsCoolingDown)
     {
         _IsWarmingUp = true;
         IsWarmingUpFeedback.FireUpdate();
         // Fake power-up cycle
         WarmupTimer = new CTimer(o =>
         {
             _IsWarmingUp = false;
             _PowerIsOn   = true;
             IsWarmingUpFeedback.FireUpdate();
             PowerIsOnFeedback.FireUpdate();
         }, WarmupTime);
     }
 }
Пример #8
0
        /// <summary>
        ///
        /// </summary>
        public override void PowerOn()
        {
            Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Powering On Display");

            IsPoweringOnIgnorePowerFb = true;
            //Send(PowerOnCmd);
            SendBytes(new byte[] { 0xAA, 0x11, 0x00, 0x01, 0x01, 0x00 });
            if (!PowerIsOnFeedback.BoolValue && !_IsWarmingUp && !_IsCoolingDown)
            {
                _IsWarmingUp = true;
                IsWarmingUpFeedback.FireUpdate();
                // Fake power-up cycle
                WarmupTimer = new CTimer(o =>
                {
                    _IsWarmingUp = false;
                    _PowerIsOn   = true;
                    IsWarmingUpFeedback.FireUpdate();
                    PowerIsOnFeedback.FireUpdate();
                }, WarmupTime);
            }
        }
        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);
            }
        }