Replaced incallfeedback with activecallcount....

This commit is contained in:
Heath Volmer
2017-09-18 14:27:49 -06:00
parent 8df353ab75
commit 95a6f3948f
16 changed files with 4857 additions and 4766 deletions

View File

@@ -20,7 +20,7 @@ namespace PepperDash.Essentials.Core
void SendDtmf(string digit);
BoolFeedback InCallFeedback { get; }
IntFeedback ActiveCallCountFeedback { get; }
BoolFeedback IncomingCallFeedback { get; }
@@ -30,7 +30,7 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// Defines minimum volume controls for a codec device with dialing capabilities
/// </summary>
public interface ICodecAudio : IBasicVolumeWithFeedback, ICodecPrivacy
public interface ICodecAudio : IBasicVolumeWithFeedback, IPrivacy
{
}
@@ -38,7 +38,7 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// Adds control of codec receive volume
/// </summary>
public interface ICodecReceiveVolume
public interface IReceiveVolume
{
// Break this out into 3 interfaces
void SetReceiveVolume(ushort level);
@@ -52,7 +52,7 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// Adds control of codec transmit volume
/// </summary>
public interface ICodecTransmitVolume
public interface ITransmitVolume
{
void SetTransmitVolume(ushort level);
void TransmitMuteOn();
@@ -65,7 +65,7 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// Adds control of codec privacy function (microphone mute)
/// </summary>
public interface ICodecPrivacy
public interface IPrivacy
{
void PrivacyModeOn();
void PrivacyModeOff();

View File

@@ -127,13 +127,14 @@
<Compile Include="SetTopBox\IRSetTopBoxBase.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Streaming\Roku.cs" />
<Compile Include="VC\CiscoCodec\CiscoCodec.cs" />
<Compile Include="VC\CiscoCodec\xConfiguration.cs" />
<Compile Include="VC\CiscoCodec\xEvent.cs" />
<Compile Include="VC\CiscoCodec\HttpApiServer.cs" />
<Compile Include="VC\MockVC\MockVC.cs" />
<Compile Include="VC\CiscoCodec\xStatus.cs" />
<Compile Include="VC\VideoCodecBase.cs" />
<Compile Include="VideoCodec\CiscoCodec\CiscoCodec.cs" />
<Compile Include="VideoCodec\CiscoCodec\xConfiguration.cs" />
<Compile Include="VideoCodec\CiscoCodec\xEvent.cs" />
<Compile Include="VideoCodec\CiscoCodec\HttpApiServer.cs" />
<Compile Include="VideoCodec\CodecActiveCallItem.cs" />
<Compile Include="VideoCodec\MockVC\MockVC.cs" />
<Compile Include="VideoCodec\CiscoCodec\xStatus.cs" />
<Compile Include="VideoCodec\VideoCodecBase.cs" />
<None Include="Properties\ControlSystem.cfg" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" />

View File

@@ -49,7 +49,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
}
}
protected override Func<bool> PrivacyModeFeedbackFunc
protected override Func<bool> PrivacyModeIsOnFeedbackFunc
{
get
{
@@ -522,7 +522,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
(selector as Action)();
}
protected override Func<bool> InCallFeedbackFunc { get { return () => false; } }
//protected Func<bool> InCallFeedbackFunc { get { return () => false; } }
protected override Func<bool> IncomingCallFeedbackFunc { get { return () => false; } }
@@ -598,7 +598,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
{
string sendingMode = string.Empty;
if (InCallFeedback.BoolValue)
if (IsInCall)
sendingMode = "LocalRemote";
else
sendingMode = "LocalOnly";
@@ -700,6 +700,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
{
SendText("xCommand SystemUnit Boot Action: Restart");
}
protected override Func<int> ActiveCallCountFeedbackFunc
{
get { throw new NotImplementedException(); }
}
}
/// <summary>

View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Devices.Common.VideoCodec
{
public class CodecActiveCallItem
{
public string Name { get; private set; }
public string Number { get; private set; }
public eCodecCallType Type { get; private set; }
}
public enum eCodecCallType
{
None, Audio, Video
}
}

View File

@@ -16,7 +16,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
{
MuteFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Mute={0}", _IsMuted);
VolumeLevelFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Volume={0}", _VolumeLevel);
InCallFeedback.OutputChange += (o, a) => Debug.Console(1, this, "InCall={0}", _InCall);
ActiveCallCountFeedback.OutputChange += (o, a) => Debug.Console(1, this, "InCall={0}", _ActiveCallCount);
IncomingCallFeedback.OutputChange += (o, a) => Debug.Console(1, this, "IncomingCall={0}", _IncomingCall);
//ReceiveLevelFeedback.OutputChange += (o, a) => Debug.Console(1, this, "ReceiveLevel={0}", _ReceiveLevel);
//ReceiveMuteIsOnFeedback.OutputChange += (o, a) => Debug.Console(1, this, "ReceiveMute={0}", _ReceiveMute);
@@ -25,11 +25,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
SharingSourceFeedback.OutputChange += (o, a) => Debug.Console(1, this, "SharingSource={0}", _SharingSource);
}
protected override Func<bool> InCallFeedbackFunc
protected override Func<int> ActiveCallCountFeedbackFunc
{
get { return () => _InCall; }
get { return () => _ActiveCallCount; }
}
bool _InCall;
int _ActiveCallCount;
protected override Func<bool> IncomingCallFeedbackFunc
{
@@ -61,7 +61,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
//}
//bool _ReceiveMute;
protected override Func<bool> PrivacyModeFeedbackFunc
protected override Func<bool> PrivacyModeIsOnFeedbackFunc
{
get { return () => _PrivacyModeIsOn; }
}
@@ -92,8 +92,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
{
Debug.Console(1, this, "Dial: {0}", s);
_InCall = true;
InCallFeedback.FireUpdate();
//_InCall = true;
//IsInCall.FireUpdate();
}
/// <summary>
@@ -102,8 +102,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
public override void EndCall()
{
Debug.Console(1, this, "EndCall");
_InCall = false;
InCallFeedback.FireUpdate();
//_InCall = false;
//IsInCall.FireUpdate();
}
/// <summary>

View File

@@ -27,29 +27,36 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
#endregion
public BoolFeedback InCallFeedback { get; private set; }
public bool IsInCall { get { return ActiveCallCountFeedback.IntValue > 0; } }
public BoolFeedback IncomingCallFeedback { get; private set; }
abstract protected Func<bool> InCallFeedbackFunc { get; }
public IntFeedback ActiveCallCountFeedback { get; private set; }
abstract protected Func<int> ActiveCallCountFeedbackFunc { get; }
abstract protected Func<bool> IncomingCallFeedbackFunc { get; }
abstract protected Func<bool> PrivacyModeFeedbackFunc { get; }
abstract protected Func<bool> PrivacyModeIsOnFeedbackFunc { get; }
abstract protected Func<int> VolumeLevelFeedbackFunc { get; }
abstract protected Func<bool> MuteFeedbackFunc { get; }
abstract protected Func<string> SharingSourceFeedbackFunc { get; }
public List<CodecActiveCallItem> ActiveCalls { get; set; }
public VideoCodecBase(string key, string name)
: base(key, name)
{
InCallFeedback = new BoolFeedback(InCallFeedbackFunc);
ActiveCallCountFeedback = new IntFeedback(ActiveCallCountFeedbackFunc);
IncomingCallFeedback = new BoolFeedback(IncomingCallFeedbackFunc);
PrivacyModeIsOnFeedback = new BoolFeedback(PrivacyModeFeedbackFunc);
PrivacyModeIsOnFeedback = new BoolFeedback(PrivacyModeIsOnFeedbackFunc);
VolumeLevelFeedback = new IntFeedback(VolumeLevelFeedbackFunc);
MuteFeedback = new BoolFeedback(MuteFeedbackFunc);
SharingSourceFeedback = new StringFeedback(SharingSourceFeedbackFunc);
InputPorts = new RoutingPortCollection<RoutingInputPort>();
InCallFeedback.OutputChange += new EventHandler<EventArgs>(InCallFeedback_OutputChange);
ActiveCallCountFeedback.OutputChange += new EventHandler<EventArgs>(ActiveCallCountFeedback_OutputChange);
ActiveCalls = new List<CodecActiveCallItem>();
}
/// <summary>
@@ -57,11 +64,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void InCallFeedback_OutputChange(object sender, EventArgs e)
void ActiveCallCountFeedback_OutputChange(object sender, EventArgs e)
{
if (UsageTracker != null)
{
if (InCallFeedback.BoolValue)
if (IsInCall)
UsageTracker.StartDeviceUsage();
else
UsageTracker.EndDeviceUsage();
@@ -83,7 +90,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
{
return new List<Feedback>
{
InCallFeedback,
IncomingCallFeedback,
PrivacyModeIsOnFeedback,
SharingSourceFeedback

View File

@@ -11,11 +11,40 @@ using PepperDash.Essentials.Devices.Common.VideoCodec;
namespace PepperDash.Essentials
{
public class EssentialsHuddleVtc1Room : EssentialsRoomBase, IHasCurrentSourceInfoChange
public class EssentialsHuddleVtc1Room : EssentialsRoomBase, IHasCurrentSourceInfoChange, IPrivacy
{
public event EventHandler<VolumeDeviceChangeEventArgs> CurrentVolumeDeviceChange;
public event SourceInfoChangeHandler CurrentSingleSourceChange;
//************************
// Call-related stuff
public BoolFeedback InCallFeedback { get; private set; }
/// <summary>
/// Make this more specific
/// </summary>
public List<CodecActiveCallItem> ActiveCalls { get; private set; }
/// <summary>
/// States: 0 for on hook, 1 for video, 2 for audio, 3 for telekenesis
/// </summary>
public IntFeedback CallTypeFeedback { get; private set; }
/// <summary>
///
/// </summary>
public BoolFeedback PrivacyModeIsOnFeedback { get; private set; }
/// <summary>
/// When something in the room is sharing with the far end or through other means
/// </summary>
public BoolFeedback IsSharingFeedback { get; private set; }
//************************
protected override Func<bool> OnFeedbackFunc
{
get
@@ -162,6 +191,7 @@ namespace PepperDash.Essentials
DefaultDisplay = defaultDisplay;
VideoCodec = vc;
DefaultAudioDevice = defaultAudio;
if (defaultAudio is IBasicVolumeControls)
DefaultVolumeControls = defaultAudio as IBasicVolumeControls;
else if (defaultAudio is IHasVolumeDevice)
@@ -196,6 +226,12 @@ namespace PepperDash.Essentials
};
}
InCallFeedback = new BoolFeedback(() => false); //###################################################
IsSharingFeedback = new BoolFeedback(() => false); //##########################################################
PrivacyModeIsOnFeedback = new BoolFeedback(() => false); //####################################################
CallTypeFeedback = new IntFeedback(() => 0); //######################################################
SourceListKey = "default";
EnablePowerOnToLastSource = true;
}
@@ -401,5 +437,25 @@ namespace PepperDash.Essentials
foreach (var room in allRooms)
(room as EssentialsHuddleSpaceRoom).RunRouteAction("roomOff");
}
#region IPrivacy Members
public void PrivacyModeOff()
{
// Turn off privacy on all things (codec only for now)
}
public void PrivacyModeOn()
{
// Turn on ...
}
public void PrivacyModeToggle()
{
}
#endregion
}
}

View File

@@ -93,7 +93,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
DialStringBackspaceVisibleFeedback
.LinkInputSig(TriList.BooleanInput[UIBoolJoin.KeyboardClearVisible]);
Codec.InCallFeedback.OutputChange += new EventHandler<EventArgs>(InCallFeedback_OutputChange);
Codec.ActiveCallCountFeedback.OutputChange += new EventHandler<EventArgs>(InCallFeedback_OutputChange);
}
/// <summary>
@@ -190,7 +190,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
/// </summary>
void ConnectPress()
{
if (Codec.InCallFeedback.BoolValue)
if (Codec.IsInCall)
Codec.EndCall();
else
Codec.Dial(DialStringBuilder.ToString());
@@ -201,13 +201,13 @@ namespace PepperDash.Essentials.UIDrivers.VC
/// </summary>
void InCallFeedback_OutputChange(object sender, EventArgs e)
{
var inCall = Codec.InCallFeedback.BoolValue;
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.InCallFeedback.BoolValue) // Call is starting
if (Codec.IsInCall) // Call is starting
{
// Header icon
// Volume bar needs to have mic mute