mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-01 13:55:05 +00:00
Compare commits
18 Commits
1.6.5-alph
...
1.6.5-alph
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
753b4e69ee | ||
|
|
b502007fff | ||
|
|
1e6d65fe53 | ||
|
|
72515a79ca | ||
|
|
b286008403 | ||
|
|
c8e3f752db | ||
|
|
33c3822b7c | ||
|
|
97701ef3c4 | ||
|
|
6589f8c4f4 | ||
|
|
eb80f38813 | ||
|
|
862a5ebd12 | ||
|
|
cb89bd3908 | ||
|
|
54dd424b01 | ||
|
|
b6b88086f3 | ||
|
|
b2ec99e663 | ||
|
|
74c101628b | ||
|
|
ea28b8afa4 | ||
|
|
f5d7c90be1 |
@@ -13,6 +13,7 @@ using PepperDash.Essentials.Room.Config;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||
using PepperDash.Essentials.Devices.Common.AudioCodec;
|
||||
using PepperDash_Essentials_Core.DeviceTypeInterfaces;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
@@ -313,7 +314,7 @@ namespace PepperDash.Essentials
|
||||
|
||||
|
||||
VideoCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate();
|
||||
VideoCodec.IsReadyChange += (o, a) => this.SetCodecExternalSources();
|
||||
VideoCodec.IsReadyChange += (o, a) => { this.SetCodecExternalSources(); SetCodecBranding(); };
|
||||
|
||||
if (AudioCodec != null)
|
||||
AudioCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate();
|
||||
@@ -703,29 +704,36 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
string codecTieLine = "";
|
||||
codecTieLine = ConfigReader.ConfigObject.TieLines.SingleOrDefault(x => x.DestinationKey == VideoCodec.Key).DestinationPort;
|
||||
videoCodecWithExternalSwitching.ClearExternalSources();
|
||||
videoCodecWithExternalSwitching.RunRouteAction = RunRouteAction;
|
||||
var srcList = ConfigReader.ConfigObject.SourceLists.SingleOrDefault(x => x.Key == SourceListKey).Value.OrderBy(kv => kv.Value.Order); ;
|
||||
|
||||
foreach (var kvp in srcList)
|
||||
{
|
||||
var srcConfig = kvp.Value;
|
||||
string codecTieLine = ConfigReader.ConfigObject.TieLines.SingleOrDefault(x => x.DestinationKey == VideoCodec.Key).DestinationPort;
|
||||
videoCodecWithExternalSwitching.ClearExternalSources();
|
||||
videoCodecWithExternalSwitching.RunRouteAction = RunRouteAction;
|
||||
var srcList = ConfigReader.ConfigObject.SourceLists.SingleOrDefault(x => x.Key == SourceListKey).Value.OrderBy(kv => kv.Value.Order); ;
|
||||
|
||||
if (kvp.Key != DefaultCodecRouteString && kvp.Key != "roomOff")
|
||||
{
|
||||
foreach (var kvp in srcList)
|
||||
{
|
||||
var srcConfig = kvp.Value;
|
||||
|
||||
videoCodecWithExternalSwitching.AddExternalSource(codecTieLine, kvp.Key, srcConfig.PreferredName, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceType.desktop);
|
||||
videoCodecWithExternalSwitching.SetExternalSourceState(kvp.Key, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceMode.Ready);
|
||||
if (kvp.Key != DefaultCodecRouteString && kvp.Key != "roomOff")
|
||||
{
|
||||
|
||||
videoCodecWithExternalSwitching.AddExternalSource(codecTieLine, kvp.Key, srcConfig.PreferredName, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceType.desktop);
|
||||
videoCodecWithExternalSwitching.SetExternalSourceState(kvp.Key, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceMode.Ready);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetCodecBranding()
|
||||
{
|
||||
var vcWithBranding = VideoCodec as IHasBranding;
|
||||
|
||||
if (vcWithBranding == null) return;
|
||||
|
||||
Debug.Console(1, this, "Setting Codec Branding");
|
||||
vcWithBranding.InitializeBranding(Key);
|
||||
}
|
||||
|
||||
#region IPrivacy Members
|
||||
|
||||
|
||||
@@ -266,7 +266,7 @@ namespace PepperDash_Essentials_Core.Bridges.JoinMaps
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Directory Line Selected FB",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
@@ -447,7 +447,7 @@ namespace PepperDash_Essentials_Core.Bridges.JoinMaps
|
||||
{
|
||||
Description = "Current Hook State",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.Serial
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("IncomingAnswer")] public JoinDataComplete IncomingAnswer =
|
||||
@@ -615,6 +615,101 @@ namespace PepperDash_Essentials_Core.Bridges.JoinMaps
|
||||
JoinType = eJoinType.Analog
|
||||
});
|
||||
|
||||
[JoinName("MicMuteOn")] public JoinDataComplete MicMuteOn =
|
||||
new JoinDataComplete(new JoinData {JoinNumber = 171, JoinSpan = 1},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Mic Mute On",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("MicMuteOff")] public JoinDataComplete MicMuteOff =
|
||||
new JoinDataComplete(new JoinData {JoinNumber = 172, JoinSpan = 1},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Mic Mute Off",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("MicMuteToggle")] public JoinDataComplete MicMuteToggle =
|
||||
new JoinDataComplete(new JoinData {JoinNumber = 173, JoinSpan = 1},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Mic Mute Toggle",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("VolumeMuteOn")]
|
||||
public JoinDataComplete VolumeMuteOn =
|
||||
new JoinDataComplete(new JoinData { JoinNumber = 176, JoinSpan = 1 },
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Volume Mute On",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("VolumeMuteOff")]
|
||||
public JoinDataComplete VolumeMuteOff =
|
||||
new JoinDataComplete(new JoinData { JoinNumber = 177, JoinSpan = 1 },
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Volume Mute Off",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("VolumeMuteToggle")]
|
||||
public JoinDataComplete VolumeMuteToggle =
|
||||
new JoinDataComplete(new JoinData { JoinNumber = 178, JoinSpan = 1 },
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Volume Mute Toggle",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("VolumeUp")] public JoinDataComplete VolumeUp =
|
||||
new JoinDataComplete(new JoinData {JoinNumber = 174, JoinSpan = 1},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Volume Up",
|
||||
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("VolumeDown")]
|
||||
public JoinDataComplete VolumeDown =
|
||||
new JoinDataComplete(new JoinData { JoinNumber = 175, JoinSpan = 1 },
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Volume Down",
|
||||
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("VolumeLevel")]
|
||||
public JoinDataComplete VolumeLevel =
|
||||
new JoinDataComplete(new JoinData { JoinNumber = 174, JoinSpan = 1 },
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Volume Level",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.Analog
|
||||
});
|
||||
|
||||
[JoinName("MinutesBeforeMeetingStart")] public JoinDataComplete MinutesBeforeMeetingStart =
|
||||
new JoinDataComplete(new JoinData {JoinNumber = 41, JoinSpan = 1},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Minutes before meeting start that a meeting is joinable",
|
||||
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
||||
JoinType = eJoinType.Analog
|
||||
});
|
||||
|
||||
public VideoCodecControllerJoinMap(uint joinStart) : base(joinStart, typeof (VideoCodecControllerJoinMap))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
|
||||
{
|
||||
public interface IHasBranding
|
||||
{
|
||||
bool BrandingEnabled { get; }
|
||||
void InitializeBranding(string roomKey);
|
||||
}
|
||||
}
|
||||
@@ -195,6 +195,7 @@
|
||||
<Compile Include="Devices\PC\Laptop.cs" />
|
||||
<Compile Include="Devices\ReconfigurableDevice.cs" />
|
||||
<Compile Include="Devices\VolumeDeviceChangeEventArgs.cs" />
|
||||
<Compile Include="DeviceTypeInterfaces\IHasBranding.cs" />
|
||||
<Compile Include="DeviceTypeInterfaces\IMobileControl.cs" />
|
||||
<Compile Include="Factory\DeviceFactory.cs" />
|
||||
<Compile Include="Factory\IDeviceFactory.cs" />
|
||||
|
||||
@@ -24,24 +24,32 @@ namespace PepperDash.Essentials.Devices.Common.Codec
|
||||
|
||||
public class CodecScheduleAwareness
|
||||
{
|
||||
List<Meeting> _Meetings;
|
||||
List<Meeting> _meetings;
|
||||
|
||||
public event EventHandler<MeetingEventArgs> MeetingEventChange;
|
||||
|
||||
public event EventHandler<EventArgs> MeetingsListHasChanged;
|
||||
|
||||
/// <summary>
|
||||
private int _meetingWarningMinutes = 5;
|
||||
|
||||
public int MeetingWarningMinutes
|
||||
{
|
||||
get { return _meetingWarningMinutes; }
|
||||
set { _meetingWarningMinutes = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Setter triggers MeetingsListHasChanged event
|
||||
/// </summary>
|
||||
public List<Meeting> Meetings
|
||||
{
|
||||
get
|
||||
{
|
||||
return _Meetings;
|
||||
return _meetings;
|
||||
}
|
||||
set
|
||||
{
|
||||
_Meetings = value;
|
||||
_meetings = value;
|
||||
|
||||
var handler = MeetingsListHasChanged;
|
||||
if (handler != null)
|
||||
@@ -51,13 +59,20 @@ namespace PepperDash.Essentials.Devices.Common.Codec
|
||||
}
|
||||
}
|
||||
|
||||
private CTimer ScheduleChecker;
|
||||
private CTimer _scheduleChecker;
|
||||
|
||||
public CodecScheduleAwareness()
|
||||
{
|
||||
Meetings = new List<Meeting>();
|
||||
|
||||
ScheduleChecker = new CTimer(CheckSchedule, null, 1000, 1000);
|
||||
_scheduleChecker = new CTimer(CheckSchedule, null, 1000, 1000);
|
||||
}
|
||||
|
||||
public CodecScheduleAwareness(long pollTime)
|
||||
{
|
||||
Meetings = new List<Meeting>();
|
||||
|
||||
_scheduleChecker = new CTimer(CheckSchedule, null, pollTime, pollTime);
|
||||
}
|
||||
|
||||
private void OnMeetingChange(eMeetingEventChangeType changeType, Meeting meeting)
|
||||
@@ -74,9 +89,9 @@ namespace PepperDash.Essentials.Devices.Common.Codec
|
||||
// Iterate the meeting list and check if any meeting need to do anythingk
|
||||
|
||||
const double meetingTimeEpsilon = 0.0001;
|
||||
foreach (Meeting m in Meetings)
|
||||
foreach (var m in Meetings)
|
||||
{
|
||||
eMeetingEventChangeType changeType = eMeetingEventChangeType.Unkown;
|
||||
var changeType = eMeetingEventChangeType.Unkown;
|
||||
|
||||
if (m.TimeToMeetingStart.TotalMinutes <= m.MeetingWarningMinutes.TotalMinutes) // Meeting is about to start
|
||||
changeType = eMeetingEventChangeType.MeetingStartWarning;
|
||||
@@ -100,12 +115,17 @@ namespace PepperDash.Essentials.Devices.Common.Codec
|
||||
/// </summary>
|
||||
public class Meeting
|
||||
{
|
||||
public TimeSpan MeetingWarningMinutes = TimeSpan.FromMinutes(5);
|
||||
public int MinutesBeforeMeeting;
|
||||
|
||||
public string Id { get; set; }
|
||||
public string Organizer { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string Agenda { get; set; }
|
||||
|
||||
public TimeSpan MeetingWarningMinutes
|
||||
{
|
||||
get { return TimeSpan.FromMinutes(MinutesBeforeMeeting); }
|
||||
}
|
||||
public TimeSpan TimeToMeetingStart
|
||||
{
|
||||
get
|
||||
@@ -134,7 +154,7 @@ namespace PepperDash.Essentials.Devices.Common.Codec
|
||||
{
|
||||
get
|
||||
{
|
||||
return StartTime.AddMinutes(-5) <= DateTime.Now
|
||||
return StartTime.AddMinutes(-MinutesBeforeMeeting) <= DateTime.Now
|
||||
&& DateTime.Now <= EndTime; //.AddMinutes(-5);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,10 +13,12 @@ using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||
using PepperDash.Essentials.Core.Routing;
|
||||
using PepperDash.Essentials.Devices.Common.Cameras;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||
using PepperDash_Essentials_Core.DeviceTypeInterfaces;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
{
|
||||
@@ -26,10 +28,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
|
||||
public class CiscoSparkCodec : VideoCodecBase, IHasCallHistory, IHasCallFavorites, IHasDirectory,
|
||||
IHasScheduleAwareness, IOccupancyStatusProvider, IHasCodecLayouts, IHasCodecSelfView,
|
||||
ICommunicationMonitor, IRouting, IHasCodecCameras, IHasCameraAutoMode, IHasCodecRoomPresets, IHasExternalSourceSwitching
|
||||
ICommunicationMonitor, IRouting, IHasCodecCameras, IHasCameraAutoMode, IHasCodecRoomPresets, IHasExternalSourceSwitching, IHasBranding
|
||||
{
|
||||
public event EventHandler<DirectoryEventArgs> DirectoryResultReturned;
|
||||
|
||||
private CTimer _brandingTimer;
|
||||
|
||||
public CommunicationGather PortGather { get; private set; }
|
||||
|
||||
public StatusMonitorBase CommunicationMonitor { get; private set; }
|
||||
@@ -402,13 +406,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
|
||||
CreateOsdSource();
|
||||
|
||||
if (props.ExternalSourceListEnabled != null)
|
||||
{
|
||||
ExternalSourceListEnabled = props.ExternalSourceListEnabled;
|
||||
}
|
||||
ExternalSourceListEnabled = props.ExternalSourceListEnabled;
|
||||
|
||||
if (props.UiBranding == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Debug.Console(2, this, "Setting branding properties enable: {0} _brandingUrl {1}", props.UiBranding.Enable,
|
||||
props.UiBranding.BrandingUrl);
|
||||
|
||||
BrandingEnabled = props.UiBranding.Enable;
|
||||
_brandingUrl = props.UiBranding.BrandingUrl;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Runs in it's own thread to dequeue messages in the order they were received to be processed
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
@@ -444,6 +454,83 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
TieLineCollection.Default.Add(tl);
|
||||
}
|
||||
|
||||
public void InitializeBranding(string roomKey)
|
||||
{
|
||||
Debug.Console(1, this, "Initializing Branding for room {0}", roomKey);
|
||||
|
||||
if (!BrandingEnabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var mcBridgeKey = String.Format("mobileControlBridge-{0}", roomKey);
|
||||
|
||||
var mcBridge = DeviceManager.GetDeviceForKey(mcBridgeKey) as IMobileControlRoomBridge;
|
||||
|
||||
if (!String.IsNullOrEmpty(_brandingUrl))
|
||||
{
|
||||
Debug.Console(1, this, "Branding URL found: {0}", _brandingUrl);
|
||||
if (_brandingTimer != null)
|
||||
{
|
||||
_brandingTimer.Stop();
|
||||
_brandingTimer.Dispose();
|
||||
}
|
||||
|
||||
_brandingTimer = new CTimer((o) =>
|
||||
{
|
||||
if (_sendMcUrl)
|
||||
{
|
||||
SendMcBrandingUrl(mcBridge);
|
||||
_sendMcUrl = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
SendBrandingUrl();
|
||||
_sendMcUrl = true;
|
||||
}
|
||||
}, 0, 15000);
|
||||
} else if (String.IsNullOrEmpty(_brandingUrl))
|
||||
{
|
||||
Debug.Console(1, this, "No Branding URL found");
|
||||
if (mcBridge == null) return;
|
||||
|
||||
Debug.Console(2, this, "Setting QR code URL: {0}", mcBridge.QrCodeUrl);
|
||||
|
||||
mcBridge.UserCodeChanged += (o, a) => SendMcBrandingUrl(mcBridge);
|
||||
|
||||
SendMcBrandingUrl(mcBridge);
|
||||
}
|
||||
}
|
||||
|
||||
private void SendMcBrandingUrl(IMobileControlRoomBridge mcBridge)
|
||||
{
|
||||
if (mcBridge == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Console(1, this, "Sending url: {0}", mcBridge.QrCodeUrl);
|
||||
|
||||
SendText("xconfiguration userinterface custommessage: \"Scan the QR code with a mobile phone to get started\"");
|
||||
SendText("xconfiguration userinterface osd halfwakemessage: \"Tap the touch panel or scan the QR code with a mobile phone to get started\"");
|
||||
|
||||
SendText(String.Format(
|
||||
"xcommand userinterface branding fetch type: branding url: {0}",
|
||||
mcBridge.QrCodeUrl));
|
||||
SendText(String.Format(
|
||||
"xcommand userinterface branding fetch type: halfwakebranding url: {0}",
|
||||
mcBridge.QrCodeUrl));
|
||||
}
|
||||
|
||||
private void SendBrandingUrl()
|
||||
{
|
||||
Debug.Console(1, this, "Sending url: {0}", _brandingUrl);
|
||||
|
||||
SendText(String.Format("xcommand userinterface branding fetch type: branding url: {0}",
|
||||
_brandingUrl));
|
||||
SendText(String.Format("xcommand userinterface branding fetch type: halfwakebranding url: {0}",
|
||||
_brandingUrl));
|
||||
}
|
||||
/// <summary>
|
||||
/// Starts the HTTP feedback server and syncronizes state of codec
|
||||
/// </summary>
|
||||
@@ -1841,6 +1928,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
private set;
|
||||
}
|
||||
|
||||
public bool BrandingEnabled { get; private set; }
|
||||
private string _brandingUrl;
|
||||
private bool _sendMcUrl;
|
||||
|
||||
/// <summary>
|
||||
/// Adds an external source to the Cisco
|
||||
/// </summary>
|
||||
|
||||
@@ -40,6 +40,9 @@ namespace PepperDash.Essentials.Devices.Common.Codec
|
||||
[JsonProperty("phonebookResultsLimit")]
|
||||
public uint PhonebookResultsLimit { get; set; }
|
||||
|
||||
[JsonProperty("UiBranding")]
|
||||
public BrandingLogoProperties UiBranding { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class SharingProperties
|
||||
@@ -47,4 +50,13 @@ namespace PepperDash.Essentials.Devices.Common.Codec
|
||||
[JsonProperty("autoShareContentWhileInCall")]
|
||||
public bool AutoShareContentWhileInCall { get; set; }
|
||||
}
|
||||
|
||||
public class BrandingLogoProperties
|
||||
{
|
||||
[JsonProperty("enable")]
|
||||
public bool Enable { get; set; }
|
||||
|
||||
[JsonProperty("brandingUrl")]
|
||||
public string BrandingUrl { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -133,16 +133,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
{
|
||||
get
|
||||
{
|
||||
bool value;
|
||||
|
||||
if (ActiveCalls != null)
|
||||
{
|
||||
value = ActiveCalls.Any(c => c.IsActiveCall);
|
||||
}
|
||||
else
|
||||
{
|
||||
value = false;
|
||||
}
|
||||
var value = ActiveCalls != null && ActiveCalls.Any(c => c.IsActiveCall);
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@@ -293,6 +284,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
|
||||
LinkVideoCodecContentSharingToApi(trilist, joinMap);
|
||||
|
||||
LinkVideoCodecPrivacyToApi(trilist, joinMap);
|
||||
|
||||
LinkVideoCodecVolumeToApi(trilist, joinMap);
|
||||
|
||||
if (codec is ICommunicationMonitor)
|
||||
{
|
||||
LinkVideoCodecCommMonitorToApi(codec as ICommunicationMonitor, trilist, joinMap);
|
||||
@@ -371,6 +366,34 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
};
|
||||
}
|
||||
|
||||
private void LinkVideoCodecVolumeToApi(BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
||||
{
|
||||
MuteFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VolumeMuteOn.JoinNumber]);
|
||||
MuteFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.VolumeMuteOff.JoinNumber]);
|
||||
|
||||
trilist.SetSigFalseAction(joinMap.VolumeMuteOn.JoinNumber, MuteOn);
|
||||
trilist.SetSigFalseAction(joinMap.VolumeMuteOff.JoinNumber, MuteOff);
|
||||
trilist.SetSigFalseAction(joinMap.VolumeMuteToggle.JoinNumber, MuteToggle);
|
||||
|
||||
VolumeLevelFeedback.LinkInputSig(trilist.UShortInput[joinMap.VolumeLevel.JoinNumber]);
|
||||
|
||||
trilist.SetBoolSigAction(joinMap.VolumeUp.JoinNumber, VolumeUp);
|
||||
trilist.SetBoolSigAction(joinMap.VolumeDown.JoinNumber, VolumeDown);
|
||||
|
||||
trilist.SetUShortSigAction(joinMap.VolumeLevel.JoinNumber, SetVolume);
|
||||
|
||||
}
|
||||
|
||||
private void LinkVideoCodecPrivacyToApi(BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
||||
{
|
||||
PrivacyModeIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.MicMuteOn.JoinNumber]);
|
||||
PrivacyModeIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.MicMuteOff.JoinNumber]);
|
||||
|
||||
trilist.SetSigFalseAction(joinMap.MicMuteOn.JoinNumber, PrivacyModeOn);
|
||||
trilist.SetSigFalseAction(joinMap.MicMuteOff.JoinNumber, PrivacyModeOff);
|
||||
trilist.SetSigFalseAction(joinMap.MicMuteToggle.JoinNumber, PrivacyModeToggle);
|
||||
}
|
||||
|
||||
private void LinkVideoCodecCommMonitorToApi(ICommunicationMonitor codec, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
||||
{
|
||||
codec.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
|
||||
@@ -452,41 +475,49 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
{
|
||||
trilist.SetSigFalseAction(joinMap.UpdateMeetings.JoinNumber, codec.GetSchedule);
|
||||
|
||||
codec.CodecSchedule.MeetingsListHasChanged += (sender, args) =>
|
||||
trilist.SetUShortSigAction(joinMap.MinutesBeforeMeetingStart.JoinNumber, (i) =>
|
||||
{
|
||||
var clearBytes = XSigHelpers.ClearOutputs();
|
||||
codec.CodecSchedule.MeetingWarningMinutes = i;
|
||||
});
|
||||
|
||||
trilist.SetString(joinMap.Schedule.JoinNumber,
|
||||
Encoding.GetEncoding(XSigEncoding).GetString(clearBytes, 0, clearBytes.Length));
|
||||
codec.CodecSchedule.MeetingsListHasChanged += (sender, args) => UpdateMeetingsList(codec, trilist, joinMap);
|
||||
|
||||
var meetingsData = UpdateMeetingsListXSig(codec.CodecSchedule.Meetings);
|
||||
|
||||
trilist.SetString(joinMap.Schedule.JoinNumber, meetingsData);
|
||||
|
||||
trilist.SetSigFalseAction(joinMap.DialMeeting.JoinNumber, () =>
|
||||
codec.CodecSchedule.MeetingEventChange +=
|
||||
(sender, args) =>
|
||||
{
|
||||
if (codec.CodecSchedule.Meetings[0].Joinable)
|
||||
if (args.ChangeType == eMeetingEventChangeType.MeetingStartWarning)
|
||||
{
|
||||
Dial(codec.CodecSchedule.Meetings[0]);
|
||||
UpdateMeetingsList(codec, trilist, joinMap);
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
trilist.SetUshort(joinMap.MeetingCount.JoinNumber, (ushort) codec.CodecSchedule.Meetings.Count);
|
||||
};
|
||||
private void UpdateMeetingsList(IHasScheduleAwareness codec, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
||||
{
|
||||
var currentTime = DateTime.Now;
|
||||
var currentMeetings =
|
||||
codec.CodecSchedule.Meetings.Where(m => m.StartTime >= currentTime || m.EndTime >= currentTime).ToList();
|
||||
|
||||
var meetingsData = UpdateMeetingsListXSig(currentMeetings);
|
||||
|
||||
trilist.SetString(joinMap.Schedule.JoinNumber, meetingsData);
|
||||
|
||||
trilist.SetSigFalseAction(joinMap.DialMeeting.JoinNumber, () =>
|
||||
{
|
||||
if (codec.CodecSchedule.Meetings[0].Joinable)
|
||||
{
|
||||
Dial(codec.CodecSchedule.Meetings[0]);
|
||||
}
|
||||
});
|
||||
|
||||
trilist.SetUshort(joinMap.MeetingCount.JoinNumber, (ushort)currentMeetings.Count);
|
||||
}
|
||||
|
||||
private string UpdateMeetingsListXSig(List<Meeting> meetings)
|
||||
{
|
||||
/*const int maxCalls = 8;
|
||||
const int maxStrings = 5;
|
||||
const int offset = 6;
|
||||
var callIndex = 0;
|
||||
var digitalIndex = maxStrings*maxCalls;
|
||||
*/
|
||||
|
||||
const int maxMeetings = 3;
|
||||
const int maxDigitals = 1;
|
||||
const int maxStrings = 4;
|
||||
const int maxDigitals = 2;
|
||||
const int maxStrings = 7;
|
||||
const int offset = maxDigitals + maxStrings;
|
||||
var digitalIndex = maxStrings*maxMeetings; //15
|
||||
var stringIndex = 0;
|
||||
@@ -496,37 +527,65 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
/*
|
||||
* Digitals
|
||||
* IsJoinable - 1
|
||||
* IsDialable - 2
|
||||
*
|
||||
* Serials
|
||||
* Organizer - 1
|
||||
* Title - 2
|
||||
* Agenda - 3
|
||||
* Start Date - 3
|
||||
* Start Time - 4
|
||||
* End Time - 5
|
||||
* End Date - 5
|
||||
* End Time - 6
|
||||
*/
|
||||
|
||||
|
||||
foreach(var meeting in meetings)
|
||||
{
|
||||
var currentTime = DateTime.Now;
|
||||
|
||||
if(meeting.StartTime < currentTime && meeting.EndTime < currentTime) continue;
|
||||
|
||||
if (meetingIndex > maxMeetings*offset) break;
|
||||
if (meetingIndex >= maxMeetings*offset) break;
|
||||
|
||||
//digitals
|
||||
tokenArray[digitalIndex] = new XSigDigitalToken(digitalIndex + 1, meeting.Joinable);
|
||||
tokenArray[digitalIndex + 1] = new XSigDigitalToken(digitalIndex + 2, meeting.Id != "0");
|
||||
|
||||
//serials
|
||||
tokenArray[stringIndex] = new XSigSerialToken(stringIndex + 1, meeting.Organizer);
|
||||
tokenArray[stringIndex + 1] = new XSigSerialToken(stringIndex + 2, meeting.Title);
|
||||
tokenArray[stringIndex + 2] = new XSigSerialToken(stringIndex + 3, meeting.StartTime.ToString("MM/dd/yyyy h:mm"));
|
||||
tokenArray[stringIndex + 3] = new XSigSerialToken(stringIndex + 4, meeting.EndTime.ToString("MM/dd/yyyy h:mm"));
|
||||
tokenArray[stringIndex + 2] = new XSigSerialToken(stringIndex + 3, meeting.StartTime.ToShortDateString());
|
||||
tokenArray[stringIndex + 3] = new XSigSerialToken(stringIndex + 4, meeting.StartTime.ToShortTimeString());
|
||||
tokenArray[stringIndex + 4] = new XSigSerialToken(stringIndex + 5, meeting.EndTime.ToShortDateString());
|
||||
tokenArray[stringIndex + 5] = new XSigSerialToken(stringIndex + 6, meeting.EndTime.ToShortTimeString());
|
||||
tokenArray[stringIndex + 6] = new XSigSerialToken(stringIndex + 7, meeting.Id);
|
||||
|
||||
|
||||
digitalIndex += maxDigitals;
|
||||
meetingIndex += offset;
|
||||
stringIndex += maxStrings;
|
||||
}
|
||||
|
||||
while (meetingIndex < maxMeetings*offset)
|
||||
{
|
||||
digitalIndex += maxDigitals;
|
||||
meetingIndex += offset;
|
||||
stringIndex += maxStrings;
|
||||
|
||||
//digitals
|
||||
tokenArray[digitalIndex] = new XSigDigitalToken(digitalIndex + 1, false);
|
||||
tokenArray[digitalIndex + 1] = new XSigDigitalToken(digitalIndex + 2, false);
|
||||
|
||||
//serials
|
||||
tokenArray[stringIndex] = new XSigSerialToken(stringIndex + 1, String.Empty);
|
||||
tokenArray[stringIndex + 1] = new XSigSerialToken(stringIndex + 2, String.Empty);
|
||||
tokenArray[stringIndex + 2] = new XSigSerialToken(stringIndex + 3, String.Empty);
|
||||
tokenArray[stringIndex + 3] = new XSigSerialToken(stringIndex + 4, String.Empty);
|
||||
tokenArray[stringIndex + 4] = new XSigSerialToken(stringIndex + 5, String.Empty);
|
||||
tokenArray[stringIndex + 5] = new XSigSerialToken(stringIndex + 6, String.Empty);
|
||||
tokenArray[stringIndex + 6] = new XSigSerialToken(stringIndex + 7, String.Empty);
|
||||
}
|
||||
|
||||
return GetXSigString(tokenArray);
|
||||
}
|
||||
|
||||
|
||||
@@ -946,8 +946,20 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
public ThirdParty ThirdParty { get; set; }
|
||||
}
|
||||
|
||||
public static List<Meeting> GetGenericMeetingsFromBookingResult(List<BookingsListResult> bookings,
|
||||
int minutesBeforeMeetingStart)
|
||||
{
|
||||
var rv = GetGenericMeetingsFromBookingResult(bookings);
|
||||
|
||||
foreach (var meeting in rv)
|
||||
{
|
||||
meeting.MinutesBeforeMeeting = minutesBeforeMeetingStart;
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
/// <summary>
|
||||
/// Extracts the necessary meeting values from the Cisco bookings response ans converts them to the generic class
|
||||
/// Extracts the necessary meeting values from the Zoom bookings response and converts them to the generic class
|
||||
/// </summary>
|
||||
/// <param name="bookings"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
@@ -22,10 +22,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
IRouting,
|
||||
IHasScheduleAwareness, IHasCodecCameras, IHasParticipants
|
||||
{
|
||||
private const long MeetingRefreshTimer = 60000;
|
||||
private const uint DefaultMeetingDurationMin = 30;
|
||||
private const string Delimiter = "\x0D\x0A";
|
||||
private readonly CrestronQueue<string> _receiveQueue;
|
||||
|
||||
|
||||
private readonly Thread _receiveThread;
|
||||
|
||||
private readonly ZoomRoomSyncState _syncState;
|
||||
@@ -88,7 +90,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
SelfviewIsOnFeedback = new BoolFeedback(SelfViewIsOnFeedbackFunc);
|
||||
|
||||
CodecSchedule = new CodecScheduleAwareness();
|
||||
CodecSchedule = new CodecScheduleAwareness(MeetingRefreshTimer);
|
||||
|
||||
SetUpFeedbackActions();
|
||||
|
||||
@@ -842,7 +844,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
// this is a single participant event notification
|
||||
|
||||
var participant =
|
||||
JsonConvert.DeserializeObject<zCommand.ListParticipant>(responseObj.ToString());
|
||||
JsonConvert.DeserializeObject<zCommand.ListParticipant>(
|
||||
responseObj.ToString());
|
||||
|
||||
if (participant != null)
|
||||
{
|
||||
@@ -946,7 +949,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
if (codecBookings != null && codecBookings.Count > 0)
|
||||
{
|
||||
CodecSchedule.Meetings = zCommand.GetGenericMeetingsFromBookingResult(codecBookings);
|
||||
CodecSchedule.Meetings = zCommand.GetGenericMeetingsFromBookingResult(
|
||||
codecBookings, CodecSchedule.MeetingWarningMinutes);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -1340,13 +1344,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Increments the voluem
|
||||
/// </summary>
|
||||
/// <param name="pressRelease"></param>
|
||||
public override void VolumeUp(bool pressRelease)
|
||||
{
|
||||
// TODO: Implment volume increment that calls SetVolume()
|
||||
// TODO: Implment volume decrement that calls SetVolume()
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user