mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-28 11:54:57 +00:00
Compare commits
25 Commits
1.4.33-alp
...
1.4.33-alp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b71313248d | ||
|
|
f27b6fadb9 | ||
|
|
113b08a227 | ||
|
|
7f87b083cb | ||
|
|
eef5c41dfe | ||
|
|
dd1b15edee | ||
|
|
1a44d28adb | ||
|
|
e218f13d45 | ||
|
|
df92bdac8e | ||
|
|
51ece9daff | ||
|
|
08d6090bc5 | ||
|
|
96cd5cfe81 | ||
|
|
0d854270b6 | ||
|
|
16d5795267 | ||
|
|
c54351f8ee | ||
|
|
5819ac78ec | ||
|
|
ebc50f0caa | ||
|
|
85f28498c4 | ||
|
|
df192895a1 | ||
|
|
e74d8c2497 | ||
|
|
042c94e6cf | ||
|
|
0ed613de73 | ||
|
|
b07e85c4e7 | ||
|
|
3e9b67a1ad | ||
|
|
3b84c0e3db |
174
PepperDashEssentials/AppServer/Messengers/CameraBaseMessenger.cs
Normal file
174
PepperDashEssentials/AppServer/Messengers/CameraBaseMessenger.cs
Normal file
@@ -0,0 +1,174 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices.Common.Cameras;
|
||||
|
||||
namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
public class CameraBaseMessenger : MessengerBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Device being bridged
|
||||
/// </summary>
|
||||
public CameraBase Camera { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="camera"></param>
|
||||
/// <param name="messagePath"></param>
|
||||
public CameraBaseMessenger(string key, CameraBase camera, string messagePath)
|
||||
: base(key, messagePath)
|
||||
{
|
||||
if (camera == null)
|
||||
throw new ArgumentNullException("camera");
|
||||
|
||||
Camera = camera;
|
||||
|
||||
var presetsCamera = Camera as IHasCameraPresets;
|
||||
|
||||
if (presetsCamera != null)
|
||||
{
|
||||
presetsCamera.PresetsListHasChanged += new EventHandler<EventArgs>(presetsCamera_PresetsListHasChanged);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void presetsCamera_PresetsListHasChanged(object sender, EventArgs e)
|
||||
{
|
||||
var presetsCamera = Camera as IHasCameraPresets;
|
||||
|
||||
var presetList = new List<CameraPreset>();
|
||||
|
||||
if (presetsCamera != null)
|
||||
presetList = presetsCamera.Presets;
|
||||
|
||||
PostStatusMessage(new
|
||||
{
|
||||
presets = presetList
|
||||
});
|
||||
}
|
||||
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
appServerController.AddAction(MessagePath + "/fullStatus", new Action(SendCameraFullMessageObject));
|
||||
|
||||
var ptzCamera = Camera as IHasCameraPtzControl;
|
||||
|
||||
if (ptzCamera != null)
|
||||
{
|
||||
|
||||
// Need to evaluate how to pass through these P&H actions. Need a method that takes a bool maybe?
|
||||
AppServerController.AddAction(MessagePath + "/cameraUp", new PressAndHoldAction((b) =>
|
||||
{
|
||||
if (b)
|
||||
ptzCamera.TiltUp();
|
||||
else
|
||||
ptzCamera.TiltStop();
|
||||
}));
|
||||
AppServerController.AddAction(MessagePath + "/cameraDown", new PressAndHoldAction((b) =>
|
||||
{
|
||||
if (b)
|
||||
ptzCamera.TiltDown();
|
||||
else
|
||||
ptzCamera.TiltStop();
|
||||
}));
|
||||
AppServerController.AddAction(MessagePath + "/cameraLeft", new PressAndHoldAction((b) =>
|
||||
{
|
||||
if (b)
|
||||
ptzCamera.PanLeft();
|
||||
else
|
||||
ptzCamera.PanStop();
|
||||
}));
|
||||
AppServerController.AddAction(MessagePath + "/cameraRight", new PressAndHoldAction((b) =>
|
||||
{
|
||||
if (b)
|
||||
ptzCamera.PanRight();
|
||||
else
|
||||
ptzCamera.PanStop();
|
||||
}));
|
||||
AppServerController.AddAction(MessagePath + "/cameraZoomIn", new PressAndHoldAction((b) =>
|
||||
{
|
||||
if (b)
|
||||
ptzCamera.ZoomIn();
|
||||
else
|
||||
ptzCamera.ZoomStop();
|
||||
}));
|
||||
AppServerController.AddAction(MessagePath + "/cameraZoomOut", new PressAndHoldAction((b) =>
|
||||
{
|
||||
if (b)
|
||||
ptzCamera.ZoomOut();
|
||||
else
|
||||
ptzCamera.ZoomStop();
|
||||
}));
|
||||
}
|
||||
|
||||
if (Camera is IHasCameraAutoMode)
|
||||
{
|
||||
appServerController.AddAction(MessagePath + "/cameraModeAuto", new Action((Camera as IHasCameraAutoMode).CameraAutoModeOn));
|
||||
appServerController.AddAction(MessagePath + "/cameraModeManual", new Action((Camera as IHasCameraAutoMode).CameraAutoModeOff));
|
||||
}
|
||||
|
||||
if (Camera is IPower)
|
||||
{
|
||||
appServerController.AddAction(MessagePath + "/cameraModeOff", new Action((Camera as IPower).PowerOff));
|
||||
}
|
||||
|
||||
var presetsCamera = Camera as IHasCameraPresets;
|
||||
|
||||
if (presetsCamera != null)
|
||||
{
|
||||
for(int i = 1; i <= 6; i++)
|
||||
{
|
||||
var preset = i;
|
||||
appServerController.AddAction(MessagePath + "/cameraPreset" + i, new Action<int>((p) => presetsCamera.PresetSelect(preset)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper method to update the full status of the camera
|
||||
/// </summary>
|
||||
void SendCameraFullMessageObject()
|
||||
{
|
||||
var presetsCamera = Camera as IHasCameraPresets;
|
||||
|
||||
var presetList = new List<CameraPreset>();
|
||||
|
||||
if (presetsCamera != null)
|
||||
presetList = presetsCamera.Presets;
|
||||
|
||||
PostStatusMessage(new
|
||||
{
|
||||
cameraMode = GetCameraMode(),
|
||||
hasPresets = Camera is IHasCameraPresets,
|
||||
presets = presetList
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Computes the current camera mode
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
string GetCameraMode()
|
||||
{
|
||||
string m;
|
||||
if (Camera is IHasCameraAutoMode && (Camera as IHasCameraAutoMode).CameraAutoModeIsOnFeedback.BoolValue)
|
||||
m = eCameraControlMode.Auto.ToString().ToLower();
|
||||
else if (Camera is IPower && !(Camera as IPower).PowerIsOnFeedback.BoolValue)
|
||||
m = eCameraControlMode.Off.ToString().ToLower();
|
||||
else
|
||||
m = eCameraControlMode.Manual.ToString().ToLower();
|
||||
return m;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,216 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.EthernetCommunication;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
|
||||
namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
public class Ddvc01AtcMessenger : MessengerBase
|
||||
{
|
||||
BasicTriList EISC;
|
||||
|
||||
/// <summary>
|
||||
/// 221
|
||||
/// </summary>
|
||||
const uint BDialHangupOnHook = 221;
|
||||
|
||||
/// <summary>
|
||||
/// 251
|
||||
/// </summary>
|
||||
const uint BIncomingAnswer = 251;
|
||||
/// <summary>
|
||||
/// 252
|
||||
/// </summary>
|
||||
const uint BIncomingReject = 252;
|
||||
/// <summary>
|
||||
/// 241
|
||||
/// </summary>
|
||||
const uint BSpeedDial1 = 241;
|
||||
/// <summary>
|
||||
/// 242
|
||||
/// </summary>
|
||||
const uint BSpeedDial2 = 242;
|
||||
/// <summary>
|
||||
/// 243
|
||||
/// </summary>
|
||||
const uint BSpeedDial3 = 243;
|
||||
/// <summary>
|
||||
/// 244
|
||||
/// </summary>
|
||||
const uint BSpeedDial4 = 244;
|
||||
|
||||
/// <summary>
|
||||
/// 201
|
||||
/// </summary>
|
||||
const uint SCurrentDialString = 201;
|
||||
/// <summary>
|
||||
/// 211
|
||||
/// </summary>
|
||||
const uint SCurrentCallNumber = 211;
|
||||
/// <summary>
|
||||
/// 212
|
||||
/// </summary>
|
||||
const uint SCurrentCallName = 212;
|
||||
/// <summary>
|
||||
/// 221
|
||||
/// </summary>
|
||||
const uint SHookState = 221;
|
||||
/// <summary>
|
||||
/// 222
|
||||
/// </summary>
|
||||
const uint SCallDirection = 222;
|
||||
|
||||
/// <summary>
|
||||
/// 201-212 0-9*#
|
||||
/// </summary>
|
||||
Dictionary<string, uint> DTMFMap = new Dictionary<string, uint>
|
||||
{
|
||||
{ "1", 201 },
|
||||
{ "2", 202 },
|
||||
{ "3", 203 },
|
||||
{ "4", 204 },
|
||||
{ "5", 205 },
|
||||
{ "6", 206 },
|
||||
{ "7", 207 },
|
||||
{ "8", 208 },
|
||||
{ "9", 209 },
|
||||
{ "0", 210 },
|
||||
{ "*", 211 },
|
||||
{ "#", 212 },
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
CodecActiveCallItem CurrentCallItem;
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="eisc"></param>
|
||||
/// <param name="messagePath"></param>
|
||||
public Ddvc01AtcMessenger(string key, BasicTriList eisc, string messagePath)
|
||||
: base(key, messagePath)
|
||||
{
|
||||
EISC = eisc;
|
||||
|
||||
CurrentCallItem = new CodecActiveCallItem();
|
||||
CurrentCallItem.Type = eCodecCallType.Audio;
|
||||
CurrentCallItem.Id = "-audio-";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void SendFullStatus()
|
||||
{
|
||||
|
||||
|
||||
this.PostStatusMessage(new
|
||||
{
|
||||
calls = GetCurrentCallList(),
|
||||
currentCallString = EISC.GetString(SCurrentCallNumber),
|
||||
currentDialString = EISC.GetString(SCurrentDialString),
|
||||
isInCall = EISC.GetString(SHookState) == "Connected"
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="appServerController"></param>
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
//EISC.SetStringSigAction(SCurrentDialString, s => PostStatusMessage(new { currentDialString = s }));
|
||||
|
||||
EISC.SetStringSigAction(SHookState, s =>
|
||||
{
|
||||
CurrentCallItem.Status = (eCodecCallStatus)Enum.Parse(typeof(eCodecCallStatus), s, true);
|
||||
//GetCurrentCallList();
|
||||
SendFullStatus();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(SCurrentCallNumber, s =>
|
||||
{
|
||||
CurrentCallItem.Number = s;
|
||||
SendCallsList();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(SCurrentCallName, s =>
|
||||
{
|
||||
CurrentCallItem.Name = s;
|
||||
SendCallsList();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(SCallDirection, s =>
|
||||
{
|
||||
CurrentCallItem.Direction = (eCodecCallDirection)Enum.Parse(typeof(eCodecCallDirection), s, true);
|
||||
SendCallsList();
|
||||
});
|
||||
|
||||
// Add press and holds using helper
|
||||
Action<string, uint> addPHAction = (s, u) =>
|
||||
AppServerController.AddAction(MessagePath + s, new PressAndHoldAction(b => EISC.SetBool(u, b)));
|
||||
|
||||
// Add straight pulse calls
|
||||
Action<string, uint> addAction = (s, u) =>
|
||||
AppServerController.AddAction(MessagePath + s, new Action(() => EISC.PulseBool(u, 100)));
|
||||
addAction("/endCallById", BDialHangupOnHook);
|
||||
addAction("/endAllCalls", BDialHangupOnHook);
|
||||
addAction("/acceptById", BIncomingAnswer);
|
||||
addAction("/rejectById", BIncomingReject);
|
||||
addAction("/speedDial1", BSpeedDial1);
|
||||
addAction("/speedDial2", BSpeedDial2);
|
||||
addAction("/speedDial3", BSpeedDial3);
|
||||
addAction("/speedDial4", BSpeedDial4);
|
||||
|
||||
// Get status
|
||||
AppServerController.AddAction(MessagePath + "/fullStatus", new Action(SendFullStatus));
|
||||
// Dial on string
|
||||
AppServerController.AddAction(MessagePath + "/dial", new Action<string>(s => EISC.SetString(SCurrentDialString, s)));
|
||||
// Pulse DTMF
|
||||
AppServerController.AddAction(MessagePath + "/dtmf", new Action<string>(s =>
|
||||
{
|
||||
if (DTMFMap.ContainsKey(s))
|
||||
{
|
||||
EISC.PulseBool(DTMFMap[s], 100);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void SendCallsList()
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
calls = GetCurrentCallList(),
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Turns the
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
List<CodecActiveCallItem> GetCurrentCallList()
|
||||
{
|
||||
if (CurrentCallItem.Status == eCodecCallStatus.Disconnected)
|
||||
{
|
||||
return new List<CodecActiveCallItem>();
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<CodecActiveCallItem>() { CurrentCallItem };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,648 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.EthernetCommunication;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
|
||||
namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
public class Ddvc01VtcMessenger : MessengerBase
|
||||
{
|
||||
BasicTriList EISC;
|
||||
|
||||
/********* Bools *********/
|
||||
/// <summary>
|
||||
/// 724
|
||||
/// </summary>
|
||||
const uint BDialHangup = 724;
|
||||
/// <summary>
|
||||
/// 750
|
||||
/// </summary>
|
||||
const uint BCallIncoming = 750;
|
||||
/// <summary>
|
||||
/// 751
|
||||
/// </summary>
|
||||
const uint BIncomingAnswer = 751;
|
||||
/// <summary>
|
||||
/// 752
|
||||
/// </summary>
|
||||
const uint BIncomingReject = 752;
|
||||
/// <summary>
|
||||
/// 741
|
||||
/// </summary>
|
||||
const uint BSpeedDial1 = 741;
|
||||
/// <summary>
|
||||
/// 742
|
||||
/// </summary>
|
||||
const uint BSpeedDial2 = 742;
|
||||
/// <summary>
|
||||
/// 743
|
||||
/// </summary>
|
||||
const uint BSpeedDial3 = 743;
|
||||
/// <summary>
|
||||
/// 744
|
||||
/// </summary>
|
||||
const uint BSpeedDial4 = 744;
|
||||
/// <summary>
|
||||
/// 800
|
||||
/// </summary>
|
||||
const uint BDirectorySearchBusy = 800;
|
||||
/// <summary>
|
||||
/// 801
|
||||
/// </summary>
|
||||
const uint BDirectoryLineSelected = 801;
|
||||
/// <summary>
|
||||
/// 801 when selected entry is a contact
|
||||
/// </summary>
|
||||
const uint BDirectoryEntryIsContact = 801;
|
||||
/// <summary>
|
||||
/// 802 To show/hide back button
|
||||
/// </summary>
|
||||
const uint BDirectoryIsRoot = 802;
|
||||
/// <summary>
|
||||
/// 803 Pulse from system to inform us when directory is ready
|
||||
/// </summary>
|
||||
const uint DDirectoryHasChanged = 803;
|
||||
/// <summary>
|
||||
/// 804
|
||||
/// </summary>
|
||||
const uint BDirectoryRoot = 804;
|
||||
/// <summary>
|
||||
/// 805
|
||||
/// </summary>
|
||||
const uint BDirectoryFolderBack = 805;
|
||||
/// <summary>
|
||||
/// 806
|
||||
/// </summary>
|
||||
const uint BDirectoryDialSelectedLine = 806;
|
||||
/// <summary>
|
||||
/// 811
|
||||
/// </summary>
|
||||
const uint BCameraControlUp = 811;
|
||||
/// <summary>
|
||||
/// 812
|
||||
/// </summary>
|
||||
const uint BCameraControlDown = 812;
|
||||
/// <summary>
|
||||
/// 813
|
||||
/// </summary>
|
||||
const uint BCameraControlLeft = 813;
|
||||
/// <summary>
|
||||
/// 814
|
||||
/// </summary>
|
||||
const uint BCameraControlRight = 814;
|
||||
/// <summary>
|
||||
/// 815
|
||||
/// </summary>
|
||||
const uint BCameraControlZoomIn = 815;
|
||||
/// <summary>
|
||||
/// 816
|
||||
/// </summary>
|
||||
const uint BCameraControlZoomOut = 816;
|
||||
/// <summary>
|
||||
/// 821 - 826
|
||||
/// </summary>
|
||||
const uint BCameraPresetStart = 821;
|
||||
|
||||
/// <summary>
|
||||
/// 831
|
||||
/// </summary>
|
||||
const uint BCameraModeAuto = 831;
|
||||
/// <summary>
|
||||
/// 832
|
||||
/// </summary>
|
||||
const uint BCameraModeManual = 832;
|
||||
/// <summary>
|
||||
/// 833
|
||||
/// </summary>
|
||||
const uint BCameraModeOff = 833;
|
||||
|
||||
/// <summary>
|
||||
/// 841
|
||||
/// </summary>
|
||||
const uint BCameraSelfView = 841;
|
||||
|
||||
/// <summary>
|
||||
/// 842
|
||||
/// </summary>
|
||||
const uint BCameraLayout = 842;
|
||||
/// <summary>
|
||||
/// 843
|
||||
/// </summary>
|
||||
const uint BCameraSupportsAutoMode = 843;
|
||||
/// <summary>
|
||||
/// 844
|
||||
/// </summary>
|
||||
const uint BCameraSupportsOffMode = 844;
|
||||
|
||||
|
||||
/********* Ushorts *********/
|
||||
/// <summary>
|
||||
/// 760
|
||||
/// </summary>
|
||||
const uint UCameraNumberSelect = 760;
|
||||
/// <summary>
|
||||
/// 801
|
||||
/// </summary>
|
||||
const uint UDirectorySelectRow = 801;
|
||||
/// <summary>
|
||||
/// 801
|
||||
/// </summary>
|
||||
const uint UDirectoryRowCount = 801;
|
||||
|
||||
|
||||
|
||||
/********* Strings *********/
|
||||
/// <summary>
|
||||
/// 701
|
||||
/// </summary>
|
||||
const uint SCurrentDialString = 701;
|
||||
/// <summary>
|
||||
/// 702
|
||||
/// </summary>
|
||||
const uint SCurrentCallName = 702;
|
||||
/// <summary>
|
||||
/// 703
|
||||
/// </summary>
|
||||
const uint SCurrentCallNumber = 703;
|
||||
/// <summary>
|
||||
/// 731
|
||||
/// </summary>
|
||||
const uint SHookState = 731;
|
||||
/// <summary>
|
||||
/// 722
|
||||
/// </summary>
|
||||
const uint SCallDirection = 722;
|
||||
/// <summary>
|
||||
/// 751
|
||||
/// </summary>
|
||||
const uint SIncomingCallName = 751;
|
||||
/// <summary>
|
||||
/// 752
|
||||
/// </summary>
|
||||
const uint SIncomingCallNumber = 752;
|
||||
|
||||
/// <summary>
|
||||
/// 800
|
||||
/// </summary>
|
||||
const uint SDirectorySearchString = 800;
|
||||
/// <summary>
|
||||
/// 801-1055
|
||||
/// </summary>
|
||||
const uint SDirectoryEntriesStart = 801;
|
||||
/// <summary>
|
||||
/// 1056
|
||||
/// </summary>
|
||||
const uint SDirectoryEntrySelectedName = 1056;
|
||||
/// <summary>
|
||||
/// 1057
|
||||
/// </summary>
|
||||
const uint SDirectoryEntrySelectedNumber = 1057;
|
||||
/// <summary>
|
||||
/// 1058
|
||||
/// </summary>
|
||||
const uint SDirectorySelectedFolderName = 1058;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 701-712 0-9*#
|
||||
/// </summary>
|
||||
Dictionary<string, uint> DTMFMap = new Dictionary<string, uint>
|
||||
{
|
||||
{ "1", 701 },
|
||||
{ "2", 702 },
|
||||
{ "3", 703 },
|
||||
{ "4", 704 },
|
||||
{ "5", 705 },
|
||||
{ "6", 706 },
|
||||
{ "7", 707 },
|
||||
{ "8", 708 },
|
||||
{ "9", 709 },
|
||||
{ "0", 710 },
|
||||
{ "*", 711 },
|
||||
{ "#", 712 },
|
||||
};
|
||||
|
||||
CodecActiveCallItem CurrentCallItem;
|
||||
CodecActiveCallItem IncomingCallItem;
|
||||
|
||||
ushort PreviousDirectoryLength = 0;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="eisc"></param>
|
||||
/// <param name="messagePath"></param>
|
||||
public Ddvc01VtcMessenger(string key, BasicTriList eisc, string messagePath)
|
||||
: base(key, messagePath)
|
||||
{
|
||||
EISC = eisc;
|
||||
|
||||
CurrentCallItem = new CodecActiveCallItem();
|
||||
CurrentCallItem.Type = eCodecCallType.Video;
|
||||
CurrentCallItem.Id = "-video-";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="appServerController"></param>
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
var asc = appServerController;
|
||||
EISC.SetStringSigAction(SHookState, s =>
|
||||
{
|
||||
CurrentCallItem.Status = (eCodecCallStatus)Enum.Parse(typeof(eCodecCallStatus), s, true);
|
||||
PostFullStatus(); // SendCallsList();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(SCurrentCallNumber, s =>
|
||||
{
|
||||
CurrentCallItem.Number = s;
|
||||
PostCallsList();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(SCurrentCallName, s =>
|
||||
{
|
||||
CurrentCallItem.Name = s;
|
||||
PostCallsList();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(SCallDirection, s =>
|
||||
{
|
||||
CurrentCallItem.Direction = (eCodecCallDirection)Enum.Parse(typeof(eCodecCallDirection), s, true);
|
||||
PostCallsList();
|
||||
});
|
||||
|
||||
EISC.SetBoolSigAction(BCallIncoming, b =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
var ica = new CodecActiveCallItem()
|
||||
{
|
||||
Direction = eCodecCallDirection.Incoming,
|
||||
Id = "-video-incoming",
|
||||
Name = EISC.GetString(SIncomingCallName),
|
||||
Number = EISC.GetString(SIncomingCallNumber),
|
||||
Status = eCodecCallStatus.Ringing,
|
||||
Type = eCodecCallType.Video
|
||||
};
|
||||
IncomingCallItem = ica;
|
||||
}
|
||||
else
|
||||
{
|
||||
IncomingCallItem = null;
|
||||
}
|
||||
PostCallsList();
|
||||
});
|
||||
|
||||
EISC.SetBoolSigAction(BCameraSupportsAutoMode, b =>
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
cameraSupportsAutoMode = b
|
||||
});
|
||||
});
|
||||
EISC.SetBoolSigAction(BCameraSupportsOffMode, b =>
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
cameraSupportsOffMode = b
|
||||
});
|
||||
});
|
||||
|
||||
// Directory insanity
|
||||
EISC.SetUShortSigAction(UDirectoryRowCount, u =>
|
||||
{
|
||||
// The length of the list comes in before the list does.
|
||||
// Splice the sig change operation onto the last string sig that will be changing
|
||||
// when the directory entries make it through.
|
||||
if (PreviousDirectoryLength > 0)
|
||||
{
|
||||
EISC.ClearStringSigAction(SDirectoryEntriesStart + PreviousDirectoryLength - 1);
|
||||
}
|
||||
EISC.SetStringSigAction(SDirectoryEntriesStart + u - 1, s => PostDirectory());
|
||||
PreviousDirectoryLength = u;
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(SDirectoryEntrySelectedName, s =>
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
directoryContactSelected = new
|
||||
{
|
||||
name = EISC.GetString(SDirectoryEntrySelectedName),
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(SDirectoryEntrySelectedNumber, s =>
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
directoryContactSelected = new
|
||||
{
|
||||
number = EISC.GetString(SDirectoryEntrySelectedNumber),
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(SDirectorySelectedFolderName, s => PostStatusMessage(new
|
||||
{
|
||||
directorySelectedFolderName = EISC.GetString(SDirectorySelectedFolderName)
|
||||
}));
|
||||
|
||||
EISC.SetSigTrueAction(BCameraModeAuto, () => PostCameraMode());
|
||||
EISC.SetSigTrueAction(BCameraModeManual, () => PostCameraMode());
|
||||
EISC.SetSigTrueAction(BCameraModeOff, () => PostCameraMode());
|
||||
|
||||
EISC.SetBoolSigAction(BCameraSelfView, b => PostStatusMessage(new
|
||||
{
|
||||
cameraSelfView = b
|
||||
}));
|
||||
|
||||
EISC.SetUShortSigAction(UCameraNumberSelect, (u) => PostSelectedCamera());
|
||||
|
||||
|
||||
// Add press and holds using helper action
|
||||
Action<string, uint> addPHAction = (s, u) =>
|
||||
AppServerController.AddAction(MessagePath + s, new PressAndHoldAction(b => EISC.SetBool(u, b)));
|
||||
addPHAction("/cameraUp", BCameraControlUp);
|
||||
addPHAction("/cameraDown", BCameraControlDown);
|
||||
addPHAction("/cameraLeft", BCameraControlLeft);
|
||||
addPHAction("/cameraRight", BCameraControlRight);
|
||||
addPHAction("/cameraZoomIn", BCameraControlZoomIn);
|
||||
addPHAction("/cameraZoomOut", BCameraControlZoomOut);
|
||||
|
||||
// Add straight pulse calls using helper action
|
||||
Action<string, uint> addAction = (s, u) =>
|
||||
AppServerController.AddAction(MessagePath + s, new Action(() => EISC.PulseBool(u, 100)));
|
||||
addAction("/endCallById", BDialHangup);
|
||||
addAction("/endAllCalls", BDialHangup);
|
||||
addAction("/acceptById", BIncomingAnswer);
|
||||
addAction("/rejectById", BIncomingReject);
|
||||
addAction("/speedDial1", BSpeedDial1);
|
||||
addAction("/speedDial2", BSpeedDial2);
|
||||
addAction("/speedDial3", BSpeedDial3);
|
||||
addAction("/speedDial4", BSpeedDial4);
|
||||
addAction("/cameraModeAuto", BCameraModeAuto);
|
||||
addAction("/cameraModeManual", BCameraModeManual);
|
||||
addAction("/cameraModeOff", BCameraModeOff);
|
||||
addAction("/cameraSelfView", BCameraSelfView);
|
||||
addAction("/cameraLayout", BCameraLayout);
|
||||
|
||||
asc.AddAction("/cameraSelect", new Action<string>(SelectCamera));
|
||||
|
||||
// camera presets
|
||||
for(uint i = 0; i < 6; i++)
|
||||
{
|
||||
addAction("/cameraPreset" + (i + 1), BCameraPresetStart + i);
|
||||
}
|
||||
|
||||
asc.AddAction(MessagePath + "/isReady", new Action(PostIsReady));
|
||||
// Get status
|
||||
asc.AddAction(MessagePath + "/fullStatus", new Action(PostFullStatus));
|
||||
// Dial on string
|
||||
asc.AddAction(MessagePath + "/dial", new Action<string>(s =>
|
||||
EISC.SetString(SCurrentDialString, s)));
|
||||
// Pulse DTMF
|
||||
asc.AddAction(MessagePath + "/dtmf", new Action<string>(s =>
|
||||
{
|
||||
if (DTMFMap.ContainsKey(s))
|
||||
{
|
||||
EISC.PulseBool(DTMFMap[s], 100);
|
||||
}
|
||||
}));
|
||||
|
||||
// Directory madness
|
||||
asc.AddAction(MessagePath + "/directoryRoot", new Action(() => EISC.PulseBool(BDirectoryRoot)));
|
||||
asc.AddAction(MessagePath + "/directoryBack", new Action(() => EISC.PulseBool(BDirectoryFolderBack)));
|
||||
asc.AddAction(MessagePath + "/directoryById", new Action<string>(s =>
|
||||
{
|
||||
// the id should contain the line number to forward to simpl
|
||||
try
|
||||
{
|
||||
var u = ushort.Parse(s);
|
||||
EISC.SetUshort(UDirectorySelectRow, u);
|
||||
EISC.PulseBool(BDirectoryLineSelected);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
Debug.Console(1, this, Debug.ErrorLogLevel.Warning,
|
||||
"/directoryById request contains non-numeric ID incompatible with DDVC bridge");
|
||||
}
|
||||
|
||||
}));
|
||||
asc.AddAction(MessagePath + "/directorySelectContact", new Action<string>(s =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var u = ushort.Parse(s);
|
||||
EISC.SetUshort(UDirectorySelectRow, u);
|
||||
EISC.PulseBool(BDirectoryLineSelected);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
}));
|
||||
asc.AddAction(MessagePath + "/directoryDialContact", new Action(() => {
|
||||
EISC.PulseBool(BDirectoryDialSelectedLine);
|
||||
}));
|
||||
asc.AddAction(MessagePath + "/getDirectory", new Action(() =>
|
||||
{
|
||||
if (EISC.GetUshort(UDirectoryRowCount) > 0)
|
||||
{
|
||||
PostDirectory();
|
||||
}
|
||||
else
|
||||
{
|
||||
EISC.PulseBool(BDirectoryRoot);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void PostFullStatus()
|
||||
{
|
||||
this.PostStatusMessage(new
|
||||
{
|
||||
calls = GetCurrentCallList(),
|
||||
cameraMode = GetCameraMode(),
|
||||
cameraSelfView = EISC.GetBool(BCameraSelfView),
|
||||
cameraSupportsAutoMode = EISC.GetBool(BCameraSupportsAutoMode),
|
||||
cameraSupportsOffMode = EISC.GetBool(BCameraSupportsOffMode),
|
||||
currentCallString = EISC.GetString(SCurrentCallNumber),
|
||||
currentDialString = EISC.GetString(SCurrentDialString),
|
||||
directoryContactSelected = new
|
||||
{
|
||||
name = EISC.GetString(SDirectoryEntrySelectedName),
|
||||
number = EISC.GetString(SDirectoryEntrySelectedNumber)
|
||||
},
|
||||
directorySelectedFolderName = EISC.GetString(SDirectorySelectedFolderName),
|
||||
isInCall = EISC.GetString(SHookState) == "Connected",
|
||||
hasDirectory = true,
|
||||
hasDirectorySearch = false,
|
||||
hasRecents = !EISC.BooleanOutput[502].BoolValue,
|
||||
hasCameras = true,
|
||||
showCamerasWhenNotInCall = EISC.BooleanOutput[503].BoolValue,
|
||||
selectedCamera = GetSelectedCamera(),
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void PostDirectory()
|
||||
{
|
||||
var u = EISC.GetUshort(UDirectoryRowCount);
|
||||
var items = new List<object>();
|
||||
for (uint i = 0; i < u; i++)
|
||||
{
|
||||
var name = EISC.GetString(SDirectoryEntriesStart + i);
|
||||
var id = (i + 1).ToString();
|
||||
// is folder or contact?
|
||||
if (name.StartsWith("[+]"))
|
||||
{
|
||||
items.Add(new
|
||||
{
|
||||
folderId = id,
|
||||
name = name
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
items.Add(new
|
||||
{
|
||||
contactId = id,
|
||||
name = name
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var directoryMessage = new
|
||||
{
|
||||
currentDirectory = new
|
||||
{
|
||||
isRootDirectory = EISC.GetBool(BDirectoryIsRoot),
|
||||
directoryResults = items
|
||||
}
|
||||
};
|
||||
PostStatusMessage(directoryMessage);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void PostCameraMode()
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
cameraMode = GetCameraMode()
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="mode"></param>
|
||||
string GetCameraMode()
|
||||
{
|
||||
string m;
|
||||
if (EISC.GetBool(BCameraModeAuto)) m = "auto";
|
||||
else if (EISC.GetBool(BCameraModeManual)) m = "manual";
|
||||
else m = "off";
|
||||
return m;
|
||||
}
|
||||
|
||||
void PostSelectedCamera()
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
selectedCamera = GetSelectedCamera()
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
string GetSelectedCamera()
|
||||
{
|
||||
var num = EISC.GetUshort(UCameraNumberSelect);
|
||||
string m;
|
||||
if (num == 100)
|
||||
{
|
||||
m = "cameraFar";
|
||||
}
|
||||
else
|
||||
{
|
||||
m = "camera" + num;
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void PostIsReady()
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
isReady = true
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void PostCallsList()
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
calls = GetCurrentCallList(),
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="s"></param>
|
||||
void SelectCamera(string s)
|
||||
{
|
||||
var cam = s.Substring(6);
|
||||
if (cam.ToLower() == "far")
|
||||
{
|
||||
EISC.SetUshort(UCameraNumberSelect, 100);
|
||||
}
|
||||
else
|
||||
{
|
||||
EISC.SetUshort(UCameraNumberSelect, UInt16.Parse(cam));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Turns the
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
List<CodecActiveCallItem> GetCurrentCallList()
|
||||
{
|
||||
var list = new List<CodecActiveCallItem>();
|
||||
if (CurrentCallItem.Status != eCodecCallStatus.Disconnected)
|
||||
{
|
||||
list.Add(CurrentCallItem);
|
||||
}
|
||||
if (EISC.GetBool(BCallIncoming)) {
|
||||
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
public class IRunRouteActionMessenger : MessengerBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Device being bridged
|
||||
/// </summary>
|
||||
public IRunRouteAction RoutingDevice {get; private set;}
|
||||
|
||||
public IRunRouteActionMessenger(string key, IRunRouteAction routingDevice, string messagePath)
|
||||
: base(key, messagePath)
|
||||
{
|
||||
if (routingDevice == null)
|
||||
throw new ArgumentNullException("routingDevice");
|
||||
|
||||
RoutingDevice = routingDevice;
|
||||
|
||||
var routingSink = RoutingDevice as IRoutingSinkNoSwitching;
|
||||
|
||||
if (routingSink != null)
|
||||
{
|
||||
routingSink.CurrentSourceChange += new SourceInfoChangeHandler(routingSink_CurrentSourceChange);
|
||||
}
|
||||
}
|
||||
|
||||
void routingSink_CurrentSourceChange(SourceListItem info, ChangeType type)
|
||||
{
|
||||
SendRoutingFullMessageObject();
|
||||
}
|
||||
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
appServerController.AddAction(MessagePath + "/fullStatus", new Action(SendRoutingFullMessageObject));
|
||||
|
||||
appServerController.AddAction(MessagePath + "/source", new Action<SourceSelectMessageContent>(c =>
|
||||
{
|
||||
RoutingDevice.RunRouteAction(c.SourceListItem, c.SourceListKey);
|
||||
}));
|
||||
|
||||
var sinkDevice = RoutingDevice as IRoutingSinkNoSwitching;
|
||||
if(sinkDevice != null)
|
||||
{
|
||||
sinkDevice.CurrentSourceChange += new SourceInfoChangeHandler((o, a) =>
|
||||
{
|
||||
SendRoutingFullMessageObject();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper method to update full status of the routing device
|
||||
/// </summary>
|
||||
void SendRoutingFullMessageObject()
|
||||
{
|
||||
var sinkDevice = RoutingDevice as IRoutingSinkNoSwitching;
|
||||
|
||||
if(sinkDevice != null)
|
||||
{
|
||||
var sourceKey = sinkDevice.CurrentSourceInfoKey;
|
||||
|
||||
if (string.IsNullOrEmpty(sourceKey))
|
||||
sourceKey = "none";
|
||||
|
||||
PostStatusMessage(new
|
||||
{
|
||||
selectedSourceKey = sourceKey
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
230
PepperDashEssentials/AppServer/Messengers/SIMPLAtcMessenger.cs
Normal file
230
PepperDashEssentials/AppServer/Messengers/SIMPLAtcMessenger.cs
Normal file
@@ -0,0 +1,230 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.EthernetCommunication;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
|
||||
namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
public class SIMPLAtcMessenger : MessengerBase
|
||||
{
|
||||
BasicTriList EISC;
|
||||
|
||||
public SIMPLAtcJoinMap JoinMap {get; private set;}
|
||||
|
||||
///// <summary>
|
||||
///// 221
|
||||
///// </summary>
|
||||
//const uint BDialHangupOnHook = 221;
|
||||
|
||||
///// <summary>
|
||||
///// 251
|
||||
///// </summary>
|
||||
//const uint BIncomingAnswer = 251;
|
||||
///// <summary>
|
||||
///// 252
|
||||
///// </summary>
|
||||
//const uint BIncomingReject = 252;
|
||||
///// <summary>
|
||||
///// 241
|
||||
///// </summary>
|
||||
//const uint BSpeedDial1 = 241;
|
||||
///// <summary>
|
||||
///// 242
|
||||
///// </summary>
|
||||
//const uint BSpeedDial2 = 242;
|
||||
///// <summary>
|
||||
///// 243
|
||||
///// </summary>
|
||||
//const uint BSpeedDial3 = 243;
|
||||
///// <summary>
|
||||
///// 244
|
||||
///// </summary>
|
||||
//const uint BSpeedDial4 = 244;
|
||||
|
||||
///// <summary>
|
||||
///// 201
|
||||
///// </summary>
|
||||
//const uint SCurrentDialString = 201;
|
||||
///// <summary>
|
||||
///// 211
|
||||
///// </summary>
|
||||
//const uint SCurrentCallNumber = 211;
|
||||
///// <summary>
|
||||
///// 212
|
||||
///// </summary>
|
||||
//const uint SCurrentCallName = 212;
|
||||
///// <summary>
|
||||
///// 221
|
||||
///// </summary>
|
||||
//const uint SHookState = 221;
|
||||
///// <summary>
|
||||
///// 222
|
||||
///// </summary>
|
||||
//const uint SCallDirection = 222;
|
||||
|
||||
///// <summary>
|
||||
///// 201-212 0-9*#
|
||||
///// </summary>
|
||||
//Dictionary<string, uint> DTMFMap = new Dictionary<string, uint>
|
||||
//{
|
||||
// { "1", 201 },
|
||||
// { "2", 202 },
|
||||
// { "3", 203 },
|
||||
// { "4", 204 },
|
||||
// { "5", 205 },
|
||||
// { "6", 206 },
|
||||
// { "7", 207 },
|
||||
// { "8", 208 },
|
||||
// { "9", 209 },
|
||||
// { "0", 210 },
|
||||
// { "*", 211 },
|
||||
// { "#", 212 },
|
||||
//};
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
CodecActiveCallItem CurrentCallItem;
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="eisc"></param>
|
||||
/// <param name="messagePath"></param>
|
||||
public SIMPLAtcMessenger(string key, BasicTriList eisc, string messagePath)
|
||||
: base(key, messagePath)
|
||||
{
|
||||
EISC = eisc;
|
||||
|
||||
JoinMap = new SIMPLAtcJoinMap();
|
||||
|
||||
// TODO: Take in JoinStart value from config
|
||||
JoinMap.OffsetJoinNumbers(201);
|
||||
|
||||
CurrentCallItem = new CodecActiveCallItem();
|
||||
CurrentCallItem.Type = eCodecCallType.Audio;
|
||||
CurrentCallItem.Id = "-audio-";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void SendFullStatus()
|
||||
{
|
||||
|
||||
|
||||
this.PostStatusMessage(new
|
||||
{
|
||||
calls = GetCurrentCallList(),
|
||||
currentCallString = EISC.GetString(JoinMap.GetJoinForKey(SIMPLAtcJoinMap.CurrentCallName)),
|
||||
currentDialString = EISC.GetString(JoinMap.GetJoinForKey(SIMPLAtcJoinMap.CurrentDialString)),
|
||||
isInCall = EISC.GetString(JoinMap.GetJoinForKey(SIMPLAtcJoinMap.HookState)) == "Connected"
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="appServerController"></param>
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
//EISC.SetStringSigAction(SCurrentDialString, s => PostStatusMessage(new { currentDialString = s }));
|
||||
|
||||
EISC.SetStringSigAction(JoinMap.GetJoinForKey(SIMPLAtcJoinMap.HookState), s =>
|
||||
{
|
||||
CurrentCallItem.Status = (eCodecCallStatus)Enum.Parse(typeof(eCodecCallStatus), s, true);
|
||||
//GetCurrentCallList();
|
||||
SendFullStatus();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(JoinMap.GetJoinForKey(SIMPLAtcJoinMap.CurrentCallNumber), s =>
|
||||
{
|
||||
CurrentCallItem.Number = s;
|
||||
SendCallsList();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(JoinMap.GetJoinForKey(SIMPLAtcJoinMap.CurrentCallName), s =>
|
||||
{
|
||||
CurrentCallItem.Name = s;
|
||||
SendCallsList();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(JoinMap.GetJoinForKey(SIMPLAtcJoinMap.CallDirection), s =>
|
||||
{
|
||||
CurrentCallItem.Direction = (eCodecCallDirection)Enum.Parse(typeof(eCodecCallDirection), s, true);
|
||||
SendCallsList();
|
||||
});
|
||||
|
||||
// Add press and holds using helper
|
||||
Action<string, uint> addPHAction = (s, u) =>
|
||||
AppServerController.AddAction(MessagePath + s, new PressAndHoldAction(b => EISC.SetBool(u, b)));
|
||||
|
||||
// Add straight pulse calls
|
||||
Action<string, uint> addAction = (s, u) =>
|
||||
AppServerController.AddAction(MessagePath + s, new Action(() => EISC.PulseBool(u, 100)));
|
||||
addAction("/endCallById", JoinMap.GetJoinForKey(SIMPLAtcJoinMap.EndCall));
|
||||
addAction("/endAllCalls", JoinMap.GetJoinForKey(SIMPLAtcJoinMap.EndCall));
|
||||
addAction("/acceptById", JoinMap.GetJoinForKey(SIMPLAtcJoinMap.IncomingAnswer));
|
||||
addAction("/rejectById", JoinMap.GetJoinForKey(SIMPLAtcJoinMap.IncomingReject));
|
||||
|
||||
var speeddialStart = JoinMap.GetJoinForKey(SIMPLAtcJoinMap.SpeedDialStart);
|
||||
var speeddialEnd = JoinMap.GetJoinForKey(SIMPLAtcJoinMap.SpeedDialStart) + JoinMap.GetJoinSpanForKey(SIMPLAtcJoinMap.SpeedDialStart);
|
||||
|
||||
var speedDialIndex = 1;
|
||||
for (uint i = speeddialStart; i < speeddialEnd; i++)
|
||||
{
|
||||
addAction(string.Format("/speedDial{0}", speedDialIndex), i);
|
||||
speedDialIndex++;
|
||||
}
|
||||
|
||||
// Get status
|
||||
AppServerController.AddAction(MessagePath + "/fullStatus", new Action(SendFullStatus));
|
||||
// Dial on string
|
||||
AppServerController.AddAction(MessagePath + "/dial", new Action<string>(s => EISC.SetString(JoinMap.GetJoinForKey(SIMPLAtcJoinMap.CurrentDialString), s)));
|
||||
// Pulse DTMF
|
||||
AppServerController.AddAction(MessagePath + "/dtmf", new Action<string>(s =>
|
||||
{
|
||||
var join = JoinMap.GetJoinForKey(s);
|
||||
if (join > 0)
|
||||
{
|
||||
EISC.PulseBool(join, 100);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void SendCallsList()
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
calls = GetCurrentCallList(),
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Turns the
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
List<CodecActiveCallItem> GetCurrentCallList()
|
||||
{
|
||||
if (CurrentCallItem.Status == eCodecCallStatus.Disconnected)
|
||||
{
|
||||
return new List<CodecActiveCallItem>();
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<CodecActiveCallItem>() { CurrentCallItem };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,224 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.EthernetCommunication;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Bridges;
|
||||
using PepperDash.Essentials.Devices.Common.Cameras;
|
||||
|
||||
namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
public class SIMPLCameraMessenger : MessengerBase
|
||||
{
|
||||
BasicTriList EISC;
|
||||
|
||||
CameraControllerJoinMap JoinMap;
|
||||
|
||||
//public class BoolJoin
|
||||
//{
|
||||
// /// <summary>
|
||||
// /// 1
|
||||
// /// </summary>
|
||||
// public const uint CameraControlUp = 1;
|
||||
// /// <summary>
|
||||
// /// 2
|
||||
// /// </summary>
|
||||
// public const uint CameraControlDown = 2;
|
||||
// /// <summary>
|
||||
// /// 3
|
||||
// /// </summary>
|
||||
// public const uint CameraControlLeft = 3;
|
||||
// /// <summary>
|
||||
// /// 4
|
||||
// /// </summary>
|
||||
// public const uint CameraControlRight = 4;
|
||||
// /// <summary>
|
||||
// /// 5
|
||||
// /// </summary>
|
||||
// public const uint CameraControlZoomIn = 5;
|
||||
// /// <summary>
|
||||
// /// 6
|
||||
// /// </summary>
|
||||
// public const uint CameraControlZoomOut = 6;
|
||||
// /// <summary>
|
||||
// /// 10
|
||||
// /// </summary>
|
||||
// public const uint CameraHasPresets = 10;
|
||||
// /// <summary>
|
||||
// /// 11 - 20
|
||||
// /// </summary>
|
||||
// public const uint CameraPresetStart = 10;
|
||||
|
||||
// /// <summary>
|
||||
// /// 21
|
||||
// /// </summary>
|
||||
// public const uint CameraModeAuto = 21;
|
||||
// /// <summary>
|
||||
// /// 22
|
||||
// /// </summary>
|
||||
// public const uint CameraModeManual = 22;
|
||||
// /// <summary>
|
||||
// /// 23
|
||||
// /// </summary>
|
||||
// public const uint CameraModeOff = 23;
|
||||
// /// <summary>
|
||||
// /// 24
|
||||
// /// </summary>
|
||||
// public const uint CameraSupportsModeAuto = 24;
|
||||
// /// <summary>
|
||||
// /// 25
|
||||
// /// </summary>
|
||||
// public const uint CameraSupportsModeOff = 25;
|
||||
//}
|
||||
|
||||
//public class UshortJoin
|
||||
//{
|
||||
// /// <summary>
|
||||
// /// 10
|
||||
// /// </summary>
|
||||
// public const uint CameraPresetCount = 10;
|
||||
//}
|
||||
|
||||
//public class StringJoin
|
||||
//{
|
||||
// /// <summary>
|
||||
// /// 11-20
|
||||
// /// </summary>
|
||||
// public const uint CameraPresetNameStart = 10;
|
||||
//}
|
||||
|
||||
public SIMPLCameraMessenger(string key, BasicTriList eisc, string messagePath, uint joinStart)
|
||||
: base(key, messagePath)
|
||||
{
|
||||
EISC = eisc;
|
||||
//JoinStart = joinStart - 1;
|
||||
JoinMap = new CameraControllerJoinMap();
|
||||
|
||||
JoinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
|
||||
EISC.SetUShortSigAction(JoinMap.GetJoinForKey(CameraControllerJoinMap.NumberOfPresets), (u) => SendCameraFullMessageObject());
|
||||
|
||||
EISC.SetBoolSigAction(JoinMap.GetJoinForKey(CameraControllerJoinMap.CameraModeAuto), (b) => PostCameraMode());
|
||||
EISC.SetBoolSigAction(JoinMap.GetJoinForKey(CameraControllerJoinMap.CameraModeManual), (b) => PostCameraMode());
|
||||
EISC.SetBoolSigAction(JoinMap.GetJoinForKey(CameraControllerJoinMap.CameraModeOff), (b) => PostCameraMode());
|
||||
}
|
||||
|
||||
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
var asc = appServerController;
|
||||
|
||||
asc.AddAction(MessagePath + "/fullStatus", new Action(SendCameraFullMessageObject));
|
||||
|
||||
// Add press and holds using helper action
|
||||
Action<string, uint> addPHAction = (s, u) =>
|
||||
asc.AddAction(MessagePath + s, new PressAndHoldAction(b => EISC.SetBool(u, b)));
|
||||
addPHAction("/cameraUp", JoinMap.GetJoinForKey(CameraControllerJoinMap.TiltUp));
|
||||
addPHAction("/cameraDown", JoinMap.GetJoinForKey(CameraControllerJoinMap.TiltDown));
|
||||
addPHAction("/cameraLeft", JoinMap.GetJoinForKey(CameraControllerJoinMap.PanLeft));
|
||||
addPHAction("/cameraRight", JoinMap.GetJoinForKey(CameraControllerJoinMap.PanRight));
|
||||
addPHAction("/cameraZoomIn", JoinMap.GetJoinForKey(CameraControllerJoinMap.ZoomIn));
|
||||
addPHAction("/cameraZoomOut", JoinMap.GetJoinForKey(CameraControllerJoinMap.ZoomOut));
|
||||
|
||||
Action<string, uint> addAction = (s, u) =>
|
||||
asc.AddAction(MessagePath + s, new Action(() => EISC.PulseBool(u, 100)));
|
||||
|
||||
addAction("/cameraModeAuto", JoinMap.GetJoinForKey(CameraControllerJoinMap.CameraModeAuto));
|
||||
addAction("/cameraModeManual", JoinMap.GetJoinForKey(CameraControllerJoinMap.CameraModeManual));
|
||||
addAction("/cameraModeOff", JoinMap.GetJoinForKey(CameraControllerJoinMap.CameraModeOff));
|
||||
|
||||
var presetStart = JoinMap.GetJoinForKey(CameraControllerJoinMap.PresetRecallStart);
|
||||
var presetEnd = JoinMap.GetJoinForKey(CameraControllerJoinMap.PresetRecallStart) + JoinMap.GetJoinSpanForKey(CameraControllerJoinMap.PresetRecallStart);
|
||||
|
||||
int presetId = 1;
|
||||
// camera presets
|
||||
for (uint i = presetStart; i <= presetEnd; i++)
|
||||
{
|
||||
addAction("/cameraPreset" + (presetId), i);
|
||||
presetId++;
|
||||
}
|
||||
}
|
||||
|
||||
public void CustomUnregsiterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
appServerController.RemoveAction(MessagePath + "/fullStatus");
|
||||
|
||||
appServerController.RemoveAction(MessagePath + "/cameraUp");
|
||||
appServerController.RemoveAction(MessagePath + "/cameraDown");
|
||||
appServerController.RemoveAction(MessagePath + "/cameraLeft");
|
||||
appServerController.RemoveAction(MessagePath + "/cameraRight");
|
||||
appServerController.RemoveAction(MessagePath + "/cameraZoomIn");
|
||||
appServerController.RemoveAction(MessagePath + "/cameraZoomOut");
|
||||
appServerController.RemoveAction(MessagePath + "/cameraModeAuto");
|
||||
appServerController.RemoveAction(MessagePath + "/cameraModeManual");
|
||||
appServerController.RemoveAction(MessagePath + "/cameraModeOff");
|
||||
|
||||
EISC.SetUShortSigAction(JoinMap.GetJoinForKey(CameraControllerJoinMap.NumberOfPresets), null);
|
||||
|
||||
EISC.SetBoolSigAction(JoinMap.GetJoinForKey(CameraControllerJoinMap.CameraModeAuto), null);
|
||||
EISC.SetBoolSigAction(JoinMap.GetJoinForKey(CameraControllerJoinMap.CameraModeManual), null);
|
||||
EISC.SetBoolSigAction(JoinMap.GetJoinForKey(CameraControllerJoinMap.CameraModeOff), null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper method to update the full status of the camera
|
||||
/// </summary>
|
||||
void SendCameraFullMessageObject()
|
||||
{
|
||||
var presetList = new List<CameraPreset>();
|
||||
|
||||
// Build a list of camera presets based on the names and count
|
||||
if (EISC.GetBool(JoinMap.GetJoinForKey(CameraControllerJoinMap.SupportsPresets)))
|
||||
{
|
||||
var presetStart = JoinMap.GetJoinForKey(CameraControllerJoinMap.PresetLabelStart);
|
||||
var presetEnd = JoinMap.GetJoinForKey(CameraControllerJoinMap.PresetLabelStart) + JoinMap.GetJoinForKey(CameraControllerJoinMap.NumberOfPresets);
|
||||
|
||||
var presetId = 1;
|
||||
for (uint i = presetStart; i < presetEnd; i++)
|
||||
{
|
||||
var presetName = EISC.GetString(i);
|
||||
var preset = new CameraPreset(presetId, presetName, string.IsNullOrEmpty(presetName), true);
|
||||
presetList.Add(preset);
|
||||
presetId++;
|
||||
}
|
||||
}
|
||||
|
||||
PostStatusMessage(new
|
||||
{
|
||||
cameraMode = GetCameraMode(),
|
||||
hasPresets = EISC.GetBool(JoinMap.GetJoinForKey(CameraControllerJoinMap.SupportsPresets)),
|
||||
presets = presetList
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void PostCameraMode()
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
cameraMode = GetCameraMode()
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Computes the current camera mode
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
string GetCameraMode()
|
||||
{
|
||||
string m;
|
||||
if (EISC.GetBool(JoinMap.GetJoinForKey(CameraControllerJoinMap.CameraModeAuto))) m = eCameraControlMode.Auto.ToString().ToLower();
|
||||
else if (EISC.GetBool(JoinMap.GetJoinForKey(CameraControllerJoinMap.CameraModeManual))) m = eCameraControlMode.Manual.ToString().ToLower();
|
||||
else m = eCameraControlMode.Off.ToString().ToLower();
|
||||
return m;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
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.Core;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
public class SIMPLRouteMessenger : MessengerBase
|
||||
{
|
||||
BasicTriList EISC;
|
||||
|
||||
uint JoinStart;
|
||||
|
||||
public class StringJoin
|
||||
{
|
||||
/// <summary>
|
||||
/// 1
|
||||
/// </summary>
|
||||
public const uint CurrentSource = 1;
|
||||
}
|
||||
|
||||
public SIMPLRouteMessenger(string key, BasicTriList eisc, string messagePath, uint joinStart)
|
||||
: base(key, messagePath)
|
||||
{
|
||||
EISC = eisc;
|
||||
JoinStart = joinStart - 1;
|
||||
|
||||
EISC.SetStringSigAction(JoinStart + StringJoin.CurrentSource, (s) => SendRoutingFullMessageObject(s));
|
||||
}
|
||||
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
appServerController.AddAction(MessagePath + "/fullStatus", new Action(() =>
|
||||
{
|
||||
SendRoutingFullMessageObject(EISC.GetString(JoinStart + StringJoin.CurrentSource));
|
||||
}));
|
||||
|
||||
appServerController.AddAction(MessagePath +"/source", new Action<SourceSelectMessageContent>(c =>
|
||||
{
|
||||
EISC.SetString(JoinStart + StringJoin.CurrentSource, c.SourceListItem);
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
public void CustomUnregsiterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
appServerController.RemoveAction(MessagePath + "/fullStatus");
|
||||
appServerController.RemoveAction(MessagePath + "/source");
|
||||
|
||||
EISC.SetStringSigAction(JoinStart + StringJoin.CurrentSource, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper method to update full status of the routing device
|
||||
/// </summary>
|
||||
void SendRoutingFullMessageObject(string sourceKey)
|
||||
{
|
||||
if (string.IsNullOrEmpty(sourceKey))
|
||||
sourceKey = "none";
|
||||
|
||||
PostStatusMessage(new
|
||||
{
|
||||
selectedSourceKey = sourceKey
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
665
PepperDashEssentials/AppServer/Messengers/SIMPLVtcMessenger.cs
Normal file
665
PepperDashEssentials/AppServer/Messengers/SIMPLVtcMessenger.cs
Normal file
@@ -0,0 +1,665 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.EthernetCommunication;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
using PepperDash.Essentials.Devices.Common.Cameras;
|
||||
|
||||
namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
public class SIMPLVtcMessenger : MessengerBase
|
||||
{
|
||||
BasicTriList EISC;
|
||||
|
||||
public SIMPLVtcJoinMap JoinMap { get; private set; }
|
||||
|
||||
///********* Bools *********/
|
||||
///// <summary>
|
||||
///// 724
|
||||
///// </summary>
|
||||
//const uint BDialHangup = 724;
|
||||
///// <summary>
|
||||
///// 750
|
||||
///// </summary>
|
||||
//const uint BCallIncoming = 750;
|
||||
///// <summary>
|
||||
///// 751
|
||||
///// </summary>
|
||||
//const uint BIncomingAnswer = 751;
|
||||
///// <summary>
|
||||
///// 752
|
||||
///// </summary>
|
||||
//const uint BIncomingReject = 752;
|
||||
///// <summary>
|
||||
///// 741
|
||||
///// </summary>
|
||||
//const uint BSpeedDial1 = 741;
|
||||
///// <summary>
|
||||
///// 742
|
||||
///// </summary>
|
||||
//const uint BSpeedDial2 = 742;
|
||||
///// <summary>
|
||||
///// 743
|
||||
///// </summary>
|
||||
//const uint BSpeedDial3 = 743;
|
||||
///// <summary>
|
||||
///// 744
|
||||
///// </summary>
|
||||
//const uint BSpeedDial4 = 744;
|
||||
///// <summary>
|
||||
///// 800
|
||||
///// </summary>
|
||||
//const uint BDirectorySearchBusy = 800;
|
||||
///// <summary>
|
||||
///// 801
|
||||
///// </summary>
|
||||
//const uint BDirectoryLineSelected = 801;
|
||||
///// <summary>
|
||||
///// 801 when selected entry is a contact
|
||||
///// </summary>
|
||||
//const uint BDirectoryEntryIsContact = 801;
|
||||
///// <summary>
|
||||
///// 802 To show/hide back button
|
||||
///// </summary>
|
||||
//const uint BDirectoryIsRoot = 802;
|
||||
///// <summary>
|
||||
///// 803 Pulse from system to inform us when directory is ready
|
||||
///// </summary>
|
||||
//const uint BDirectoryHasChanged = 803;
|
||||
///// <summary>
|
||||
///// 804
|
||||
///// </summary>
|
||||
//const uint BDirectoryRoot = 804;
|
||||
///// <summary>
|
||||
///// 805
|
||||
///// </summary>
|
||||
//const uint BDirectoryFolderBack = 805;
|
||||
///// <summary>
|
||||
///// 806
|
||||
///// </summary>
|
||||
//const uint BDirectoryDialSelectedLine = 806;
|
||||
///// <summary>
|
||||
///// 811
|
||||
///// </summary>
|
||||
//const uint BCameraControlUp = 811;
|
||||
///// <summary>
|
||||
///// 812
|
||||
///// </summary>
|
||||
//const uint BCameraControlDown = 812;
|
||||
///// <summary>
|
||||
///// 813
|
||||
///// </summary>
|
||||
//const uint BCameraControlLeft = 813;
|
||||
///// <summary>
|
||||
///// 814
|
||||
///// </summary>
|
||||
//const uint BCameraControlRight = 814;
|
||||
///// <summary>
|
||||
///// 815
|
||||
///// </summary>
|
||||
//const uint BCameraControlZoomIn = 815;
|
||||
///// <summary>
|
||||
///// 816
|
||||
///// </summary>
|
||||
//const uint BCameraControlZoomOut = 816;
|
||||
///// <summary>
|
||||
///// 821 - 826
|
||||
///// </summary>
|
||||
//const uint BCameraPresetStart = 821;
|
||||
|
||||
///// <summary>
|
||||
///// 831
|
||||
///// </summary>
|
||||
//const uint BCameraModeAuto = 831;
|
||||
///// <summary>
|
||||
///// 832
|
||||
///// </summary>
|
||||
//const uint BCameraModeManual = 832;
|
||||
///// <summary>
|
||||
///// 833
|
||||
///// </summary>
|
||||
//const uint BCameraModeOff = 833;
|
||||
|
||||
///// <summary>
|
||||
///// 841
|
||||
///// </summary>
|
||||
//const uint BCameraSelfView = 841;
|
||||
|
||||
///// <summary>
|
||||
///// 842
|
||||
///// </summary>
|
||||
//const uint BCameraLayout = 842;
|
||||
///// <summary>
|
||||
///// 843
|
||||
///// </summary>
|
||||
//const uint BCameraSupportsAutoMode = 843;
|
||||
///// <summary>
|
||||
///// 844
|
||||
///// </summary>
|
||||
//const uint BCameraSupportsOffMode = 844;
|
||||
|
||||
|
||||
///********* Ushorts *********/
|
||||
///// <summary>
|
||||
///// 760
|
||||
///// </summary>
|
||||
//const uint UCameraNumberSelect = 760;
|
||||
///// <summary>
|
||||
///// 801
|
||||
///// </summary>
|
||||
//const uint UDirectorySelectRow = 801;
|
||||
///// <summary>
|
||||
///// 801
|
||||
///// </summary>
|
||||
//const uint UDirectoryRowCount = 801;
|
||||
|
||||
|
||||
|
||||
///********* Strings *********/
|
||||
///// <summary>
|
||||
///// 701
|
||||
///// </summary>
|
||||
//const uint SCurrentDialString = 701;
|
||||
///// <summary>
|
||||
///// 702
|
||||
///// </summary>
|
||||
//const uint SCurrentCallName = 702;
|
||||
///// <summary>
|
||||
///// 703
|
||||
///// </summary>
|
||||
//const uint SCurrentCallNumber = 703;
|
||||
///// <summary>
|
||||
///// 731
|
||||
///// </summary>
|
||||
//const uint SHookState = 731;
|
||||
///// <summary>
|
||||
///// 722
|
||||
///// </summary>
|
||||
//const uint SCallDirection = 722;
|
||||
///// <summary>
|
||||
///// 751
|
||||
///// </summary>
|
||||
//const uint SIncomingCallName = 751;
|
||||
///// <summary>
|
||||
///// 752
|
||||
///// </summary>
|
||||
//const uint SIncomingCallNumber = 752;
|
||||
|
||||
///// <summary>
|
||||
///// 800
|
||||
///// </summary>
|
||||
//const uint SDirectorySearchString = 800;
|
||||
///// <summary>
|
||||
///// 801-1055
|
||||
///// </summary>
|
||||
//const uint SDirectoryEntriesStart = 801;
|
||||
///// <summary>
|
||||
///// 1056
|
||||
///// </summary>
|
||||
//const uint SDirectoryEntrySelectedName = 1056;
|
||||
///// <summary>
|
||||
///// 1057
|
||||
///// </summary>
|
||||
//const uint SDirectoryEntrySelectedNumber = 1057;
|
||||
///// <summary>
|
||||
///// 1058
|
||||
///// </summary>
|
||||
//const uint SDirectorySelectedFolderName = 1058;
|
||||
|
||||
|
||||
///// <summary>
|
||||
///// 701-712 0-9*#
|
||||
///// </summary>
|
||||
//Dictionary<string, uint> DTMFMap = new Dictionary<string, uint>
|
||||
//{
|
||||
// { "1", 701 },
|
||||
// { "2", 702 },
|
||||
// { "3", 703 },
|
||||
// { "4", 704 },
|
||||
// { "5", 705 },
|
||||
// { "6", 706 },
|
||||
// { "7", 707 },
|
||||
// { "8", 708 },
|
||||
// { "9", 709 },
|
||||
// { "0", 710 },
|
||||
// { "*", 711 },
|
||||
// { "#", 712 },
|
||||
//};
|
||||
|
||||
CodecActiveCallItem CurrentCallItem;
|
||||
CodecActiveCallItem IncomingCallItem;
|
||||
|
||||
ushort PreviousDirectoryLength = 701;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="eisc"></param>
|
||||
/// <param name="messagePath"></param>
|
||||
public SIMPLVtcMessenger(string key, BasicTriList eisc, string messagePath)
|
||||
: base(key, messagePath)
|
||||
{
|
||||
EISC = eisc;
|
||||
|
||||
JoinMap = new SIMPLVtcJoinMap();
|
||||
|
||||
// TODO: Take in JoinStart value from config
|
||||
JoinMap.OffsetJoinNumbers(701);
|
||||
|
||||
|
||||
CurrentCallItem = new CodecActiveCallItem();
|
||||
CurrentCallItem.Type = eCodecCallType.Video;
|
||||
CurrentCallItem.Id = "-video-";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="appServerController"></param>
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
var asc = appServerController;
|
||||
EISC.SetStringSigAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.HookState), s =>
|
||||
{
|
||||
CurrentCallItem.Status = (eCodecCallStatus)Enum.Parse(typeof(eCodecCallStatus), s, true);
|
||||
PostFullStatus(); // SendCallsList();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CurrentCallNumber), s =>
|
||||
{
|
||||
CurrentCallItem.Number = s;
|
||||
PostCallsList();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CurrentCallName), s =>
|
||||
{
|
||||
CurrentCallItem.Name = s;
|
||||
PostCallsList();
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CallDirection), s =>
|
||||
{
|
||||
CurrentCallItem.Direction = (eCodecCallDirection)Enum.Parse(typeof(eCodecCallDirection), s, true);
|
||||
PostCallsList();
|
||||
});
|
||||
|
||||
EISC.SetBoolSigAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.IncomingCall), b =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
var ica = new CodecActiveCallItem()
|
||||
{
|
||||
Direction = eCodecCallDirection.Incoming,
|
||||
Id = "-video-incoming",
|
||||
Name = EISC.GetString(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.IncomingCallName)),
|
||||
Number = EISC.GetString(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.IncomingCallNumber)),
|
||||
Status = eCodecCallStatus.Ringing,
|
||||
Type = eCodecCallType.Video
|
||||
};
|
||||
IncomingCallItem = ica;
|
||||
}
|
||||
else
|
||||
{
|
||||
IncomingCallItem = null;
|
||||
}
|
||||
PostCallsList();
|
||||
});
|
||||
|
||||
EISC.SetBoolSigAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraSupportsAutoMode), b =>
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
cameraSupportsAutoMode = b
|
||||
});
|
||||
});
|
||||
EISC.SetBoolSigAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraSupportsOffMode), b =>
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
cameraSupportsOffMode = b
|
||||
});
|
||||
});
|
||||
|
||||
// Directory insanity
|
||||
EISC.SetUShortSigAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryRowCount), u =>
|
||||
{
|
||||
// The length of the list comes in before the list does.
|
||||
// Splice the sig change operation onto the last string sig that will be changing
|
||||
// when the directory entries make it through.
|
||||
if (PreviousDirectoryLength > 0)
|
||||
{
|
||||
EISC.ClearStringSigAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryEntriesStart) + PreviousDirectoryLength - 1);
|
||||
}
|
||||
EISC.SetStringSigAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryEntriesStart) + u - 1, s => PostDirectory());
|
||||
PreviousDirectoryLength = u;
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryEntrySelectedName), s =>
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
directoryContactSelected = new
|
||||
{
|
||||
name = EISC.GetString(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryEntrySelectedName)),
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryEntrySelectedNumber), s =>
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
directoryContactSelected = new
|
||||
{
|
||||
number = EISC.GetString(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryEntrySelectedNumber)),
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
EISC.SetStringSigAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectorySelectedFolderName), s => PostStatusMessage(new
|
||||
{
|
||||
directorySelectedFolderName = EISC.GetString(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectorySelectedFolderName))
|
||||
}));
|
||||
|
||||
EISC.SetSigTrueAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraModeAuto), () => PostCameraMode());
|
||||
EISC.SetSigTrueAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraModeManual), () => PostCameraMode());
|
||||
EISC.SetSigTrueAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraModeOff), () => PostCameraMode());
|
||||
|
||||
EISC.SetBoolSigAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraSelfView), b => PostStatusMessage(new
|
||||
{
|
||||
cameraSelfView = b
|
||||
}));
|
||||
|
||||
EISC.SetUShortSigAction(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraNumberSelect), (u) => PostSelectedCamera());
|
||||
|
||||
|
||||
// Add press and holds using helper action
|
||||
Action<string, uint> addPHAction = (s, u) =>
|
||||
AppServerController.AddAction(MessagePath + s, new PressAndHoldAction(b => EISC.SetBool(u, b)));
|
||||
addPHAction("/cameraUp", JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraTiltUp));
|
||||
addPHAction("/cameraDown", JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraTiltDown));
|
||||
addPHAction("/cameraLeft", JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraPanLeft));
|
||||
addPHAction("/cameraRight", JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraPanRight));
|
||||
addPHAction("/cameraZoomIn", JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraZoomIn));
|
||||
addPHAction("/cameraZoomOut", JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraZoomOut));
|
||||
|
||||
// Add straight pulse calls using helper action
|
||||
Action<string, uint> addAction = (s, u) =>
|
||||
AppServerController.AddAction(MessagePath + s, new Action(() => EISC.PulseBool(u, 100)));
|
||||
addAction("/endCallById", JoinMap.GetJoinForKey(SIMPLVtcJoinMap.EndCall));
|
||||
addAction("/endAllCalls", JoinMap.GetJoinForKey(SIMPLVtcJoinMap.EndCall));
|
||||
addAction("/acceptById", JoinMap.GetJoinForKey(SIMPLVtcJoinMap.IncomingAnswer));
|
||||
addAction("/rejectById", JoinMap.GetJoinForKey(SIMPLVtcJoinMap.IncomingReject));
|
||||
|
||||
var speeddialStart = JoinMap.GetJoinForKey(SIMPLAtcJoinMap.SpeedDialStart);
|
||||
var speeddialEnd = JoinMap.GetJoinForKey(SIMPLAtcJoinMap.SpeedDialStart) + JoinMap.GetJoinSpanForKey(SIMPLAtcJoinMap.SpeedDialStart);
|
||||
|
||||
var speedDialIndex = 1;
|
||||
for (uint i = speeddialStart; i < speeddialEnd; i++)
|
||||
{
|
||||
addAction(string.Format("/speedDial{0}", speedDialIndex), i);
|
||||
speedDialIndex++;
|
||||
}
|
||||
|
||||
addAction("/cameraModeAuto", JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraModeAuto));
|
||||
addAction("/cameraModeManual", JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraModeManual));
|
||||
addAction("/cameraModeOff", JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraModeOff));
|
||||
addAction("/cameraSelfView", JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraSelfView));
|
||||
addAction("/cameraLayout", JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraLayout));
|
||||
|
||||
asc.AddAction("/cameraSelect", new Action<string>(SelectCamera));
|
||||
|
||||
// camera presets
|
||||
for(uint i = 0; i < 6; i++)
|
||||
{
|
||||
addAction("/cameraPreset" + (i + 1), JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraPresetStart) + i);
|
||||
}
|
||||
|
||||
asc.AddAction(MessagePath + "/isReady", new Action(PostIsReady));
|
||||
// Get status
|
||||
asc.AddAction(MessagePath + "/fullStatus", new Action(PostFullStatus));
|
||||
// Dial on string
|
||||
asc.AddAction(MessagePath + "/dial", new Action<string>(s =>
|
||||
EISC.SetString(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CurrentDialString), s)));
|
||||
// Pulse DTMF
|
||||
AppServerController.AddAction(MessagePath + "/dtmf", new Action<string>(s =>
|
||||
{
|
||||
var join = JoinMap.GetJoinForKey(s);
|
||||
if (join > 0)
|
||||
{
|
||||
EISC.PulseBool(join, 100);
|
||||
}
|
||||
}));
|
||||
|
||||
// Directory madness
|
||||
asc.AddAction(MessagePath + "/directoryRoot", new Action(() => EISC.PulseBool(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryRoot))));
|
||||
asc.AddAction(MessagePath + "/directoryBack", new Action(() => EISC.PulseBool(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryFolderBack))));
|
||||
asc.AddAction(MessagePath + "/directoryById", new Action<string>(s =>
|
||||
{
|
||||
// the id should contain the line number to forward to simpl
|
||||
try
|
||||
{
|
||||
var u = ushort.Parse(s);
|
||||
EISC.SetUshort(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectorySelectRow), u);
|
||||
EISC.PulseBool(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryLineSelected));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
Debug.Console(1, this, Debug.ErrorLogLevel.Warning,
|
||||
"/directoryById request contains non-numeric ID incompatible with DDVC bridge");
|
||||
}
|
||||
|
||||
}));
|
||||
asc.AddAction(MessagePath + "/directorySelectContact", new Action<string>(s =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var u = ushort.Parse(s);
|
||||
EISC.SetUshort(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectorySelectRow), u);
|
||||
EISC.PulseBool(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryLineSelected));
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
}));
|
||||
asc.AddAction(MessagePath + "/directoryDialContact", new Action(() => {
|
||||
EISC.PulseBool(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryDialSelectedLine));
|
||||
}));
|
||||
asc.AddAction(MessagePath + "/getDirectory", new Action(() =>
|
||||
{
|
||||
if (EISC.GetUshort(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryRowCount)) > 0)
|
||||
{
|
||||
PostDirectory();
|
||||
}
|
||||
else
|
||||
{
|
||||
EISC.PulseBool(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryRoot));
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void PostFullStatus()
|
||||
{
|
||||
this.PostStatusMessage(new
|
||||
{
|
||||
calls = GetCurrentCallList(),
|
||||
cameraMode = GetCameraMode(),
|
||||
cameraSelfView = EISC.GetBool(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraSelfView)),
|
||||
cameraSupportsAutoMode = EISC.GetBool(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraSupportsAutoMode)),
|
||||
cameraSupportsOffMode = EISC.GetBool(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraSupportsOffMode)),
|
||||
currentCallString = EISC.GetString(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CurrentCallNumber)),
|
||||
currentDialString = EISC.GetString(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CurrentDialString)),
|
||||
directoryContactSelected = new
|
||||
{
|
||||
name = EISC.GetString(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryEntrySelectedName)),
|
||||
number = EISC.GetString(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryEntrySelectedNumber))
|
||||
},
|
||||
directorySelectedFolderName = EISC.GetString(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectorySelectedFolderName)),
|
||||
isInCall = EISC.GetString(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.HookState)) == "Connected",
|
||||
hasDirectory = true,
|
||||
hasDirectorySearch = false,
|
||||
hasRecents = !EISC.BooleanOutput[502].BoolValue,
|
||||
hasCameras = true,
|
||||
showCamerasWhenNotInCall = EISC.BooleanOutput[503].BoolValue,
|
||||
selectedCamera = GetSelectedCamera(),
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void PostDirectory()
|
||||
{
|
||||
var u = EISC.GetUshort(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryRowCount));
|
||||
var items = new List<object>();
|
||||
for (uint i = 0; i < u; i++)
|
||||
{
|
||||
var name = EISC.GetString(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryEntriesStart) + i);
|
||||
var id = (i + 1).ToString();
|
||||
// is folder or contact?
|
||||
if (name.StartsWith("[+]"))
|
||||
{
|
||||
items.Add(new
|
||||
{
|
||||
folderId = id,
|
||||
name = name
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
items.Add(new
|
||||
{
|
||||
contactId = id,
|
||||
name = name
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var directoryMessage = new
|
||||
{
|
||||
currentDirectory = new
|
||||
{
|
||||
isRootDirectory = EISC.GetBool(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.DirectoryIsRoot)),
|
||||
directoryResults = items
|
||||
}
|
||||
};
|
||||
PostStatusMessage(directoryMessage);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void PostCameraMode()
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
cameraMode = GetCameraMode()
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="mode"></param>
|
||||
string GetCameraMode()
|
||||
{
|
||||
string m;
|
||||
if (EISC.GetBool(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraModeAuto))) m = eCameraControlMode.Auto.ToString().ToLower();
|
||||
else if (EISC.GetBool(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraModeManual))) m = eCameraControlMode.Manual.ToString().ToLower();
|
||||
else m = eCameraControlMode.Off.ToString().ToLower();
|
||||
return m;
|
||||
}
|
||||
|
||||
void PostSelectedCamera()
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
selectedCamera = GetSelectedCamera()
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
string GetSelectedCamera()
|
||||
{
|
||||
var num = EISC.GetUshort(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraNumberSelect));
|
||||
string m;
|
||||
if (num == 100)
|
||||
{
|
||||
m = "cameraFar";
|
||||
}
|
||||
else
|
||||
{
|
||||
m = "camera" + num;
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void PostIsReady()
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
isReady = true
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void PostCallsList()
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
calls = GetCurrentCallList(),
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="s"></param>
|
||||
void SelectCamera(string s)
|
||||
{
|
||||
var cam = s.Substring(6);
|
||||
if (cam.ToLower() == "far")
|
||||
{
|
||||
EISC.SetUshort(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraNumberSelect), 100);
|
||||
}
|
||||
else
|
||||
{
|
||||
EISC.SetUshort(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.CameraNumberSelect), UInt16.Parse(cam));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Turns the
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
List<CodecActiveCallItem> GetCurrentCallList()
|
||||
{
|
||||
var list = new List<CodecActiveCallItem>();
|
||||
if (CurrentCallItem.Status != eCodecCallStatus.Disconnected)
|
||||
{
|
||||
list.Add(CurrentCallItem);
|
||||
}
|
||||
if (EISC.GetBool(JoinMap.GetJoinForKey(SIMPLVtcJoinMap.IncomingCall))) {
|
||||
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Essentials.Bridges;
|
||||
|
||||
namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
/// <summary>
|
||||
/// Properties to configure a SIMPL Messenger
|
||||
/// </summary>
|
||||
public class SimplMessengerPropertiesConfig : EiscApiPropertiesConfig.ApiDevicePropertiesConfig
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,8 @@ using Crestron.SimplSharp;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
using PepperDash.Core;
|
||||
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
using PepperDash.Essentials.Devices.Common.Cameras;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||
@@ -202,6 +204,59 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
appServerController.AddAction(MessagePath + "/getCallHistory", new Action(GetCallHistory));
|
||||
}
|
||||
var cameraCodec = Codec as IHasCodecCameras;
|
||||
if (cameraCodec != null)
|
||||
{
|
||||
Debug.Console(2, this, "Adding IHasCodecCameras Actions");
|
||||
|
||||
cameraCodec.CameraSelected += new EventHandler<CameraSelectedEventArgs>(cameraCodec_CameraSelected);
|
||||
|
||||
appServerController.AddAction(MessagePath + "/cameraSelect", new Action<string>(s => cameraCodec.SelectCamera(s)));
|
||||
|
||||
MapCameraActions();
|
||||
|
||||
var presetsCodec = Codec as IHasCodecRoomPresets;
|
||||
if (presetsCodec != null)
|
||||
{
|
||||
Debug.Console(2, this, "Adding IHasCodecRoomPresets Actions");
|
||||
|
||||
presetsCodec.CodecRoomPresetsListHasChanged += new EventHandler<EventArgs>(presetsCodec_CameraPresetsListHasChanged);
|
||||
|
||||
appServerController.AddAction(MessagePath + "/cameraPreset", new Action<int>(u => presetsCodec.CodecRoomPresetSelect(u)));
|
||||
appServerController.AddAction(MessagePath + "/cameraPresetStore", new Action<CodecRoomPreset>(p => presetsCodec.CodecRoomPresetStore(p.ID, p.Description)));
|
||||
}
|
||||
|
||||
var speakerTrackCodec = Codec as IHasCameraAutoMode;
|
||||
if (speakerTrackCodec != null)
|
||||
{
|
||||
Debug.Console(2, this, "Adding IHasCameraAutoMode Actions");
|
||||
|
||||
speakerTrackCodec.CameraAutoModeIsOnFeedback.OutputChange += new EventHandler<PepperDash.Essentials.Core.FeedbackEventArgs>(CameraAutoModeIsOnFeedback_OutputChange);
|
||||
|
||||
appServerController.AddAction(MessagePath + "/cameraAuto", new Action(speakerTrackCodec.CameraAutoModeOn));
|
||||
appServerController.AddAction(MessagePath + "/cameraManual", new Action(speakerTrackCodec.CameraAutoModeOff));
|
||||
}
|
||||
}
|
||||
|
||||
var selfViewCodec = Codec as IHasCodecSelfView;
|
||||
|
||||
if (selfViewCodec != null)
|
||||
{
|
||||
Debug.Console(2, this, "Adding IHasCodecSelfView Actions");
|
||||
|
||||
appServerController.AddAction(MessagePath + "/cameraSelfView", new Action(selfViewCodec.SelfViewModeToggle));
|
||||
}
|
||||
|
||||
var layoutsCodec = Codec as IHasCodecLayouts;
|
||||
|
||||
if (layoutsCodec != null)
|
||||
{
|
||||
Debug.Console(2, this, "Adding IHasCodecLayouts Actions");
|
||||
|
||||
appServerController.AddAction(MessagePath + "/cameraRemoteView", new Action(layoutsCodec.LocalLayoutToggle));
|
||||
}
|
||||
|
||||
Debug.Console(2, this, "Adding Privacy & Standby Actions");
|
||||
|
||||
appServerController.AddAction(MessagePath + "/privacyModeOn", new Action(Codec.PrivacyModeOn));
|
||||
appServerController.AddAction(MessagePath + "/privacyModeOff", new Action(Codec.PrivacyModeOff));
|
||||
@@ -212,6 +267,89 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
appServerController.AddAction(MessagePath + "/standbyOff", new Action(Codec.StandbyDeactivate));
|
||||
}
|
||||
|
||||
void presetsCodec_CameraPresetsListHasChanged(object sender, EventArgs e)
|
||||
{
|
||||
PostCameraPresets();
|
||||
}
|
||||
|
||||
void CameraAutoModeIsOnFeedback_OutputChange(object sender, PepperDash.Essentials.Core.FeedbackEventArgs e)
|
||||
{
|
||||
PostCameraMode();
|
||||
}
|
||||
|
||||
|
||||
void cameraCodec_CameraSelected(object sender, CameraSelectedEventArgs e)
|
||||
{
|
||||
MapCameraActions();
|
||||
PostSelectedCamera();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Maps the camera control actions to the current selected camera on the codec
|
||||
/// </summary>
|
||||
void MapCameraActions()
|
||||
{
|
||||
var cameraCodec = Codec as IHasCameras;
|
||||
|
||||
if (cameraCodec != null && cameraCodec.SelectedCamera != null)
|
||||
{
|
||||
|
||||
AppServerController.RemoveAction(MessagePath + "/cameraUp");
|
||||
AppServerController.RemoveAction(MessagePath + "/cameraDown");
|
||||
AppServerController.RemoveAction(MessagePath + "/cameraLeft");
|
||||
AppServerController.RemoveAction(MessagePath + "/cameraRight");
|
||||
AppServerController.RemoveAction(MessagePath + "/cameraZoomIn");
|
||||
AppServerController.RemoveAction(MessagePath + "/cameraZoomOut");
|
||||
AppServerController.RemoveAction(MessagePath + "/cameraHome");
|
||||
|
||||
var camera = cameraCodec.SelectedCamera as IHasCameraPtzControl;
|
||||
if (camera != null)
|
||||
{
|
||||
AppServerController.AddAction(MessagePath + "/cameraUp", new PressAndHoldAction(new Action<bool>(b => { if (b)camera.TiltUp(); else camera.TiltStop(); })));
|
||||
AppServerController.AddAction(MessagePath + "/cameraDown", new PressAndHoldAction(new Action<bool>(b => { if (b)camera.TiltDown(); else camera.TiltStop(); })));
|
||||
AppServerController.AddAction(MessagePath + "/cameraLeft", new PressAndHoldAction(new Action<bool>(b => { if (b)camera.PanLeft(); else camera.PanStop(); })));
|
||||
AppServerController.AddAction(MessagePath + "/cameraRight", new PressAndHoldAction(new Action<bool>(b => { if (b)camera.PanRight(); else camera.PanStop(); })));
|
||||
AppServerController.AddAction(MessagePath + "/cameraZoomIn", new PressAndHoldAction(new Action<bool>(b => { if (b)camera.ZoomIn(); else camera.ZoomStop(); })));
|
||||
AppServerController.AddAction(MessagePath + "/cameraZoomOut", new PressAndHoldAction(new Action<bool>(b => { if (b)camera.ZoomOut(); else camera.ZoomStop(); })));
|
||||
AppServerController.AddAction(MessagePath + "/cameraHome", new Action(camera.PositionHome));
|
||||
|
||||
var focusCamera = cameraCodec as IHasCameraFocusControl;
|
||||
|
||||
AppServerController.RemoveAction(MessagePath + "/cameraAutoFocus");
|
||||
AppServerController.RemoveAction(MessagePath + "/cameraFocusNear");
|
||||
AppServerController.RemoveAction(MessagePath + "/cameraFocusFar");
|
||||
|
||||
if (focusCamera != null)
|
||||
{
|
||||
AppServerController.AddAction(MessagePath + "/cameraAutoFocus", new Action(focusCamera.TriggerAutoFocus));
|
||||
AppServerController.AddAction(MessagePath + "/cameraFocusNear", new PressAndHoldAction(new Action<bool>(b => { if (b)focusCamera.FocusNear(); else focusCamera.FocusStop(); })));
|
||||
AppServerController.AddAction(MessagePath + "/cameraFocusFar", new PressAndHoldAction(new Action<bool>(b => { if (b)focusCamera.FocusFar(); else focusCamera.FocusStop(); })));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
string GetCameraMode()
|
||||
{
|
||||
string m = "";
|
||||
|
||||
var speakerTrackCodec = Codec as IHasCameraAutoMode;
|
||||
if (speakerTrackCodec != null)
|
||||
{
|
||||
if (speakerTrackCodec.CameraAutoModeIsOnFeedback.BoolValue) m = eCameraControlMode.Auto.ToString();
|
||||
else m = eCameraControlMode.Manual.ToString();
|
||||
}
|
||||
|
||||
var cameraOffCodec = Codec as IHasCameraOff;
|
||||
if (cameraOffCodec != null)
|
||||
{
|
||||
if (cameraOffCodec.CameraIsOffFeedback.BoolValue)
|
||||
m = eCameraControlMode.Off.ToString();
|
||||
}
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
void GetCallHistory()
|
||||
{
|
||||
var codec = (Codec as IHasCallHistory);
|
||||
@@ -344,6 +482,22 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
return;
|
||||
}
|
||||
|
||||
object cameraInfo = null;
|
||||
|
||||
var camerasCodec = Codec as IHasCodecCameras;
|
||||
if (camerasCodec != null)
|
||||
{
|
||||
cameraInfo = new
|
||||
{
|
||||
cameraManualSupported = true, // For now, we assume manual mode is supported and selectively hide controls based on camera selection
|
||||
cameraAutoSupported = Codec is IHasCameraAutoMode,
|
||||
cameraOffSupported = Codec is IHasCameraOff,
|
||||
cameraMode = GetCameraMode(),
|
||||
cameraList = camerasCodec.Cameras,
|
||||
selectedCamera = GetSelectedCamera(camerasCodec)
|
||||
};
|
||||
}
|
||||
|
||||
var info = Codec.CodecInfo;
|
||||
PostStatusMessage(new
|
||||
{
|
||||
@@ -366,8 +520,77 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
hasDirectory = Codec is IHasDirectory,
|
||||
hasDirectorySearch = true,
|
||||
hasRecents = Codec is IHasCallHistory,
|
||||
hasCameras = Codec is IHasCodecCameras
|
||||
hasCameras = Codec is IHasCameras,
|
||||
cameras = cameraInfo,
|
||||
presets = GetCurrentPresets()
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void PostCameraMode()
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
cameras = new
|
||||
{
|
||||
cameraMode = GetCameraMode()
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void PostSelectedCamera()
|
||||
{
|
||||
var camerasCodec = Codec as IHasCodecCameras;
|
||||
|
||||
PostStatusMessage(new
|
||||
{
|
||||
cameras = new
|
||||
{
|
||||
selectedCamera = GetSelectedCamera(camerasCodec)
|
||||
},
|
||||
presets = GetCurrentPresets()
|
||||
});
|
||||
}
|
||||
|
||||
void PostCameraPresets()
|
||||
{
|
||||
|
||||
PostStatusMessage(new
|
||||
{
|
||||
presets = GetCurrentPresets()
|
||||
});
|
||||
}
|
||||
|
||||
object GetSelectedCamera(IHasCodecCameras camerasCodec)
|
||||
{
|
||||
return new
|
||||
{
|
||||
key = camerasCodec.SelectedCameraFeedback.StringValue,
|
||||
isFarEnd = camerasCodec.ControllingFarEndCameraFeedback.BoolValue,
|
||||
capabilites = new
|
||||
{
|
||||
canPan = camerasCodec.SelectedCamera.CanPan,
|
||||
canTilt = camerasCodec.SelectedCamera.CanTilt,
|
||||
canZoom = camerasCodec.SelectedCamera.CanZoom,
|
||||
canFocus = camerasCodec.SelectedCamera.CanFocus
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
List<CodecRoomPreset> GetCurrentPresets()
|
||||
{
|
||||
var presetsCodec = Codec as IHasCodecRoomPresets;
|
||||
|
||||
List<CodecRoomPreset> currentPresets = null;
|
||||
|
||||
if (presetsCodec != null && Codec is IHasFarEndCameraControl && (Codec as IHasFarEndCameraControl).ControllingFarEndCameraFeedback.BoolValue)
|
||||
currentPresets = presetsCodec.FarEndRoomPresets;
|
||||
else
|
||||
currentPresets = presetsCodec.NearEndPresets;
|
||||
|
||||
return currentPresets;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,8 @@ namespace PepperDash.Essentials
|
||||
|
||||
public AudioCodecBaseMessenger ACMessenger { get; private set; }
|
||||
|
||||
public Dictionary<string, MessengerBase> DeviceMessengers { get; private set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
@@ -67,7 +69,15 @@ namespace PepperDash.Essentials
|
||||
var routeRoom = Room as IRunRouteAction;
|
||||
if(routeRoom != null)
|
||||
Parent.AddAction(string.Format(@"/room/{0}/source", Room.Key), new Action<SourceSelectMessageContent>(c =>
|
||||
routeRoom.RunRouteAction(c.SourceListItem)));
|
||||
{
|
||||
if(string.IsNullOrEmpty(c.SourceListKey))
|
||||
routeRoom.RunRouteAction(c.SourceListItem, Room.SourceListKey);
|
||||
else
|
||||
{
|
||||
routeRoom.RunRouteAction(c.SourceListItem, c.SourceListKey);
|
||||
}
|
||||
}));
|
||||
|
||||
|
||||
var defaultRoom = Room as IRunDefaultPresentRoute;
|
||||
if(defaultRoom != null)
|
||||
@@ -115,6 +125,8 @@ namespace PepperDash.Essentials
|
||||
ACMessenger.RegisterWithAppServer(Parent);
|
||||
}
|
||||
|
||||
SetupDeviceMessengers();
|
||||
|
||||
var defCallRm = Room as IRunDefaultCallRoute;
|
||||
if (defCallRm != null)
|
||||
{
|
||||
@@ -134,6 +146,36 @@ namespace PepperDash.Essentials
|
||||
Room.ShutdownPromptTimer.WasCancelled += ShutdownPromptTimer_WasCancelled;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set up the messengers for each device type
|
||||
/// </summary>
|
||||
void SetupDeviceMessengers()
|
||||
{
|
||||
DeviceMessengers = new Dictionary<string,MessengerBase>();
|
||||
|
||||
foreach (var device in DeviceManager.AllDevices)
|
||||
{
|
||||
Debug.Console(2, this, "Attempting to set up device messenger for device: {0}", device.Key);
|
||||
|
||||
if (device is Essentials.Devices.Common.Cameras.CameraBase)
|
||||
{
|
||||
var camDevice = device as Essentials.Devices.Common.Cameras.CameraBase;
|
||||
Debug.Console(2, this, "Adding CameraBaseMessenger for device: {0}", device.Key);
|
||||
var cameraMessenger = new CameraBaseMessenger(device.Key + "-" + Parent.Key, camDevice, "/device/" + device.Key);
|
||||
DeviceMessengers.Add(device.Key, cameraMessenger);
|
||||
cameraMessenger.RegisterWithAppServer(Parent);
|
||||
}
|
||||
if (device is Essentials.Devices.Common.SoftCodec.BlueJeansPc)
|
||||
{
|
||||
var softCodecDevice = device as Essentials.Devices.Common.SoftCodec.BlueJeansPc;
|
||||
Debug.Console(2, this, "Adding IRunRouteActionMessnger for device: {0}", device.Key);
|
||||
var routeMessenger = new IRunRouteActionMessenger(device.Key + "-" + Parent.Key, softCodecDevice, "/device/" + device.Key);
|
||||
DeviceMessengers.Add(device.Key, routeMessenger);
|
||||
routeMessenger.RegisterWithAppServer(Parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -430,6 +472,7 @@ namespace PepperDash.Essentials
|
||||
public class SourceSelectMessageContent
|
||||
{
|
||||
public string SourceListItem { get; set; }
|
||||
public string SourceListKey { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -10,6 +10,7 @@ using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.AppServer;
|
||||
using PepperDash.Essentials.AppServer.Messengers;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
@@ -18,204 +19,8 @@ using PepperDash.Essentials.Room.Config;
|
||||
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public class MobileControlDdvc01RoomBridge : MobileControlBridgeBase, IDelayedConfiguration
|
||||
public class MobileControlSIMPLRoomBridge : MobileControlBridgeBase, IDelayedConfiguration
|
||||
{
|
||||
public class BoolJoin
|
||||
{
|
||||
/// <summary>
|
||||
/// 301
|
||||
/// </summary>
|
||||
public const uint RoomIsOn = 301;
|
||||
|
||||
/// <summary>
|
||||
/// 12
|
||||
/// </summary>
|
||||
public const uint PrivacyMute = 12;
|
||||
|
||||
/// <summary>
|
||||
/// 41
|
||||
/// </summary>
|
||||
public const uint PromptForCode = 41;
|
||||
/// <summary>
|
||||
/// 42
|
||||
/// </summary>
|
||||
public const uint ClientJoined = 42;
|
||||
/// <summary>
|
||||
/// 51
|
||||
/// </summary>
|
||||
public const uint ActivityShare = 51;
|
||||
/// <summary>
|
||||
/// 52
|
||||
/// </summary>
|
||||
public const uint ActivityPhoneCall = 52;
|
||||
/// <summary>
|
||||
/// 53
|
||||
/// </summary>
|
||||
public const uint ActivityVideoCall = 53;
|
||||
|
||||
/// <summary>
|
||||
/// 1
|
||||
/// </summary>
|
||||
public const uint MasterVolumeIsMuted = 1;
|
||||
/// <summary>
|
||||
/// 1
|
||||
/// </summary>
|
||||
public const uint MasterVolumeMuteToggle = 1;
|
||||
/// <summary>
|
||||
/// 1
|
||||
/// </summary>
|
||||
public const uint VolumeMutesJoinStart = 1;
|
||||
/// <summary>
|
||||
/// 61
|
||||
/// </summary>
|
||||
public const uint ShutdownCancel = 61;
|
||||
/// <summary>
|
||||
/// 62
|
||||
/// </summary>
|
||||
public const uint ShutdownEnd = 62;
|
||||
/// <summary>
|
||||
/// 63
|
||||
/// </summary>
|
||||
public const uint ShutdownStart = 63;
|
||||
/// <summary>
|
||||
/// 72
|
||||
/// </summary>
|
||||
public const uint SourceHasChanged = 71;
|
||||
|
||||
/// <summary>
|
||||
/// 261 - The start of the range of speed dial visibles
|
||||
/// </summary>
|
||||
public const uint SpeedDialVisibleStartJoin = 261;
|
||||
/// <summary>
|
||||
/// 501
|
||||
/// </summary>
|
||||
public const uint ConfigIsReady = 501;
|
||||
/// <summary>
|
||||
/// 502
|
||||
/// </summary>
|
||||
public const uint HideVideoConfRecents = 502;
|
||||
/// <summary>
|
||||
/// 503
|
||||
/// </summary>
|
||||
public const uint ShowCameraWhenNotInCall = 503;
|
||||
/// <summary>
|
||||
/// 504
|
||||
/// </summary>
|
||||
public const uint UseSourceEnabled = 504;
|
||||
/// <summary>
|
||||
/// 601
|
||||
/// </summary>
|
||||
public const uint SourceShareDisableJoinStart = 601;
|
||||
/// <summary>
|
||||
/// 621
|
||||
/// </summary>
|
||||
public const uint SourceIsEnabledJoinStart = 621;
|
||||
|
||||
}
|
||||
|
||||
public class UshortJoin
|
||||
{
|
||||
/// <summary>
|
||||
/// 1
|
||||
/// </summary>
|
||||
public const uint MasterVolumeLevel = 1;
|
||||
/// <summary>
|
||||
/// 1
|
||||
/// </summary>
|
||||
public const uint VolumeSlidersJoinStart = 1;
|
||||
/// <summary>
|
||||
/// 61
|
||||
/// </summary>
|
||||
public const uint ShutdownPromptDuration = 61;
|
||||
/// <summary>
|
||||
/// 101
|
||||
/// </summary>
|
||||
public const uint NumberOfAuxFaders = 101;
|
||||
}
|
||||
|
||||
public class StringJoin
|
||||
{
|
||||
/// <summary>
|
||||
/// 1
|
||||
/// </summary>
|
||||
public const uint VolumeSliderNamesJoinStart = 1;
|
||||
/// <summary>
|
||||
/// 71
|
||||
/// </summary>
|
||||
public const uint SelectedSourceKey = 71;
|
||||
|
||||
/// <summary>
|
||||
/// 241
|
||||
/// </summary>
|
||||
public const uint SpeedDialNameStartJoin = 241;
|
||||
|
||||
/// <summary>
|
||||
/// 251
|
||||
/// </summary>
|
||||
public const uint SpeedDialNumberStartJoin = 251;
|
||||
|
||||
/// <summary>
|
||||
/// 501
|
||||
/// </summary>
|
||||
public const uint ConfigRoomName = 501;
|
||||
/// <summary>
|
||||
/// 502
|
||||
/// </summary>
|
||||
public const uint ConfigHelpMessage = 502;
|
||||
/// <summary>
|
||||
/// 503
|
||||
/// </summary>
|
||||
public const uint ConfigHelpNumber = 503;
|
||||
/// <summary>
|
||||
/// 504
|
||||
/// </summary>
|
||||
public const uint ConfigRoomPhoneNumber = 504;
|
||||
/// <summary>
|
||||
/// 505
|
||||
/// </summary>
|
||||
public const uint ConfigRoomURI = 505;
|
||||
/// <summary>
|
||||
/// 401
|
||||
/// </summary>
|
||||
public const uint UserCodeToSystem = 401;
|
||||
/// <summary>
|
||||
/// 402
|
||||
/// </summary>
|
||||
public const uint ServerUrl = 402;
|
||||
/// <summary>
|
||||
/// 512
|
||||
/// </summary>
|
||||
public const uint RoomSpeedDialNamesJoinStart = 512;
|
||||
/// <summary>
|
||||
/// 516
|
||||
/// </summary>
|
||||
public const uint RoomSpeedDialNumberssJoinStart = 516;
|
||||
/// <summary>
|
||||
/// 601
|
||||
/// </summary>
|
||||
public const uint SourceNameJoinStart = 601;
|
||||
/// <summary>
|
||||
/// 621
|
||||
/// </summary>
|
||||
public const uint SourceIconJoinStart = 621;
|
||||
/// <summary>
|
||||
/// 641
|
||||
/// </summary>
|
||||
public const uint SourceKeyJoinStart = 641;
|
||||
/// <summary>
|
||||
/// 661
|
||||
/// </summary>
|
||||
public const uint SourceTypeJoinStart = 661;
|
||||
/// <summary>
|
||||
/// 761
|
||||
/// </summary>
|
||||
public const uint CameraNearNameStart = 761;
|
||||
/// <summary>
|
||||
/// 770 - presence of this name on the input will cause the camera to be added
|
||||
/// </summary>
|
||||
public const uint CameraFarName = 770;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fires when config is ready to go
|
||||
/// </summary>
|
||||
@@ -223,6 +28,8 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
|
||||
public ThreeSeriesTcpIpEthernetIntersystemCommunications EISC { get; private set; }
|
||||
|
||||
public MobileControlSIMPLRoomJoinMap JoinMap { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -231,15 +38,15 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
public override string RoomName
|
||||
{
|
||||
get {
|
||||
var name = EISC.StringOutput[StringJoin.ConfigRoomName].StringValue;
|
||||
var name = EISC.StringOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ConfigRoomName)].StringValue;
|
||||
return string.IsNullOrEmpty(name) ? "Not Loaded" : name;
|
||||
}
|
||||
}
|
||||
|
||||
MobileControlDdvc01DeviceBridge SourceBridge;
|
||||
|
||||
Ddvc01AtcMessenger AtcMessenger;
|
||||
Ddvc01VtcMessenger VtcMessenger;
|
||||
SIMPLAtcMessenger AtcMessenger;
|
||||
SIMPLVtcMessenger VtcMessenger;
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -248,7 +55,7 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
/// <param name="key"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="ipId"></param>
|
||||
public MobileControlDdvc01RoomBridge(string key, string name, uint ipId)
|
||||
public MobileControlSIMPLRoomBridge(string key, string name, uint ipId)
|
||||
: base(key, name)
|
||||
{
|
||||
try
|
||||
@@ -258,8 +65,16 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
if (reg != Crestron.SimplSharpPro.eDeviceRegistrationUnRegistrationResponse.Success)
|
||||
Debug.Console(0, this, "Cannot connect EISC at IPID {0}: \r{1}", ipId, reg);
|
||||
|
||||
JoinMap = new MobileControlSIMPLRoomJoinMap();
|
||||
|
||||
// TODO: Possibly set up alternate constructor or take in joinMapKey and joinStart properties in constructor
|
||||
JoinMap.OffsetJoinNumbers(1);
|
||||
|
||||
SourceBridge = new MobileControlDdvc01DeviceBridge(key + "-sourceBridge", "DDVC01 source bridge", EISC);
|
||||
DeviceManager.AddDevice(SourceBridge);
|
||||
|
||||
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -279,24 +94,33 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
SetupFeedbacks();
|
||||
|
||||
var atcKey = string.Format("atc-{0}-{1}", this.Key, Parent.Key);
|
||||
AtcMessenger = new Ddvc01AtcMessenger(atcKey, EISC, "/device/audioCodec");
|
||||
AtcMessenger = new SIMPLAtcMessenger(atcKey, EISC, "/device/audioCodec");
|
||||
AtcMessenger.RegisterWithAppServer(Parent);
|
||||
|
||||
var vtcKey = string.Format("atc-{0}-{1}", this.Key, Parent.Key);
|
||||
VtcMessenger = new Ddvc01VtcMessenger(vtcKey, EISC, "/device/videoCodec");
|
||||
VtcMessenger = new SIMPLVtcMessenger(vtcKey, EISC, "/device/videoCodec");
|
||||
VtcMessenger.RegisterWithAppServer(Parent);
|
||||
|
||||
EISC.SigChange += EISC_SigChange;
|
||||
EISC.OnlineStatusChange += (o, a) =>
|
||||
{
|
||||
Debug.Console(1, this, "DDVC EISC online={0}. Config is ready={1}", a.DeviceOnLine, EISC.BooleanOutput[BoolJoin.ConfigIsReady].BoolValue);
|
||||
if (a.DeviceOnLine && EISC.BooleanOutput[BoolJoin.ConfigIsReady].BoolValue)
|
||||
Debug.Console(1, this, "DDVC EISC online={0}. Config is ready={1}. Use Essentials Config={2}",
|
||||
a.DeviceOnLine, EISC.BooleanOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ConfigIsReady)].BoolValue, EISC.BooleanOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ConfigIsLocal)].BoolValue);
|
||||
|
||||
if (a.DeviceOnLine && EISC.BooleanOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ConfigIsReady)].BoolValue)
|
||||
LoadConfigValues();
|
||||
|
||||
if (a.DeviceOnLine && EISC.BooleanOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ConfigIsLocal)].BoolValue)
|
||||
UseEssentialsConfig();
|
||||
};
|
||||
// load config if it's already there
|
||||
if (EISC.IsOnline && EISC.BooleanOutput[BoolJoin.ConfigIsReady].BoolValue) // || EISC.BooleanInput[BoolJoin.ConfigIsReady].BoolValue)
|
||||
if (EISC.IsOnline && EISC.BooleanOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ConfigIsReady)].BoolValue) // || EISC.BooleanInput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ConfigIsReady].BoolValue)
|
||||
LoadConfigValues();
|
||||
|
||||
if (EISC.IsOnline && EISC.BooleanOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ConfigIsLocal)].BoolValue)
|
||||
{
|
||||
UseEssentialsConfig();
|
||||
}
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(s =>
|
||||
{
|
||||
@@ -323,41 +147,60 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
return base.CustomActivate();
|
||||
}
|
||||
|
||||
void UseEssentialsConfig()
|
||||
{
|
||||
ConfigIsLoaded = false;
|
||||
|
||||
SetupDeviceMessengers();
|
||||
|
||||
Debug.Console(0, this, "******* ESSENTIALS CONFIG: \r{0}", JsonConvert.SerializeObject(ConfigReader.ConfigObject, Formatting.Indented));
|
||||
|
||||
var handler = ConfigurationIsReady;
|
||||
if (handler != null)
|
||||
{
|
||||
handler(this, new EventArgs());
|
||||
}
|
||||
|
||||
ConfigIsLoaded = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Setup the actions to take place on various incoming API calls
|
||||
/// </summary>
|
||||
void SetupFunctions()
|
||||
{
|
||||
Parent.AddAction(@"/room/room1/promptForCode", new Action(() => EISC.PulseBool(BoolJoin.PromptForCode)));
|
||||
Parent.AddAction(@"/room/room1/clientJoined", new Action(() => EISC.PulseBool(BoolJoin.ClientJoined)));
|
||||
Parent.AddAction(@"/room/room1/promptForCode", new Action(() => EISC.PulseBool(JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.PromptForCode))));
|
||||
Parent.AddAction(@"/room/room1/clientJoined", new Action(() => EISC.PulseBool(JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ClientJoined))));
|
||||
|
||||
Parent.AddAction(@"/room/room1/status", new Action(SendFullStatus));
|
||||
|
||||
Parent.AddAction(@"/room/room1/source", new Action<SourceSelectMessageContent>(c =>
|
||||
{
|
||||
EISC.SetString(StringJoin.SelectedSourceKey, c.SourceListItem);
|
||||
EISC.PulseBool(BoolJoin.SourceHasChanged);
|
||||
EISC.SetString(JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.SelectedSourceKey), c.SourceListItem);
|
||||
EISC.PulseBool(JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.SourceHasChanged));
|
||||
}));
|
||||
|
||||
Parent.AddAction(@"/room/room1/defaultsource", new Action(() =>
|
||||
EISC.PulseBool(BoolJoin.ActivityShare)));
|
||||
EISC.PulseBool(JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ActivityShare))));
|
||||
Parent.AddAction(@"/room/room1/activityPhone", new Action(() =>
|
||||
EISC.PulseBool(BoolJoin.ActivityPhoneCall)));
|
||||
EISC.PulseBool(JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ActivityPhoneCall))));
|
||||
Parent.AddAction(@"/room/room1/activityVideo", new Action(() =>
|
||||
EISC.PulseBool(BoolJoin.ActivityVideoCall)));
|
||||
EISC.PulseBool(JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ActivityVideoCall))));
|
||||
|
||||
Parent.AddAction(@"/room/room1/volumes/master/level", new Action<ushort>(u =>
|
||||
EISC.SetUshort(UshortJoin.MasterVolumeLevel, u)));
|
||||
EISC.SetUshort(JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.MasterVolume), u)));
|
||||
Parent.AddAction(@"/room/room1/volumes/master/muteToggle", new Action(() =>
|
||||
EISC.PulseBool(BoolJoin.MasterVolumeIsMuted)));
|
||||
EISC.PulseBool(JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.MasterVolume))));
|
||||
Parent.AddAction(@"/room/room1/volumes/master/privacyMuteToggle", new Action(() =>
|
||||
EISC.PulseBool(BoolJoin.PrivacyMute)));
|
||||
EISC.PulseBool(JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.PrivacyMute))));
|
||||
|
||||
|
||||
// /xyzxyz/volumes/master/muteToggle ---> BoolInput[1]
|
||||
|
||||
for (uint i = 2; i <= 7; i++)
|
||||
var volumeStart = JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.VolumeJoinStart);
|
||||
var volumeEnd = JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.VolumeJoinStart) + JoinMap.GetJoinSpanForKey(MobileControlSIMPLRoomJoinMap.VolumeJoinStart);
|
||||
|
||||
for (uint i = volumeStart; i <= volumeEnd; i++)
|
||||
{
|
||||
var index = i;
|
||||
Parent.AddAction(string.Format(@"/room/room1/volumes/level-{0}/level", index), new Action<ushort>(u =>
|
||||
@@ -367,13 +210,16 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
}
|
||||
|
||||
Parent.AddAction(@"/room/room1/shutdownStart", new Action(() =>
|
||||
EISC.PulseBool(BoolJoin.ShutdownStart)));
|
||||
EISC.PulseBool(JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ShutdownStart))));
|
||||
Parent.AddAction(@"/room/room1/shutdownEnd", new Action(() =>
|
||||
EISC.PulseBool(BoolJoin.ShutdownEnd)));
|
||||
EISC.PulseBool(JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ShutdownEnd))));
|
||||
Parent.AddAction(@"/room/room1/shutdownCancel", new Action(() =>
|
||||
EISC.PulseBool(BoolJoin.ShutdownCancel)));
|
||||
EISC.PulseBool(JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ShutdownCancel))));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -398,21 +244,21 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
void SetupFeedbacks()
|
||||
{
|
||||
// Power
|
||||
EISC.SetBoolSigAction(BoolJoin.RoomIsOn, b =>
|
||||
EISC.SetBoolSigAction(JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.RoomIsOn), b =>
|
||||
PostStatusMessage(new
|
||||
{
|
||||
isOn = b
|
||||
}));
|
||||
|
||||
// Source change things
|
||||
EISC.SetSigTrueAction(BoolJoin.SourceHasChanged, () =>
|
||||
EISC.SetSigTrueAction(JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.SourceHasChanged), () =>
|
||||
PostStatusMessage(new
|
||||
{
|
||||
selectedSourceKey = EISC.StringOutput[StringJoin.SelectedSourceKey].StringValue
|
||||
selectedSourceKey = EISC.StringOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.SelectedSourceKey)].StringValue
|
||||
}));
|
||||
|
||||
// Volume things
|
||||
EISC.SetUShortSigAction(UshortJoin.MasterVolumeLevel, u =>
|
||||
EISC.SetUShortSigAction(JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.MasterVolume), u =>
|
||||
PostStatusMessage(new
|
||||
{
|
||||
volumes = new
|
||||
@@ -427,7 +273,7 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
// map MasterVolumeIsMuted join -> status/volumes/master/muted
|
||||
//
|
||||
|
||||
EISC.SetBoolSigAction(BoolJoin.MasterVolumeIsMuted, b =>
|
||||
EISC.SetBoolSigAction(JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.MasterVolume), b =>
|
||||
PostStatusMessage(new
|
||||
{
|
||||
volumes = new
|
||||
@@ -438,7 +284,7 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
}
|
||||
}
|
||||
}));
|
||||
EISC.SetBoolSigAction(BoolJoin.PrivacyMute, b =>
|
||||
EISC.SetBoolSigAction(JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.PrivacyMute), b =>
|
||||
PostStatusMessage(new
|
||||
{
|
||||
volumes = new
|
||||
@@ -450,7 +296,10 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
}
|
||||
}));
|
||||
|
||||
for (uint i = 2; i <= 7; i++)
|
||||
var volumeStart = JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.VolumeJoinStart);
|
||||
var volumeEnd = JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.VolumeJoinStart) + JoinMap.GetJoinSpanForKey(MobileControlSIMPLRoomJoinMap.VolumeJoinStart);
|
||||
|
||||
for (uint i = volumeStart; i <= volumeEnd; i++)
|
||||
{
|
||||
var index = i; // local scope for lambdas
|
||||
EISC.SetUShortSigAction(index, u => // start at join 2
|
||||
@@ -481,7 +330,7 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
});
|
||||
}
|
||||
|
||||
EISC.SetUShortSigAction(UshortJoin.NumberOfAuxFaders, u =>
|
||||
EISC.SetUShortSigAction(JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.NumberOfAuxFaders), u =>
|
||||
PostStatusMessage(new {
|
||||
volumes = new {
|
||||
numberOfAuxFaders = u,
|
||||
@@ -489,30 +338,30 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
}));
|
||||
|
||||
// shutdown things
|
||||
EISC.SetSigTrueAction(BoolJoin.ShutdownCancel, new Action(() =>
|
||||
EISC.SetSigTrueAction(JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ShutdownCancel), new Action(() =>
|
||||
PostMessage("/room/shutdown/", new
|
||||
{
|
||||
state = "wasCancelled"
|
||||
})));
|
||||
EISC.SetSigTrueAction(BoolJoin.ShutdownEnd, new Action(() =>
|
||||
EISC.SetSigTrueAction(JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ShutdownEnd), new Action(() =>
|
||||
PostMessage("/room/shutdown/", new
|
||||
{
|
||||
state = "hasFinished"
|
||||
})));
|
||||
EISC.SetSigTrueAction(BoolJoin.ShutdownStart, new Action(() =>
|
||||
EISC.SetSigTrueAction(JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ShutdownStart), new Action(() =>
|
||||
PostMessage("/room/shutdown/", new
|
||||
{
|
||||
state = "hasStarted",
|
||||
duration = EISC.UShortOutput[UshortJoin.ShutdownPromptDuration].UShortValue
|
||||
duration = EISC.UShortOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ShutdownPromptDuration)].UShortValue
|
||||
})));
|
||||
|
||||
// Config things
|
||||
EISC.SetSigTrueAction(BoolJoin.ConfigIsReady, LoadConfigValues);
|
||||
EISC.SetSigTrueAction(JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ConfigIsReady), LoadConfigValues);
|
||||
|
||||
// Activity modes
|
||||
EISC.SetSigTrueAction(BoolJoin.ActivityShare, () => UpdateActivity(1));
|
||||
EISC.SetSigTrueAction(BoolJoin.ActivityPhoneCall, () => UpdateActivity(2));
|
||||
EISC.SetSigTrueAction(BoolJoin.ActivityVideoCall, () => UpdateActivity(3));
|
||||
EISC.SetSigTrueAction(JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ActivityShare), () => UpdateActivity(1));
|
||||
EISC.SetSigTrueAction(JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ActivityPhoneCall), () => UpdateActivity(2));
|
||||
EISC.SetSigTrueAction(JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ActivityVideoCall), () => UpdateActivity(3));
|
||||
}
|
||||
|
||||
|
||||
@@ -556,7 +405,7 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
Debug.Console(0, this, "Replacing Room[0] in config");
|
||||
co.Rooms[0] = rm;
|
||||
}
|
||||
rm.Name = EISC.StringOutput[StringJoin.ConfigRoomName].StringValue;
|
||||
rm.Name = EISC.StringOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ConfigRoomName)].StringValue;
|
||||
rm.Key = "room1";
|
||||
rm.Type = "ddvc01";
|
||||
|
||||
@@ -567,13 +416,13 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
rmProps = JsonConvert.DeserializeObject<DDVC01RoomPropertiesConfig>(rm.Properties.ToString());
|
||||
|
||||
rmProps.Help = new EssentialsHelpPropertiesConfig();
|
||||
rmProps.Help.CallButtonText = EISC.StringOutput[StringJoin.ConfigHelpNumber].StringValue;
|
||||
rmProps.Help.Message = EISC.StringOutput[StringJoin.ConfigHelpMessage].StringValue;
|
||||
rmProps.Help.CallButtonText = EISC.StringOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ConfigHelpNumber)].StringValue;
|
||||
rmProps.Help.Message = EISC.StringOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ConfigHelpMessage)].StringValue;
|
||||
|
||||
rmProps.Environment = new EssentialsEnvironmentPropertiesConfig(); // enabled defaults to false
|
||||
|
||||
rmProps.RoomPhoneNumber = EISC.StringOutput[StringJoin.ConfigRoomPhoneNumber].StringValue;
|
||||
rmProps.RoomURI = EISC.StringOutput[StringJoin.ConfigRoomURI].StringValue;
|
||||
rmProps.RoomPhoneNumber = EISC.StringOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ConfigRoomPhoneNumber)].StringValue;
|
||||
rmProps.RoomURI = EISC.StringOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ConfigRoomURI)].StringValue;
|
||||
rmProps.SpeedDials = new List<DDVC01SpeedDial>();
|
||||
|
||||
// This MAY need a check
|
||||
@@ -581,7 +430,7 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
rmProps.VideoCodecKey = "videoCodec";
|
||||
|
||||
// volume control names
|
||||
var volCount = EISC.UShortOutput[UshortJoin.NumberOfAuxFaders].UShortValue;
|
||||
var volCount = EISC.UShortOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.NumberOfAuxFaders)].UShortValue;
|
||||
|
||||
//// use Volumes object or?
|
||||
//rmProps.VolumeSliderNames = new List<string>();
|
||||
@@ -626,18 +475,18 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
// add sources...
|
||||
for (uint i = 0; i <= 19; i++)
|
||||
{
|
||||
var name = EISC.StringOutput[StringJoin.SourceNameJoinStart + i].StringValue;
|
||||
if (EISC.BooleanOutput[BoolJoin.UseSourceEnabled].BoolValue
|
||||
&& !EISC.BooleanOutput[BoolJoin.SourceIsEnabledJoinStart + i].BoolValue)
|
||||
var name = EISC.StringOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.SourceNameJoinStart) + i].StringValue;
|
||||
if (EISC.BooleanOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.UseSourceEnabled)].BoolValue
|
||||
&& !EISC.BooleanOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.SourceIsEnabledJoinStart) + i].BoolValue)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else if(!EISC.BooleanOutput[BoolJoin.UseSourceEnabled].BoolValue && string.IsNullOrEmpty(name))
|
||||
else if(!EISC.BooleanOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.UseSourceEnabled)].BoolValue && string.IsNullOrEmpty(name))
|
||||
break;
|
||||
var icon = EISC.StringOutput[StringJoin.SourceIconJoinStart + i].StringValue;
|
||||
var key = EISC.StringOutput[StringJoin.SourceKeyJoinStart + i].StringValue;
|
||||
var type = EISC.StringOutput[StringJoin.SourceTypeJoinStart + i].StringValue;
|
||||
var disableShare = EISC.BooleanOutput[BoolJoin.SourceShareDisableJoinStart + i].BoolValue;
|
||||
var icon = EISC.StringOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.SourceIconJoinStart) + i].StringValue;
|
||||
var key = EISC.StringOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.SourceKeyJoinStart) + i].StringValue;
|
||||
var type = EISC.StringOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.SourceTypeJoinStart) + i].StringValue;
|
||||
var disableShare = EISC.BooleanOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.SourceShareDisableJoinStart) + i].BoolValue;
|
||||
|
||||
Debug.Console(0, this, "Adding source {0} '{1}'", key, name);
|
||||
var newSLI = new SourceListItem{
|
||||
@@ -679,14 +528,14 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
var acFavs = new List<PepperDash.Essentials.Devices.Common.Codec.CodecActiveCallItem>();
|
||||
for (uint i = 0; i < 4; i++)
|
||||
{
|
||||
if (!EISC.GetBool(BoolJoin.SpeedDialVisibleStartJoin + i))
|
||||
if (!EISC.GetBool(JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.SpeedDialVisibleStartJoin) + i))
|
||||
{
|
||||
break;
|
||||
}
|
||||
acFavs.Add(new PepperDash.Essentials.Devices.Common.Codec.CodecActiveCallItem()
|
||||
{
|
||||
Name = EISC.GetString(StringJoin.SpeedDialNameStartJoin + i),
|
||||
Number = EISC.GetString(StringJoin.SpeedDialNumberStartJoin + i),
|
||||
Name = EISC.GetString(JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.SpeedDialNameStartJoin) + i),
|
||||
Number = EISC.GetString(JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.SpeedDialNumberStartJoin) + i),
|
||||
Type = PepperDash.Essentials.Devices.Common.Codec.eCodecCallType.Audio
|
||||
});
|
||||
}
|
||||
@@ -718,7 +567,7 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
var camsProps = new List<object>();
|
||||
for (uint i = 0; i < 9; i++)
|
||||
{
|
||||
var name = EISC.GetString(i + StringJoin.CameraNearNameStart);
|
||||
var name = EISC.GetString(i + JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.CameraNearNameStart));
|
||||
if (!string.IsNullOrEmpty(name))
|
||||
{
|
||||
camsProps.Add(new
|
||||
@@ -728,7 +577,7 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
});
|
||||
}
|
||||
}
|
||||
var farName = EISC.GetString(StringJoin.CameraFarName);
|
||||
var farName = EISC.GetString(JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.CameraFarName));
|
||||
if (!string.IsNullOrEmpty(farName))
|
||||
{
|
||||
camsProps.Add(new
|
||||
@@ -755,6 +604,8 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
co.Devices.Add(conf);
|
||||
}
|
||||
|
||||
SetupDeviceMessengers();
|
||||
|
||||
Debug.Console(0, this, "******* CONFIG FROM DDVC: \r{0}", JsonConvert.SerializeObject(ConfigReader.ConfigObject, Formatting.Indented));
|
||||
|
||||
var handler = ConfigurationIsReady;
|
||||
@@ -766,6 +617,67 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
ConfigIsLoaded = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Iterates device config and adds messengers as neede for each device type
|
||||
/// </summary>
|
||||
void SetupDeviceMessengers()
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach (var device in ConfigReader.ConfigObject.Devices)
|
||||
{
|
||||
if (device.Group.Equals("simplmessenger"))
|
||||
{
|
||||
var props = JsonConvert.DeserializeObject<SimplMessengerPropertiesConfig>(device.Properties.ToString());
|
||||
|
||||
var messengerKey = string.Format("device-{0}-{1}", this.Key, Parent.Key);
|
||||
|
||||
if (DeviceManager.GetDeviceForKey(messengerKey) != null)
|
||||
{
|
||||
Debug.Console(2, this, "Messenger with key: {0} already exists. Skipping...", messengerKey);
|
||||
continue;
|
||||
}
|
||||
|
||||
var dev = ConfigReader.ConfigObject.GetDeviceForKey(props.DeviceKey);
|
||||
|
||||
if (dev == null)
|
||||
{
|
||||
Debug.Console(1, this, "Unable to find device config for key: '{0}'", props.DeviceKey);
|
||||
continue;
|
||||
}
|
||||
|
||||
var type = device.Type.ToLower();
|
||||
MessengerBase messenger = null;
|
||||
|
||||
if (type.Equals("simplcameramessenger"))
|
||||
{
|
||||
Debug.Console(2, this, "Adding SIMPLCameraMessenger for: '{0}'", props.DeviceKey);
|
||||
messenger = new SIMPLCameraMessenger(messengerKey, EISC, "/device/" + props.DeviceKey, props.JoinStart);
|
||||
}
|
||||
else if (type.Equals("simplroutemessenger"))
|
||||
{
|
||||
Debug.Console(2, this, "Adding SIMPLRouteMessenger for: '{0}'", props.DeviceKey);
|
||||
messenger = new SIMPLRouteMessenger(messengerKey, EISC, "/device/" + props.DeviceKey, props.JoinStart);
|
||||
}
|
||||
|
||||
if (messenger != null)
|
||||
{
|
||||
DeviceManager.AddDevice(messenger);
|
||||
messenger.RegisterWithAppServer(Parent);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(2, this, "Unable to add messenger for device: '{0}' of type: '{1}'", props.DeviceKey, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(2, this, "Error Setting up Device Managers: {0}", e);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -773,7 +685,7 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
if (ConfigIsLoaded)
|
||||
{
|
||||
var count = EISC.UShortOutput[UshortJoin.NumberOfAuxFaders].UShortValue;
|
||||
var count = EISC.UShortOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.NumberOfAuxFaders)].UShortValue;
|
||||
|
||||
Debug.Console(1, this, "The Fader Count is : {0}", count);
|
||||
|
||||
@@ -781,7 +693,11 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
|
||||
// Create auxFaders
|
||||
var auxFaderDict = new Dictionary<string, Volume>();
|
||||
for (uint i = 2; i <= count; i++)
|
||||
|
||||
var volumeStart = JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.VolumeJoinStart);
|
||||
var volumeEnd = JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.VolumeJoinStart) + JoinMap.GetJoinSpanForKey(MobileControlSIMPLRoomJoinMap.VolumeJoinStart);
|
||||
|
||||
for (uint i = volumeStart; i <= count; i++)
|
||||
{
|
||||
auxFaderDict.Add("level-" + i,
|
||||
new Volume("level-" + i,
|
||||
@@ -795,22 +711,22 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
var volumes = new Volumes();
|
||||
|
||||
volumes.Master = new Volume("master",
|
||||
EISC.UShortOutput[UshortJoin.MasterVolumeLevel].UShortValue,
|
||||
EISC.BooleanOutput[BoolJoin.MasterVolumeIsMuted].BoolValue,
|
||||
EISC.StringOutput[1].StringValue,
|
||||
EISC.UShortOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.MasterVolume)].UShortValue,
|
||||
EISC.BooleanOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.MasterVolume)].BoolValue,
|
||||
EISC.StringOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.MasterVolume)].StringValue,
|
||||
true,
|
||||
"something.png");
|
||||
volumes.Master.HasPrivacyMute = true;
|
||||
volumes.Master.PrivacyMuted = EISC.BooleanOutput[BoolJoin.PrivacyMute].BoolValue;
|
||||
volumes.Master.PrivacyMuted = EISC.BooleanOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.PrivacyMute)].BoolValue;
|
||||
|
||||
volumes.AuxFaders = auxFaderDict;
|
||||
volumes.NumberOfAuxFaders = EISC.UShortInput[UshortJoin.NumberOfAuxFaders].UShortValue;
|
||||
volumes.NumberOfAuxFaders = EISC.UShortInput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.NumberOfAuxFaders)].UShortValue;
|
||||
|
||||
PostStatusMessage(new
|
||||
{
|
||||
activityMode = GetActivityMode(),
|
||||
isOn = EISC.BooleanOutput[BoolJoin.RoomIsOn].BoolValue,
|
||||
selectedSourceKey = EISC.StringOutput[StringJoin.SelectedSourceKey].StringValue,
|
||||
isOn = EISC.BooleanOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.RoomIsOn)].BoolValue,
|
||||
selectedSourceKey = EISC.StringOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.SelectedSourceKey)].StringValue,
|
||||
volumes = volumes
|
||||
});
|
||||
}
|
||||
@@ -829,9 +745,9 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
/// <returns></returns>
|
||||
int GetActivityMode()
|
||||
{
|
||||
if (EISC.BooleanOutput[BoolJoin.ActivityPhoneCall].BoolValue) return 2;
|
||||
else if (EISC.BooleanOutput[BoolJoin.ActivityShare].BoolValue) return 1;
|
||||
else if (EISC.BooleanOutput[BoolJoin.ActivityVideoCall].BoolValue) return 3;
|
||||
if (EISC.BooleanOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ActivityPhoneCall)].BoolValue) return 2;
|
||||
else if (EISC.BooleanOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ActivityShare)].BoolValue) return 1;
|
||||
else if (EISC.BooleanOutput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ActivityVideoCall)].BoolValue) return 3;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -873,12 +789,15 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
if (Debug.Level >= 1)
|
||||
Debug.Console(1, this, "DDVC EISC change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue);
|
||||
var uo = args.Sig.UserObject;
|
||||
if (uo is Action<bool>)
|
||||
(uo as Action<bool>)(args.Sig.BoolValue);
|
||||
else if (uo is Action<ushort>)
|
||||
(uo as Action<ushort>)(args.Sig.UShortValue);
|
||||
else if (uo is Action<string>)
|
||||
(uo as Action<string>)(args.Sig.StringValue);
|
||||
if (uo != null)
|
||||
{
|
||||
if (uo is Action<bool>)
|
||||
(uo as Action<bool>)(args.Sig.BoolValue);
|
||||
else if (uo is Action<ushort>)
|
||||
(uo as Action<ushort>)(args.Sig.UShortValue);
|
||||
else if (uo is Action<string>)
|
||||
(uo as Action<string>)(args.Sig.StringValue);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -905,8 +824,8 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
protected override void UserCodeChange()
|
||||
{
|
||||
Debug.Console(1, this, "Server user code changed: {0}", UserCode);
|
||||
EISC.StringInput[StringJoin.UserCodeToSystem].StringValue = UserCode;
|
||||
EISC.StringInput[StringJoin.ServerUrl].StringValue = Parent.Config.ClientAppUrl;
|
||||
EISC.StringInput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.UserCodeToSystem)].StringValue = UserCode;
|
||||
EISC.StringInput[JoinMap.GetJoinForKey(MobileControlSIMPLRoomJoinMap.ServerUrl)].StringValue = Parent.Config.ClientAppUrl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.AppServer
|
||||
{
|
||||
public class MobileControlSIMPLRoomJoinMap : JoinMapBase
|
||||
{
|
||||
public const string ConfigIsLocal = "ConfigIsLocal";
|
||||
public const string RoomIsOn = "RoomIsOn";
|
||||
public const string PrivacyMute = "PrivacyMute";
|
||||
public const string PromptForCode = "PromptForCode";
|
||||
public const string ClientJoined = "ClientJoined";
|
||||
public const string ActivityShare = "ActivityShare";
|
||||
public const string ActivityPhoneCall = "ActivityPhoneCall";
|
||||
public const string ActivityVideoCall = "ActivityVideoCall";
|
||||
public const string MasterVolume = "MasterVolumeMute";
|
||||
public const string VolumeJoinStart = "VolumeMutesJoinStart";
|
||||
public const string ShutdownCancel = "ShutdownCancel";
|
||||
public const string ShutdownEnd = "ShutdownEnd";
|
||||
public const string ShutdownStart = "ShutdownStart";
|
||||
public const string SourceHasChanged = "SourceHasChanged";
|
||||
public const string SpeedDialVisibleStartJoin = "SpeedDialVisibleStartJoin";
|
||||
public const string ConfigIsReady = "ConfigIsReady";
|
||||
public const string HideVideoConfRecents = "HideVideoConfRecents";
|
||||
public const string ShowCameraWhenNotInCall = "ShowCameraWhenNotInCall";
|
||||
public const string UseSourceEnabled = "UseSourceEnabled";
|
||||
public const string SourceShareDisableJoinStart = "SourceShareDisableJoinStart";
|
||||
public const string SourceIsEnabledJoinStart = "SourceIsEnabledJoinStart";
|
||||
|
||||
//public const string MasterVolumeLevel = "MasterVolumeLevel";
|
||||
public const string VolumeSlidersJoinStart = "VolumeSlidersJoinStart";
|
||||
public const string ShutdownPromptDuration = "ShutdownPromptDuration";
|
||||
public const string NumberOfAuxFaders = "NumberOfAuxFaders";
|
||||
|
||||
public const string VolumeSliderNamesJoinStart = "VolumeSliderNamesJoinStart";
|
||||
public const string SelectedSourceKey = "SelectedSourceKey";
|
||||
public const string SpeedDialNameStartJoin = "SpeedDialNameStartJoin";
|
||||
public const string SpeedDialNumberStartJoin = "SpeedDialNumberStartJoin";
|
||||
public const string ConfigRoomName = "ConfigRoomName";
|
||||
public const string ConfigHelpMessage = "ConfigHelpMessage";
|
||||
public const string ConfigHelpNumber = "ConfigHelpNumber";
|
||||
public const string ConfigRoomPhoneNumber = "ConfigRoomPhoneNumber";
|
||||
public const string ConfigRoomURI = "ConfigRoomURI";
|
||||
public const string UserCodeToSystem = "UserCodeToSystem";
|
||||
public const string ServerUrl = "ServerUrl";
|
||||
public const string RoomSpeedDialNamesJoinStart = "RoomSpeedDialNamesJoinStart";
|
||||
public const string RoomSpeedDialNumberssJoinStart = "RoomSpeedDialNumberssJoinStart";
|
||||
public const string SourceNameJoinStart = "SourceNameJoinStart";
|
||||
public const string SourceIconJoinStart = "SourceIconJoinStart";
|
||||
public const string SourceKeyJoinStart = "SourceKeyJoinStart";
|
||||
public const string SourceTypeJoinStart = "SourceTypeJoinStart";
|
||||
public const string CameraNearNameStart = "CameraNearNameStart";
|
||||
public const string CameraFarName = "CameraFarName";
|
||||
|
||||
public MobileControlSIMPLRoomJoinMap()
|
||||
{
|
||||
Joins.Add(ConfigIsLocal, new JoinMetadata() { JoinNumber = 100, Label = "Config is local to Essentials", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(RoomIsOn, new JoinMetadata() { JoinNumber = 301, Label = "Room Is On", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(PrivacyMute, new JoinMetadata() { JoinNumber = 12, Label = "Privacy Mute Toggle/FB", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(PromptForCode, new JoinMetadata() { JoinNumber = 41, Label = "Prompt User for Code", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(ClientJoined, new JoinMetadata() { JoinNumber = 42, Label = "Client Joined", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(ActivityShare, new JoinMetadata() { JoinNumber = 51, Label = "Activity Share", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(ActivityPhoneCall, new JoinMetadata() { JoinNumber = 52, Label = "Activity Phone Call", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(ActivityVideoCall, new JoinMetadata() { JoinNumber = 53, Label = "Activity Video Call", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(MasterVolume, new JoinMetadata() { JoinNumber = 1, Label = "Master Volume Mute Toggle/FB/Level/Label", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinSpan = 1, JoinType = eJoinType.DigitalAnalogSerial });
|
||||
Joins.Add(VolumeJoinStart, new JoinMetadata() { JoinNumber = 2, Label = "Volume Mute Toggle/FB/Level/Label", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinSpan = 8, JoinType = eJoinType.DigitalAnalogSerial });
|
||||
Joins.Add(ShutdownCancel, new JoinMetadata() { JoinNumber = 61, Label = "Shutdown Cancel", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(ShutdownEnd, new JoinMetadata() { JoinNumber = 62, Label = "Shutdown End", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(ShutdownStart, new JoinMetadata() { JoinNumber = 63, Label = "ShutdownStart", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(SourceHasChanged, new JoinMetadata() { JoinNumber = 71, Label = "Source Changed", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
// Possibly move these to Audio Codec Messenger
|
||||
Joins.Add(SpeedDialVisibleStartJoin, new JoinMetadata() { JoinNumber = 261, Label = "Speed Dial Visible", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinSpan = 10, JoinType = eJoinType.Digital });
|
||||
//
|
||||
Joins.Add(ConfigIsReady, new JoinMetadata() { JoinNumber = 501, Label = "Config info from SIMPL is ready", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(HideVideoConfRecents, new JoinMetadata() { JoinNumber = 502, Label = "Hide Video Conference Recents", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(ShowCameraWhenNotInCall, new JoinMetadata() { JoinNumber = 503, Label = "Show camera when not in call", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(UseSourceEnabled, new JoinMetadata() { JoinNumber = 504, Label = "Use Source Enabled Joins", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(SourceShareDisableJoinStart, new JoinMetadata() { JoinNumber = 601, Label = "Source is not sharable", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 20, JoinType = eJoinType.Digital });
|
||||
Joins.Add(SourceIsEnabledJoinStart, new JoinMetadata() { JoinNumber = 621, Label = "Source is enabled", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 20, JoinType = eJoinType.Digital });
|
||||
|
||||
|
||||
Joins.Add(ShutdownPromptDuration, new JoinMetadata() { JoinNumber = 61, Label = "Shutdown Prompt Timer Duration", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Analog });
|
||||
Joins.Add(NumberOfAuxFaders, new JoinMetadata() { JoinNumber = 101, Label = "Number of Auxilliary Faders", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Analog });
|
||||
|
||||
|
||||
Joins.Add(SelectedSourceKey, new JoinMetadata() { JoinNumber = 71, Label = "Key of selected source", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
|
||||
// Possibly move these to Audio Codec Messenger
|
||||
Joins.Add(SpeedDialNameStartJoin, new JoinMetadata() { JoinNumber = 241, Label = "Speed Dial names", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 10, JoinType = eJoinType.Serial });
|
||||
Joins.Add(SpeedDialNumberStartJoin, new JoinMetadata() { JoinNumber = 251, Label = "Speed Dial numbers", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 10, JoinType = eJoinType.Serial });
|
||||
//
|
||||
Joins.Add(UserCodeToSystem, new JoinMetadata() { JoinNumber = 401, Label = "User Ccde", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(ServerUrl, new JoinMetadata() { JoinNumber = 402, Label = "Server URL", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(ConfigRoomName, new JoinMetadata() { JoinNumber = 501, Label = "Room Nnme", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(ConfigHelpMessage, new JoinMetadata() { JoinNumber = 502, Label = "Room help message", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(ConfigHelpNumber, new JoinMetadata() { JoinNumber = 503, Label = "Room help number", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(ConfigRoomPhoneNumber, new JoinMetadata() { JoinNumber = 504, Label = "Room phone number", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(ConfigRoomURI, new JoinMetadata() { JoinNumber = 505, Label = "Room URI", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(SourceNameJoinStart, new JoinMetadata() { JoinNumber = 601, Label = "Source Names", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 20, JoinType = eJoinType.Serial });
|
||||
Joins.Add(SourceIconJoinStart, new JoinMetadata() { JoinNumber = 621, Label = "Source Icons", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 20, JoinType = eJoinType.Serial });
|
||||
Joins.Add(SourceKeyJoinStart, new JoinMetadata() { JoinNumber = 641, Label = "Source Keys", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 20, JoinType = eJoinType.Serial });
|
||||
Joins.Add(SourceTypeJoinStart, new JoinMetadata() { JoinNumber = 661, Label = "Source Types", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 20, JoinType = eJoinType.Serial });
|
||||
|
||||
// Possibly move these to Audio Codec Messenger
|
||||
Joins.Add(CameraNearNameStart, new JoinMetadata() { JoinNumber = 761, Label = "Near End Camera Names", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 10, JoinType = eJoinType.Serial });
|
||||
Joins.Add(CameraFarName, new JoinMetadata() { JoinNumber = 770, Label = "Far End Camera Name", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
//
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
foreach (var join in Joins)
|
||||
{
|
||||
join.Value.JoinNumber = join.Value.JoinNumber + joinOffset;
|
||||
}
|
||||
|
||||
PrintJoinMapInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.AppServer
|
||||
{
|
||||
public class SIMPLAtcJoinMap : JoinMapBase
|
||||
{
|
||||
public const string EndCall = "EndCall";
|
||||
public const string IncomingAnswer = "IncomingAnswer";
|
||||
public const string IncomingReject = "IncomingReject";
|
||||
public const string SpeedDialStart = "SpeedDialStart";
|
||||
public const string CurrentDialString = "CurrentDialString";
|
||||
public const string CurrentCallNumber = "CurrentCallNumber";
|
||||
public const string CurrentCallName = "CurrentCallName";
|
||||
public const string HookState = "HookState";
|
||||
public const string CallDirection = "CallDirection";
|
||||
public const string Dtmf0 = "0";
|
||||
public const string Dtmf1 = "1";
|
||||
public const string Dtmf2 = "2";
|
||||
public const string Dtmf3 = "3";
|
||||
public const string Dtmf4 = "4";
|
||||
public const string Dtmf5 = "5";
|
||||
public const string Dtmf6 = "6";
|
||||
public const string Dtmf7 = "7";
|
||||
public const string Dtmf8 = "8";
|
||||
public const string Dtmf9 = "9";
|
||||
public const string DtmfStar = "*";
|
||||
public const string DtmfPound = "#";
|
||||
|
||||
|
||||
public SIMPLAtcJoinMap()
|
||||
{
|
||||
Joins.Add(EndCall, new JoinMetadata() { JoinNumber = 21, Label = "Hang Up", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(IncomingAnswer, new JoinMetadata() { JoinNumber = 51, Label = "Answer Incoming Call", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(IncomingReject, new JoinMetadata() { JoinNumber = 52, Label = "Reject Incoming Call", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(SpeedDialStart, new JoinMetadata() { JoinNumber = 41, Label = "Speed Dial", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 4, JoinType = eJoinType.Digital });
|
||||
Joins.Add(CurrentDialString, new JoinMetadata() { JoinNumber = 1, Label = "Current Dial String", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(CurrentCallNumber, new JoinMetadata() { JoinNumber = 11, Label = "Current Call Number", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(CurrentCallName, new JoinMetadata() { JoinNumber = 12, Label = "Current Call Name", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(HookState, new JoinMetadata() { JoinNumber = 21, Label = "Current Hook State", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(CallDirection, new JoinMetadata() { JoinNumber = 22, Label = "Current Call Direction", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(Dtmf1, new JoinMetadata() { JoinNumber = 1, Label = "DTMF 1", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf2, new JoinMetadata() { JoinNumber = 2, Label = "DTMF 2", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf3, new JoinMetadata() { JoinNumber = 3, Label = "DTMF 3", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf4, new JoinMetadata() { JoinNumber = 4, Label = "DTMF 4", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf5, new JoinMetadata() { JoinNumber = 5, Label = "DTMF 5", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf6, new JoinMetadata() { JoinNumber = 6, Label = "DTMF 6", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf7, new JoinMetadata() { JoinNumber = 7, Label = "DTMF 7", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf8, new JoinMetadata() { JoinNumber = 8, Label = "DTMF 8", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf9, new JoinMetadata() { JoinNumber = 9, Label = "DTMF 9", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf0, new JoinMetadata() { JoinNumber = 10, Label = "DTMF 0", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(DtmfStar, new JoinMetadata() { JoinNumber = 11, Label = "DTMF *", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(DtmfPound, new JoinMetadata() { JoinNumber = 12, Label = "DTMF #", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
foreach (var join in Joins)
|
||||
{
|
||||
join.Value.JoinNumber = join.Value.JoinNumber + joinOffset;
|
||||
}
|
||||
|
||||
PrintJoinMapInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
157
PepperDashEssentials/AppServer/SIMPLJoinMaps/SIMPLVtcJoinMap.cs
Normal file
157
PepperDashEssentials/AppServer/SIMPLJoinMaps/SIMPLVtcJoinMap.cs
Normal file
@@ -0,0 +1,157 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.AppServer
|
||||
{
|
||||
public class SIMPLVtcJoinMap : JoinMapBase
|
||||
{
|
||||
public const string EndCall = "EndCall";
|
||||
public const string IncomingCall = "IncomingCall";
|
||||
public const string IncomingAnswer = "IncomingAnswer";
|
||||
public const string IncomingReject = "IncomingReject";
|
||||
public const string SpeedDialStart = "SpeedDialStart";
|
||||
public const string DirectorySearchBusy = "DirectorySearchBusy";
|
||||
public const string DirectoryLineSelected = "DirectoryLineSelected";
|
||||
public const string DirectoryEntryIsContact = "DirectoryEntryIsContact";
|
||||
public const string DirectoryIsRoot = "DirectoryIsRoot";
|
||||
public const string DDirectoryHasChanged = "DDirectoryHasChanged";
|
||||
public const string DirectoryRoot = "DirectoryRoot";
|
||||
public const string DirectoryFolderBack = "DirectoryFoldeBrack";
|
||||
public const string DirectoryDialSelectedLine = "DirectoryDialSelectedLine";
|
||||
|
||||
public const string CameraTiltUp = "CameraTiltUp";
|
||||
public const string CameraTiltDown = "CameraTiltDown";
|
||||
public const string CameraPanLeft = "CameraPanLeft";
|
||||
public const string CameraPanRight = "CameraPanRight";
|
||||
public const string CameraZoomIn = "CameraZoomIn";
|
||||
public const string CameraZoomOut = "CameraZoomOut";
|
||||
public const string CameraPresetStart = "CameraPresetStart";
|
||||
public const string CameraModeAuto = "CameraModeAuto";
|
||||
public const string CameraModeManual = "CameraModeManual";
|
||||
public const string CameraModeOff = "CameraModeOff";
|
||||
|
||||
public const string CameraSelfView = "CameraSelfView";
|
||||
public const string CameraLayout = "CameraLayout";
|
||||
|
||||
public const string CameraSupportsAutoMode = "CameraSupportsAutoMode";
|
||||
public const string CameraSupportsOffMode = "CameraSupportsOffMode";
|
||||
|
||||
public const string CameraNumberSelect = "CameraNumberSelect";
|
||||
public const string DirectorySelectRow = "DirectorySelectRow";
|
||||
public const string DirectoryRowCount = "DirectoryRowCount";
|
||||
|
||||
public const string CurrentDialString = "CurrentDialString";
|
||||
public const string CurrentCallNumber = "CurrentCallNumber";
|
||||
public const string CurrentCallName = "CurrentCallName";
|
||||
public const string HookState = "HookState";
|
||||
public const string CallDirection = "CallDirection";
|
||||
public const string IncomingCallName = "IncomingCallName";
|
||||
public const string IncomingCallNumber = "IncomingCallNumber";
|
||||
public const string DirectorySearchString = "DirectorySearchString";
|
||||
public const string DirectoryEntriesStart = "EndCaDirectoryEntriesStartll";
|
||||
public const string DirectoryEntrySelectedName = "DirectoryEntrySelectedName";
|
||||
public const string DirectoryEntrySelectedNumber = "DirectoryEntrySelectedNumber";
|
||||
public const string DirectorySelectedFolderName = "DirectorySelectedFolderName";
|
||||
|
||||
public const string Dtmf0 = "0";
|
||||
public const string Dtmf1 = "1";
|
||||
public const string Dtmf2 = "2";
|
||||
public const string Dtmf3 = "3";
|
||||
public const string Dtmf4 = "4";
|
||||
public const string Dtmf5 = "5";
|
||||
public const string Dtmf6 = "6";
|
||||
public const string Dtmf7 = "7";
|
||||
public const string Dtmf8 = "8";
|
||||
public const string Dtmf9 = "9";
|
||||
public const string DtmfStar = "*";
|
||||
public const string DtmfPound = "#";
|
||||
|
||||
|
||||
public SIMPLVtcJoinMap()
|
||||
{
|
||||
// TODO: Set Join metedata
|
||||
|
||||
Joins.Add(EndCall, new JoinMetadata() { JoinNumber = 24, Label = "Hang Up", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(IncomingCall, new JoinMetadata() { JoinNumber = 50, Label = "Incoming Call FB", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(IncomingAnswer, new JoinMetadata() { JoinNumber = 51, Label = "Answer Incoming Call", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(IncomingReject, new JoinMetadata() { JoinNumber = 52, Label = "Reject Incoming Call", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(SpeedDialStart, new JoinMetadata() { JoinNumber = 41, Label = "Speed Dial", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 4, JoinType = eJoinType.Digital });
|
||||
|
||||
Joins.Add(DirectorySearchBusy, new JoinMetadata() { JoinNumber = 100, Label = "Directory Search Busy FB", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(DirectoryLineSelected, new JoinMetadata() { JoinNumber = 101, Label = "Directory Line Selected FB", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(DirectoryEntryIsContact, new JoinMetadata() { JoinNumber = 101, Label = "Directory Selected Entry Is Contact FB", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(DirectoryIsRoot, new JoinMetadata() { JoinNumber = 102, Label = "Directory is on Root FB", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(DDirectoryHasChanged, new JoinMetadata() { JoinNumber = 103, Label = "Directory has changed FB", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(DirectoryRoot, new JoinMetadata() { JoinNumber = 104, Label = "Go to Directory Root", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(DirectoryFolderBack, new JoinMetadata() { JoinNumber = 105, Label = "Go back one directory level", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(DirectoryDialSelectedLine, new JoinMetadata() { JoinNumber = 106, Label = "Dial selected directory line", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
|
||||
Joins.Add(CameraTiltUp, new JoinMetadata() { JoinNumber = 111, Label = "Camera Tilt Up", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(CameraTiltDown, new JoinMetadata() { JoinNumber = 112, Label = "Camera Tilt Down", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(CameraPanLeft, new JoinMetadata() { JoinNumber = 113, Label = "Camera Pan Left", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(CameraPanRight, new JoinMetadata() { JoinNumber = 114, Label = "Camera Pan Right", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(CameraZoomIn, new JoinMetadata() { JoinNumber = 115, Label = "Camera Zoom In", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(CameraZoomOut, new JoinMetadata() { JoinNumber = 116, Label = "Camera Zoom Out", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(CameraPresetStart, new JoinMetadata() { JoinNumber = 121, Label = "Camera Presets", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 5, JoinType = eJoinType.Digital });
|
||||
Joins.Add(CameraModeAuto, new JoinMetadata() { JoinNumber = 131, Label = "Camera Mode Auto", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(CameraModeManual, new JoinMetadata() { JoinNumber = 132, Label = "Camera Mode Manual", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(CameraModeOff, new JoinMetadata() { JoinNumber = 133, Label = "Camera Mode Off", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
|
||||
Joins.Add(CameraSelfView, new JoinMetadata() { JoinNumber = 141, Label = "Camera Self View Toggle/FB", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(CameraLayout, new JoinMetadata() { JoinNumber = 142, Label = "Camera Layout Toggle", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
|
||||
Joins.Add(CameraSupportsAutoMode, new JoinMetadata() { JoinNumber = 143, Label = "Camera Supports Auto Mode FB", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(CameraSupportsOffMode, new JoinMetadata() { JoinNumber = 144, Label = "Camera Supports Off Mode FB", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
|
||||
|
||||
Joins.Add(CameraNumberSelect, new JoinMetadata() { JoinNumber = 60, Label = "Camera Number Select/FB", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinSpan = 1, JoinType = eJoinType.Analog });
|
||||
Joins.Add(DirectorySelectRow, new JoinMetadata() { JoinNumber = 101, Label = "Directory Select Row/FB", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Analog });
|
||||
Joins.Add(DirectoryRowCount, new JoinMetadata() { JoinNumber = 101, Label = "Directory Row Count FB", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Analog });
|
||||
|
||||
Joins.Add(CurrentDialString, new JoinMetadata() { JoinNumber = 1, Label = "Current Dial String", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(CurrentCallNumber, new JoinMetadata() { JoinNumber = 3, Label = "Current Call Number", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(CurrentCallName, new JoinMetadata() { JoinNumber = 2, Label = "Current Call Name", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(HookState, new JoinMetadata() { JoinNumber = 31, Label = "Current Hook State", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(CallDirection, new JoinMetadata() { JoinNumber = 22, Label = "Current Call Direction", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(IncomingCallName, new JoinMetadata() { JoinNumber = 51, Label = "Incoming Call Name", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(IncomingCallNumber, new JoinMetadata() { JoinNumber = 52, Label = "Incoming Call Number", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
|
||||
Joins.Add(DirectorySearchString, new JoinMetadata() { JoinNumber = 100, Label = "Directory Search String", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(DirectoryEntriesStart, new JoinMetadata() { JoinNumber = 101, Label = "Directory Entries", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 255, JoinType = eJoinType.Serial });
|
||||
Joins.Add(DirectoryEntrySelectedName, new JoinMetadata() { JoinNumber = 356, Label = "Selected Directory Entry Name", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(DirectoryEntrySelectedNumber, new JoinMetadata() { JoinNumber = 357, Label = "Selected Directory Entry Number", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
Joins.Add(DirectorySelectedFolderName, new JoinMetadata() { JoinNumber = 358, Label = "Selected Directory Folder Name", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Serial });
|
||||
|
||||
Joins.Add(Dtmf1, new JoinMetadata() { JoinNumber = 1, Label = "DTMF 1", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf2, new JoinMetadata() { JoinNumber = 2, Label = "DTMF 2", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf3, new JoinMetadata() { JoinNumber = 3, Label = "DTMF 3", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf4, new JoinMetadata() { JoinNumber = 4, Label = "DTMF 4", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf5, new JoinMetadata() { JoinNumber = 5, Label = "DTMF 5", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf6, new JoinMetadata() { JoinNumber = 6, Label = "DTMF 6", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf7, new JoinMetadata() { JoinNumber = 7, Label = "DTMF 7", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf8, new JoinMetadata() { JoinNumber = 8, Label = "DTMF 8", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf9, new JoinMetadata() { JoinNumber = 9, Label = "DTMF 9", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(Dtmf0, new JoinMetadata() { JoinNumber = 10, Label = "DTMF 0", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(DtmfStar, new JoinMetadata() { JoinNumber = 11, Label = "DTMF *", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(DtmfPound, new JoinMetadata() { JoinNumber = 12, Label = "DTMF #", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
foreach (var join in Joins)
|
||||
{
|
||||
join.Value.JoinNumber = join.Value.JoinNumber + joinOffset;
|
||||
}
|
||||
|
||||
PrintJoinMapInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -55,6 +55,8 @@ namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public EiscApiPropertiesConfig PropertiesConfig { get; private set; }
|
||||
|
||||
public Dictionary<string, JoinMapBase> JoinMaps { get; set; }
|
||||
|
||||
public ThreeSeriesTcpIpEthernetIntersystemCommunications Eisc { get; private set; }
|
||||
|
||||
public EiscApi(DeviceConfig dc) :
|
||||
@@ -279,10 +281,10 @@ namespace PepperDash.Essentials.Bridges
|
||||
public EssentialsControlPropertiesConfig Control { get; set; }
|
||||
|
||||
[JsonProperty("devices")]
|
||||
public List<ApiDevice> Devices { get; set; }
|
||||
public List<ApiDevicePropertiesConfig> Devices { get; set; }
|
||||
|
||||
|
||||
public class ApiDevice
|
||||
public class ApiDevicePropertiesConfig
|
||||
{
|
||||
[JsonProperty("deviceKey")]
|
||||
public string DeviceKey { get; set; }
|
||||
|
||||
@@ -15,7 +15,6 @@ namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class CameraControllerApiExtensions
|
||||
{
|
||||
|
||||
public static void LinkToApi(this PepperDash.Essentials.Devices.Common.Cameras.CameraBase cameraDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
CameraControllerJoinMap joinMap = new CameraControllerJoinMap();
|
||||
@@ -31,13 +30,13 @@ namespace PepperDash.Essentials.Bridges
|
||||
Debug.Console(0, "Linking to Bridge Type {0}", cameraDevice.GetType().Name.ToString());
|
||||
|
||||
var commMonitor = cameraDevice as ICommunicationMonitor;
|
||||
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.GetJoinForKey(CameraControllerJoinMap.IsOnline)]);
|
||||
|
||||
var ptzCamera = cameraDevice as IHasCameraPtzControl;
|
||||
|
||||
if (ptzCamera != null)
|
||||
{
|
||||
trilist.SetBoolSigAction(joinMap.Left, (b) =>
|
||||
trilist.SetBoolSigAction(joinMap.GetJoinForKey(CameraControllerJoinMap.PanLeft), (b) =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
@@ -48,7 +47,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
ptzCamera.PanStop();
|
||||
}
|
||||
});
|
||||
trilist.SetBoolSigAction(joinMap.Right, (b) =>
|
||||
trilist.SetBoolSigAction(joinMap.GetJoinForKey(CameraControllerJoinMap.PanRight), (b) =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
@@ -60,7 +59,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
}
|
||||
});
|
||||
|
||||
trilist.SetBoolSigAction(joinMap.Up, (b) =>
|
||||
trilist.SetBoolSigAction(joinMap.GetJoinForKey(CameraControllerJoinMap.TiltUp), (b) =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
@@ -71,7 +70,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
ptzCamera.TiltStop();
|
||||
}
|
||||
});
|
||||
trilist.SetBoolSigAction(joinMap.Down, (b) =>
|
||||
trilist.SetBoolSigAction(joinMap.GetJoinForKey(CameraControllerJoinMap.TiltDown), (b) =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
@@ -83,7 +82,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
}
|
||||
});
|
||||
|
||||
trilist.SetBoolSigAction(joinMap.ZoomIn, (b) =>
|
||||
trilist.SetBoolSigAction(joinMap.GetJoinForKey(CameraControllerJoinMap.ZoomIn), (b) =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
@@ -95,7 +94,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
}
|
||||
});
|
||||
|
||||
trilist.SetBoolSigAction(joinMap.ZoomOut, (b) =>
|
||||
trilist.SetBoolSigAction(joinMap.GetJoinForKey(CameraControllerJoinMap.ZoomOut), (b) =>
|
||||
{
|
||||
if (b)
|
||||
{
|
||||
@@ -108,27 +107,57 @@ namespace PepperDash.Essentials.Bridges
|
||||
});
|
||||
}
|
||||
|
||||
if (cameraDevice.GetType().Name.ToString().ToLower() == "cameravisca")
|
||||
if (cameraDevice is IPower)
|
||||
{
|
||||
var viscaCamera = cameraDevice as PepperDash.Essentials.Devices.Common.Cameras.CameraVisca;
|
||||
trilist.SetSigTrueAction(joinMap.PowerOn, () => viscaCamera.PowerOn());
|
||||
trilist.SetSigTrueAction(joinMap.PowerOff, () => viscaCamera.PowerOff());
|
||||
var powerCamera = cameraDevice as IPower;
|
||||
trilist.SetSigTrueAction(joinMap.GetJoinForKey(CameraControllerJoinMap.PowerOn), () => powerCamera.PowerOn());
|
||||
trilist.SetSigTrueAction(joinMap.GetJoinForKey(CameraControllerJoinMap.PowerOff), () => powerCamera.PowerOff());
|
||||
|
||||
powerCamera.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.GetJoinForKey(CameraControllerJoinMap.PowerOn)]);
|
||||
powerCamera.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.GetJoinForKey(CameraControllerJoinMap.PowerOff)]);
|
||||
}
|
||||
|
||||
viscaCamera.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn]);
|
||||
viscaCamera.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff]);
|
||||
if (cameraDevice is ICommunicationMonitor)
|
||||
{
|
||||
var monitoredCamera = cameraDevice as ICommunicationMonitor;
|
||||
monitoredCamera.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.GetJoinForKey(CameraControllerJoinMap.IsOnline)]);
|
||||
}
|
||||
|
||||
viscaCamera.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||
for (int i = 0; i < joinMap.NumberOfPresets; i++)
|
||||
if (cameraDevice is IHasCameraPresets)
|
||||
{
|
||||
// Set the preset lables when they change
|
||||
var presetsCamera = cameraDevice as IHasCameraPresets;
|
||||
presetsCamera.PresetsListHasChanged += new EventHandler<EventArgs>((o, a) =>
|
||||
{
|
||||
for (int i = 1; i <= joinMap.GetJoinForKey(CameraControllerJoinMap.NumberOfPresets); i++)
|
||||
{
|
||||
int tempNum = i - 1;
|
||||
|
||||
string label = "" ;
|
||||
|
||||
var preset = presetsCamera.Presets.FirstOrDefault(p => p.ID.Equals(i));
|
||||
|
||||
if (preset != null)
|
||||
label = preset.Description;
|
||||
|
||||
trilist.SetString((ushort)(joinMap.GetJoinForKey(CameraControllerJoinMap.PresetLabelStart) + tempNum), label);
|
||||
}
|
||||
});
|
||||
|
||||
for (int i = 0; i < joinMap.GetJoinForKey(CameraControllerJoinMap.NumberOfPresets); i++)
|
||||
{
|
||||
int tempNum = i;
|
||||
trilist.SetSigTrueAction((ushort)(joinMap.PresetRecallOffset + tempNum), () =>
|
||||
|
||||
trilist.SetSigTrueAction((ushort)(joinMap.GetJoinForKey(CameraControllerJoinMap.PresetRecallStart) + tempNum), () =>
|
||||
{
|
||||
viscaCamera.RecallPreset(tempNum);
|
||||
presetsCamera.PresetSelect(tempNum);
|
||||
});
|
||||
trilist.SetSigTrueAction((ushort)(joinMap.GetJoinForKey(CameraControllerJoinMap.PresetSaveStart) + tempNum), () =>
|
||||
{
|
||||
var label = trilist.GetString(joinMap.GetJoinForKey(CameraControllerJoinMap.PresetLabelStart + tempNum));
|
||||
|
||||
presetsCamera.PresetStore(tempNum, label);
|
||||
});
|
||||
trilist.SetSigTrueAction((ushort)(joinMap.PresetSaveOffset + tempNum), () =>
|
||||
{
|
||||
viscaCamera.SavePreset(tempNum);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,54 +8,89 @@ using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
/// <summary>
|
||||
/// Join map for CameraBase devices
|
||||
/// </summary>
|
||||
public class CameraControllerJoinMap : JoinMapBase
|
||||
{
|
||||
public uint IsOnline { get; set; }
|
||||
public uint PowerOff { get; set; }
|
||||
public uint PowerOn { get; set; }
|
||||
public uint Up { get; set; }
|
||||
public uint Down { get; set; }
|
||||
public uint Left { get; set; }
|
||||
public uint Right { get; set; }
|
||||
public uint ZoomIn { get; set; }
|
||||
public uint ZoomOut { get; set; }
|
||||
public uint PresetRecallOffset { get; set; }
|
||||
public uint PresetSaveOffset { get; set; }
|
||||
public uint NumberOfPresets { get; set; }
|
||||
public const string IsOnline = "IsOnline";
|
||||
public const string PowerOff = "PowerOff";
|
||||
public const string PowerOn = "PowerOn";
|
||||
public const string TiltUp = "TiltUp";
|
||||
public const string TiltDown = "TiltDown";
|
||||
public const string PanLeft = "PanLeft";
|
||||
public const string PanRight = "PanRight";
|
||||
public const string ZoomIn = "ZoomIn";
|
||||
public const string ZoomOut = "ZoomOut";
|
||||
public const string PresetRecallStart = "PresetRecallStart";
|
||||
public const string PresetSaveStart = "PresetSaveStart";
|
||||
public const string PresetLabelStart = "PresetReacllStgart";
|
||||
public const string NumberOfPresets = "NumberOfPresets";
|
||||
public const string CameraModeAuto = "CameraModeAuto";
|
||||
public const string CameraModeManual = "CameraModeManual";
|
||||
public const string CameraModeOff = "CameraModeOff";
|
||||
public const string SupportsCameraModeAuto = "SupportsCameraModeAuto";
|
||||
public const string SupportsCameraModeOff = "SupportsCameraModeOff";
|
||||
public const string SupportsPresets = "SupportsPresets";
|
||||
|
||||
public CameraControllerJoinMap()
|
||||
{
|
||||
// Digital
|
||||
IsOnline = 9;
|
||||
PowerOff = 8;
|
||||
PowerOn = 7;
|
||||
Up = 1;
|
||||
Down = 2;
|
||||
Left = 3;
|
||||
Right = 4;
|
||||
ZoomIn = 5;
|
||||
ZoomOut = 6;
|
||||
PresetRecallOffset = 10;
|
||||
PresetSaveOffset = 30;
|
||||
NumberOfPresets = 5;
|
||||
// Analog
|
||||
Joins.Add(TiltDown, new JoinMetadata()
|
||||
{ JoinNumber = 1, Label = "Tilt Up", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(TiltDown, new JoinMetadata()
|
||||
{ JoinNumber = 2, Label = "Tilt Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(PanLeft, new JoinMetadata()
|
||||
{ JoinNumber = 3, Label = "Pan Left", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(PanRight, new JoinMetadata()
|
||||
{ JoinNumber = 4, Label = "Pan Right", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(ZoomIn, new JoinMetadata()
|
||||
{ JoinNumber = 5, Label = "Zoom In", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(ZoomOut, new JoinMetadata()
|
||||
{ JoinNumber = 6, Label = "Zoom Out", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
|
||||
Joins.Add(PowerOn, new JoinMetadata()
|
||||
{ JoinNumber = 7, Label = "Power On", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(PowerOff, new JoinMetadata()
|
||||
{ JoinNumber = 8, Label = "Power Off", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(IsOnline, new JoinMetadata()
|
||||
{ JoinNumber = 9, Label = "Is Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
|
||||
Joins.Add(PresetRecallStart, new JoinMetadata()
|
||||
{ JoinNumber = 11, Label = "Preset Recall Start", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 20, JoinType = eJoinType.Digital });
|
||||
Joins.Add(PresetLabelStart, new JoinMetadata()
|
||||
{ JoinNumber = 11, Label = "Preset Label Start", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 20, JoinType = eJoinType.Serial });
|
||||
|
||||
Joins.Add(PresetSaveStart, new JoinMetadata()
|
||||
{ JoinNumber = 31, Label = "Preset Save Start", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 20, JoinType = eJoinType.Digital });
|
||||
|
||||
Joins.Add(NumberOfPresets, new JoinMetadata()
|
||||
{ JoinNumber = 11, Label = "Number of Presets", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Analog });
|
||||
|
||||
Joins.Add(CameraModeAuto, new JoinMetadata()
|
||||
{ JoinNumber = 51, Label = "Camera Mode Auto", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(CameraModeManual, new JoinMetadata()
|
||||
{ JoinNumber = 52, Label = "Camera Mode Manual", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(CameraModeOff, new JoinMetadata()
|
||||
{ JoinNumber = 53, Label = "Camera Mode Off", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
|
||||
Joins.Add(SupportsCameraModeAuto, new JoinMetadata()
|
||||
{ JoinNumber = 55, Label = "Supports Camera Mode Auto", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(SupportsCameraModeOff, new JoinMetadata()
|
||||
{ JoinNumber = 56, Label = "Supports Camera Mode Off", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
Joins.Add(SupportsPresets, new JoinMetadata()
|
||||
{ JoinNumber = 57, Label = "Supports Presets", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinSpan = 1, JoinType = eJoinType.Digital });
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
foreach (var join in Joins)
|
||||
{
|
||||
join.Value.JoinNumber = join.Value.JoinNumber + joinOffset;
|
||||
}
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
PowerOff = PowerOff + joinOffset;
|
||||
PowerOn = PowerOn + joinOffset;
|
||||
Up = Up + joinOffset;
|
||||
Down = Down + joinOffset;
|
||||
Left = Left + joinOffset;
|
||||
Right = Right + joinOffset;
|
||||
ZoomIn = ZoomIn + joinOffset;
|
||||
ZoomOut = ZoomOut + joinOffset;
|
||||
PresetRecallOffset = PresetRecallOffset + joinOffset;
|
||||
PresetSaveOffset = PresetSaveOffset + joinOffset;
|
||||
PrintJoinMapInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -69,7 +69,7 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
var comm = CommFactory.GetControlPropertiesConfig(dc);
|
||||
|
||||
var bridge = new PepperDash.Essentials.Room.MobileControl.MobileControlDdvc01RoomBridge(key, name, comm.IpIdInt);
|
||||
var bridge = new PepperDash.Essentials.Room.MobileControl.MobileControlSIMPLRoomBridge(key, name, comm.IpIdInt);
|
||||
bridge.AddPreActivationAction(() =>
|
||||
{
|
||||
var parent = DeviceManager.AllDevices.FirstOrDefault(d => d.Key == "appServer") as MobileControlSystemController;
|
||||
|
||||
@@ -186,7 +186,7 @@ namespace PepperDash.Essentials.Fusion
|
||||
|
||||
|
||||
FusionRoom.SystemPowerOn.OutputSig.SetSigFalseAction((Room as EssentialsHuddleVtc1Room).PowerOnToDefaultOrLastSource);
|
||||
FusionRoom.SystemPowerOff.OutputSig.SetSigFalseAction(() => (Room as EssentialsHuddleVtc1Room).RunRouteAction("roomOff"));
|
||||
FusionRoom.SystemPowerOff.OutputSig.SetSigFalseAction(() => (Room as EssentialsHuddleVtc1Room).RunRouteAction("roomOff", Room.SourceListKey));
|
||||
// NO!! room.RoomIsOn.LinkComplementInputSig(FusionRoom.SystemPowerOff.InputSig);
|
||||
|
||||
|
||||
@@ -342,7 +342,7 @@ namespace PepperDash.Essentials.Fusion
|
||||
|
||||
// Current Source
|
||||
var defaultDisplaySourceNone = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 8, displayName + "Source None", eSigIoMask.InputOutputSig);
|
||||
defaultDisplaySourceNone.OutputSig.UserObject = new Action<bool>(b => { if (!b) (Room as EssentialsHuddleVtc1Room).RunRouteAction("roomOff"); }); ;
|
||||
defaultDisplaySourceNone.OutputSig.UserObject = new Action<bool>(b => { if (!b) (Room as EssentialsHuddleVtc1Room).RunRouteAction("roomOff", Room.SourceListKey); }); ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,13 +108,21 @@
|
||||
<Reference Include="System.Data" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AppServer\Messengers\CameraBaseMessenger.cs" />
|
||||
<Compile Include="AppServer\Messengers\ConfigMessenger.cs" />
|
||||
<Compile Include="AppServer\Messengers\Ddvc01AtcMessenger.cs" />
|
||||
<Compile Include="AppServer\Messengers\SIMPLAtcMessenger.cs" />
|
||||
<Compile Include="AppServer\Messengers\AudioCodecBaseMessenger.cs" />
|
||||
<Compile Include="AppServer\Messengers\Ddvc01VtcMessenger.cs" />
|
||||
<Compile Include="AppServer\Messengers\SIMPLVtcMessenger.cs" />
|
||||
<Compile Include="AppServer\Messengers\IRunRouteActionMessenger.cs" />
|
||||
<Compile Include="AppServer\Messengers\MessengerBase.cs" />
|
||||
<Compile Include="AppServer\Messengers\SIMPLCameraMessenger.cs" />
|
||||
<Compile Include="AppServer\Messengers\SimplMessengerPropertiesConfig.cs" />
|
||||
<Compile Include="AppServer\Messengers\SIMPLRouteMessenger.cs" />
|
||||
<Compile Include="AppServer\Messengers\SystemMonitorMessenger.cs" />
|
||||
<Compile Include="AppServer\Messengers\VideoCodecBaseMessenger.cs" />
|
||||
<Compile Include="AppServer\SIMPLJoinMaps\SIMPLVtcJoinMap.cs" />
|
||||
<Compile Include="AppServer\SIMPLJoinMaps\SIMPLAtcJoinMap.cs" />
|
||||
<Compile Include="AppServer\SIMPLJoinMaps\MobileControlSIMPLRoomJoinMap.cs" />
|
||||
<Compile Include="Audio\EssentialsVolumeLevelConfig.cs" />
|
||||
<Compile Include="Bridges\AppleTvBridge.cs" />
|
||||
<Compile Include="Bridges\BridgeBase.cs" />
|
||||
@@ -177,7 +185,7 @@
|
||||
<Compile Include="AppServer\MobileControlDdvc01DeviceBridge.cs" />
|
||||
<Compile Include="AppServer\Interfaces.cs" />
|
||||
<Compile Include="AppServer\RoomBridges\MobileControlBridgeBase.cs" />
|
||||
<Compile Include="AppServer\RoomBridges\MobileControlDdvc01RoomBridge.cs" />
|
||||
<Compile Include="AppServer\RoomBridges\MobileControlSIMPLRoomBridge.cs" />
|
||||
<Compile Include="AppServer\RoomBridges\MobileControlEssentialsHuddleSpaceRoomBridge.cs" />
|
||||
<Compile Include="AppServer\DeviceTypeInterfaces\IChannelExtensions.cs" />
|
||||
<Compile Include="AppServer\DeviceTypeInterfaces\IColorExtensions.cs" />
|
||||
|
||||
@@ -4,6 +4,10 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Config
|
||||
{
|
||||
/// <summary>
|
||||
@@ -11,9 +15,28 @@ namespace PepperDash.Essentials.Room.Config
|
||||
/// </summary>
|
||||
public class EssentialsHuddleRoomPropertiesConfig : EssentialsRoomPropertiesConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// The key of the default display device
|
||||
/// </summary>
|
||||
[JsonProperty("defaultDisplayKey")]
|
||||
public string DefaultDisplayKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The key of the default audio device
|
||||
/// </summary>
|
||||
[JsonProperty("defaultAudioKey")]
|
||||
public string DefaultAudioKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The key of the source list for the room
|
||||
/// </summary>
|
||||
[JsonProperty("sourceListKey")]
|
||||
public string SourceListKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The key of the default source item from the source list
|
||||
/// </summary>
|
||||
[JsonProperty("defaultSourceItem")]
|
||||
public string DefaultSourceItem { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -348,7 +348,7 @@ namespace PepperDash.Essentials
|
||||
|
||||
CrestronEnvironment.Sleep(1000);
|
||||
|
||||
RunRouteAction("roomOff");
|
||||
RunRouteAction("roomOff", SourceListKey);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -357,7 +357,7 @@ namespace PepperDash.Essentials
|
||||
public override bool RunDefaultPresentRoute()
|
||||
{
|
||||
if (DefaultSourceItem != null)
|
||||
RunRouteAction(DefaultSourceItem);
|
||||
RunRouteAction(DefaultSourceItem, SourceListKey);
|
||||
|
||||
return DefaultSourceItem != null;
|
||||
}
|
||||
@@ -368,7 +368,7 @@ namespace PepperDash.Essentials
|
||||
/// <returns></returns>
|
||||
public bool RunDefaultCallRoute()
|
||||
{
|
||||
RunRouteAction(DefaultCodecRouteString);
|
||||
RunRouteAction(DefaultCodecRouteString, SourceListKey);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -376,9 +376,9 @@ namespace PepperDash.Essentials
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="routeKey"></param>
|
||||
public void RunRouteAction(string routeKey)
|
||||
public void RunRouteAction(string routeKey, string sourceListKey)
|
||||
{
|
||||
RunRouteAction(routeKey, null);
|
||||
RunRouteAction(routeKey, sourceListKey, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -386,7 +386,7 @@ namespace PepperDash.Essentials
|
||||
/// route or commands
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
public void RunRouteAction(string routeKey, Action successCallback)
|
||||
public void RunRouteAction(string routeKey, string sourceListKey, Action successCallback)
|
||||
{
|
||||
// Run this on a separate thread
|
||||
new CTimer(o =>
|
||||
@@ -398,10 +398,10 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
|
||||
Debug.Console(1, this, "Run route action '{0}'", routeKey);
|
||||
var dict = ConfigReader.ConfigObject.GetSourceListForKey(SourceListKey);
|
||||
var dict = ConfigReader.ConfigObject.GetSourceListForKey(sourceListKey);
|
||||
if (dict == null)
|
||||
{
|
||||
Debug.Console(1, this, "WARNING: Config source list '{0}' not found", SourceListKey);
|
||||
Debug.Console(1, this, "WARNING: Config source list '{0}' not found", sourceListKey);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -619,7 +619,7 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
if (!EnablePowerOnToLastSource || LastSourceKey == null)
|
||||
return;
|
||||
RunRouteAction(LastSourceKey);
|
||||
RunRouteAction(LastSourceKey, SourceListKey);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -630,7 +630,7 @@ namespace PepperDash.Essentials
|
||||
var allRooms = DeviceManager.AllDevices.Where(d =>
|
||||
d is EssentialsHuddleSpaceRoom && !(d as EssentialsHuddleSpaceRoom).ExcludeFromGlobalFunctions);
|
||||
foreach (var room in allRooms)
|
||||
(room as EssentialsHuddleSpaceRoom).RunRouteAction("roomOff");
|
||||
(room as EssentialsHuddleSpaceRoom).RunRouteAction("roomOff", (room as EssentialsHuddleSpaceRoom).SourceListKey);
|
||||
}
|
||||
|
||||
#region IPrivacy Members
|
||||
|
||||
@@ -264,8 +264,30 @@ namespace PepperDash.Essentials
|
||||
/// <param name="routeKey"></param>
|
||||
public void RunRouteAction(string routeKey)
|
||||
{
|
||||
RunRouteAction(routeKey, null);
|
||||
}
|
||||
RunRouteAction(routeKey, new Action(() => { }));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="routeKey"></param>
|
||||
/// <param name="souceListKey"></param>
|
||||
/// <param name="successCallback"></param>
|
||||
public void RunRouteAction(string routeKey, string souceListKey)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="routeKey"></param>
|
||||
/// <param name="souceListKey"></param>
|
||||
/// <param name="successCallback"></param>
|
||||
public void RunRouteAction(string routeKey, string souceListKey, Action successCallback)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a source from config list SourceListKey and dynamically build and executes the
|
||||
|
||||
@@ -394,8 +394,30 @@ namespace PepperDash.Essentials
|
||||
/// <param name="routeKey"></param>
|
||||
public void RunRouteAction(string routeKey)
|
||||
{
|
||||
RunRouteAction(routeKey, null);
|
||||
}
|
||||
RunRouteAction(routeKey, new Action(() => { }));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="routeKey"></param>
|
||||
/// <param name="souceListKey"></param>
|
||||
/// <param name="successCallback"></param>
|
||||
public void RunRouteAction(string routeKey, string souceListKey)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="routeKey"></param>
|
||||
/// <param name="souceListKey"></param>
|
||||
/// <param name="successCallback"></param>
|
||||
public void RunRouteAction(string routeKey, string souceListKey, Action successCallback)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a source from config list SourceListKey and dynamically build and executes the
|
||||
|
||||
@@ -564,7 +564,7 @@ namespace PepperDash.Essentials
|
||||
void UiSelectSource(string key)
|
||||
{
|
||||
// Run the route and when it calls back, show the source
|
||||
CurrentRoom.RunRouteAction(key, null);
|
||||
CurrentRoom.RunRouteAction(key, new Action(() => { }));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -726,7 +726,7 @@ namespace PepperDash.Essentials
|
||||
void UiSelectSource(string key)
|
||||
{
|
||||
// Run the route and when it calls back, show the source
|
||||
CurrentRoom.RunRouteAction(key, null);
|
||||
CurrentRoom.RunRouteAction(key, new Action(() => { }));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -941,7 +941,7 @@ namespace PepperDash.Essentials
|
||||
if (_CurrentRoom != null)
|
||||
_CurrentRoom.CurrentSourceChange += new SourceInfoChangeHandler(CurrentRoom_CurrentSingleSourceChange);
|
||||
|
||||
TriList.SetSigFalseAction(UIBoolJoin.CallStopSharingPress, () => _CurrentRoom.RunRouteAction("codecOsd"));
|
||||
TriList.SetSigFalseAction(UIBoolJoin.CallStopSharingPress, () => _CurrentRoom.RunRouteAction("codecOsd", _CurrentRoom.SourceListKey));
|
||||
|
||||
(Parent as EssentialsPanelMainInterfaceDriver).HeaderDriver.SetupHeaderButtons(this, CurrentRoom);
|
||||
}
|
||||
@@ -987,7 +987,7 @@ namespace PepperDash.Essentials
|
||||
if (CurrentRoom.CurrentSourceInfo != null && CurrentRoom.CurrentSourceInfo.DisableCodecSharing)
|
||||
{
|
||||
Debug.Console(1, CurrentRoom, "Transitioning to in-call, cancelling non-sharable source");
|
||||
CurrentRoom.RunRouteAction("codecOsd");
|
||||
CurrentRoom.RunRouteAction("codecOsd", CurrentRoom.SourceListKey);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,5 +39,25 @@ namespace PepperDash.Essentials.Core.Config
|
||||
|
||||
return SourceLists[key];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks Devices for an item with a Key that matches and returns it if found. Otherwise, retunes null
|
||||
/// </summary>
|
||||
/// <param name="key">Key of desired device</param>
|
||||
/// <returns></returns>
|
||||
public DeviceConfig GetDeviceForKey(string key)
|
||||
{
|
||||
if (string.IsNullOrEmpty(key))
|
||||
return null;
|
||||
|
||||
var deviceConfig = Devices.FirstOrDefault(d => d.Key.Equals(key));
|
||||
|
||||
if (deviceConfig != null)
|
||||
return deviceConfig;
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -67,36 +67,68 @@ namespace PepperDash.Essentials.Core
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Specifies and icon for the source list item
|
||||
/// </summary>
|
||||
[JsonProperty("icon")]
|
||||
public string Icon { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Alternate icon
|
||||
/// </summary>
|
||||
[JsonProperty("altIcon")]
|
||||
public string AltIcon { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates if the item should be included in the source list
|
||||
/// </summary>
|
||||
[JsonProperty("includeInSourceList")]
|
||||
public bool IncludeInSourceList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Used to specify the order of the items in the source list when displayed
|
||||
/// </summary>
|
||||
[JsonProperty("order")]
|
||||
public int Order { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The key of the device for volume control
|
||||
/// </summary>
|
||||
[JsonProperty("volumeControlKey")]
|
||||
public string VolumeControlKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The type of source list item
|
||||
/// </summary>
|
||||
[JsonProperty("type")]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public eSourceListItemType Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The list of routes to execute for this source list item
|
||||
/// </summary>
|
||||
[JsonProperty("routeList")]
|
||||
public List<SourceRouteListItem> RouteList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates if this source should be disabled for sharing to the far end call participants via codec content
|
||||
/// </summary>
|
||||
[JsonProperty("disableCodecSharing")]
|
||||
public bool DisableCodecSharing { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates if this source should be disabled for routing to a shared output
|
||||
/// </summary>
|
||||
[JsonProperty("disableRoutedSharing")]
|
||||
public bool DisableRoutedSharing { get; set; }
|
||||
|
||||
[JsonProperty("destinations")]
|
||||
public List<eSourceListItemDestinationTypes> Destinations { get; set; }
|
||||
/// <summary>
|
||||
/// A means to reference a source list for this source item, in the event that this source has an input that can have sources routed to it
|
||||
/// </summary>
|
||||
[JsonProperty("sourceListKey")]
|
||||
public string SourceListKey { get; set; }
|
||||
|
||||
public SourceListItem()
|
||||
{
|
||||
|
||||
@@ -332,7 +332,7 @@ namespace PepperDash.Essentials.Core.Fusion
|
||||
|
||||
|
||||
FusionRoom.SystemPowerOn.OutputSig.SetSigFalseAction((Room as EssentialsRoomBase).PowerOnToDefaultOrLastSource);
|
||||
FusionRoom.SystemPowerOff.OutputSig.SetSigFalseAction(() => (Room as IRunRouteAction).RunRouteAction("roomOff"));
|
||||
FusionRoom.SystemPowerOff.OutputSig.SetSigFalseAction(() => (Room as IRunRouteAction).RunRouteAction("roomOff", Room.SourceListKey));
|
||||
// NO!! room.RoomIsOn.LinkComplementInputSig(FusionRoom.SystemPowerOff.InputSig);
|
||||
FusionRoom.ErrorMessage.InputSig.StringValue =
|
||||
"3: 7 Errors: This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;";
|
||||
@@ -1086,7 +1086,7 @@ namespace PepperDash.Essentials.Core.Fusion
|
||||
SourceToFeedbackSigs.Add(pSrc, sigD.InputSig);
|
||||
|
||||
// And respond to selection in Fusion
|
||||
sigD.OutputSig.SetSigFalseAction(() => (Room as IRunRouteAction).RunRouteAction(routeKey));
|
||||
sigD.OutputSig.SetSigFalseAction(() => (Room as IRunRouteAction).RunRouteAction(routeKey, Room.SourceListKey));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -1288,7 +1288,7 @@ namespace PepperDash.Essentials.Core.Fusion
|
||||
|
||||
// Current Source
|
||||
var defaultDisplaySourceNone = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 8, displayName + "Source None", eSigIoMask.InputOutputSig);
|
||||
defaultDisplaySourceNone.OutputSig.UserObject = new Action<bool>(b => { if (!b) (Room as IRunRouteAction).RunRouteAction("roomOff"); }); ;
|
||||
defaultDisplaySourceNone.OutputSig.UserObject = new Action<bool>(b => { if (!b) (Room as IRunRouteAction).RunRouteAction("roomOff", Room.SourceListKey); }); ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,11 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public static class JoinMapHelper
|
||||
@@ -42,8 +45,150 @@ namespace PepperDash.Essentials.Core
|
||||
/// <param name="joinStart"></param>
|
||||
public abstract void OffsetJoinNumbers(uint joinStart);
|
||||
|
||||
/// <summary>
|
||||
/// The collection of joins and associated metadata
|
||||
/// </summary>
|
||||
public Dictionary<string, JoinMetadata> Joins = new Dictionary<string, JoinMetadata>();
|
||||
|
||||
/// <summary>
|
||||
/// Prints the join information to console
|
||||
/// </summary>
|
||||
public void PrintJoinMapInfo()
|
||||
{
|
||||
Debug.Console(0, "{0}:\n", this.GetType().Name);
|
||||
|
||||
// Get the joins of each type and print them
|
||||
Debug.Console(0, "Digitals:");
|
||||
var digitals = Joins.Where(j => (j.Value.JoinType & eJoinType.Digital) == eJoinType.Digital).ToDictionary(j => j.Key, j => j.Value);
|
||||
PrintJoinList(GetSortedJoins(digitals));
|
||||
|
||||
Debug.Console(0, "Analogs:");
|
||||
var analogs = Joins.Where(j => (j.Value.JoinType & eJoinType.Analog) == eJoinType.Analog).ToDictionary(j => j.Key, j => j.Value);
|
||||
PrintJoinList(GetSortedJoins(analogs));
|
||||
|
||||
Debug.Console(0, "Serials:");
|
||||
var serials = Joins.Where(j => (j.Value.JoinType & eJoinType.Serial) == eJoinType.Serial).ToDictionary(j => j.Key, j => j.Value);
|
||||
PrintJoinList(GetSortedJoins(serials));
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a sorted list by JoinNumber
|
||||
/// </summary>
|
||||
/// <param name="joins"></param>
|
||||
/// <returns></returns>
|
||||
List<KeyValuePair<string, JoinMetadata>> GetSortedJoins(Dictionary<string, JoinMetadata> joins)
|
||||
{
|
||||
var sortedJoins = joins.ToList();
|
||||
|
||||
sortedJoins.Sort((pair1, pair2) => pair1.Value.JoinNumber.CompareTo(pair2.Value.JoinNumber));
|
||||
|
||||
return sortedJoins;
|
||||
}
|
||||
|
||||
void PrintJoinList(List<KeyValuePair<string, JoinMetadata>> joins)
|
||||
{
|
||||
foreach (var join in joins)
|
||||
{
|
||||
Debug.Console(0,
|
||||
@"Join Number: {0} | Label: '{1}' | JoinSpan: '{2}' | Type: '{3}' | Capabilities: '{4}'",
|
||||
join.Value.JoinNumber,
|
||||
join.Value.Label,
|
||||
join.Value.JoinSpan,
|
||||
join.Value.JoinType.ToString(),
|
||||
join.Value.JoinCapabilities.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the join number for the join with the specified key
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
public uint GetJoinForKey(string key)
|
||||
{
|
||||
if (Joins.ContainsKey(key))
|
||||
return Joins[key].JoinNumber;
|
||||
|
||||
else return 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the join span for the join with the specified key
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
public uint GetJoinSpanForKey(string key)
|
||||
{
|
||||
if (Joins.ContainsKey(key))
|
||||
return Joins[key].JoinSpan;
|
||||
|
||||
else return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read = Provides feedback to SIMPL
|
||||
/// Write = Responds to sig values from SIMPL
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum eJoinCapabilities
|
||||
{
|
||||
None = 0,
|
||||
ToSIMPL = 1,
|
||||
FromSIMPL = 2,
|
||||
ToFromSIMPL = ToSIMPL | FromSIMPL
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum eJoinType
|
||||
{
|
||||
None = 0,
|
||||
Digital = 1,
|
||||
Analog = 2,
|
||||
Serial = 4,
|
||||
DigitalAnalog = Digital | Analog,
|
||||
DigitalSerial = Digital | Serial,
|
||||
AnalogSerial = Analog | Serial,
|
||||
DigitalAnalogSerial = Digital | Analog | Serial
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Data describing the join
|
||||
/// </summary>
|
||||
public class JoinMetadata
|
||||
{
|
||||
/// <summary>
|
||||
/// A label for the join to better describe it's usage
|
||||
/// </summary>
|
||||
[JsonProperty("label")]
|
||||
public string Label { get; set; }
|
||||
/// <summary>
|
||||
/// Signal type(s)
|
||||
/// </summary>
|
||||
[JsonProperty("joinType")]
|
||||
public eJoinType JoinType { get; set; }
|
||||
/// <summary>
|
||||
/// Join number (based on join offset value)
|
||||
/// </summary>
|
||||
[JsonProperty("joinNumber")]
|
||||
public uint JoinNumber { get; set; }
|
||||
/// <summary>
|
||||
/// Join range span. If join indicates the start of a range of joins, this indicated the maximum number of joins in the range
|
||||
/// </summary>
|
||||
[JsonProperty("joinSpan")]
|
||||
public uint JoinSpan { get; set; }
|
||||
/// <summary>
|
||||
/// Indicates whether the join is read and/or write
|
||||
/// </summary>
|
||||
[JsonProperty("joinCapabilities")]
|
||||
public eJoinCapabilities JoinCapabilities { get; set; }
|
||||
/// <summary>
|
||||
/// Indicates a set of valid values (particularly if this translates to an enum
|
||||
/// </summary>
|
||||
[JsonProperty("validValues")]
|
||||
public string[] ValidValues { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -155,6 +155,7 @@
|
||||
<Compile Include="Monitoring\SystemMonitorController.cs" />
|
||||
<Compile Include="Microphone Privacy\MicrophonePrivacyController.cs" />
|
||||
<Compile Include="Microphone Privacy\MicrophonePrivacyControllerConfig.cs" />
|
||||
<Compile Include="Presets\PresetBase.cs" />
|
||||
<Compile Include="Ramps and Increments\ActionIncrementer.cs" />
|
||||
<Compile Include="Config\Comm and IR\CommFactory.cs" />
|
||||
<Compile Include="Config\Comm and IR\CommunicationExtras.cs" />
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Presets
|
||||
{
|
||||
public class PresetBase
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public int ID { get; set; }
|
||||
/// <summary>
|
||||
/// Used to store the name of the preset
|
||||
/// </summary>
|
||||
[JsonProperty("description")]
|
||||
public string Description { get; set; }
|
||||
/// <summary>
|
||||
/// Indicates if the preset is defined(stored) in the codec
|
||||
/// </summary>
|
||||
[JsonProperty("defined")]
|
||||
public bool Defined { get; set; }
|
||||
/// <summary>
|
||||
/// Indicates if the preset has the capability to be defined
|
||||
/// </summary>
|
||||
[JsonProperty("isDefinable")]
|
||||
public bool IsDefinable { get; set; }
|
||||
|
||||
public PresetBase(int id, string description, bool def, bool isDef)
|
||||
{
|
||||
ID = id;
|
||||
Description = description;
|
||||
Defined = def;
|
||||
IsDefinable = isDef;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -173,6 +173,8 @@ namespace PepperDash.Essentials.Core
|
||||
RoomVacancyShutdownTimer.SecondsToCount = RoomVacancyShutdownPromptSeconds;
|
||||
else if (mode == eVacancyMode.InInitialVacancy)
|
||||
RoomVacancyShutdownTimer.SecondsToCount = RoomVacancyShutdownSeconds;
|
||||
else if (mode == eVacancyMode.InShutdownWarning)
|
||||
RoomVacancyShutdownTimer.SecondsToCount = 60;
|
||||
VacancyMode = mode;
|
||||
RoomVacancyShutdownTimer.Start();
|
||||
|
||||
|
||||
@@ -35,9 +35,10 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
public interface IRunRouteAction
|
||||
{
|
||||
void RunRouteAction(string routeKey);
|
||||
void RunRouteAction(string routeKey, string sourceListKey);
|
||||
|
||||
void RunRouteAction(string routeKey, string sourceListKey, Action successCallback);
|
||||
|
||||
void RunRouteAction(string routeKey, Action successCallback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -2,13 +2,16 @@
|
||||
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.Codec;
|
||||
using System.Text.RegularExpressions;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.Reflection;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Presets;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||
{
|
||||
@@ -21,8 +24,16 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||
Focus = 8
|
||||
}
|
||||
|
||||
public abstract class CameraBase : Device
|
||||
public abstract class CameraBase : Device, IRoutingOutputs
|
||||
{
|
||||
public eCameraControlMode ControlMode { get; protected set; }
|
||||
|
||||
#region IRoutingOutputs Members
|
||||
|
||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; protected set; }
|
||||
|
||||
#endregion
|
||||
|
||||
public bool CanPan
|
||||
{
|
||||
get
|
||||
@@ -59,14 +70,37 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||
protected eCameraCapabilities Capabilities { get; set; }
|
||||
|
||||
public CameraBase(string key, string name) :
|
||||
base(key, name) { }
|
||||
base(key, name)
|
||||
{
|
||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
||||
|
||||
ControlMode = eCameraControlMode.Manual;
|
||||
}
|
||||
}
|
||||
|
||||
public class CameraPreset : PresetBase
|
||||
{
|
||||
public CameraPreset(int id, string description, bool isDefined, bool isDefinable)
|
||||
: base(id, description, isDefined, isDefinable)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class CameraPropertiesConfig
|
||||
{
|
||||
public CommunicationMonitorConfig CommunicationMonitorProperties { get; set; }
|
||||
|
||||
public ControlPropertiesConfig Control { get; set; }
|
||||
|
||||
[JsonProperty("supportsAutoMode")]
|
||||
public bool SupportsAutoMode { get; set; }
|
||||
|
||||
[JsonProperty("supportsOffMode")]
|
||||
public bool SupportsOffMode { get; set; }
|
||||
|
||||
[JsonProperty("presets")]
|
||||
public List<CameraPreset> Presets { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -9,9 +9,9 @@ using PepperDash.Essentials.Core;
|
||||
namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||
{
|
||||
public enum eCameraControlMode
|
||||
{
|
||||
Off = 0,
|
||||
Manual,
|
||||
{
|
||||
Manual = 0,
|
||||
Off,
|
||||
Auto
|
||||
}
|
||||
|
||||
@@ -88,6 +88,8 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||
/// </summary>
|
||||
public interface IHasCameraPanControl
|
||||
{
|
||||
// void PanLeft(bool pressRelease);
|
||||
// void PanRight(bool pressRelease);
|
||||
void PanLeft();
|
||||
void PanRight();
|
||||
void PanStop();
|
||||
@@ -98,6 +100,8 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||
/// </summary>
|
||||
public interface IHasCameraTiltControl
|
||||
{
|
||||
// void TiltDown(bool pressRelease);
|
||||
// void TildUp(bool pressRelease);
|
||||
void TiltDown();
|
||||
void TiltUp();
|
||||
void TiltStop();
|
||||
@@ -108,6 +112,8 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||
/// </summary>
|
||||
public interface IHasCameraZoomControl
|
||||
{
|
||||
// void ZoomIn(bool pressRelease);
|
||||
// void ZoomOut(bool pressRelease);
|
||||
void ZoomIn();
|
||||
void ZoomOut();
|
||||
void ZoomStop();
|
||||
|
||||
@@ -11,7 +11,7 @@ using Crestron.SimplSharp.Reflection;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||
{
|
||||
public class CameraVisca : CameraBase, IHasCameraPtzControl, ICommunicationMonitor
|
||||
public class CameraVisca : CameraBase, IHasCameraPtzControl, ICommunicationMonitor, IHasCameraPresets, IPower
|
||||
{
|
||||
public IBasicCommunication Communication { get; private set; }
|
||||
public CommunicationGather PortGather { get; private set; }
|
||||
@@ -25,11 +25,14 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||
public bool PowerIsOn { get; private set; }
|
||||
|
||||
byte[] IncomingBuffer = new byte[] { };
|
||||
public BoolFeedback PowerIsOnFeedback { get; private set; }
|
||||
public BoolFeedback PowerIsOnFeedback { get; private set; }
|
||||
|
||||
public CameraVisca(string key, string name, IBasicCommunication comm, CameraPropertiesConfig props) :
|
||||
base(key, name)
|
||||
{
|
||||
Presets = props.Presets;
|
||||
|
||||
OutputPorts.Add(new RoutingOutputPort("videoOut", eRoutingSignalType.Video, eRoutingPortConnectionType.None, null, this, true));
|
||||
|
||||
// Default to all capabilties
|
||||
Capabilities = eCameraCapabilities.Pan | eCameraCapabilities.Tilt | eCameraCapabilities.Zoom | eCameraCapabilities.Focus;
|
||||
@@ -132,6 +135,15 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||
{
|
||||
SendBytes(new Byte[] {0x81, 0x01, 0x04, 0x00, 0x03, 0xFF});
|
||||
}
|
||||
|
||||
public void PowerToggle()
|
||||
{
|
||||
if (PowerIsOnFeedback.BoolValue)
|
||||
PowerOff();
|
||||
else
|
||||
PowerOn();
|
||||
}
|
||||
|
||||
public void PanLeft()
|
||||
{
|
||||
SendPanTiltCommand(new byte[] {0x01, 0x03});
|
||||
@@ -206,5 +218,22 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||
SendBytes(new byte[] { 0x81, 0x01, 0x04, 0x3F, 0x01, (byte)presetNumber, 0xFF });
|
||||
}
|
||||
|
||||
}
|
||||
#region IHasCameraPresets Members
|
||||
|
||||
public event EventHandler<EventArgs> PresetsListHasChanged;
|
||||
|
||||
public List<CameraPreset> Presets { get; private set; }
|
||||
|
||||
public void PresetSelect(int preset)
|
||||
{
|
||||
RecallPreset(preset);
|
||||
}
|
||||
|
||||
public void PresetStore(int preset, string description)
|
||||
{
|
||||
SavePreset(preset);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||
{
|
||||
/// <summary>
|
||||
/// Describes a camera with preset functionality
|
||||
/// </summary>
|
||||
public interface IHasCameraPresets
|
||||
{
|
||||
event EventHandler<EventArgs> PresetsListHasChanged;
|
||||
|
||||
List<CameraPreset> Presets { get; }
|
||||
|
||||
void PresetSelect(int preset);
|
||||
|
||||
void PresetStore(int preset, string description);
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,19 @@ using System.Text.RegularExpressions;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.DSP
|
||||
{
|
||||
public interface IBiampTesiraDspLevelControl : IBasicVolumeWithFeedback
|
||||
{
|
||||
/// <summary>
|
||||
/// In BiAmp: Instance Tag, QSC: Named Control, Polycom:
|
||||
/// </summary>
|
||||
string ControlPointTag { get; }
|
||||
int Index1 { get; }
|
||||
int Index2 { get; }
|
||||
bool HasMute { get; }
|
||||
bool HasLevel { get; }
|
||||
bool AutomaticUnmuteOnVolumeUp { get; }
|
||||
}
|
||||
|
||||
public class TesiraForteLevelControl : TesiraForteControlPoint, IBiampTesiraDspLevelControl, IKeyed
|
||||
{
|
||||
bool _IsMuted;
|
||||
|
||||
@@ -56,19 +56,4 @@ namespace PepperDash.Essentials.Devices.Common.DSP
|
||||
// ATC
|
||||
// Mics, unusual
|
||||
|
||||
public interface IBiampTesiraDspLevelControl : IBasicVolumeWithFeedback
|
||||
{
|
||||
/// <summary>
|
||||
/// In BiAmp: Instance Tag, QSC: Named Control, Polycom:
|
||||
/// </summary>
|
||||
string ControlPointTag { get; }
|
||||
int Index1 { get; }
|
||||
int Index2 { get; }
|
||||
bool HasMute { get; }
|
||||
bool HasLevel { get; }
|
||||
bool AutomaticUnmuteOnVolumeUp { get; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -102,6 +102,7 @@
|
||||
<Compile Include="AudioCodec\MockAC\MockAcPropertiesConfig.cs" />
|
||||
<Compile Include="Cameras\CameraBase.cs" />
|
||||
<Compile Include="Cameras\CameraVisca.cs" />
|
||||
<Compile Include="Cameras\IHasCameraPresets.cs" />
|
||||
<Compile Include="Codec\eCodecCallDirection.cs" />
|
||||
<Compile Include="Codec\eCodecCallType.cs" />
|
||||
<Compile Include="Codec\eCodecCallStatus.cs" />
|
||||
@@ -114,6 +115,7 @@
|
||||
<Compile Include="Power Controllers\DigitalLoggerPropertiesConfig.cs" />
|
||||
<Compile Include="ImageProcessors\AnalogWay\AnalongWayLiveCore.cs" />
|
||||
<Compile Include="ImageProcessors\AnalogWay\AnalogWayLiveCorePropertiesConfig.cs" />
|
||||
<Compile Include="SoftCodec\BlueJeansPc.cs" />
|
||||
<Compile Include="VideoCodec\CiscoCodec\CiscoCamera.cs" />
|
||||
<Compile Include="VideoCodec\CiscoCodec\RoomPresets.cs" />
|
||||
<Compile Include="Cameras\CameraControl.cs" />
|
||||
|
||||
@@ -129,22 +129,27 @@ namespace PepperDash.Essentials.Devices.Common
|
||||
return new Core.Devices.Laptop(key, name);
|
||||
}
|
||||
|
||||
else if (typeName == "mockvc")
|
||||
{
|
||||
return new VideoCodec.MockVC(dc);
|
||||
}
|
||||
else if (typeName == "bluejeanspc")
|
||||
{
|
||||
return new SoftCodec.BlueJeansPc(key, name);
|
||||
}
|
||||
|
||||
else if (typeName == "mockac")
|
||||
{
|
||||
var props = JsonConvert.DeserializeObject<AudioCodec.MockAcPropertiesConfig>(properties.ToString());
|
||||
return new AudioCodec.MockAC(key, name, props);
|
||||
}
|
||||
else if (typeName == "mockvc")
|
||||
{
|
||||
return new VideoCodec.MockVC(dc);
|
||||
}
|
||||
|
||||
else if (typeName.StartsWith("ciscospark"))
|
||||
{
|
||||
var comm = CommFactory.CreateCommForDevice(dc);
|
||||
return new VideoCodec.Cisco.CiscoSparkCodec(dc, comm);
|
||||
}
|
||||
else if (typeName == "mockac")
|
||||
{
|
||||
var props = JsonConvert.DeserializeObject<AudioCodec.MockAcPropertiesConfig>(properties.ToString());
|
||||
return new AudioCodec.MockAC(key, name, props);
|
||||
}
|
||||
|
||||
else if (typeName.StartsWith("ciscospark"))
|
||||
{
|
||||
var comm = CommFactory.CreateCommForDevice(dc);
|
||||
return new VideoCodec.Cisco.CiscoSparkCodec(dc, comm);
|
||||
}
|
||||
|
||||
else if (typeName == "zoomroom")
|
||||
{
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
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.Core.Routing;
|
||||
using PepperDash.Essentials.Core.Devices;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.SoftCodec
|
||||
{
|
||||
public class BlueJeansPc : InRoomPc, IRoutingInputs, IRunRouteAction, IRoutingSinkNoSwitching
|
||||
{
|
||||
|
||||
public RoutingInputPort AnyVideoIn { get; private set; }
|
||||
|
||||
#region IRoutingInputs Members
|
||||
|
||||
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
public BlueJeansPc(string key, string name)
|
||||
: base(key, name)
|
||||
{
|
||||
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
||||
InputPorts.Add(AnyVideoIn = new RoutingInputPort(RoutingPortNames.AnyVideoIn, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.None, 0, this));
|
||||
}
|
||||
|
||||
#region IRunRouteAction Members
|
||||
|
||||
public void RunRouteAction(string routeKey, string sourceListKey)
|
||||
{
|
||||
RunRouteAction(routeKey, sourceListKey, null);
|
||||
}
|
||||
|
||||
public void RunRouteAction(string routeKey, string sourceListKey, Action successCallback)
|
||||
{
|
||||
CrestronInvoke.BeginInvoke(o =>
|
||||
{
|
||||
Debug.Console(1, this, "Run route action '{0}' on SourceList: {1}", routeKey, sourceListKey);
|
||||
|
||||
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];
|
||||
|
||||
foreach (var route in item.RouteList)
|
||||
{
|
||||
DoRoute(route);
|
||||
}
|
||||
|
||||
// store the name and UI info for routes
|
||||
if (item.SourceKey == "none")
|
||||
{
|
||||
CurrentSourceInfoKey = routeKey;
|
||||
CurrentSourceInfo = null;
|
||||
}
|
||||
else if (item.SourceKey != null)
|
||||
{
|
||||
CurrentSourceInfoKey = routeKey;
|
||||
CurrentSourceInfo = item;
|
||||
}
|
||||
|
||||
// report back when done
|
||||
if (successCallback != null)
|
||||
successCallback();
|
||||
});
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="route"></param>
|
||||
/// <returns></returns>
|
||||
bool DoRoute(SourceRouteListItem route)
|
||||
{
|
||||
IRoutingSinkNoSwitching dest = null;
|
||||
|
||||
dest = DeviceManager.GetDeviceForKey(route.DestinationKey) as IRoutingSinkNoSwitching;
|
||||
|
||||
if (dest == null)
|
||||
{
|
||||
Debug.Console(1, this, "Cannot route, unknown destination '{0}'", route.DestinationKey);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (route.SourceKey.Equals("$off", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
dest.ReleaseRoute();
|
||||
if (dest is IPower)
|
||||
(dest as IPower).PowerOff();
|
||||
}
|
||||
else
|
||||
{
|
||||
var source = DeviceManager.GetDeviceForKey(route.SourceKey) as IRoutingOutputs;
|
||||
if (source == null)
|
||||
{
|
||||
Debug.Console(1, this, "Cannot route unknown source '{0}' to {1}", route.SourceKey, route.DestinationKey);
|
||||
return false;
|
||||
}
|
||||
dest.ReleaseAndMakeRoute(source, route.Type);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region IHasCurrentSourceInfoChange Members
|
||||
|
||||
public string CurrentSourceInfoKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The SourceListItem last run - containing names and icons
|
||||
/// </summary>
|
||||
public SourceListItem CurrentSourceInfo
|
||||
{
|
||||
get { return _CurrentSourceInfo; }
|
||||
set
|
||||
{
|
||||
if (value == _CurrentSourceInfo) return;
|
||||
|
||||
var handler = CurrentSourceChange;
|
||||
// remove from in-use tracker, if so equipped
|
||||
if (_CurrentSourceInfo != null && _CurrentSourceInfo.SourceDevice is IInUseTracking)
|
||||
(_CurrentSourceInfo.SourceDevice as IInUseTracking).InUseTracker.RemoveUser(this, "control");
|
||||
|
||||
if (handler != null)
|
||||
handler(_CurrentSourceInfo, ChangeType.WillChange);
|
||||
|
||||
_CurrentSourceInfo = value;
|
||||
|
||||
// add to in-use tracking
|
||||
if (_CurrentSourceInfo != null && _CurrentSourceInfo.SourceDevice is IInUseTracking)
|
||||
(_CurrentSourceInfo.SourceDevice as IInUseTracking).InUseTracker.AddUser(this, "control");
|
||||
if (handler != null)
|
||||
handler(_CurrentSourceInfo, ChangeType.DidChange);
|
||||
}
|
||||
}
|
||||
SourceListItem _CurrentSourceInfo;
|
||||
|
||||
public event SourceInfoChangeHandler CurrentSourceChange;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ using Crestron.SimplSharp;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core.Presets;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec.Cisco;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
@@ -67,34 +68,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a room preset on a video coded. Typically stores camera position(s) and video routing. Can be recalled by Far End if enabled.
|
||||
/// Represents a room preset on a video codec. Typically stores camera position(s) and video routing. Can be recalled by Far End if enabled.
|
||||
/// </summary>
|
||||
public class CodecRoomPreset
|
||||
public class CodecRoomPreset : PresetBase
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public int ID { get; set; }
|
||||
/// <summary>
|
||||
/// Used to store the name of the preset
|
||||
/// </summary>
|
||||
[JsonProperty("description")]
|
||||
public string Description { get; set; }
|
||||
/// <summary>
|
||||
/// Indicates if the preset is defined(stored) in the codec
|
||||
/// </summary>
|
||||
[JsonProperty("defined")]
|
||||
public bool Defined { get; set; }
|
||||
/// <summary>
|
||||
/// Indicates if the preset has the capability to be defined
|
||||
/// </summary>
|
||||
[JsonProperty("isDefinable")]
|
||||
public bool IsDefinable { get; set; }
|
||||
|
||||
public CodecRoomPreset(int id, string description, bool def, bool isDef)
|
||||
: base(id, description, def, isDef)
|
||||
{
|
||||
ID = id;
|
||||
Description = description;
|
||||
Defined = def;
|
||||
IsDefinable = isDef;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user