diff --git a/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoCodec.cs b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoCodec.cs index e8faa1de..926a30d2 100644 --- a/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoCodec.cs +++ b/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoCodec.cs @@ -275,6 +275,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco /// void SyncState_InitialSyncCompleted(object sender, EventArgs e) { + // Fire the ready event + SetIsReady(); //CommDebuggingIsOn = false; GetCallHistory(); diff --git a/Essentials Devices Common/Essentials Devices Common/VideoCodec/MockVC/MockVC.cs b/Essentials Devices Common/Essentials Devices Common/VideoCodec/MockVC/MockVC.cs index 777ce01b..65e60530 100644 --- a/Essentials Devices Common/Essentials Devices Common/VideoCodec/MockVC/MockVC.cs +++ b/Essentials Devices Common/Essentials Devices Common/VideoCodec/MockVC/MockVC.cs @@ -24,6 +24,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec public MockVC(string key, string name) : base(key, name) { + CodecInfo = new MockCodecInfo(); + // Debug helpers IncomingCallFeedback.OutputChange += (o, a) => Debug.Console(1, this, "IncomingCall={0}", _IncomingCall); MuteFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Mute={0}", _IsMuted); @@ -40,6 +42,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec InputPorts.Add(HdmiIn1); InputPorts.Add(HdmiIn2); OutputPorts.Add(HdmiOut); + + SetIsReady(); } protected override Func IncomingCallFeedbackFunc @@ -299,4 +303,42 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec } } + + /// + /// Implementation for the mock VC + /// + public class MockCodecInfo : VideoCodecInfo + { + + public override bool MultiSiteOptionIsEnabled + { + get { return true; } + } + + public override string IpAddress + { + get { return "xx.xx.xx.xx"; } + } + + public override string PhoneNumber + { + get { return "333-444-5555"; } + } + + public override string SipUri + { + get { return "mock@someurl.com"; } + } + + public override bool AutoAnswerEnabled + { + get { return _AutoAnswerEnabled; } + } + bool _AutoAnswerEnabled; + + public void SetAutoAnswer(bool value) + { + _AutoAnswerEnabled = value; + } + } } \ No newline at end of file diff --git a/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs b/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs index 9d664fda..deadefbd 100644 --- a/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs +++ b/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs @@ -1,185 +1,200 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Crestron.SimplSharp; - -using PepperDash.Core; -using PepperDash.Essentials.Core; -using PepperDash.Essentials.Devices.Common; -using PepperDash.Essentials.Devices.Common.Codec; - -namespace PepperDash.Essentials.Devices.Common.VideoCodec -{ - public abstract class VideoCodecBase : Device, IRoutingInputsOutputs, IUsageTracking, IHasDialer, IHasSharing, ICodecAudio, iCodecInfo - { - /// - /// Fires when the status of any active, dialing, or incoming call changes or is new - /// - public event EventHandler CallStatusChange; - - #region IUsageTracking Members - - /// - /// This object can be added by outside users of this class to provide usage tracking - /// for various services - /// - public UsageTracking UsageTracker { get; set; } - - #endregion - - public RoutingPortCollection InputPorts { get; private set; } - - public RoutingPortCollection OutputPorts { get; private set; } - - /// - /// Returns true when any call is not in state Unknown, Disconnecting, Disconnected - /// - public bool IsInCall { get { return ActiveCalls.Any(c => c.IsActiveCall); } } - - public BoolFeedback IncomingCallFeedback { get; private set; } - - abstract protected Func IncomingCallFeedbackFunc { get; } - abstract protected Func PrivacyModeIsOnFeedbackFunc { get; } - abstract protected Func VolumeLevelFeedbackFunc { get; } - abstract protected Func MuteFeedbackFunc { get; } - abstract protected Func SharingSourceFeedbackFunc { get; } - +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; + +using PepperDash.Core; +using PepperDash.Essentials.Core; +using PepperDash.Essentials.Devices.Common; +using PepperDash.Essentials.Devices.Common.Codec; + +namespace PepperDash.Essentials.Devices.Common.VideoCodec +{ + public abstract class VideoCodecBase : Device, IRoutingInputsOutputs, IUsageTracking, IHasDialer, IHasSharing, ICodecAudio, iCodecInfo + { + /// + /// Fires when the status of any active, dialing, or incoming call changes or is new + /// + public event EventHandler CallStatusChange; + + public event EventHandler IsReadyChange; + + #region IUsageTracking Members + + /// + /// This object can be added by outside users of this class to provide usage tracking + /// for various services + /// + public UsageTracking UsageTracker { get; set; } + + #endregion + + public RoutingPortCollection InputPorts { get; private set; } + + public RoutingPortCollection OutputPorts { get; private set; } + + /// + /// Returns true when any call is not in state Unknown, Disconnecting, Disconnected + /// + public bool IsInCall { get { return ActiveCalls.Any(c => c.IsActiveCall); } } + + public BoolFeedback IncomingCallFeedback { get; private set; } + + abstract protected Func IncomingCallFeedbackFunc { get; } + abstract protected Func PrivacyModeIsOnFeedbackFunc { get; } + abstract protected Func VolumeLevelFeedbackFunc { get; } + abstract protected Func MuteFeedbackFunc { get; } + abstract protected Func SharingSourceFeedbackFunc { get; } + public List ActiveCalls { get; set; } - public VideoCodecInfo CodecInfo { get; protected set; } - - public VideoCodecBase(string key, string name) - : base(key, name) - { - IncomingCallFeedback = new BoolFeedback(IncomingCallFeedbackFunc); - PrivacyModeIsOnFeedback = new BoolFeedback(PrivacyModeIsOnFeedbackFunc); - VolumeLevelFeedback = new IntFeedback(VolumeLevelFeedbackFunc); - MuteFeedback = new BoolFeedback(MuteFeedbackFunc); - SharingSourceFeedback = new StringFeedback(SharingSourceFeedbackFunc); - - InputPorts = new RoutingPortCollection(); - OutputPorts = new RoutingPortCollection(); - + public VideoCodecInfo CodecInfo { get; protected set; } + + public bool IsReady { get; protected set; } + + public VideoCodecBase(string key, string name) + : base(key, name) + { + IncomingCallFeedback = new BoolFeedback(IncomingCallFeedbackFunc); + PrivacyModeIsOnFeedback = new BoolFeedback(PrivacyModeIsOnFeedbackFunc); + VolumeLevelFeedback = new IntFeedback(VolumeLevelFeedbackFunc); + MuteFeedback = new BoolFeedback(MuteFeedbackFunc); + SharingSourceFeedback = new StringFeedback(SharingSourceFeedbackFunc); + + InputPorts = new RoutingPortCollection(); + OutputPorts = new RoutingPortCollection(); + ActiveCalls = new List(); - } - - #region IHasDialer Members - - public abstract void Dial(string s); - public abstract void EndCall(CodecActiveCallItem call); - public abstract void EndAllCalls(); - public abstract void AcceptCall(CodecActiveCallItem call); - public abstract void RejectCall(CodecActiveCallItem call); - public abstract void SendDtmf(string s); - - #endregion - - public virtual List Feedbacks - { - get - { - return new List - { - IncomingCallFeedback, - PrivacyModeIsOnFeedback, - SharingSourceFeedback - }; - } - } - - public abstract void ExecuteSwitch(object selector); - - /// - /// Helper method to fire CallStatusChange event with old and new status - /// - protected void SetNewCallStatusAndFireCallStatusChange(eCodecCallStatus newStatus, CodecActiveCallItem call) - { - var prevStatus = call.Status; - call.Status = newStatus; - OnCallStatusChange(prevStatus, newStatus, call); - } - - /// - /// - /// - /// - /// - /// - protected void OnCallStatusChange(eCodecCallStatus previousStatus, eCodecCallStatus newStatus, CodecActiveCallItem item) - { - var handler = CallStatusChange; - if (handler != null) - handler(this, new CodecCallStatusItemChangeEventArgs(previousStatus, newStatus, item)); - } - - #region ICodecAudio Members - - public abstract void PrivacyModeOn(); - public abstract void PrivacyModeOff(); - public abstract void PrivacyModeToggle(); - public BoolFeedback PrivacyModeIsOnFeedback { get; private set; } - - - public BoolFeedback MuteFeedback { get; private set; } - - public abstract void MuteOff(); - - public abstract void MuteOn(); - - public abstract void SetVolume(ushort level); - - public IntFeedback VolumeLevelFeedback { get; private set; } - - public abstract void MuteToggle(); - - public abstract void VolumeDown(bool pressRelease); - - - public abstract void VolumeUp(bool pressRelease); - - #endregion - - #region IHasSharing Members - - public abstract void StartSharing(); - public abstract void StopSharing(); - - public StringFeedback SharingSourceFeedback { get; private set; } - - #endregion - - // **** DEBUGGING THINGS **** - /// - /// - /// - public virtual void ListCalls() - { - var sb = new StringBuilder(); - foreach (var c in ActiveCalls) - sb.AppendFormat("{0} {1} -- {2} {3}\r", c.Id, c.Number, c.Name, c.Status); - Debug.Console(1, "{0}", sb.ToString()); } - } - - /// - /// - /// - public class CodecCallStatusItemChangeEventArgs : EventArgs - { - public CodecActiveCallItem CallItem { get; private set; } - - public eCodecCallStatus PreviousStatus { get; private set; } - - public eCodecCallStatus NewStatus { get; private set; } - - public CodecCallStatusItemChangeEventArgs(eCodecCallStatus previousStatus, - eCodecCallStatus newStatus, CodecActiveCallItem item) - { - PreviousStatus = previousStatus; - NewStatus = newStatus; - CallItem = item; - } - } + #region IHasDialer Members + + public abstract void Dial(string s); + public abstract void EndCall(CodecActiveCallItem call); + public abstract void EndAllCalls(); + public abstract void AcceptCall(CodecActiveCallItem call); + public abstract void RejectCall(CodecActiveCallItem call); + public abstract void SendDtmf(string s); + + #endregion + + public virtual List Feedbacks + { + get + { + return new List + { + IncomingCallFeedback, + PrivacyModeIsOnFeedback, + SharingSourceFeedback + }; + } + } + + public abstract void ExecuteSwitch(object selector); + + /// + /// Helper method to fire CallStatusChange event with old and new status + /// + protected void SetNewCallStatusAndFireCallStatusChange(eCodecCallStatus newStatus, CodecActiveCallItem call) + { + var prevStatus = call.Status; + call.Status = newStatus; + OnCallStatusChange(prevStatus, newStatus, call); + } + + /// + /// + /// + /// + /// + /// + protected void OnCallStatusChange(eCodecCallStatus previousStatus, eCodecCallStatus newStatus, CodecActiveCallItem item) + { + var handler = CallStatusChange; + if (handler != null) + handler(this, new CodecCallStatusItemChangeEventArgs(previousStatus, newStatus, item)); + } + + /// + /// Sets IsReady property and fires the event. Used for dependent classes to sync up their data. + /// + protected void SetIsReady() + { + IsReady = true; + var h = IsReadyChange; + if(h != null) + h(this, new EventArgs()); + } + + #region ICodecAudio Members + + public abstract void PrivacyModeOn(); + public abstract void PrivacyModeOff(); + public abstract void PrivacyModeToggle(); + public BoolFeedback PrivacyModeIsOnFeedback { get; private set; } + + + public BoolFeedback MuteFeedback { get; private set; } + + public abstract void MuteOff(); + + public abstract void MuteOn(); + + public abstract void SetVolume(ushort level); + + public IntFeedback VolumeLevelFeedback { get; private set; } + + public abstract void MuteToggle(); + + public abstract void VolumeDown(bool pressRelease); + + + public abstract void VolumeUp(bool pressRelease); + + #endregion + + #region IHasSharing Members + + public abstract void StartSharing(); + public abstract void StopSharing(); + + public StringFeedback SharingSourceFeedback { get; private set; } + + #endregion + + // **** DEBUGGING THINGS **** + /// + /// + /// + public virtual void ListCalls() + { + var sb = new StringBuilder(); + foreach (var c in ActiveCalls) + sb.AppendFormat("{0} {1} -- {2} {3}\r", c.Id, c.Number, c.Name, c.Status); + Debug.Console(1, "{0}", sb.ToString()); + } + + } + + /// + /// + /// + public class CodecCallStatusItemChangeEventArgs : EventArgs + { + public CodecActiveCallItem CallItem { get; private set; } + + public eCodecCallStatus PreviousStatus { get; private set; } + + public eCodecCallStatus NewStatus { get; private set; } + + public CodecCallStatusItemChangeEventArgs(eCodecCallStatus previousStatus, + eCodecCallStatus newStatus, CodecActiveCallItem item) + { + PreviousStatus = previousStatus; + NewStatus = newStatus; + CallItem = item; + } + } } \ No newline at end of file diff --git a/Essentials/PepperDashEssentials/UI/JoinConstants/UIBoolJoin.cs b/Essentials/PepperDashEssentials/UI/JoinConstants/UIBoolJoin.cs index 7d2f41a2..5526ea9f 100644 --- a/Essentials/PepperDashEssentials/UI/JoinConstants/UIBoolJoin.cs +++ b/Essentials/PepperDashEssentials/UI/JoinConstants/UIBoolJoin.cs @@ -40,47 +40,46 @@ namespace PepperDash.Essentials // Audio Conference -#warning Move these to 1100's /// - /// 1001 + /// 1101 /// - public const uint ACKeypadVisible = 1001; + public const uint ACKeypadVisible = 1101; /// - /// 1002 + /// 1102 /// - public const uint ACStagingPopoverVisible = 1002; + public const uint ACStagingPopoverVisible = 1102; /// - /// 1011 + /// 1111 /// - public const uint ACSpeedDial1Press = 1011; + public const uint ACSpeedDial1Press = 1111; /// - /// 1012 + /// 1112 /// - public const uint ACSpeedDial2Press = 1012; + public const uint ACSpeedDial2Press = 1112; /// - /// 1013 + /// 1113 /// - public const uint ACSpeedDial3Press = 1013; + public const uint ACSpeedDial3Press = 1113; /// - /// 1014 + /// 1114 /// - public const uint ACSpeedDial4Press = 1014; + public const uint ACSpeedDial4Press = 1114; /// - /// 1021 + /// 1121 /// - public const uint ACSpeedDial1Visible = 1021; + public const uint ACSpeedDial1Visible = 1121; /// - /// 1022 + /// 1122 /// - public const uint ACSpeedDial2Visible = 1022; + public const uint ACSpeedDial2Visible = 1122; /// - /// 1023 + /// 1123 /// - public const uint ACSpeedDial3Visible = 1023; + public const uint ACSpeedDial3Visible = 1123; /// - /// 1024 + /// 1124 /// - public const uint ACSpeedDial4Visible = 1024; + public const uint ACSpeedDial4Visible = 1124; //****************************************************** // Video Conference diff --git a/Essentials/PepperDashEssentials/UIDrivers/Essentials/EssentialsPresentationPanelAvFunctionsDriver.cs b/Essentials/PepperDashEssentials/UIDrivers/Essentials/EssentialsPresentationPanelAvFunctionsDriver.cs index e8dda4ef..f94913c4 100644 --- a/Essentials/PepperDashEssentials/UIDrivers/Essentials/EssentialsPresentationPanelAvFunctionsDriver.cs +++ b/Essentials/PepperDashEssentials/UIDrivers/Essentials/EssentialsPresentationPanelAvFunctionsDriver.cs @@ -232,7 +232,6 @@ namespace PepperDash.Essentials TriList.SetSigFalseAction(UIBoolJoin.RoomHeaderButtonPress, () => ShowInterlockedModal(UIBoolJoin.RoomHeaderPageVisible)); -#warning Add press and hold to gear button here TriList.SetSigFalseAction(UIBoolJoin.GearHeaderButtonPress, () => ShowInterlockedModal(UIBoolJoin.VolumesPageVisible)); diff --git a/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs b/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs index 534e8b8c..c5fc71c0 100644 --- a/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs +++ b/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs @@ -178,8 +178,8 @@ namespace PepperDash.Essentials SourceStagingSrl = new SubpageReferenceList(TriList, UISmartObjectJoin.SourceStagingSRL, 3, 3, 3); ActivityFooterSrl = new SubpageReferenceList(TriList, UISmartObjectJoin.ActivityFooterSRL, 3, 3, 3); - CallButtonSig = ActivityFooterSrl.BoolInputSig(1, 1); - ShareButtonSig = ActivityFooterSrl.BoolInputSig(2, 1); + CallButtonSig = ActivityFooterSrl.BoolInputSig(2, 1); + ShareButtonSig = ActivityFooterSrl.BoolInputSig(1, 1); EndMeetingButtonSig = ActivityFooterSrl.BoolInputSig(3, 1); SetupActivityFooterWhenRoomOff(); @@ -425,13 +425,13 @@ namespace PepperDash.Essentials void SetupActivityFooterWhenRoomOff() { ActivityFooterSrl.Clear(); - ActivityFooterSrl.AddItem(new SubpageReferenceListActivityItem(1, ActivityFooterSrl, 1, - b => { if (!b) ActivityCallButtonPressed(); })); - ActivityFooterSrl.AddItem(new SubpageReferenceListActivityItem(2, ActivityFooterSrl, 0, + ActivityFooterSrl.AddItem(new SubpageReferenceListActivityItem(1, ActivityFooterSrl, 0, b => { if (!b) ActivityShareButtonPressed(); })); + ActivityFooterSrl.AddItem(new SubpageReferenceListActivityItem(2, ActivityFooterSrl, 3, + b => { if (!b) ActivityCallButtonPressed(); })); ActivityFooterSrl.Count = 2; - TriList.SetUshort(UIUshortJoin.PresentationStagingCaretMode, 5); // right one slot - TriList.SetUshort(UIUshortJoin.CallStagingCaretMode, 1); // left one slot + TriList.SetUshort(UIUshortJoin.PresentationStagingCaretMode, 1); // right one slot + TriList.SetUshort(UIUshortJoin.CallStagingCaretMode, 5); // left one slot } /// @@ -440,15 +440,15 @@ namespace PepperDash.Essentials void SetupActivityFooterWhenRoomOn() { ActivityFooterSrl.Clear(); - ActivityFooterSrl.AddItem(new SubpageReferenceListActivityItem(1, ActivityFooterSrl, 1, - b => { if (!b) ActivityCallButtonPressed(); })); - ActivityFooterSrl.AddItem(new SubpageReferenceListActivityItem(2, ActivityFooterSrl, 0, + ActivityFooterSrl.AddItem(new SubpageReferenceListActivityItem(1, ActivityFooterSrl, 0, b => { if (!b) ActivityShareButtonPressed(); })); - ActivityFooterSrl.AddItem(new SubpageReferenceListActivityItem(3, ActivityFooterSrl, - 3, b => { if (!b) PowerButtonPressed(); })); + ActivityFooterSrl.AddItem(new SubpageReferenceListActivityItem(2, ActivityFooterSrl, 3, + b => { if (!b) ActivityCallButtonPressed(); })); + ActivityFooterSrl.AddItem(new SubpageReferenceListActivityItem(3, ActivityFooterSrl, 4, + b => { if (!b) PowerButtonPressed(); })); ActivityFooterSrl.Count = 3; - TriList.SetUshort(UIUshortJoin.PresentationStagingCaretMode, 0); // center - TriList.SetUshort(UIUshortJoin.CallStagingCaretMode, 2); // left -2 + TriList.SetUshort(UIUshortJoin.PresentationStagingCaretMode, 2); // center + TriList.SetUshort(UIUshortJoin.CallStagingCaretMode, 0); // left -2 } /// diff --git a/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs b/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs index 417ee8a4..53ea6eeb 100644 --- a/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs +++ b/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs @@ -85,6 +85,12 @@ namespace PepperDash.Essentials.UIDrivers.VC codec.CallStatusChange += new EventHandler(Codec_CallStatusChange); + // If the codec is ready, then get the values we want, otherwise wait + if (Codec.IsReady) + Codec_IsReady(); + else + codec.IsReadyChange += (o, a) => Codec_IsReady(); + InCall = new BoolFeedback(() => false); LocalPrivacyIsMuted = new BoolFeedback(() => false); @@ -113,6 +119,19 @@ namespace PepperDash.Essentials.UIDrivers.VC .LinkInputSig(TriList.BooleanInput[UIBoolJoin.VCKeypadBackspaceVisible]); TriList.SetSigFalseAction(UIBoolJoin.VCKeypadTextPress, RevealKeyboard); + + // Address and number + } + + /// + /// + /// + /// + /// + void Codec_IsReady() + { + TriList.SetString(UIStringJoin.RoomPhoneText, Codec.CodecInfo.PhoneNumber); + TriList.SetString(UIStringJoin.RoomSipText, Codec.CodecInfo.SipUri); } /// diff --git a/Release Package/PepperDashEssentials.cpz b/Release Package/PepperDashEssentials.cpz index cc391a45..7ab0e6a2 100644 Binary files a/Release Package/PepperDashEssentials.cpz and b/Release Package/PepperDashEssentials.cpz differ diff --git a/Release Package/PepperDashEssentials.dll b/Release Package/PepperDashEssentials.dll index cb72b2a0..3cc9e169 100644 Binary files a/Release Package/PepperDashEssentials.dll and b/Release Package/PepperDashEssentials.dll differ