mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 05:05:00 +00:00
Merge fixup
This commit is contained in:
@@ -17,6 +17,7 @@ using PepperDash.Core;
|
|||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
using PepperDash.Essentials.Room.Cotija;
|
using PepperDash.Essentials.Room.Cotija;
|
||||||
|
using PepperDash.Essentials.AppServer.Messengers;
|
||||||
|
|
||||||
namespace PepperDash.Essentials
|
namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
@@ -39,6 +40,8 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
Dictionary<string, CTimer> PushedActions = new Dictionary<string, CTimer>();
|
Dictionary<string, CTimer> PushedActions = new Dictionary<string, CTimer>();
|
||||||
|
|
||||||
|
public ConfigMessenger ConfigMessenger { get; private set; }
|
||||||
|
|
||||||
CTimer ServerHeartbeatCheckTimer;
|
CTimer ServerHeartbeatCheckTimer;
|
||||||
|
|
||||||
long ServerHeartbeatInterval = 20000;
|
long ServerHeartbeatInterval = 20000;
|
||||||
@@ -49,7 +52,7 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
DateTime LastAckMessage;
|
DateTime LastAckMessage;
|
||||||
|
|
||||||
string SystemUuid;
|
public string SystemUuid;
|
||||||
|
|
||||||
List<CotijaBridgeBase> RoomBridges = new List<CotijaBridgeBase>();
|
List<CotijaBridgeBase> RoomBridges = new List<CotijaBridgeBase>();
|
||||||
|
|
||||||
@@ -97,11 +100,15 @@ namespace PepperDash.Essentials
|
|||||||
CrestronConsole.AddNewConsoleCommand(s => CleanUpWebsocketClient(), "mobiledisco",
|
CrestronConsole.AddNewConsoleCommand(s => CleanUpWebsocketClient(), "mobiledisco",
|
||||||
"Disconnects websocket", ConsoleAccessLevelEnum.AccessOperator);
|
"Disconnects websocket", ConsoleAccessLevelEnum.AccessOperator);
|
||||||
|
|
||||||
|
CrestronConsole.AddNewConsoleCommand(s => ParseStreamRx(s), "mobilesimulateaction", "Simulates a message from the server", ConsoleAccessLevelEnum.AccessOperator);
|
||||||
|
|
||||||
CrestronEnvironment.ProgramStatusEventHandler += new ProgramStatusEventHandler(CrestronEnvironment_ProgramStatusEventHandler);
|
CrestronEnvironment.ProgramStatusEventHandler += new ProgramStatusEventHandler(CrestronEnvironment_ProgramStatusEventHandler);
|
||||||
CrestronEnvironment.EthernetEventHandler += new EthernetEventHandler(CrestronEnvironment_EthernetEventHandler);
|
CrestronEnvironment.EthernetEventHandler += new EthernetEventHandler(CrestronEnvironment_EthernetEventHandler);
|
||||||
|
|
||||||
|
// Config Messenger
|
||||||
|
var cmKey = Key + "-config";
|
||||||
|
ConfigMessenger = new ConfigMessenger(cmKey, "/config");
|
||||||
|
ConfigMessenger.RegisterWithAppServer(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -319,10 +326,12 @@ namespace PepperDash.Essentials
|
|||||||
CrestronConsole.ConsoleCommandResponse(@"Mobile Control Information:
|
CrestronConsole.ConsoleCommandResponse(@"Mobile Control Information:
|
||||||
Server address: {0}
|
Server address: {0}
|
||||||
System Name: {1}
|
System Name: {1}
|
||||||
System UUID: {2}
|
System URL: {2}
|
||||||
System User code: {3}
|
System UUID: {3}
|
||||||
Connected?: {4}
|
System User code: {4}
|
||||||
Seconds Since Last Ack: {5}", url, name, SystemUuid,
|
Connected?: {5}
|
||||||
|
Seconds Since Last Ack: {6}"
|
||||||
|
, url, name, ConfigReader.ConfigObject.SystemUrl, SystemUuid,
|
||||||
code, conn, secSinceLastAck.Seconds);
|
code, conn, secSinceLastAck.Seconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -452,9 +461,9 @@ namespace PepperDash.Essentials
|
|||||||
Debug.Console(1, this, "Socket send result error: {0}", result);
|
Debug.Console(1, this, "Socket send result error: {0}", result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!WSClient.Connected)
|
else if (WSClient == null)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "Cannot send. Not connected {0}");
|
Debug.Console(1, this, "Cannot send. Not connected.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
75
PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs
Normal file
75
PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles interactions with the app server to update the config
|
||||||
|
/// </summary>
|
||||||
|
public class ConfigMessenger : MessengerBase
|
||||||
|
{
|
||||||
|
public ConfigMessenger(string key, string messagePath)
|
||||||
|
: base(key, messagePath)
|
||||||
|
{
|
||||||
|
ConfigUpdater.ConfigStatusChanged -= ConfigUpdater_ConfigStatusChanged;
|
||||||
|
ConfigUpdater.ConfigStatusChanged += new EventHandler<ConfigStatusEventArgs>(ConfigUpdater_ConfigStatusChanged);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConfigUpdater_ConfigStatusChanged(object sender, ConfigStatusEventArgs e)
|
||||||
|
{
|
||||||
|
PostUpdateStatus(e.UpdateStatus.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void CustomRegisterWithAppServer(CotijaSystemController appServerController)
|
||||||
|
{
|
||||||
|
appServerController.AddAction(MessagePath + "/updateConfig", new Action<string>(s => GetConfigFile(s)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Generates or passes the URL to make the request to GET the config from a server
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="url"></param>
|
||||||
|
void GetConfigFile(string url)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Attempt to parse the URL
|
||||||
|
var parser = new Crestron.SimplSharp.Net.Http.UrlParser(url);
|
||||||
|
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Successfully parsed URL from AppServer message: {0}", parser.Url);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
// If unable to parse the URL, generate it from config data
|
||||||
|
Debug.Console(2, "Error parsing URL: {0}", e);
|
||||||
|
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Unable to parse URL from AppServer message. Generating URL from config data");
|
||||||
|
url = string.Format("http://{0}/api/system/{1}/config", AppServerController.Config.ServerUrl, AppServerController.SystemUuid);
|
||||||
|
}
|
||||||
|
|
||||||
|
ConfigUpdater.GetConfigFromServer(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Posts a message with the current status of the config update
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="status"></param>
|
||||||
|
void PostUpdateStatus(string status)
|
||||||
|
{
|
||||||
|
PostStatusMessage(new
|
||||||
|
{
|
||||||
|
updateStatus = status
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -40,8 +40,11 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
void ProgramInfoChanged(object sender, ProgramInfoEventArgs e)
|
void ProgramInfoChanged(object sender, ProgramInfoEventArgs e)
|
||||||
{
|
{
|
||||||
Debug.Console(1, "Posting Status Message: {0}", e.ProgramInfo.ToString());
|
if (e.ProgramInfo != null)
|
||||||
PostStatusMessage(e.ProgramInfo);
|
{
|
||||||
|
//Debug.Console(1, "Posting Status Message: {0}", e.ProgramInfo.ToString());
|
||||||
|
PostStatusMessage(e.ProgramInfo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
if (dirCodec != null)
|
if (dirCodec != null)
|
||||||
{
|
{
|
||||||
dirCodec.DirectoryResultReturned += new EventHandler<DirectoryEventArgs>(dirCodec_DirectoryResultReturned);
|
dirCodec.DirectoryResultReturned += new EventHandler<DirectoryEventArgs>(dirCodec_DirectoryResultReturned);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var recCodec = codec as IHasCallHistory;
|
var recCodec = codec as IHasCallHistory;
|
||||||
@@ -74,12 +75,73 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
void dirCodec_DirectoryResultReturned(object sender, DirectoryEventArgs e)
|
void dirCodec_DirectoryResultReturned(object sender, DirectoryEventArgs e)
|
||||||
{
|
{
|
||||||
PostStatusMessage(new
|
SendDirectory((Codec as IHasDirectory).CurrentDirectoryResult, e.DirectoryIsOnRoot);
|
||||||
{
|
|
||||||
currentDirectory = e.Directory
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Posts the current directory
|
||||||
|
/// </summary>
|
||||||
|
void SendDirectory(CodecDirectory directory, bool isRoot)
|
||||||
|
{
|
||||||
|
var dirCodec = Codec as IHasDirectory;
|
||||||
|
|
||||||
|
if (dirCodec != null)
|
||||||
|
{
|
||||||
|
var prefixedDirectoryResults = PrefixDirectoryFolderItems(directory);
|
||||||
|
|
||||||
|
var directoryMessage = new
|
||||||
|
{
|
||||||
|
currentDirectory = new
|
||||||
|
{
|
||||||
|
directoryResults = prefixedDirectoryResults,
|
||||||
|
isRootDirectory = isRoot
|
||||||
|
}
|
||||||
|
};
|
||||||
|
PostStatusMessage(directoryMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Iterates a directory object and prefixes any folder items with "[+] "
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="directory"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
List<DirectoryItem> PrefixDirectoryFolderItems (CodecDirectory directory)
|
||||||
|
{
|
||||||
|
var tempDirectoryList = new List<DirectoryItem>();
|
||||||
|
|
||||||
|
if (directory.CurrentDirectoryResults.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (var item in directory.CurrentDirectoryResults)
|
||||||
|
{
|
||||||
|
if (item is DirectoryFolder)
|
||||||
|
{
|
||||||
|
var newFolder = new DirectoryFolder();
|
||||||
|
|
||||||
|
newFolder = (DirectoryFolder)item.Clone();
|
||||||
|
|
||||||
|
string prefixName = "[+] " + newFolder.Name;
|
||||||
|
|
||||||
|
newFolder.Name = prefixName;
|
||||||
|
|
||||||
|
tempDirectoryList.Add(newFolder);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tempDirectoryList.Add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
// DirectoryItem noResults = new DirectoryItem() { Name = "No Results Found" };
|
||||||
|
|
||||||
|
// tempDirectoryList.Add(noResults);
|
||||||
|
//}
|
||||||
|
|
||||||
|
return tempDirectoryList;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -122,10 +184,24 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
if (call != null)
|
if (call != null)
|
||||||
Codec.AcceptCall(call);
|
Codec.AcceptCall(call);
|
||||||
}));
|
}));
|
||||||
appServerController.AddAction(MessagePath + "/getDirectory", new Action(GetDirectoryRoot));
|
|
||||||
appServerController.AddAction(MessagePath + "/directoryById", new Action<string>(s => GetDirectory(s)));
|
// Directory actions
|
||||||
appServerController.AddAction(MessagePath + "/directorySearch", new Action<string>(s => DirectorySearch(s)));
|
var dirCodec = Codec as IHasDirectory;
|
||||||
appServerController.AddAction(MessagePath + "/getCallHistory", new Action(GetCallHistory));
|
if (dirCodec != null)
|
||||||
|
{
|
||||||
|
appServerController.AddAction(MessagePath + "/getDirectory", new Action(GetDirectoryRoot));
|
||||||
|
appServerController.AddAction(MessagePath + "/directoryById", new Action<string>(s => GetDirectory(s)));
|
||||||
|
appServerController.AddAction(MessagePath + "/directorySearch", new Action<string>(s => DirectorySearch(s)));
|
||||||
|
appServerController.AddAction(MessagePath + "/directoryBack", new Action(GetPreviousDirectory));
|
||||||
|
}
|
||||||
|
|
||||||
|
// History actions
|
||||||
|
var recCodec = Codec as IHasCallHistory;
|
||||||
|
if (recCodec != null)
|
||||||
|
{
|
||||||
|
appServerController.AddAction(MessagePath + "/getCallHistory", new Action(GetCallHistory));
|
||||||
|
}
|
||||||
|
|
||||||
appServerController.AddAction(MessagePath + "/privacyModeOn", new Action(Codec.PrivacyModeOn));
|
appServerController.AddAction(MessagePath + "/privacyModeOn", new Action(Codec.PrivacyModeOn));
|
||||||
appServerController.AddAction(MessagePath + "/privacyModeOff", new Action(Codec.PrivacyModeOff));
|
appServerController.AddAction(MessagePath + "/privacyModeOff", new Action(Codec.PrivacyModeOff));
|
||||||
appServerController.AddAction(MessagePath + "/privacyModeToggle", new Action(Codec.PrivacyModeToggle));
|
appServerController.AddAction(MessagePath + "/privacyModeToggle", new Action(Codec.PrivacyModeToggle));
|
||||||
@@ -215,12 +291,28 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PostStatusMessage(new
|
dirCodec.SetCurrentDirectoryToRoot();
|
||||||
{
|
|
||||||
currentDirectory = dirCodec.DirectoryRoot
|
//PostStatusMessage(new
|
||||||
});
|
//{
|
||||||
|
// currentDirectory = dirCodec.DirectoryRoot
|
||||||
|
//});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Requests the parent folder contents
|
||||||
|
/// </summary>
|
||||||
|
void GetPreviousDirectory()
|
||||||
|
{
|
||||||
|
var dirCodec = Codec as IHasDirectory;
|
||||||
|
if (dirCodec == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
dirCodec.GetDirectoryParentFolderContents();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handler for codec changes
|
/// Handler for codec changes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -271,6 +363,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
},
|
},
|
||||||
showSelfViewByDefault = Codec.ShowSelfViewByDefault,
|
showSelfViewByDefault = Codec.ShowSelfViewByDefault,
|
||||||
hasDirectory = Codec is IHasDirectory,
|
hasDirectory = Codec is IHasDirectory,
|
||||||
|
hasDirectorySearch = true,
|
||||||
hasRecents = Codec is IHasCallHistory,
|
hasRecents = Codec is IHasCallHistory,
|
||||||
hasCameras = Codec is IHasCameraControl
|
hasCameras = Codec is IHasCameraControl
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
public AudioCodecBaseMessenger ACMessenger { get; private set; }
|
public AudioCodecBaseMessenger ACMessenger { get; private set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ namespace PepperDash.Essentials
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines if the program is running on a processor (appliance) or server (XiO Edge).
|
/// Determines if the program is running on a processor (appliance) or server (VC-4).
|
||||||
///
|
///
|
||||||
/// Sets Global.FilePathPrefix based on platform
|
/// Sets Global.FilePathPrefix based on platform
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -179,7 +179,7 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify the
|
// Notify the OS that the program intitialization has completed
|
||||||
SystemMonitor.ProgramInitialization.ProgramInitializationComplete = true;
|
SystemMonitor.ProgramInitialization.ProgramInitializationComplete = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,6 +108,7 @@
|
|||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="AppServer\Messengers\ConfigMessenger.cs" />
|
||||||
<Compile Include="AppServer\Messengers\Ddvc01AtcMessenger.cs" />
|
<Compile Include="AppServer\Messengers\Ddvc01AtcMessenger.cs" />
|
||||||
<Compile Include="AppServer\Messengers\AudioCodecBaseMessenger.cs" />
|
<Compile Include="AppServer\Messengers\AudioCodecBaseMessenger.cs" />
|
||||||
<Compile Include="AppServer\Messengers\Ddvc01VtcMessenger.cs" />
|
<Compile Include="AppServer\Messengers\Ddvc01VtcMessenger.cs" />
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ namespace PepperDash.Essentials.Room.Config
|
|||||||
var microphonePrivacy = props.MicrophonePrivacy;
|
var microphonePrivacy = props.MicrophonePrivacy;
|
||||||
if (microphonePrivacy == null)
|
if (microphonePrivacy == null)
|
||||||
{
|
{
|
||||||
Debug.Console(0, "ERROR: Cannot create microphone privacy with null properties");
|
Debug.Console(0, "Cannot create microphone privacy with null properties");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
// Get the MicrophonePrivacy device from the device manager
|
// Get the MicrophonePrivacy device from the device manager
|
||||||
|
|||||||
@@ -266,6 +266,16 @@ namespace PepperDash.Essentials
|
|||||||
{
|
{
|
||||||
IsCoolingDownFeedback.FireUpdate();
|
IsCoolingDownFeedback.FireUpdate();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Get Microphone Privacy object, if any
|
||||||
|
this.MicrophonePrivacy = EssentialsRoomConfigHelper.GetMicrophonePrivacy(PropertiesConfig, this);
|
||||||
|
|
||||||
|
Debug.Console(2, this, "Microphone Privacy Config evaluated.");
|
||||||
|
|
||||||
|
// Get emergency object, if any
|
||||||
|
this.Emergency = EssentialsRoomConfigHelper.GetEmergency(PropertiesConfig, this);
|
||||||
|
|
||||||
|
Debug.Console(2, this, "Emergency Config evaluated.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -279,7 +289,7 @@ namespace PepperDash.Essentials
|
|||||||
inAudioCall = AudioCodec.IsInCall;
|
inAudioCall = AudioCodec.IsInCall;
|
||||||
|
|
||||||
if(VideoCodec != null)
|
if(VideoCodec != null)
|
||||||
inVideoCall = AudioCodec.IsInCall;
|
inVideoCall = VideoCodec.IsInCall;
|
||||||
|
|
||||||
if (inAudioCall || inVideoCall)
|
if (inAudioCall || inVideoCall)
|
||||||
return true;
|
return true;
|
||||||
@@ -327,12 +337,6 @@ namespace PepperDash.Essentials
|
|||||||
this.DefaultSourceItem = PropertiesConfig.DefaultSourceItem;
|
this.DefaultSourceItem = PropertiesConfig.DefaultSourceItem;
|
||||||
this.DefaultVolume = (ushort)(PropertiesConfig.Volumes.Master.Level * 65535 / 100);
|
this.DefaultVolume = (ushort)(PropertiesConfig.Volumes.Master.Level * 65535 / 100);
|
||||||
|
|
||||||
// Get Microphone Privacy object, if any
|
|
||||||
this.MicrophonePrivacy = EssentialsRoomConfigHelper.GetMicrophonePrivacy(PropertiesConfig, this);
|
|
||||||
|
|
||||||
// Get emergency object, if any
|
|
||||||
this.Emergency = EssentialsRoomConfigHelper.GetEmergency(PropertiesConfig, this);
|
|
||||||
|
|
||||||
return base.CustomActivate();
|
return base.CustomActivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -927,7 +927,10 @@ namespace PepperDash.Essentials
|
|||||||
_CurrentRoom.CurrentSingleSourceChange += CurrentRoom_SourceInfoChange;
|
_CurrentRoom.CurrentSingleSourceChange += CurrentRoom_SourceInfoChange;
|
||||||
RefreshSourceInfo();
|
RefreshSourceInfo();
|
||||||
|
|
||||||
(_CurrentRoom.VideoCodec as IHasScheduleAwareness).CodecSchedule.MeetingsListHasChanged += CodecSchedule_MeetingsListHasChanged;
|
if (_CurrentRoom.VideoCodec is IHasScheduleAwareness)
|
||||||
|
{
|
||||||
|
(_CurrentRoom.VideoCodec as IHasScheduleAwareness).CodecSchedule.MeetingsListHasChanged += CodecSchedule_MeetingsListHasChanged;
|
||||||
|
}
|
||||||
|
|
||||||
CallSharingInfoVisibleFeedback = new BoolFeedback(() => _CurrentRoom.VideoCodec.SharingContentIsOnFeedback.BoolValue);
|
CallSharingInfoVisibleFeedback = new BoolFeedback(() => _CurrentRoom.VideoCodec.SharingContentIsOnFeedback.BoolValue);
|
||||||
_CurrentRoom.VideoCodec.SharingContentIsOnFeedback.OutputChange += SharingContentIsOnFeedback_OutputChange;
|
_CurrentRoom.VideoCodec.SharingContentIsOnFeedback.OutputChange += SharingContentIsOnFeedback_OutputChange;
|
||||||
|
|||||||
@@ -58,16 +58,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
SmartObjectDynamicList RecentCallsList;
|
SmartObjectDynamicList RecentCallsList;
|
||||||
|
|
||||||
SmartObjectDynamicList DirectoryList;
|
SmartObjectDynamicList DirectoryList;
|
||||||
|
|
||||||
CodecDirectory CurrentDirectoryResult;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Tracks the directory browse history when browsing beyond the root directory
|
|
||||||
/// </summary>
|
|
||||||
List<CodecDirectory> DirectoryBrowseHistory;
|
|
||||||
|
|
||||||
bool NextDirectoryResultIsFolderContents;
|
|
||||||
|
|
||||||
BoolFeedback DirectoryBackButtonVisibleFeedback;
|
BoolFeedback DirectoryBackButtonVisibleFeedback;
|
||||||
|
|
||||||
// These are likely temp until we get a keyboard built
|
// These are likely temp until we get a keyboard built
|
||||||
@@ -111,7 +102,6 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
SetupCallStagingPopover();
|
SetupCallStagingPopover();
|
||||||
SetupDialKeypad();
|
SetupDialKeypad();
|
||||||
ActiveCallsSRL = new SubpageReferenceList(triList, UISmartObjectJoin.CodecActiveCallsHeaderList, 5,5,5);
|
ActiveCallsSRL = new SubpageReferenceList(triList, UISmartObjectJoin.CodecActiveCallsHeaderList, 5,5,5);
|
||||||
SetupDirectoryList();
|
|
||||||
SetupRecentCallsList();
|
SetupRecentCallsList();
|
||||||
SetupFavorites();
|
SetupFavorites();
|
||||||
SetupLayoutControls();
|
SetupLayoutControls();
|
||||||
@@ -169,12 +159,14 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
});
|
});
|
||||||
SearchStringFeedback.LinkInputSig(triList.StringInput[UIStringJoin.CodecDirectorySearchEntryText]);
|
SearchStringFeedback.LinkInputSig(triList.StringInput[UIStringJoin.CodecDirectorySearchEntryText]);
|
||||||
|
|
||||||
|
SetupDirectoryList();
|
||||||
|
|
||||||
SearchStringBackspaceVisibleFeedback = new BoolFeedback(() => SearchStringBuilder.Length > 0);
|
SearchStringBackspaceVisibleFeedback = new BoolFeedback(() => SearchStringBuilder.Length > 0);
|
||||||
SearchStringBackspaceVisibleFeedback.LinkInputSig(triList.BooleanInput[UIBoolJoin.VCDirectoryBackspaceVisible]);
|
SearchStringBackspaceVisibleFeedback.LinkInputSig(triList.BooleanInput[UIBoolJoin.VCDirectoryBackspaceVisible]);
|
||||||
|
|
||||||
triList.SetSigFalseAction(UIBoolJoin.VCDirectoryBackPress, GetDirectoryParentFolderContents);
|
triList.SetSigFalseAction(UIBoolJoin.VCDirectoryBackPress, GetDirectoryParentFolderContents);
|
||||||
|
|
||||||
DirectoryBackButtonVisibleFeedback = new BoolFeedback(() => CurrentDirectoryResult != (codec as IHasDirectory).DirectoryRoot);
|
DirectoryBackButtonVisibleFeedback = (codec as IHasDirectory).CurrentDirectoryResultIsNotDirectoryRoot;
|
||||||
DirectoryBackButtonVisibleFeedback
|
DirectoryBackButtonVisibleFeedback
|
||||||
.LinkInputSig(triList.BooleanInput[UIBoolJoin.VCDirectoryBackVisible]);
|
.LinkInputSig(triList.BooleanInput[UIBoolJoin.VCDirectoryBackVisible]);
|
||||||
|
|
||||||
@@ -532,8 +524,6 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
void SetupDirectoryList()
|
void SetupDirectoryList()
|
||||||
{
|
{
|
||||||
DirectoryBrowseHistory = new List<CodecDirectory>();
|
|
||||||
|
|
||||||
var codec = Codec as IHasDirectory;
|
var codec = Codec as IHasDirectory;
|
||||||
if (codec != null)
|
if (codec != null)
|
||||||
{
|
{
|
||||||
@@ -548,28 +538,20 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
codec.PhonebookSyncState.InitialSyncCompleted += new EventHandler<EventArgs>(PhonebookSyncState_InitialSyncCompleted);
|
codec.PhonebookSyncState.InitialSyncCompleted += new EventHandler<EventArgs>(PhonebookSyncState_InitialSyncCompleted);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RefreshDirectory();
|
||||||
// If there is something here now, show it otherwise wait for the event
|
|
||||||
if (CurrentDirectoryResult != null && codec.DirectoryRoot.DirectoryResults.Count > 0)
|
|
||||||
{
|
|
||||||
RefreshDirectory();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets the current directory resutls to the DirectorRoot and updates Back Button visibiltiy
|
/// Sets the current directory results to the DirectoryRoot and updates Back Button visibiltiy
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void SetCurrentDirectoryToRoot()
|
void SetCurrentDirectoryToRoot()
|
||||||
{
|
{
|
||||||
DirectoryBrowseHistory.Clear();
|
(Codec as IHasDirectory).SetCurrentDirectoryToRoot();
|
||||||
|
|
||||||
CurrentDirectoryResult = (Codec as IHasDirectory).DirectoryRoot;
|
|
||||||
|
|
||||||
SearchKeypadClear();
|
SearchKeypadClear();
|
||||||
|
|
||||||
DirectoryBackButtonVisibleFeedback.FireUpdate();
|
|
||||||
|
|
||||||
RefreshDirectory();
|
RefreshDirectory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -584,10 +566,8 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
|
|
||||||
SetCurrentDirectoryToRoot();
|
SetCurrentDirectoryToRoot();
|
||||||
|
|
||||||
if (CurrentDirectoryResult != null && codec.DirectoryRoot.DirectoryResults.Count > 0)
|
RefreshDirectory();
|
||||||
{
|
|
||||||
RefreshDirectory();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -597,13 +577,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
void dir_DirectoryResultReturned(object sender, DirectoryEventArgs e)
|
void dir_DirectoryResultReturned(object sender, DirectoryEventArgs e)
|
||||||
{
|
{
|
||||||
if (NextDirectoryResultIsFolderContents)
|
|
||||||
{
|
|
||||||
NextDirectoryResultIsFolderContents = false;
|
|
||||||
DirectoryBrowseHistory.Add(e.Directory);
|
|
||||||
}
|
|
||||||
CurrentDirectoryResult = e.Directory;
|
|
||||||
DirectoryBackButtonVisibleFeedback.FireUpdate();
|
|
||||||
RefreshDirectory();
|
RefreshDirectory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -615,7 +589,6 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
{
|
{
|
||||||
(Codec as IHasDirectory).GetDirectoryFolderContents(folder.FolderId);
|
(Codec as IHasDirectory).GetDirectoryFolderContents(folder.FolderId);
|
||||||
|
|
||||||
NextDirectoryResultIsFolderContents = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -625,18 +598,13 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
{
|
{
|
||||||
var codec = Codec as IHasDirectory;
|
var codec = Codec as IHasDirectory;
|
||||||
|
|
||||||
if (DirectoryBrowseHistory.Count > 0)
|
if (codec != null)
|
||||||
{
|
{
|
||||||
var lastItemIndex = DirectoryBrowseHistory.Count - 1;
|
codec.GetDirectoryParentFolderContents();
|
||||||
CurrentDirectoryResult = DirectoryBrowseHistory[lastItemIndex];
|
|
||||||
DirectoryBrowseHistory.Remove(DirectoryBrowseHistory[lastItemIndex]);
|
|
||||||
|
|
||||||
RefreshDirectory();
|
//RefreshDirectory();
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SetCurrentDirectoryToRoot();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -645,10 +613,10 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
/// <param name="dir"></param>
|
/// <param name="dir"></param>
|
||||||
void RefreshDirectory()
|
void RefreshDirectory()
|
||||||
{
|
{
|
||||||
if (CurrentDirectoryResult.DirectoryResults.Count > 0)
|
if ((Codec as IHasDirectory).CurrentDirectoryResult.CurrentDirectoryResults.Count > 0)
|
||||||
{
|
{
|
||||||
ushort i = 0;
|
ushort i = 0;
|
||||||
foreach (var r in CurrentDirectoryResult.DirectoryResults)
|
foreach (var r in (Codec as IHasDirectory).CurrentDirectoryResult.CurrentDirectoryResults)
|
||||||
{
|
{
|
||||||
if (i == DirectoryList.MaxCount)
|
if (i == DirectoryList.MaxCount)
|
||||||
{
|
{
|
||||||
@@ -725,13 +693,13 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
Parent.MeetingOrContactMethodModalSrl.StringInputSig(i, 4).StringValue = "";
|
Parent.MeetingOrContactMethodModalSrl.StringInputSig(i, 4).StringValue = "";
|
||||||
Parent.MeetingOrContactMethodModalSrl.StringInputSig(i, 5).StringValue = "Connect";
|
Parent.MeetingOrContactMethodModalSrl.StringInputSig(i, 5).StringValue = "Connect";
|
||||||
Parent.MeetingOrContactMethodModalSrl.BoolInputSig(i, 2).BoolValue = true;
|
Parent.MeetingOrContactMethodModalSrl.BoolInputSig(i, 2).BoolValue = true;
|
||||||
var cc = c; // lambda scope
|
var cc = c; // to maintian lambda scope
|
||||||
Parent.MeetingOrContactMethodModalSrl.GetBoolFeedbackSig(i, 1).SetSigFalseAction(() =>
|
Parent.MeetingOrContactMethodModalSrl.GetBoolFeedbackSig(i, 1).SetSigFalseAction(() =>
|
||||||
{
|
{
|
||||||
Parent.PopupInterlock.Hide();
|
Parent.PopupInterlock.Hide();
|
||||||
var codec = Codec as VideoCodecBase;
|
var codec = Codec as VideoCodecBase;
|
||||||
if (codec != null)
|
if (codec != null)
|
||||||
codec.Dial(c.Number);
|
codec.Dial(cc.Number);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
Parent.MeetingOrContactMethodModalSrl.Count = i;
|
Parent.MeetingOrContactMethodModalSrl.Count = i;
|
||||||
@@ -1102,7 +1070,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
SearchStringFeedback.FireUpdate();
|
SearchStringFeedback.FireUpdate();
|
||||||
SearchStringKeypadCheckEnables();
|
SearchStringKeypadCheckEnables();
|
||||||
|
|
||||||
if(CurrentDirectoryResult != (Codec as IHasDirectory).DirectoryRoot)
|
if ((Codec as IHasDirectory).CurrentDirectoryResultIsNotDirectoryRoot.BoolValue)
|
||||||
SetCurrentDirectoryToRoot();
|
SetCurrentDirectoryToRoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user