mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 21:24:54 +00:00
@@ -11,5 +11,16 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||
bool WebviewIsVisible { get; }
|
||||
void ShowWebView(string url, string mode, string title, string target);
|
||||
void HideWebView();
|
||||
event EventHandler<WebViewStatusChangedEventArgs> WebViewStatusChanged;
|
||||
}
|
||||
|
||||
public class WebViewStatusChangedEventArgs : EventArgs
|
||||
{
|
||||
public string Status { get; }
|
||||
|
||||
public WebViewStatusChangedEventArgs(string status)
|
||||
{
|
||||
Status = status;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
@@ -11,6 +12,7 @@ namespace PepperDash.Essentials.Core
|
||||
/// <summary>
|
||||
/// The IRoutingInputs object this lives on
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public IRoutingInputs ParentDevice { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
@@ -8,6 +9,8 @@ namespace PepperDash.Essentials.Core
|
||||
/// <summary>
|
||||
/// The IRoutingOutputs object this port lives on
|
||||
/// </summary>
|
||||
///
|
||||
[JsonIgnore]
|
||||
public IRoutingOutputs ParentDevice { get; private set; }
|
||||
|
||||
public InUseTracking InUseTracker { get; private set; }
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using PepperDash.Core;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -37,6 +37,7 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||
|
||||
#region IRoutingOutputs Members
|
||||
|
||||
[JsonIgnore]
|
||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; protected set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Core.Logging;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||
using System;
|
||||
@@ -152,11 +153,13 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
message.Name = _device.Name;
|
||||
|
||||
PostStatusMessage(JToken.FromObject(message), MessagePath, clientId);
|
||||
var token = JToken.FromObject(message);
|
||||
|
||||
PostStatusMessage(token, MessagePath, clientId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogMessage(ex, "Exception posting status message", this);
|
||||
this.LogError(ex, "Exception posting status message for {messagePath} to {clientId}", MessagePath, clientId ?? "all clients");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,11 +176,13 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
deviceState.MessageBasePath = MessagePath;
|
||||
|
||||
PostStatusMessage(JToken.FromObject(deviceState), type, clientId);
|
||||
var token = JToken.FromObject(deviceState);
|
||||
|
||||
PostStatusMessage(token, type, clientId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogMessage(ex, "Exception posting status message", this);
|
||||
this.LogError(ex, "Exception posting status message for {type} to {clientId}", type, clientId ?? "all clients");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ using PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using static PepperDash.Essentials.AppServer.Messengers.VideoCodecBaseStateMessage.CameraStatus;
|
||||
|
||||
namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
@@ -77,6 +76,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void CallHistory_RecentCallsListHasChanged(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var state = new VideoCodecBaseStateMessage();
|
||||
|
||||
@@ -90,6 +91,11 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
PostStatusMessage(state);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.LogError(ex, "Error posting call history");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
@@ -106,6 +112,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
/// Posts the current directory
|
||||
/// </summary>
|
||||
protected void SendDirectory(CodecDirectory directory)
|
||||
{
|
||||
try
|
||||
{
|
||||
var state = new VideoCodecBaseStateMessage();
|
||||
|
||||
@@ -116,19 +124,13 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
//state.CurrentDirectory = PrefixDirectoryFolderItems(directory);
|
||||
state.CurrentDirectory = directory;
|
||||
|
||||
CrestronInvoke.BeginInvoke((o) => PostStatusMessage(state));
|
||||
|
||||
/* var directoryMessage = new
|
||||
{
|
||||
currentDirectory = new
|
||||
{
|
||||
directoryResults = prefixedDirectoryResults,
|
||||
isRootDirectory = isRoot
|
||||
}
|
||||
};
|
||||
|
||||
//Spool up a thread in case this is a large quantity of data
|
||||
CrestronInvoke.BeginInvoke((o) => PostStatusMessage(directoryMessage)); */
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.LogError(ex, "Error sending directory");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,6 +140,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Codec_IsReadyChange(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var state = new VideoCodecBaseStateMessage
|
||||
{
|
||||
@@ -147,6 +151,10 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
PostStatusMessage(state);
|
||||
|
||||
SendFullStatus();
|
||||
} catch (Exception ex)
|
||||
{
|
||||
this.LogError(ex, "Error sending codec ready status");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -352,6 +360,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
}
|
||||
|
||||
private void SharingSourceFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var state = new VideoCodecBaseStateMessage
|
||||
{
|
||||
@@ -359,9 +369,15 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
};
|
||||
|
||||
PostStatusMessage(state);
|
||||
} catch (Exception ex)
|
||||
{
|
||||
this.LogError(ex, "Error posting sharing source");
|
||||
}
|
||||
}
|
||||
|
||||
private void SharingContentIsOnFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var state = new VideoCodecBaseStateMessage
|
||||
{
|
||||
@@ -369,9 +385,15 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
};
|
||||
|
||||
PostStatusMessage(state);
|
||||
} catch (Exception ex)
|
||||
{
|
||||
this.LogError(ex, "Error posting sharing content");
|
||||
}
|
||||
}
|
||||
|
||||
private void PhonebookSyncState_InitialSyncCompleted(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var state = new VideoCodecBaseStateMessage
|
||||
{
|
||||
@@ -380,6 +402,11 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
PostStatusMessage(state);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.LogError(ex, "Error posting phonebook sync state");
|
||||
}
|
||||
}
|
||||
|
||||
private void CameraIsOffFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
||||
{
|
||||
@@ -403,9 +430,15 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
|
||||
private void CameraCodec_CameraSelected(object sender, CameraSelectedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
MapCameraActions();
|
||||
PostSelectedCamera();
|
||||
} catch(Exception ex)
|
||||
{
|
||||
this.LogError(ex, "Exception handling camera selected event");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -563,6 +596,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
}
|
||||
|
||||
private void PostCallHistory()
|
||||
{
|
||||
try
|
||||
{
|
||||
var codec = (Codec as IHasCallHistory);
|
||||
|
||||
@@ -580,6 +615,11 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.LogError(ex, "Error posting call history");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper to grab a call with string ID
|
||||
@@ -608,6 +648,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
///
|
||||
/// </summary>
|
||||
private void GetDirectoryRoot()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!(Codec is IHasDirectory dirCodec))
|
||||
{
|
||||
@@ -627,6 +669,11 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
dirCodec.SetCurrentDirectoryToRoot();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.LogError(ex, "Error getting directory root");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Requests the parent folder contents
|
||||
@@ -653,6 +700,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
///
|
||||
/// </summary>
|
||||
private void SendIsReady()
|
||||
{
|
||||
try
|
||||
{
|
||||
var status = new VideoCodecBaseStateMessage();
|
||||
|
||||
@@ -663,19 +712,25 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
PostStatusMessage(status);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.LogError(ex, "Error sending codec ready status");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper method to build call status for vtc
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected VideoCodecBaseStateMessage GetStatus()
|
||||
{
|
||||
try
|
||||
{
|
||||
var status = new VideoCodecBaseStateMessage();
|
||||
|
||||
|
||||
if (Codec is IHasCodecCameras camerasCodec)
|
||||
{
|
||||
status.Cameras = new VideoCodecBaseStateMessage.CameraStatus
|
||||
status.Cameras = new CameraStatus
|
||||
{
|
||||
CameraManualIsSupported = true,
|
||||
CameraAutoIsSupported = Codec.SupportsCameraAutoMode,
|
||||
@@ -716,10 +771,14 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
status.MeetingInfo = meetingInfoCodec.MeetingInfo;
|
||||
}
|
||||
|
||||
//Debug.Console(2, this, "VideoCodecBaseStatus:\n{0}", JsonConvert.SerializeObject(status));
|
||||
|
||||
return status;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.LogError(ex, "Error getting codec status");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void SendFullStatus()
|
||||
{
|
||||
@@ -732,15 +791,24 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
}
|
||||
|
||||
private void PostReceivingContent(bool receivingContent)
|
||||
{
|
||||
try
|
||||
{
|
||||
var state = new VideoCodecBaseStateMessage
|
||||
{
|
||||
ReceivingContent = receivingContent
|
||||
};
|
||||
|
||||
PostStatusMessage(state);
|
||||
} catch(Exception ex)
|
||||
{
|
||||
this.LogError(ex, "Error posting receiving content");
|
||||
}
|
||||
}
|
||||
|
||||
private void PostCameraSelfView()
|
||||
{
|
||||
try
|
||||
{
|
||||
var status = new VideoCodecBaseStateMessage
|
||||
{
|
||||
@@ -750,11 +818,18 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
PostStatusMessage(status);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.LogError(ex, "Error posting camera self view");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
private void PostCameraMode()
|
||||
{
|
||||
try
|
||||
{
|
||||
var status = new VideoCodecBaseStateMessage
|
||||
{
|
||||
@@ -763,20 +838,35 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
PostStatusMessage(status);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.LogError(ex, "Error posting camera mode");
|
||||
}
|
||||
}
|
||||
|
||||
private void PostSelectedCamera()
|
||||
{
|
||||
try
|
||||
{
|
||||
var camerasCodec = Codec as IHasCodecCameras;
|
||||
|
||||
var status = new VideoCodecBaseStateMessage
|
||||
{
|
||||
Cameras = new VideoCodecBaseStateMessage.CameraStatus() { SelectedCamera = GetSelectedCamera(camerasCodec) },
|
||||
Cameras = new CameraStatus() { SelectedCamera = GetSelectedCamera(camerasCodec) },
|
||||
Presets = GetCurrentPresets()
|
||||
};
|
||||
|
||||
PostStatusMessage(status);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.LogError(e, "Error posting selected camera");
|
||||
}
|
||||
}
|
||||
|
||||
private void PostCameraPresets()
|
||||
{
|
||||
try
|
||||
{
|
||||
var status = new VideoCodecBaseStateMessage
|
||||
{
|
||||
@@ -785,6 +875,11 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
PostStatusMessage(status);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
this.LogError(e, "Error posting camera presets");
|
||||
}
|
||||
}
|
||||
|
||||
private Camera GetSelectedCamera(IHasCodecCameras camerasCodec)
|
||||
{
|
||||
@@ -796,7 +891,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
camera.Name = camerasCodec.SelectedCamera.Name;
|
||||
|
||||
camera.Capabilities = new Camera.CameraCapabilities()
|
||||
camera.Capabilities = new CameraCapabilities()
|
||||
{
|
||||
CanPan = camerasCodec.SelectedCamera.CanPan,
|
||||
CanTilt = camerasCodec.SelectedCamera.CanTilt,
|
||||
@@ -922,6 +1017,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
[JsonProperty("supportsAdHocMeeting", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public bool? SupportsAdHocMeeting { get; set; }
|
||||
}
|
||||
|
||||
public class CameraStatus
|
||||
{
|
||||
@@ -942,6 +1038,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
[JsonProperty("selectedCamera", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public Camera SelectedCamera { get; set; }
|
||||
}
|
||||
|
||||
public class Camera
|
||||
{
|
||||
@@ -956,6 +1053,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
[JsonProperty("capabilities", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public CameraCapabilities Capabilities { get; set; }
|
||||
}
|
||||
|
||||
public class CameraCapabilities
|
||||
{
|
||||
@@ -972,11 +1070,6 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
public bool? CanFocus { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class VideoCodecBaseEventMessage : DeviceEventMessageBase
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user