ecs-444, 458, 474, 475, 477

This commit is contained in:
Heath Volmer
2017-09-27 12:26:36 -06:00
parent 1abf56474e
commit a5eb61ef0e
15 changed files with 323 additions and 130 deletions

View File

@@ -108,8 +108,9 @@ namespace PepperDash.Essentials.Core
// find a direct tie
var directTie = destDevInputTies.FirstOrDefault(
t => !(t.SourcePort.ParentDevice is IRoutingInputsOutputs)
&& t.DestinationPort.ParentDevice == destination
t =>// !(t.SourcePort.ParentDevice is IRoutingInputsOutputs) // why????
//&&
t.DestinationPort.ParentDevice == destination
&& t.SourcePort.ParentDevice == source);
RoutingInputPort goodInputPort = null;
if (directTie != null) // Found a tie directly to the source

View File

@@ -1,49 +1,159 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Core.Routing
{
/// <summary>
/// These should correspond directly with the portNames var in the config tool.
/// </summary>
public class RoutingPortNames
{
public const string AntennaIn = "antennaIn";
public const string AnyAudioIn = "anyAudioIn";
public const string AnyAudioOut = "anyAudioOut";
public const string AnyOut = "anyOut";
public const string AnyVideoIn = "anyVideoIn";
public const string AnyVideoOut = "anyVideoOut";
public const string BalancedAudioOut = "balancedAudioOut";
public const string ComponentIn = "componentIn";
public const string ComponentOut = "componentOut";
public const string CompositeIn = "compositeIn";
public const string CompositeOut = "compositeOut";
public const string DisplayPortIn = "displayPortIn";
public const string DisplayPortIn1 = "displayPortIn1";
public const string DisplayPortIn2 = "displayPortIn2";
public const string DisplayPortIn3 = "displayPortIn3";
public const string DisplayPortOut = "displayPortOut";
public const string DmIn = "dmIn";
public const string DmOut = "dmOut";
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Core.Routing
{
/// <summary>
/// These should correspond directly with the portNames var in the config tool.
/// </summary>
public class RoutingPortNames
{
/// <summary>
/// antennaIn
/// </summary>
public const string AntennaIn = "antennaIn";
/// <summary>
/// anyAudioIn
/// </summary>
public const string AnyAudioIn = "anyAudioIn";
/// <summary>
/// anyAudioOut
/// </summary>
public const string AnyAudioOut = "anyAudioOut";
/// <summary>
/// anyOut
/// </summary>
public const string AnyOut = "anyOut";
/// <summary>
/// anyVideoIn
/// </summary>
public const string AnyVideoIn = "anyVideoIn";
/// <summary>
/// anyVideoOut
/// </summary>
public const string AnyVideoOut = "anyVideoOut";
/// <summary>
/// balancedAudioOut
/// </summary>
public const string BalancedAudioOut = "balancedAudioOut";
/// <summary>
/// codecOsd
/// </summary>
public const string CodecOsd = "codecOsd";
/// <summary>
/// componentIn
/// </summary>
public const string ComponentIn = "componentIn";
/// <summary>
/// componentOut
/// </summary>
public const string ComponentOut = "componentOut";
/// <summary>
/// compositeIn
/// </summary>
public const string CompositeIn = "compositeIn";
/// <summary>
/// compositeOut
/// </summary>
public const string CompositeOut = "compositeOut";
/// <summary>
/// displayPortIn
/// </summary>
public const string DisplayPortIn = "displayPortIn";
/// <summary>
/// displayPortIn1
/// </summary>
public const string DisplayPortIn1 = "displayPortIn1";
/// <summary>
/// displayPortIn2
/// </summary>
public const string DisplayPortIn2 = "displayPortIn2";
/// <summary>
/// displayPortIn3
/// </summary>
public const string DisplayPortIn3 = "displayPortIn3";
/// <summary>
/// displayPortOut
/// </summary>
public const string DisplayPortOut = "displayPortOut";
/// <summary>
/// dmIn
/// </summary>
public const string DmIn = "dmIn";
/// <summary>
/// dmOut
/// </summary>
public const string DmOut = "dmOut";
/// <summary>
/// dviIn
/// </summary>
public const string DviIn = "dviIn";
/// <summary>
/// dviIn1
/// </summary>
public const string DviIn1 = "dviIn1";
public const string DviOut = "dviOut";
public const string HdmiIn = "hdmiIn";
public const string HdmiIn1 = "hdmiIn1";
public const string HdmiIn2 = "hdmiIn2";
public const string HdmiIn3 = "hdmiIn3";
public const string HdmiIn4 = "hdmiIn4";
public const string HdmiIn5 = "hdmiIn5";
public const string HdmiIn6 = "hdmiIn6";
public const string HdmiOut = "hdmiOut";
/// <summary>
/// dviOut
/// </summary>
public const string DviOut = "dviOut";
/// <summary>
/// hdmiIn
/// </summary>
public const string HdmiIn = "hdmiIn";
/// <summary>
/// hdmiIn1
/// </summary>
public const string HdmiIn1 = "hdmiIn1";
/// <summary>
/// hdmiIn2
/// </summary>
public const string HdmiIn2 = "hdmiIn2";
/// <summary>
/// hdmiIn3
/// </summary>
public const string HdmiIn3 = "hdmiIn3";
/// <summary>
/// hdmiIn4
/// </summary>
public const string HdmiIn4 = "hdmiIn4";
/// <summary>
/// hdmiIn5
/// </summary>
public const string HdmiIn5 = "hdmiIn5";
/// <summary>
/// hdmiIn6
/// </summary>
public const string HdmiIn6 = "hdmiIn6";
/// <summary>
/// hdmiOut
/// </summary>
public const string HdmiOut = "hdmiOut";
/// <summary>
/// none
/// </summary>
public const string None = "none";
/// <summary>
/// rgbIn
/// </summary>
public const string RgbIn = "rgbIn";
/// <summary>
/// rgbIn1
/// </summary>
public const string RgbIn1 = "rgbIn1";
public const string RgbIn2 = "rgbIn2";
public const string VgaIn = "vgaIn";
public const string VgaOut = "vgaOut";
}
/// <summary>
/// rgbIn2
/// </summary>
public const string RgbIn2 = "rgbIn2";
/// <summary>
/// vgaIn
/// </summary>
public const string VgaIn = "vgaIn";
/// <summary>
/// vgaOut
/// </summary>
public const string VgaOut = "vgaOut";
}
}

View File

@@ -11,18 +11,35 @@ using PepperDash.Essentials.Devices.Common.Codec;
namespace PepperDash.Essentials.Devices.Common.VideoCodec
{
public class MockVC : VideoCodecBase, IRoutingOutputs
public class MockVC : VideoCodecBase, IRoutingSource
{
public RoutingInputPort CodecOsdIn { get; private set; }
public RoutingInputPort HdmiIn1 { get; private set; }
public RoutingInputPort HdmiIn2 { get; private set; }
public RoutingOutputPort HdmiOut { get; private set; }
/// <summary>
///
/// </summary>
public MockVC(string key, string name)
: base(key, name)
{
// Debug helpers
//ActiveCallCountFeedback.OutputChange += (o, a) => Debug.Console(1, this, "InCall={0}", ActiveCallCountFeedback.IntValue);
IncomingCallFeedback.OutputChange += (o, a) => Debug.Console(1, this, "IncomingCall={0}", _IncomingCall);
MuteFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Mute={0}", _IsMuted);
PrivacyModeIsOnFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Privacy={0}", _PrivacyModeIsOn);
SharingSourceFeedback.OutputChange += (o, a) => Debug.Console(1, this, "SharingSource={0}", _SharingSource);
VolumeLevelFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Volume={0}", _VolumeLevel);
CodecOsdIn = new RoutingInputPort(RoutingPortNames.CodecOsd, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, 0, this);
HdmiIn1 = new RoutingInputPort(RoutingPortNames.HdmiIn1, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, 1, this);
HdmiIn2 = new RoutingInputPort(RoutingPortNames.HdmiIn2, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, 2, this);
HdmiOut = new RoutingOutputPort(RoutingPortNames.HdmiOut, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, null, this);
InputPorts.Add(CodecOsdIn);
InputPorts.Add(HdmiIn1);
InputPorts.Add(HdmiIn2);
OutputPorts.Add(HdmiOut);
}
protected override Func<bool> IncomingCallFeedbackFunc
@@ -151,7 +168,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
/// <param name="selector"></param>
public override void ExecuteSwitch(object selector)
{
Debug.Console(1, this, "ExecuteSwitch");
Debug.Console(1, this, "ExecuteSwitch: {0}", selector);
_SharingSource = selector.ToString();
}
@@ -281,14 +298,5 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
Debug.Console(1, this, "TestFarEndHangup");
}
#region IRoutingOutputs Members
public RoutingPortCollection<RoutingOutputPort> OutputPorts
{
get { return new RoutingPortCollection<RoutingOutputPort>(); }
}
#endregion
}
}

View File

@@ -11,7 +11,7 @@ using PepperDash.Essentials.Devices.Common.Codec;
namespace PepperDash.Essentials.Devices.Common.VideoCodec
{
public abstract class VideoCodecBase : Device, IRoutingSinkWithSwitching, IUsageTracking, IHasDialer, IHasSharing, ICodecAudio
public abstract class VideoCodecBase : Device, IRoutingInputsOutputs, IUsageTracking, IHasDialer, IHasSharing, ICodecAudio
{
/// <summary>
/// Fires when the status of any active, dialing, or incoming call changes or is new
@@ -28,11 +28,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
#endregion
#region IRoutingInputs Members
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
#endregion
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
/// <summary>
/// Returns true when any call is not in state Unknown, Disconnecting, Disconnected
@@ -41,9 +39,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
public BoolFeedback IncomingCallFeedback { get; private set; }
//public IntFeedback ActiveCallCountFeedback { get; private set; }
//abstract protected Func<int> ActiveCallCountFeedbackFunc { get; }
abstract protected Func<bool> IncomingCallFeedbackFunc { get; }
abstract protected Func<bool> PrivacyModeIsOnFeedbackFunc { get; }
abstract protected Func<int> VolumeLevelFeedbackFunc { get; }
@@ -62,6 +57,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
SharingSourceFeedback = new StringFeedback(SharingSourceFeedbackFunc);
InputPorts = new RoutingPortCollection<RoutingInputPort>();
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
ActiveCalls = new List<CodecActiveCallItem>();
}

View File

@@ -365,6 +365,14 @@ namespace PepperDash.Essentials
RunRouteAction(LastSourceKey);
}
/// <summary>
/// Does what it says
/// </summary>
public override void SetDefaultLevels()
{
Debug.Console(0, this, "SetDefaultLevels not implemented");
}
/// <summary>
///
/// </summary>

View File

@@ -99,7 +99,7 @@ namespace PepperDash.Essentials
public EssentialsHuddleVtc1PropertiesConfig Config { get; private set; }
public IRoutingSinkWithSwitching DefaultDisplay { get; private set; }
public IRoutingSinkNoSwitching DefaultAudioDevice { get; private set; }
public IBasicVolumeControls DefaultAudioDevice { get; private set; }
public IBasicVolumeControls DefaultVolumeControls { get; private set; }
public VideoCodecBase VideoCodec { get; private set; }
@@ -110,7 +110,7 @@ namespace PepperDash.Essentials
/// The config name of the source list
/// </summary>
public string SourceListKey { get; set; }
public string DefaultSourceItem { get; set; }
public ushort DefaultVolume { get; set; }
@@ -179,18 +179,25 @@ namespace PepperDash.Essentials
public string CurrentSourceInfoKey { get; private set; }
/// <summary>
/// "codecOsd"
/// </summary>
public string DefaultCodecRouteString { get { return "codecOsd"; } }
/// <summary>
///
/// </summary>
/// <param name="key"></param>
/// <param name="name"></param>
public EssentialsHuddleVtc1Room(string key, string name, IRoutingSinkWithSwitching defaultDisplay,
IRoutingSinkNoSwitching defaultAudio, VideoCodecBase vc, EssentialsHuddleVtc1PropertiesConfig config)
IBasicVolumeControls defaultAudio, VideoCodecBase codec, EssentialsHuddleVtc1PropertiesConfig config)
: base(key, name)
{
if (codec == null)
throw new ArgumentNullException("codec cannot be null");
Config = config;
DefaultDisplay = defaultDisplay;
VideoCodec = vc;
VideoCodec = codec;
DefaultAudioDevice = defaultAudio;
if (defaultAudio is IBasicVolumeControls)
@@ -227,11 +234,14 @@ namespace PepperDash.Essentials
};
}
InCallFeedback = new BoolFeedback(() => false); //###################################################
IsSharingFeedback = new BoolFeedback(() => false); //##########################################################
PrivacyModeIsOnFeedback = new BoolFeedback(() => false); //####################################################
CallTypeFeedback = new IntFeedback(() => 0); //######################################################
InCallFeedback = new BoolFeedback(() => VideoCodec.IsInCall);
IsSharingFeedback = new BoolFeedback(() => VideoCodec.SharingSourceFeedback.StringValue != null);
// 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;
@@ -244,18 +254,29 @@ namespace PepperDash.Essentials
public override void Shutdown()
{
RunRouteAction("roomOff");
VideoCodec.EndAllCalls();
}
/// <summary>
/// Routes the default source item, if any. Returns true when default route exists
/// </summary>
public bool RunDefaultRoute()
public bool RunDefaultPresentRoute()
{
if (DefaultSourceItem != null)
RunRouteAction(DefaultSourceItem);
return DefaultSourceItem != null;
}
/// <summary>
/// Sets up the room when started into call mode without presenting a source
/// </summary>
/// <returns></returns>
public bool RunDefaultCallRoute()
{
RunRouteAction(DefaultCodecRouteString);
return true;
}
/// <summary>
///
/// </summary>
@@ -355,6 +376,17 @@ namespace PepperDash.Essentials
}, 0); // end of CTimer
}
/// <summary>
/// Does what it says
/// </summary>
public override void SetDefaultLevels()
{
Debug.Console(1, this, "Restoring default levels");
var vc = CurrentVolumeControls as IBasicVolumeWithFeedback;
if (vc != null)
vc.SetVolume(DefaultVolume);
}
/// <summary>
///
@@ -388,7 +420,7 @@ namespace PepperDash.Essentials
IRoutingSinkNoSwitching dest = null;
if (route.DestinationKey.Equals("$defaultaudio", StringComparison.OrdinalIgnoreCase))
dest = DefaultAudioDevice;
dest = DefaultAudioDevice as IRoutingSinkNoSwitching;
else if (route.DestinationKey.Equals("$defaultDisplay", StringComparison.OrdinalIgnoreCase))
dest = DefaultDisplay;
else
@@ -445,17 +477,17 @@ namespace PepperDash.Essentials
public void PrivacyModeOff()
{
// Turn off privacy on all things (codec only for now)
VideoCodec.PrivacyModeOff();
}
public void PrivacyModeOn()
{
// Turn on ...
VideoCodec.PrivacyModeOn();
}
public void PrivacyModeToggle()
{
VideoCodec.PrivacyModeToggle();
}
#endregion

View File

@@ -379,6 +379,14 @@ namespace PepperDash.Essentials
RunRouteAction(LastSourceKey);
}
/// <summary>
/// Does what it says
/// </summary>
public override void SetDefaultLevels()
{
Debug.Console(0, this, "SetDefaultLevels not implemented");
}
/// <summary>
///
/// </summary>

View File

@@ -97,6 +97,11 @@ namespace PepperDash.Essentials
///
/// </summary>
public abstract void Shutdown();
/// <summary>
/// Override this to implement a default volume level(s) method
/// </summary>
public abstract void SetDefaultLevels();
}
/// <summary>

View File

@@ -37,9 +37,14 @@
public const uint VolumeSlider6Value = 3862;
/// <summary>
/// 3922
/// 3922: 0-4, center->left. 5-8, center -> right.
/// </summary>
public const uint PresentationListCaretMode = 3922;
public const uint PresentationStagingCaretMode = 3922;
/// <summary>
/// 3923: 0-4, center->left. 5-8, center -> right.
/// </summary>
public const uint CallStagingCaretMode = 3923;
/// <summary>
/// 15024 - Modes 0: On hook, 1: Phone, 2: Video

View File

@@ -318,7 +318,7 @@ namespace PepperDash.Essentials
ActivityFooterSrl.AddItem(new SubpageReferenceListActivityItem(1, ActivityFooterSrl, 0,
b => { if (!b) ShareButtonPressed(); }));
ActivityFooterSrl.Count = 1;
TriList.UShortInput[UIUshortJoin.PresentationListCaretMode].UShortValue = 0;
TriList.UShortInput[UIUshortJoin.PresentationStagingCaretMode].UShortValue = 0;
ShareButtonSig.BoolValue = false;
}
@@ -333,7 +333,7 @@ namespace PepperDash.Essentials
ActivityFooterSrl.AddItem(new SubpageReferenceListActivityItem(2, ActivityFooterSrl,
3, b => { if (!b) PowerButtonPressed(); }));
ActivityFooterSrl.Count = 2;
TriList.UShortInput[UIUshortJoin.PresentationListCaretMode].UShortValue = 1;
TriList.UShortInput[UIUshortJoin.PresentationStagingCaretMode].UShortValue = 1;
EndMeetingButtonSig = ActivityFooterSrl.BoolInputSig(2, 1);
ShareButtonSig.BoolValue = CurrentRoom.OnFeedback.BoolValue;
}

View File

@@ -485,7 +485,7 @@ namespace PepperDash.Essentials
ActivityFooterSrl.AddItem(new SubpageReferenceListActivityItem(2, ActivityFooterSrl, 1,
b => { }));
ActivityFooterSrl.Count = (ushort)(CurrentRoom.HasAudioDialer ? 2 : 1);
TriList.UShortInput[UIUshortJoin.PresentationListCaretMode].UShortValue =
TriList.UShortInput[UIUshortJoin.PresentationStagingCaretMode].UShortValue =
(ushort)(CurrentRoom.HasAudioDialer ? 1 : 0);
}
@@ -504,7 +504,7 @@ namespace PepperDash.Essentials
ActivityFooterSrl.AddItem(new SubpageReferenceListActivityItem(3, ActivityFooterSrl,
3, b => { if (!b) PowerButtonPressed(); }));
ActivityFooterSrl.Count = 3;
TriList.UShortInput[UIUshortJoin.PresentationListCaretMode].UShortValue = 2;
TriList.UShortInput[UIUshortJoin.PresentationStagingCaretMode].UShortValue = 2;
EndMeetingButtonSig = ActivityFooterSrl.BoolInputSig(3, 1);
}
else
@@ -512,7 +512,7 @@ namespace PepperDash.Essentials
ActivityFooterSrl.AddItem(new SubpageReferenceListActivityItem(2, ActivityFooterSrl,
3, b => { if (!b) PowerButtonPressed(); }));
ActivityFooterSrl.Count = 2;
TriList.UShortInput[UIUshortJoin.PresentationListCaretMode].UShortValue = 1;
TriList.UShortInput[UIUshortJoin.PresentationStagingCaretMode].UShortValue = 1;
EndMeetingButtonSig = ActivityFooterSrl.BoolInputSig(2, 1);
}
}

View File

@@ -55,7 +55,7 @@ namespace PepperDash.Essentials
EssentialsHuddleVtc1Room _CurrentRoom;
/// <summary>
/// For hitting feedback
/// For hitting feedbacks
/// </summary>
BoolInputSig CallButtonSig;
BoolInputSig ShareButtonSig;
@@ -129,6 +129,8 @@ namespace PepperDash.Essentials
public PepperDash.Essentials.Core.Touchpanels.Keyboards.HabaneroKeyboardController Keyboard { get; private set; }
UiDisplayMode CurrentMode = UiDisplayMode.Start;
/// <summary>
/// Constructor
/// </summary>
@@ -147,6 +149,7 @@ namespace PepperDash.Essentials
ActivityFooterSrl = new SubpageReferenceList(TriList, UISmartObjectJoin.ActivityFooterSRL, 3, 3, 3);
CallButtonSig = ActivityFooterSrl.BoolInputSig(1, 1);
ShareButtonSig = ActivityFooterSrl.BoolInputSig(2, 1);
EndMeetingButtonSig = ActivityFooterSrl.BoolInputSig(3, 1);
SetupActivityFooterWhenRoomOff();
@@ -203,19 +206,19 @@ namespace PepperDash.Essentials
TriList.SetBool(UIBoolJoin.TopBarHabaneroVisible, true);
TriList.SetBool(UIBoolJoin.ActivityFooterVisible, true);
// Privacy mute button
TriList.SetSigFalseAction(UIBoolJoin.Volume1SpeechMutePressAndFB, CurrentRoom.PrivacyModeToggle);
CurrentRoom.PrivacyModeIsOnFeedback.LinkInputSig(TriList.BooleanInput[UIBoolJoin.Volume1SpeechMutePressAndFB]);
// Default to showing rooms/sources now.
//ShowMode(UiDisplayMode.PresentationMode);
if (CurrentRoom.OnFeedback.BoolValue)
{
TriList.SetBool(UIBoolJoin.SourceStagingBarVisible, true);
TriList.SetBool(UIBoolJoin.TapToBeginVisible, false);
TriList.SetBool(UIBoolJoin.SelectASourceVisible, false);
}
else
{
TriList.SetBool(UIBoolJoin.StartPageVisible, true);
TriList.SetBool(UIBoolJoin.TapToBeginVisible, true);
TriList.SetBool(UIBoolJoin.SelectASourceVisible, false);
}
ShowCurrentDisplayModeSigsInUse();
@@ -280,8 +283,7 @@ namespace PepperDash.Essentials
PopupInterlock.HideAndClear());
// Default Volume button
TriList.SetSigFalseAction(UIBoolJoin.VolumeDefaultPress, () => // Set default volume method on room
{ });
TriList.SetSigFalseAction(UIBoolJoin.VolumeDefaultPress, () => CurrentRoom.SetDefaultLevels());
if (TriList is CrestronApp)
@@ -388,8 +390,8 @@ namespace PepperDash.Essentials
ActivityFooterSrl.AddItem(new SubpageReferenceListActivityItem(2, ActivityFooterSrl, 0,
b => { if (!b) ActivityShareButtonPressed(); }));
ActivityFooterSrl.Count = 2;
TriList.UShortInput[UIUshortJoin.PresentationListCaretMode].UShortValue = 0;
ShareButtonSig.BoolValue = false;
TriList.SetUshort(UIUshortJoin.PresentationStagingCaretMode, 5); // right one slot
TriList.SetUshort(UIUshortJoin.CallStagingCaretMode, 1); // left one slot
}
/// <summary>
@@ -405,11 +407,21 @@ namespace PepperDash.Essentials
ActivityFooterSrl.AddItem(new SubpageReferenceListActivityItem(3, ActivityFooterSrl,
3, b => { if (!b) PowerButtonPressed(); }));
ActivityFooterSrl.Count = 3;
TriList.UShortInput[UIUshortJoin.PresentationListCaretMode].UShortValue = 1;
EndMeetingButtonSig = ActivityFooterSrl.BoolInputSig(3, 1);
TriList.SetUshort(UIUshortJoin.PresentationStagingCaretMode, 0); // center
TriList.SetUshort(UIUshortJoin.CallStagingCaretMode, 2); // left -2
}
ShareButtonSig.BoolValue = CurrentRoom.OnFeedback.BoolValue;
}
/// <summary>
/// Single point call for setting the feedbacks on the activity buttons
/// </summary>
void SetActivityFooterFeedbacks()
{
CallButtonSig.BoolValue = CurrentMode == UiDisplayMode.Call
&& CurrentRoom.ShutdownType == ShutdownType.None;
ShareButtonSig.BoolValue = CurrentMode == UiDisplayMode.Presentation
&& CurrentRoom.ShutdownType == ShutdownType.None;
EndMeetingButtonSig.BoolValue = CurrentRoom.ShutdownType != ShutdownType.None;
}
/// <summary>
///
@@ -418,14 +430,18 @@ namespace PepperDash.Essentials
{
if (VCDriver.IsVisible)
return;
CallButtonSig.BoolValue = true;
ShareButtonSig.BoolValue = false;
HideLogo();
TriList.SetBool(UIBoolJoin.StartPageVisible, false);
TriList.SetBool(UIBoolJoin.SourceStagingBarVisible, false);
TriList.SetBool(UIBoolJoin.SelectASourceVisible, false);
if (CurrentSourcePageManager != null)
CurrentSourcePageManager.Hide();
if (!CurrentRoom.OnFeedback.BoolValue)
{
CurrentRoom.RunDefaultCallRoute();
}
CurrentMode = UiDisplayMode.Call;
SetActivityFooterFeedbacks();
VCDriver.Show();
}
@@ -436,22 +452,26 @@ namespace PepperDash.Essentials
{
if (VCDriver.IsVisible)
VCDriver.Hide();
ShareButtonSig.BoolValue = true;
CallButtonSig.BoolValue = false;
TriList.SetBool(UIBoolJoin.StartPageVisible, false);
TriList.SetBool(UIBoolJoin.CallStagingBarVisible, false);
TriList.SetBool(UIBoolJoin.SourceStagingBarVisible, true);
// Run default source when room is off and share is pressed
if (!CurrentRoom.OnFeedback.BoolValue)
{
// If there's no default, show UI elements
if(!CurrentRoom.RunDefaultRoute())
if(!CurrentRoom.RunDefaultPresentRoute())
TriList.SetBool(UIBoolJoin.SelectASourceVisible, true);
}
else // show what's active
else // room is on show what's active or select a source if nothing is yet active
{
if (CurrentSourcePageManager != null)
Debug.Console(0, "*#*#*#*# ActivitySharPressed: CurrentSourceInfoKey={0}", CurrentRoom.CurrentSourceInfoKey);
if(CurrentRoom.CurrentSourceInfo == null || CurrentRoom.CurrentSourceInfoKey == CurrentRoom.DefaultCodecRouteString)
TriList.SetBool(UIBoolJoin.SelectASourceVisible, true);
else if (CurrentSourcePageManager != null)
CurrentSourcePageManager.Show();
}
CurrentMode = UiDisplayMode.Presentation;
SetActivityFooterFeedbacks();
}
/// <summary>
@@ -536,8 +556,7 @@ namespace PepperDash.Essentials
{
// Do we need to check where the UI is? No?
var timer = CurrentRoom.ShutdownPromptTimer;
EndMeetingButtonSig.BoolValue = true;
ShareButtonSig.BoolValue = false;
SetActivityFooterFeedbacks();
if (CurrentRoom.ShutdownType == ShutdownType.Manual)
{
@@ -555,8 +574,8 @@ namespace PepperDash.Essentials
{
if (!onFb.BoolValue)
{
EndMeetingButtonSig.BoolValue = false;
PowerDownModal.HideDialog();
SetActivityFooterFeedbacks();
onFb.OutputChange -= offHandler;
}
};
@@ -580,11 +599,9 @@ namespace PepperDash.Essentials
/// <param name="e"></param>
void ShutdownPromptTimer_HasFinished(object sender, EventArgs e)
{
//Debug.Console(2, "*#*UI shutdown prompt finished");
EndMeetingButtonSig.BoolValue = false;
SetActivityFooterFeedbacks();
CurrentRoom.ShutdownPromptTimer.TimeRemainingFeedback.OutputChange -= ShutdownPromptTimer_TimeRemainingFeedback_OutputChange;
CurrentRoom.ShutdownPromptTimer.PercentFeedback.OutputChange -= ShutdownPromptTimer_PercentFeedback_OutputChange;
}
/// <summary>
@@ -594,16 +611,17 @@ namespace PepperDash.Essentials
/// <param name="e"></param>
void ShutdownPromptTimer_WasCancelled(object sender, EventArgs e)
{
//Debug.Console(2, "*#*UI shutdown prompt cancelled");
if (PowerDownModal != null)
PowerDownModal.HideDialog();
EndMeetingButtonSig.BoolValue = false;
ShareButtonSig.BoolValue = CurrentRoom.OnFeedback.BoolValue;
SetActivityFooterFeedbacks();
CurrentRoom.ShutdownPromptTimer.TimeRemainingFeedback.OutputChange += ShutdownPromptTimer_TimeRemainingFeedback_OutputChange;
CurrentRoom.ShutdownPromptTimer.PercentFeedback.OutputChange -= ShutdownPromptTimer_PercentFeedback_OutputChange;
}
/// <summary>
/// Event handler for countdown timer on power off modal
/// </summary>
void ShutdownPromptTimer_TimeRemainingFeedback_OutputChange(object sender, EventArgs e)
{
@@ -611,6 +629,9 @@ namespace PepperDash.Essentials
TriList.StringInput[ModalDialog.MessageTextJoin].StringValue = message;
}
/// <summary>
/// Event handler for percentage on power off countdown
/// </summary>
void ShutdownPromptTimer_PercentFeedback_OutputChange(object sender, EventArgs e)
{
var value = (ushort)((sender as IntFeedback).UShortValue * 65535 / 100);
@@ -669,7 +690,7 @@ namespace PepperDash.Essentials
_CurrentRoom.OnFeedback.OutputChange += CurrentRoom_OnFeedback_OutputChange;
_CurrentRoom.IsWarmingUpFeedback.OutputChange -= CurrentRoom_IsWarmingFeedback_OutputChange;
_CurrentRoom.IsCoolingDownFeedback.OutputChange -= IsCoolingDownFeedback_OutputChange;
_CurrentRoom.IsCoolingDownFeedback.OutputChange -= CurrentRoom_IsCoolingDownFeedback_OutputChange;
}
_CurrentRoom = room;
@@ -717,7 +738,7 @@ namespace PepperDash.Essentials
_CurrentRoom.OnFeedback.OutputChange += CurrentRoom_OnFeedback_OutputChange;
CurrentRoom_SyncOnFeedback();
_CurrentRoom.IsWarmingUpFeedback.OutputChange += CurrentRoom_IsWarmingFeedback_OutputChange;
_CurrentRoom.IsCoolingDownFeedback.OutputChange += IsCoolingDownFeedback_OutputChange;
_CurrentRoom.IsCoolingDownFeedback.OutputChange += CurrentRoom_IsCoolingDownFeedback_OutputChange;
_CurrentRoom.CurrentVolumeDeviceChange += CurrentRoom_CurrentAudioDeviceChange;
RefreshAudioDeviceConnections();
@@ -739,29 +760,33 @@ namespace PepperDash.Essentials
CurrentRoom_SyncOnFeedback();
}
/// <summary>
///
/// </summary>
void CurrentRoom_SyncOnFeedback()
{
var value = _CurrentRoom.OnFeedback.BoolValue;
//Debug.Console(2, CurrentRoom, "UI: Is on event={0}", value);
TriList.BooleanInput[UIBoolJoin.RoomIsOn].BoolValue = value;
if (value) //ON
{
SetupActivityFooterWhenRoomOn();
TriList.BooleanInput[UIBoolJoin.SelectASourceVisible].BoolValue = false;
TriList.BooleanInput[UIBoolJoin.SourceStagingBarVisible].BoolValue = true;
//TriList.BooleanInput[UIBoolJoin.SourceStagingBarVisible].BoolValue = true;
TriList.BooleanInput[UIBoolJoin.StartPageVisible].BoolValue = false;
TriList.BooleanInput[UIBoolJoin.VolumeSingleMute1Visible].BoolValue = true;
TriList.BooleanInput[UIBoolJoin.VolumeDualMute1Visible].BoolValue = true;
}
else
{
CurrentMode = UiDisplayMode.Start;
if (VCDriver.IsVisible)
VCDriver.Hide();
SetupActivityFooterWhenRoomOff();
ShowLogo();
SetActivityFooterFeedbacks();
TriList.BooleanInput[UIBoolJoin.StartPageVisible].BoolValue = true;
TriList.BooleanInput[UIBoolJoin.VolumeSingleMute1Visible].BoolValue = false;
TriList.BooleanInput[UIBoolJoin.VolumeDualMute1Visible].BoolValue = false;
TriList.BooleanInput[UIBoolJoin.SourceStagingBarVisible].BoolValue = false;
}
}
@@ -771,10 +796,7 @@ namespace PepperDash.Essentials
/// </summary>
void CurrentRoom_IsWarmingFeedback_OutputChange(object sender, EventArgs e)
{
var value = CurrentRoom.IsWarmingUpFeedback.BoolValue;
//Debug.Console(2, CurrentRoom, "UI: WARMING event={0}", value);
if (value)
if (CurrentRoom.IsWarmingUpFeedback.BoolValue)
{
WarmingCoolingModal = new ModalDialog(TriList);
WarmingCoolingModal.PresentModalDialog(0, "Powering Up", "Power", "<p>Room is powering up</p><p>Please wait</p>",
@@ -792,12 +814,9 @@ namespace PepperDash.Essentials
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void IsCoolingDownFeedback_OutputChange(object sender, EventArgs e)
void CurrentRoom_IsCoolingDownFeedback_OutputChange(object sender, EventArgs e)
{
var value = CurrentRoom.IsCoolingDownFeedback.BoolValue;
//Debug.Console(2, CurrentRoom, "UI: Cooldown event={0}", value);
if (value)
if (CurrentRoom.IsCoolingDownFeedback.BoolValue)
{
WarmingCoolingModal = new ModalDialog(TriList);
WarmingCoolingModal.PresentModalDialog(0, "Shut Down", "Power", "<p>Room is shutting down</p><p>Please wait</p>",

View File

@@ -75,6 +75,8 @@ namespace PepperDash.Essentials.UIDrivers.VC
public EssentialsVideoCodecUiDriver(BasicTriListWithSmartObject triList, IAVDriver parent, VideoCodecBase codec)
: base(triList)
{
if (codec == null)
throw new ArgumentNullException("Codec cannot be null");
Codec = codec;
Parent = parent;
SetupCallStagingPopover();
@@ -274,7 +276,6 @@ namespace PepperDash.Essentials.UIDrivers.VC
{
if (Codec.ActiveCalls.Count > 1)
{
Debug.Console(1, "#*#*#*# FUCK ME!!!!");
Parent.PopupInterlock.ShowInterlocked(UIBoolJoin.HeaderActiveCallsListVisible);
}
else