diff --git a/Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/CiscoCodec.cs b/Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/CiscoCodec.cs index 048462a6..334d1a06 100644 --- a/Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/CiscoCodec.cs +++ b/Essentials Devices Common/Essentials Devices Common/VC/CiscoCodec/CiscoCodec.cs @@ -41,6 +41,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco } } + protected override Func MuteFeedbackFunc + { + get { return () => false; } + } + //private HttpsClient Client; //private HttpApiServer Server; @@ -576,6 +581,22 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco { } + + public override void MuteOff() + { + } + + public override void MuteOn() + { + } + + public override void SetVolume(ushort level) + { + } + + public override void MuteToggle() + { + } } /// diff --git a/Essentials Devices Common/Essentials Devices Common/VC/MockVC/MockVC.cs b/Essentials Devices Common/Essentials Devices Common/VC/MockVC/MockVC.cs index a6033b0d..dbceea4d 100644 --- a/Essentials Devices Common/Essentials Devices Common/VC/MockVC/MockVC.cs +++ b/Essentials Devices Common/Essentials Devices Common/VC/MockVC/MockVC.cs @@ -49,8 +49,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec protected override Func VolumeLevelFeedbackFunc { - get { throw new NotImplementedException(); } + get { return () => _VolumeLevel; } } + int _VolumeLevel; + + protected override Func MuteFeedbackFunc + { + get { return () => _IsMuted; } + } + bool _IsMuted; /// /// Dials, yo! @@ -118,6 +125,31 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec } + public override void MuteOff() + { + _IsMuted = false; + MuteFeedback.FireUpdate(); + } + + public override void MuteOn() + { + _IsMuted = true; + MuteFeedback.FireUpdate(); + } + + public override void MuteToggle() + { + _IsMuted = !_IsMuted; + MuteFeedback.FireUpdate(); + } + + public override void SetVolume(ushort level) + { + _VolumeLevel = level; + VolumeLevelFeedback.FireUpdate(); + } + + /// /// /// @@ -241,5 +273,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec Debug.Console(1, this, "TestFarEndHangup"); } + } } \ No newline at end of file diff --git a/Essentials Devices Common/Essentials Devices Common/VC/VideoCodecBase.cs b/Essentials Devices Common/Essentials Devices Common/VC/VideoCodecBase.cs index 68de18e1..9ed7f3ef 100644 --- a/Essentials Devices Common/Essentials Devices Common/VC/VideoCodecBase.cs +++ b/Essentials Devices Common/Essentials Devices Common/VC/VideoCodecBase.cs @@ -33,6 +33,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec abstract protected Func PrivacyModeFeedbackFunc { get; } abstract protected Func VolumeLevelFeedbackFunc { get; } + abstract protected Func MuteFeedbackFunc { get; } public VideoCodecBase(string key, string name) : base(key, name) @@ -44,6 +45,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec PrivacyModeIsOnFeedback = new BoolFeedback(PrivacyModeFeedbackFunc); VolumeLevelFeedback = new IntFeedback(VolumeLevelFeedbackFunc); + MuteFeedback = new BoolFeedback(MuteFeedbackFunc); InputPorts = new RoutingPortCollection(); @@ -123,20 +125,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec public BoolFeedback MuteFeedback { get; private set; } - public void MuteOff() - { - - } + public abstract void MuteOff(); - public void MuteOn() - { - - } + public abstract void MuteOn(); - public void SetVolume(ushort level) - { - - } + public abstract void SetVolume(ushort level); public IntFeedback VolumeLevelFeedback { get; private set; } @@ -144,17 +137,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec #region IBasicVolumeControls Members - public void MuteToggle() + public abstract void MuteToggle(); + + public virtual void VolumeDown(bool pressRelease) { } - public void VolumeDown(bool pressRelease) - { - - } - - public void VolumeUp(bool pressRelease) + public virtual void VolumeUp(bool pressRelease) { } diff --git a/Essentials/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs b/Essentials/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs index e2b3f5d0..6ccb0f33 100644 --- a/Essentials/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs +++ b/Essentials/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs @@ -63,7 +63,7 @@ namespace PepperDash.Essentials.Room.Config var codec = DeviceManager.GetDeviceForKey(props.VideoCodecKey) as PepperDash.Essentials.Devices.Common.VideoCodec.VideoCodecBase; - var rm = new EssentialsHuddleVtc1Room(Key, Name, disp, disp, codec, props); + var rm = new EssentialsHuddleVtc1Room(Key, Name, disp, codec, codec, props); rm.LogoUrl = props.Logo.GetUrl(); rm.SourceListKey = props.SourceListKey; rm.DefaultSourceItem = props.DefaultSourceItem; diff --git a/Essentials/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs b/Essentials/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs index d875d674..0846adec 100644 --- a/Essentials/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs +++ b/Essentials/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs @@ -235,126 +235,105 @@ namespace PepperDash.Essentials public void RunRouteAction(string routeKey, Action successCallback) { // Run this on a separate thread - new CTimer(o => - { - Debug.Console(1, this, "Run route action '{0}'", routeKey); - var dict = ConfigReader.ConfigObject.GetSourceListForKey(SourceListKey); - if(dict == null) - { - Debug.Console(1, this, "WARNING: Config source list '{0}' not found", SourceListKey); - return; - } - - // Try to get the list item by it's string key - if (!dict.ContainsKey(routeKey)) - { - Debug.Console(1, this, "WARNING: No item '{0}' found on config list '{1}'", - routeKey, SourceListKey); - return; - } - - var item = dict[routeKey]; - - // End usage timer on last source - if (!string.IsNullOrEmpty(LastSourceKey)) + //new CTimer(o => + // { + try { - var lastSource = dict[LastSourceKey].SourceDevice; - try + Debug.Console(1, this, "Run route action '{0}'", routeKey); + var dict = ConfigReader.ConfigObject.GetSourceListForKey(SourceListKey); + if (dict == null) { - if (lastSource != null && lastSource is IUsageTracking) - (lastSource as IUsageTracking).UsageTracker.EndDeviceUsage(); + Debug.Console(1, this, "WARNING: Config source list '{0}' not found", SourceListKey); + return; } - catch (Exception e) + + // Try to get the list item by it's string key + if (!dict.ContainsKey(routeKey)) { - Debug.Console(1, this, "*#* EXCEPTION in end usage tracking (257):\r{0}", e); + Debug.Console(1, this, "WARNING: No item '{0}' found on config list '{1}'", + routeKey, SourceListKey); + return; } - } - // Let's run it - if (routeKey.ToLower() != "roomoff") + // End usage timer on last source + if (!string.IsNullOrEmpty(LastSourceKey)) + { + var lastSource = dict[LastSourceKey].SourceDevice; + + try + { + if (lastSource != null && lastSource is IUsageTracking) + (lastSource as IUsageTracking).UsageTracker.EndDeviceUsage(); + } + catch (Exception e) + { + Debug.Console(1, this, "*#* EXCEPTION in end usage tracking:\r{0}", e); + } + } + + // Let's run it + var item = dict[routeKey]; + if (routeKey.ToLower() != "roomoff") + LastSourceKey = routeKey; + else + CurrentSourceInfoKey = null; + + // hand off the individual routes to this helper + foreach (var route in item.RouteList) + DoRouteItem(route); + + // Start usage timer on routed source + if (item.SourceDevice is IUsageTracking) + (item.SourceDevice as IUsageTracking).UsageTracker.StartDeviceUsage(); + + // store the name and UI info for routes + if (item.SourceKey == "$off") + { + CurrentSourceInfoKey = routeKey; + CurrentSourceInfo = null; + } + else if (item.SourceKey != null) + { + CurrentSourceInfoKey = routeKey; + CurrentSourceInfo = item; + } + + OnFeedback.FireUpdate(); + + // report back when done + if (successCallback != null) + successCallback(); + } + catch (Exception e) { - LastSourceKey = routeKey; - } - else - { - CurrentSourceInfoKey = null; + Debug.Console(1, this, "ERROR in routing: {0}", e); } - foreach (var route in item.RouteList) - { - // if there is a $defaultAll on route, run two separate - if (route.DestinationKey.Equals("$defaultAll", StringComparison.OrdinalIgnoreCase)) - { - // Going to assume a single-path route for now - var tempVideo = new SourceRouteListItem - { - DestinationKey = "$defaultDisplay", - SourceKey = route.SourceKey, - Type = eRoutingSignalType.Video - }; - DoRoute(tempVideo); - } - else - DoRoute(route); - } - - // Start usage timer on routed source - if (item.SourceDevice is IUsageTracking) - { - (item.SourceDevice as IUsageTracking).UsageTracker.StartDeviceUsage(); - } - - - // Set volume control on room, using default if non provided - IBasicVolumeControls volDev = null; - // Handle special cases for volume control - if (string.IsNullOrEmpty(item.VolumeControlKey) - || item.VolumeControlKey.Equals("$defaultAudio", StringComparison.OrdinalIgnoreCase)) - volDev = DefaultVolumeControls; - else if (item.VolumeControlKey.Equals("$defaultDisplay", StringComparison.OrdinalIgnoreCase)) - volDev = DefaultDisplay as IBasicVolumeControls; - // Or a specific device, probably rarely used. - else - { - var dev = DeviceManager.GetDeviceForKey(item.VolumeControlKey); - if (dev is IBasicVolumeControls) - volDev = dev as IBasicVolumeControls; - else if (dev is IHasVolumeDevice) - volDev = (dev as IHasVolumeDevice).VolumeDevice; - } - CurrentVolumeControls = volDev; - - // store the name and UI info for routes - if (item.SourceKey == "$off") - { - CurrentSourceInfoKey = routeKey; - CurrentSourceInfo = null; - } - else if (item.SourceKey != null) - { - CurrentSourceInfoKey = routeKey; - CurrentSourceInfo = item; - } - - OnFeedback.FireUpdate(); - - // report back when done - if (successCallback != null) - successCallback(); - - }, 0); // end of CTimer + //}, 0); // end of CTimer } - /// - /// Will power the room on with the last-used source - /// - public void PowerOnToDefaultOrLastSource() - { - if (!EnablePowerOnToLastSource || LastSourceKey == null) - return; - RunRouteAction(LastSourceKey); - } + /// + /// + /// + /// + void DoRouteItem(SourceRouteListItem route) + { + // if there is a $defaultAll on route, run two separate + if (route.DestinationKey.Equals("$defaultAll", StringComparison.OrdinalIgnoreCase)) + { + // Going to assume a single-path route for now + var tempVideo = new SourceRouteListItem + { + DestinationKey = "$defaultDisplay", + SourceKey = route.SourceKey, + Type = eRoutingSignalType.Video + }; + DoRoute(tempVideo); + } + else + DoRoute(route); + } /// /// @@ -397,6 +376,16 @@ namespace PepperDash.Essentials return true; } + /// + /// Will power the room on with the last-used source + /// + public void PowerOnToDefaultOrLastSource() + { + if (!EnablePowerOnToLastSource || LastSourceKey == null) + return; + RunRouteAction(LastSourceKey); + } + /// /// Runs "roomOff" action on all rooms not set to ExcludeFromGlobalFunctions /// diff --git a/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs b/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs index b3525e22..163432ad 100644 --- a/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs +++ b/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs @@ -1,247 +1,246 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Crestron.SimplSharp; -using Crestron.SimplSharpPro.DeviceSupport; - -using PepperDash.Core; -using PepperDash.Essentials; -using PepperDash.Essentials.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; +using Crestron.SimplSharpPro.DeviceSupport; + +using PepperDash.Core; +using PepperDash.Essentials; +using PepperDash.Essentials.Core; using PepperDash.Essentials.Core.SmartObjects; -using PepperDash.Essentials.Devices.Common.VideoCodec; - -namespace PepperDash.Essentials.UIDrivers.VC -{ - - /// - /// This fella will likely need to interact with the room's source, although that is routed via the spark... - /// Probably needs event or FB to feed AV driver - to show two-mute volume when appropriate. - /// - /// - public class EssentialsVideoCodecUiDriver : PanelDriverBase - { - /// - /// - /// - VideoCodecBase Codec; - - /// - /// - /// - SmartObjectDynamicList DirectorySrl; // ***************** SRL ??? - - - /// - /// To drive UI elements outside of this driver that may be dependent on this. - /// - BoolFeedback InCall; - BoolFeedback LocalPrivacyIsMuted; - - /// - /// For the subpages above the bar - /// - JoinedSigInterlock VCControlsInterlock; - - /// - /// For the different staging bars: Active, inactive - /// - JoinedSigInterlock StagingBarInterlock; - - /// - /// For the staging button feedbacks - /// - JoinedSigInterlock StagingButtonFeedbackInterlock; - - SmartObjectNumeric DialKeypad; - - // These are likely temp until we get a keyboard built - StringFeedback DialStringFeedback; - StringBuilder DialStringBuilder = new StringBuilder(); - BoolFeedback DialStringBackspaceVisibleFeedback; - - /// - /// - /// - /// - /// - public EssentialsVideoCodecUiDriver(BasicTriListWithSmartObject triList, VideoCodecBase codec) - : base(triList) - { - Codec = codec; - SetupCallStagingPopover(); - SetupDialKeypad(); - - InCall = new BoolFeedback(() => false); - LocalPrivacyIsMuted = new BoolFeedback(() => false); - - //DirectorySrl = new SubpageReferenceList(triList, UISmartObjectJoin.VCDirectoryList, 3, 3, 3); - - VCControlsInterlock = new JoinedSigInterlock(triList); - VCControlsInterlock.SetButDontShow(UIBoolJoin.VCDirectoryVisible); - - StagingBarInterlock = new JoinedSigInterlock(triList); - StagingBarInterlock.SetButDontShow(UIBoolJoin.VCStagingInactivePopoverVisible); - - StagingButtonFeedbackInterlock = new JoinedSigInterlock(triList); - StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCRecentsVisible); - - DialStringFeedback = new StringFeedback(() => DialStringBuilder.ToString()); - DialStringFeedback.LinkInputSig(triList.StringInput[UIStringJoin.KeyboardText]); - - DialStringBackspaceVisibleFeedback = new BoolFeedback(() => DialStringBuilder.Length > 0); - DialStringBackspaceVisibleFeedback - .LinkInputSig(TriList.BooleanInput[UIBoolJoin.KeyboardClearVisible]); - - Codec.InCallFeedback.OutputChange += new EventHandler(InCallFeedback_OutputChange); - } - - /// - /// - /// - public override void Show() - { - VCControlsInterlock.Show(); - StagingBarInterlock.Show(); - base.Show(); - } - - /// - /// - /// - public override void Hide() - { - VCControlsInterlock.Hide(); - StagingBarInterlock.Hide(); - base.Hide(); - } - - /// - /// Builds the call stage - /// - void SetupCallStagingPopover() - { - TriList.SetSigFalseAction(UIBoolJoin.VCStagingDirectoryPress, ShowDirectory); - TriList.SetSigFalseAction(UIBoolJoin.VCStagingConnectPress, ConnectPress); - TriList.SetSigFalseAction(UIBoolJoin.VCStagingKeypadPress, ShowKeypad); - TriList.SetSigFalseAction(UIBoolJoin.VCStagingRecentsPress, ShowRecents); - } - - /// - /// - /// - void SetupDialKeypad() - { - if(TriList.SmartObjects.Contains(UISmartObjectJoin.VCDialKeypad)) - { - DialKeypad = new SmartObjectNumeric(TriList.SmartObjects[UISmartObjectJoin.VCDialKeypad], true); - DialKeypad.Digit0.SetSigFalseAction(() => DialKeypadPress("0")); - DialKeypad.Digit1.SetSigFalseAction(() => DialKeypadPress("1")); - DialKeypad.Digit2.SetSigFalseAction(() => DialKeypadPress("2")); - DialKeypad.Digit3.SetSigFalseAction(() => DialKeypadPress("3")); - DialKeypad.Digit4.SetSigFalseAction(() => DialKeypadPress("4")); - DialKeypad.Digit5.SetSigFalseAction(() => DialKeypadPress("5")); - DialKeypad.Digit6.SetSigFalseAction(() => DialKeypadPress("6")); - DialKeypad.Digit7.SetSigFalseAction(() => DialKeypadPress("7")); - DialKeypad.Digit8.SetSigFalseAction(() => DialKeypadPress("8")); - DialKeypad.Digit9.SetSigFalseAction(() => DialKeypadPress("9")); - DialKeypad.Misc1SigName = "*"; - DialKeypad.Misc1.SetSigFalseAction(() => DialKeypadPress("*")); - DialKeypad.Misc2SigName = "#"; - DialKeypad.Misc2.SetSigFalseAction(() => DialKeypadPress("#")); - TriList.SetSigFalseAction(UIBoolJoin.KeyboardClearPress, DialKeypadBackspacePress); - } - else - Debug.Console(0, "Trilist {0:x2}, VC dial keypad object {1} not found. Check SGD file or VTP", - TriList.ID, UISmartObjectJoin.VCDialKeypad); - } - - /// - /// - /// - void ShowCameraControls() - { - VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCCameraVisible); - StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingCameraPress); - } - - void ShowKeypad() - { - VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCKeypadVisible); - StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingKeypadPress); - } - - void ShowDirectory() - { - // populate directory - VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCDirectoryVisible); - StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingDirectoryPress); - } - - void ShowRecents() - { - //populate recents - VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCDirectoryVisible); - StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingRecentsPress); - } - - /// - /// - /// - void ConnectPress() - { - if (Codec.InCallFeedback.BoolValue) - Codec.EndCall(); - else - Codec.Dial(DialStringBuilder.ToString()); - } - - /// - /// - /// - - void InCallFeedback_OutputChange(object sender, EventArgs e) - { - var inCall = Codec.InCallFeedback.BoolValue; - Debug.Console(1, "*#* Codec Driver InCallFeedback change={0}", InCall); - TriList.UShortInput[UIUshortJoin.VCStagingConnectButtonMode].UShortValue = (ushort)(inCall ? 1 : 0); - StagingBarInterlock.ShowInterlocked( - inCall ? UIBoolJoin.VCStagingActivePopoverVisible : UIBoolJoin.VCStagingInactivePopoverVisible); - - if (Codec.InCallFeedback.BoolValue) // Call is starting - { - // Header icon - // Volume bar needs to have mic mute - } - else // ending - { - // Header icon - // Volume bar no mic mute (or hidden if no source?) - } - } - - /// - /// - /// - /// - void DialKeypadPress(string i) - { - DialStringBuilder.Append(i); - DialStringFeedback.FireUpdate(); - TriList.BooleanInput[UIBoolJoin.KeyboardClearVisible].BoolValue = - DialStringBuilder.Length > 0; - } - - /// - /// - /// - void DialKeypadBackspacePress() - { - DialStringBuilder.Remove(DialStringBuilder.Length - 1, 1); - DialStringFeedback.FireUpdate(); - TriList.BooleanInput[UIBoolJoin.KeyboardClearVisible].BoolValue = - DialStringBuilder.Length > 0; - TriList.SetBool(UIBoolJoin.VCStagingConnectEnable, DialStringBuilder.Length > 0); - } - } +using PepperDash.Essentials.Devices.Common.VideoCodec; + +namespace PepperDash.Essentials.UIDrivers.VC +{ + + /// + /// This fella will likely need to interact with the room's source, although that is routed via the spark... + /// Probably needs event or FB to feed AV driver - to show two-mute volume when appropriate. + /// + /// + public class EssentialsVideoCodecUiDriver : PanelDriverBase + { + /// + /// + /// + VideoCodecBase Codec; + + /// + /// + /// + SmartObjectDynamicList DirectorySrl; // ***************** SRL ??? + + + /// + /// To drive UI elements outside of this driver that may be dependent on this. + /// + BoolFeedback InCall; + BoolFeedback LocalPrivacyIsMuted; + + /// + /// For the subpages above the bar + /// + JoinedSigInterlock VCControlsInterlock; + + /// + /// For the different staging bars: Active, inactive + /// + JoinedSigInterlock StagingBarInterlock; + + /// + /// For the staging button feedbacks + /// + JoinedSigInterlock StagingButtonFeedbackInterlock; + + SmartObjectNumeric DialKeypad; + + // These are likely temp until we get a keyboard built + StringFeedback DialStringFeedback; + StringBuilder DialStringBuilder = new StringBuilder(); + BoolFeedback DialStringBackspaceVisibleFeedback; + + /// + /// + /// + /// + /// + public EssentialsVideoCodecUiDriver(BasicTriListWithSmartObject triList, VideoCodecBase codec) + : base(triList) + { + Codec = codec; + SetupCallStagingPopover(); + SetupDialKeypad(); + + InCall = new BoolFeedback(() => false); + LocalPrivacyIsMuted = new BoolFeedback(() => false); + + //DirectorySrl = new SubpageReferenceList(triList, UISmartObjectJoin.VCDirectoryList, 3, 3, 3); + + VCControlsInterlock = new JoinedSigInterlock(triList); + VCControlsInterlock.SetButDontShow(UIBoolJoin.VCDirectoryVisible); + + StagingBarInterlock = new JoinedSigInterlock(triList); + StagingBarInterlock.SetButDontShow(UIBoolJoin.VCStagingInactivePopoverVisible); + + StagingButtonFeedbackInterlock = new JoinedSigInterlock(triList); + StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCRecentsVisible); + + DialStringFeedback = new StringFeedback(() => DialStringBuilder.ToString()); + DialStringFeedback.LinkInputSig(triList.StringInput[UIStringJoin.KeyboardText]); + + DialStringBackspaceVisibleFeedback = new BoolFeedback(() => DialStringBuilder.Length > 0); + DialStringBackspaceVisibleFeedback + .LinkInputSig(TriList.BooleanInput[UIBoolJoin.KeyboardClearVisible]); + + Codec.InCallFeedback.OutputChange += new EventHandler(InCallFeedback_OutputChange); + } + + /// + /// + /// + public override void Show() + { + VCControlsInterlock.Show(); + StagingBarInterlock.Show(); + base.Show(); + } + + /// + /// + /// + public override void Hide() + { + VCControlsInterlock.Hide(); + StagingBarInterlock.Hide(); + base.Hide(); + } + + /// + /// Builds the call stage + /// + void SetupCallStagingPopover() + { + TriList.SetSigFalseAction(UIBoolJoin.VCStagingDirectoryPress, ShowDirectory); + TriList.SetSigFalseAction(UIBoolJoin.VCStagingConnectPress, ConnectPress); + TriList.SetSigFalseAction(UIBoolJoin.VCStagingKeypadPress, ShowKeypad); + TriList.SetSigFalseAction(UIBoolJoin.VCStagingRecentsPress, ShowRecents); + } + + /// + /// + /// + void SetupDialKeypad() + { + if(TriList.SmartObjects.Contains(UISmartObjectJoin.VCDialKeypad)) + { + DialKeypad = new SmartObjectNumeric(TriList.SmartObjects[UISmartObjectJoin.VCDialKeypad], true); + DialKeypad.Digit0.SetSigFalseAction(() => DialKeypadPress("0")); + DialKeypad.Digit1.SetSigFalseAction(() => DialKeypadPress("1")); + DialKeypad.Digit2.SetSigFalseAction(() => DialKeypadPress("2")); + DialKeypad.Digit3.SetSigFalseAction(() => DialKeypadPress("3")); + DialKeypad.Digit4.SetSigFalseAction(() => DialKeypadPress("4")); + DialKeypad.Digit5.SetSigFalseAction(() => DialKeypadPress("5")); + DialKeypad.Digit6.SetSigFalseAction(() => DialKeypadPress("6")); + DialKeypad.Digit7.SetSigFalseAction(() => DialKeypadPress("7")); + DialKeypad.Digit8.SetSigFalseAction(() => DialKeypadPress("8")); + DialKeypad.Digit9.SetSigFalseAction(() => DialKeypadPress("9")); + DialKeypad.Misc1SigName = "*"; + DialKeypad.Misc1.SetSigFalseAction(() => DialKeypadPress("*")); + DialKeypad.Misc2SigName = "#"; + DialKeypad.Misc2.SetSigFalseAction(() => DialKeypadPress("#")); + TriList.SetSigFalseAction(UIBoolJoin.KeyboardClearPress, DialKeypadBackspacePress); + } + else + Debug.Console(0, "Trilist {0:x2}, VC dial keypad object {1} not found. Check SGD file or VTP", + TriList.ID, UISmartObjectJoin.VCDialKeypad); + } + + /// + /// + /// + void ShowCameraControls() + { + VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCCameraVisible); + StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingCameraPress); + } + + void ShowKeypad() + { + VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCKeypadVisible); + StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingKeypadPress); + } + + void ShowDirectory() + { + // populate directory + VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCDirectoryVisible); + StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingDirectoryPress); + } + + void ShowRecents() + { + //populate recents + VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCDirectoryVisible); + StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingRecentsPress); + } + + /// + /// + /// + void ConnectPress() + { + if (Codec.InCallFeedback.BoolValue) + Codec.EndCall(); + else + Codec.Dial(DialStringBuilder.ToString()); + } + + /// + /// + /// + void InCallFeedback_OutputChange(object sender, EventArgs e) + { + var inCall = Codec.InCallFeedback.BoolValue; + Debug.Console(1, "*#* Codec Driver InCallFeedback change={0}", InCall); + TriList.UShortInput[UIUshortJoin.VCStagingConnectButtonMode].UShortValue = (ushort)(inCall ? 1 : 0); + StagingBarInterlock.ShowInterlocked( + inCall ? UIBoolJoin.VCStagingActivePopoverVisible : UIBoolJoin.VCStagingInactivePopoverVisible); + + if (Codec.InCallFeedback.BoolValue) // Call is starting + { + // Header icon + // Volume bar needs to have mic mute + } + else // ending + { + // Header icon + // Volume bar no mic mute (or hidden if no source?) + } + } + + /// + /// + /// + /// + void DialKeypadPress(string i) + { + DialStringBuilder.Append(i); + DialStringFeedback.FireUpdate(); + TriList.BooleanInput[UIBoolJoin.KeyboardClearVisible].BoolValue = + DialStringBuilder.Length > 0; + } + + /// + /// + /// + void DialKeypadBackspacePress() + { + DialStringBuilder.Remove(DialStringBuilder.Length - 1, 1); + DialStringFeedback.FireUpdate(); + TriList.BooleanInput[UIBoolJoin.KeyboardClearVisible].BoolValue = + DialStringBuilder.Length > 0; + TriList.SetBool(UIBoolJoin.VCStagingConnectEnable, DialStringBuilder.Length > 0); + } + } } \ No newline at end of file diff --git a/Release Package/PepperDashEssentials.cpz b/Release Package/PepperDashEssentials.cpz index eacb8b17..5c8f5172 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 d345ae49..25c39df5 100644 Binary files a/Release Package/PepperDashEssentials.dll and b/Release Package/PepperDashEssentials.dll differ