Merge remote-tracking branch 'origin/feature/ecs-407' into feature/cisco-spark-2

Conflicts:
	Essentials Devices Common/Essentials Devices Common/Codec/CodecActiveCallItem.cs
	Essentials Devices Common/Essentials Devices Common/Codec/eCodecCallStatus.cs
	Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoCodec.cs
	Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs
This commit is contained in:
Neil Dorin
2017-09-21 11:57:48 -06:00
12 changed files with 207 additions and 191 deletions

View File

@@ -40,5 +40,10 @@
/// 3922
/// </summary>
public const uint PresentationListCaretMode = 3922;
/// <summary>
/// 15024 - Modes 0: On hook, 1: Phone, 2: Video
/// </summary>
public const uint CallHeaderButtonMode = 15024;
}
}

View File

@@ -155,6 +155,12 @@ namespace PepperDash.Essentials
//PowerOffTimeout = 30000;
//TriList.StringInput[UIStringJoin.StartActivityText].StringValue = "Tap an activity below";
// Reveal proper header buttons with/without lighting
if(false) // has lighting
TriList.SetBool(UIBoolJoin.CallLeftHeaderButtonVisible, true);
else
TriList.SetBool(UIBoolJoin.CallRightHeaderButtonVisible, true);
}
/// <summary>

View File

@@ -9,11 +9,16 @@ using PepperDash.Core;
using PepperDash.Essentials;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.SmartObjects;
using PepperDash.Essentials.Devices.Common.Codec;
using PepperDash.Essentials.Devices.Common.VideoCodec;
namespace PepperDash.Essentials.UIDrivers.VC
{
#warning When InCall, keypad text should clear. Keypad becomes DTMF only. Delete is gone and disabled. Send keypresses immediately to SendDTMF. Queue them in disaply string.
#warning when Call ends, clear keypad text.
#warning FOR SPARK - (GFX also) we need a staging bar for in call state where there is no camera button
/// <summary>
/// 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.
@@ -60,6 +65,8 @@ namespace PepperDash.Essentials.UIDrivers.VC
StringBuilder DialStringBuilder = new StringBuilder();
BoolFeedback DialStringBackspaceVisibleFeedback;
ModalDialog IncomingCallModal;
/// <summary>
///
/// </summary>
@@ -72,6 +79,8 @@ namespace PepperDash.Essentials.UIDrivers.VC
SetupCallStagingPopover();
SetupDialKeypad();
codec.CallStatusChange += new EventHandler<CodecCallStatusItemChangeEventArgs>(Codec_CallStatusChange);
InCall = new BoolFeedback(() => false);
LocalPrivacyIsMuted = new BoolFeedback(() => false);
@@ -93,7 +102,98 @@ namespace PepperDash.Essentials.UIDrivers.VC
DialStringBackspaceVisibleFeedback
.LinkInputSig(TriList.BooleanInput[UIBoolJoin.KeyboardClearVisible]);
Codec.ActiveCallCountFeedback.OutputChange += new EventHandler<EventArgs>(InCallFeedback_OutputChange);
}
/// <summary>
/// Handles status changes for calls
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void Codec_CallStatusChange(object sender, CodecCallStatusItemChangeEventArgs e)
{
var call = e.CallItem;
Debug.Console(1, "*#* UI: Codec status {0}: {1} --> {2}", call.Name, e.PreviousStatus, e.NewStatus);
switch (e.NewStatus)
{
case eCodecCallStatus.Connected:
// fire at SRL item
Debug.Console(1, "*#* UI: Call Connected {0}", call.Name);
break;
case eCodecCallStatus.Connecting:
// fire at SRL item
Debug.Console(1, "*#* UI: Call Connecting {0}", call.Name);
break;
case eCodecCallStatus.Dialing:
Debug.Console(1, "*#* UI: Call Dialing {0}", call.Name);
break;
case eCodecCallStatus.Disconnected:
Debug.Console(1, "*#* UI: Call Disconnecting {0}", call.Name);
break;
case eCodecCallStatus.Disconnecting:
break;
case eCodecCallStatus.EarlyMedia:
break;
case eCodecCallStatus.Idle:
break;
case eCodecCallStatus.Incoming:
// fire up a modal
ShowIncomingModal(call);
break;
case eCodecCallStatus.OnHold:
break;
case eCodecCallStatus.Preserved:
break;
case eCodecCallStatus.RemotePreserved:
break;
case eCodecCallStatus.Ringing:
break;
default:
break;
}
TriList.UShortInput[UIUshortJoin.VCStagingConnectButtonMode].UShortValue = (ushort)(Codec.IsInCall ? 1 : 0);
StagingBarInterlock.ShowInterlocked(Codec.IsInCall ?
UIBoolJoin.VCStagingActivePopoverVisible : UIBoolJoin.VCStagingInactivePopoverVisible);
// Set mode of header button
if (!Codec.IsInCall)
TriList.SetUshort(UIUshortJoin.CallHeaderButtonMode, 0);
else if(Codec.ActiveCalls.Any(c => c.Type == eCodecCallType.Video))
TriList.SetUshort(UIUshortJoin.CallHeaderButtonMode, 2);
else
TriList.SetUshort(UIUshortJoin.CallHeaderButtonMode, 1);
// Update list of calls
var activeList = Codec.ActiveCalls.Where(c => c.IsActiveCall).ToList();
Debug.Console(1, "*#* UI - Codec has {0} calls", activeList.Count);
}
/// <summary>
///
/// </summary>
void ShowIncomingModal(CodecActiveCallItem call)
{
IncomingCallModal = new ModalDialog(TriList);
string msg;
string icon;
if (call.Type == eCodecCallType.Audio)
{
icon = "Phone";
msg = string.Format("Incoming phone call from: {0}", call.Name);
}
else
{
icon = "Camera";
msg = string.Format("Incoming video call from: {0}", call.Name);
}
IncomingCallModal.PresentModalDialog(2, "Incoming Call", icon, msg,
"Ignore", "Accept", false, false, b =>
{
if (b == 1)
Codec.RejectCall(call);
else //2
Codec.AcceptCall(call);
IncomingCallModal = null;
});
}
/// <summary>
@@ -196,28 +296,6 @@ namespace PepperDash.Essentials.UIDrivers.VC
Codec.Dial(DialStringBuilder.ToString());
}
/// <summary>
///
/// </summary>
void InCallFeedback_OutputChange(object sender, EventArgs e)
{
var inCall = Codec.IsInCall;
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.IsInCall) // 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?)
}
}
/// <summary>
///