mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-27 03:14:57 +00:00
Compare commits
31 Commits
2.0.0-alph
...
2.0.0-alph
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ae8a3ef41 | ||
|
|
0f57799382 | ||
|
|
a2e4c2fad6 | ||
|
|
ed5bd360b4 | ||
|
|
4eeb2145ae | ||
|
|
a5460f16cd | ||
|
|
3b55d6af93 | ||
|
|
285d87d8ac | ||
|
|
c6690c7765 | ||
|
|
2609006024 | ||
|
|
9e61dcd554 | ||
|
|
693d4f8723 | ||
|
|
882f41d8bd | ||
|
|
6669b6125b | ||
|
|
9ad151bd7e | ||
|
|
b0e9ecf29e | ||
|
|
d4df36b863 | ||
|
|
1146d89abf | ||
|
|
0ee3e1d52b | ||
|
|
5084861067 | ||
|
|
d6f896c4b2 | ||
|
|
7a5dc29946 | ||
|
|
812dd0e771 | ||
|
|
08a4099842 | ||
|
|
a3c7d0c96a | ||
|
|
d7af57ba16 | ||
|
|
6c2ef7b63b | ||
|
|
06244b8a18 | ||
|
|
b213262cdd | ||
|
|
e0e08ba22c | ||
|
|
420ae8c7de |
@@ -0,0 +1,24 @@
|
||||
using PepperDash.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Describes a device that has selectable inputs
|
||||
/// </summary>
|
||||
/// <typeparam name="TKey">the type to use as the key for each input item. Most likely an enum or string</typeparam>\
|
||||
/// <example>
|
||||
/// See MockDisplay for example implemntation
|
||||
/// </example>
|
||||
public interface IHasInputs<TKey, TSelector>: IKeyName
|
||||
{
|
||||
ISelectableItems<TKey> Inputs { get; }
|
||||
|
||||
void SetInput(TSelector selector);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using PepperDash.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// Describes a device that has selectable surround sound modes
|
||||
/// </summary>
|
||||
/// <typeparam name="TKey">the type to use as the key for each input item. Most likely an enum or string</typeparam>
|
||||
public interface IHasSurroundSoundModes<TKey, TSelector>: IKeyName
|
||||
{
|
||||
ISelectableItems<TKey> SurroundSoundModes { get; }
|
||||
|
||||
void SetSurroundSoundMode(TSelector selector);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||
{
|
||||
public interface ILevelControls
|
||||
{
|
||||
Dictionary<string, IBasicVolumeWithFeedback> LevelControlPoints { get; }
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/*/// <summary>
|
||||
/// Describes a MobileControlSystemController
|
||||
/// </summary>
|
||||
public interface IMobileControl : IKeyed
|
||||
@@ -20,16 +20,24 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||
void CreateMobileControlRoomBridge(IEssentialsRoom room, IMobileControl parent);
|
||||
|
||||
void LinkSystemMonitorToAppServer();
|
||||
}
|
||||
}*/
|
||||
|
||||
/// <summary>
|
||||
/// Describes a MobileSystemController that accepts IEssentialsRoom
|
||||
/// </summary>
|
||||
public interface IMobileControl3 : IMobileControl
|
||||
{
|
||||
public interface IMobileControl : IKeyed
|
||||
{
|
||||
string Host { get; }
|
||||
|
||||
string ClientAppUrl { get; }
|
||||
|
||||
string SystemUuid { get; }
|
||||
|
||||
BoolFeedback ApiOnlineAndAuthorized { get;}
|
||||
|
||||
void SendMessageObject(IMobileControlMessage o);
|
||||
|
||||
void AddAction(string key, Action<string, JToken> action);
|
||||
void AddAction<T>(T messenger, Action<string, string, JToken> action) where T:IMobileControlMessenger;
|
||||
|
||||
void RemoveAction(string key);
|
||||
|
||||
@@ -43,9 +51,11 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||
/// </summary>
|
||||
public interface IMobileControlMessenger: IKeyed
|
||||
{
|
||||
IMobileControl3 AppServerController { get; }
|
||||
IMobileControl AppServerController { get; }
|
||||
string MessagePath { get; }
|
||||
void RegisterWithAppServer(IMobileControl3 appServerController);
|
||||
|
||||
string DeviceKey { get; }
|
||||
void RegisterWithAppServer(IMobileControl appServerController);
|
||||
}
|
||||
|
||||
public interface IMobileControlMessage
|
||||
@@ -64,7 +74,7 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||
/// <summary>
|
||||
/// Describes a MobileControl Room Bridge
|
||||
/// </summary>
|
||||
public interface IMobileControlRoomBridge : IKeyed
|
||||
public interface IMobileControlRoomMessenger : IKeyed
|
||||
{
|
||||
event EventHandler<EventArgs> UserCodeChanged;
|
||||
|
||||
@@ -85,5 +95,15 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||
string RoomName { get; }
|
||||
|
||||
string AppUrl { get; }
|
||||
|
||||
void UpdateAppUrl(string url);
|
||||
}
|
||||
|
||||
public interface IMobileControlAction
|
||||
{
|
||||
IMobileControlMessenger Messenger { get; }
|
||||
|
||||
Action<string,string, JToken> Action { get; }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Describes an item that can be selected
|
||||
/// </summary>
|
||||
public interface ISelectableItem : IKeyName
|
||||
{
|
||||
event EventHandler ItemUpdated;
|
||||
|
||||
[JsonProperty("isSelected")]
|
||||
bool IsSelected { get; set; }
|
||||
void Select();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// Describes a collection of items that can be selected
|
||||
/// </summary>
|
||||
/// <typeparam name="TKey">type for the keys in the collection. Probably a string or enum</typeparam>
|
||||
public interface ISelectableItems<TKey>
|
||||
{
|
||||
event EventHandler ItemsUpdated;
|
||||
event EventHandler CurrentItemChanged;
|
||||
|
||||
[JsonProperty("items")]
|
||||
Dictionary<TKey, ISelectableItem> Items { get; set; }
|
||||
|
||||
[JsonProperty("currentItem")]
|
||||
string CurrentItem { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -7,10 +7,10 @@
|
||||
<TargetFrameworks>net472;net6</TargetFrameworks>
|
||||
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
|
||||
<OutputPath>bin\$(Configuration)\</OutputPath>
|
||||
<AssemblyName>PepperDash.Essentials.Core</AssemblyName>
|
||||
<AssemblyName>PepperDash_Essentials_Core</AssemblyName>
|
||||
<RootNamespace>PepperDash.Essentials.Core</RootNamespace>
|
||||
<Title>PepperDash Essentials Core</Title>
|
||||
<PackageId>$(AssemblyName)</PackageId>
|
||||
<PackageId>PepperDash.Essentials.Core</PackageId>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugType>full</DebugType>
|
||||
@@ -23,7 +23,7 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Crestron.SimplSharp.SDK.ProgramLibrary" Version="2.20.42" />
|
||||
<PackageReference Include="PepperDashCore" Version="2.0.0-beta-385" />
|
||||
<PackageReference Include="PepperDashCore" Version="2.0.0-alpha-392" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Crestron\CrestronGenericBaseDevice.cs.orig" />
|
||||
|
||||
@@ -357,6 +357,7 @@ namespace PepperDash.Essentials
|
||||
try
|
||||
{
|
||||
types = assy.GetTypes();
|
||||
Debug.Console(1, $"Got types for assembly {assy.GetName().Name}");
|
||||
}
|
||||
catch (TypeLoadException e)
|
||||
{
|
||||
@@ -370,6 +371,10 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
try
|
||||
{
|
||||
Debug.Console(0, $"Checking if type {type.Name} is IPluginDeviceFactory");
|
||||
|
||||
Debug.Console(0, $"{type.Name} is plugin factory: {typeof(IPluginDeviceFactory).IsAssignableFrom(type) && !type.IsAbstract}");
|
||||
|
||||
if (typeof (IPluginDeviceFactory).IsAssignableFrom(type) && !type.IsAbstract)
|
||||
{
|
||||
var plugin =
|
||||
|
||||
@@ -18,8 +18,6 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
public abstract class EssentialsRoomBase : ReconfigurableDevice, IEssentialsRoom
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -58,7 +56,7 @@ namespace PepperDash.Essentials.Core
|
||||
/// <summary>
|
||||
/// The bridge for this room if Mobile Control is enabled
|
||||
/// </summary>
|
||||
public IMobileControlRoomBridge MobileControlRoomBridge { get; private set; }
|
||||
public IMobileControlRoomMessenger MobileControlRoomBridge { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The config name of the source list
|
||||
@@ -79,6 +77,8 @@ namespace PepperDash.Essentials.Core
|
||||
}
|
||||
}
|
||||
|
||||
public string DestinationListKey { get; private set; }
|
||||
|
||||
protected const string _defaultSourceListKey = "default";
|
||||
|
||||
/// <summary>
|
||||
@@ -194,6 +194,14 @@ namespace PepperDash.Essentials.Core
|
||||
}
|
||||
}
|
||||
|
||||
protected void SetDestinationListKey(string destinationListKey)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(destinationListKey))
|
||||
{
|
||||
DestinationListKey = destinationListKey;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// If mobile control is enabled, sets the appropriate properties
|
||||
/// </summary>
|
||||
@@ -209,7 +217,7 @@ namespace PepperDash.Essentials.Core
|
||||
}
|
||||
else
|
||||
{
|
||||
MobileControlRoomBridge = mcBridge as IMobileControlRoomBridge;
|
||||
MobileControlRoomBridge = mcBridge as IMobileControlRoomMessenger;
|
||||
Debug.Console(1, this, "*********************Mobile Control Bridge found and enabled for this room");
|
||||
IsMobileControlEnabled = true;
|
||||
}
|
||||
|
||||
@@ -23,10 +23,12 @@ namespace PepperDash.Essentials.Core
|
||||
BoolFeedback IsCoolingDownFeedback { get; }
|
||||
|
||||
bool IsMobileControlEnabled { get; }
|
||||
IMobileControlRoomBridge MobileControlRoomBridge { get; }
|
||||
IMobileControlRoomMessenger MobileControlRoomBridge { get; }
|
||||
|
||||
string SourceListKey { get; }
|
||||
|
||||
string DestinationListKey { get; }
|
||||
|
||||
SecondsCountdownTimer ShutdownPromptTimer { get; }
|
||||
int ShutdownPromptSeconds { get; }
|
||||
int ShutdownVacancySeconds { get; }
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
public interface IRunDirectRouteAction
|
||||
{
|
||||
void RunDirectRoute(string sourceKey, string destinationKey);
|
||||
void RunDirectRoute(string sourceKey, string destinationKey, eRoutingSignalType type = eRoutingSignalType.AudioVideo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
16
src/PepperDash.Essentials.Core/Routing/IInputSync.cs
Normal file
16
src/PepperDash.Essentials.Core/Routing/IInputSync.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using PepperDash.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Routing
|
||||
{
|
||||
public interface IVideoSync: IKeyed
|
||||
{
|
||||
bool VideoSyncDetected { get; }
|
||||
|
||||
event EventHandler VideoSyncChanged;
|
||||
}
|
||||
}
|
||||
12
src/PepperDash.Essentials.Core/Routing/IMatrixRouting.cs
Normal file
12
src/PepperDash.Essentials.Core/Routing/IMatrixRouting.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Routing
|
||||
{
|
||||
public interface IMatrixRouting
|
||||
{
|
||||
Dictionary<string, IRoutingInputSlot> InputSlots { get; }
|
||||
Dictionary<string, IRoutingOutputSlot> OutputSlots { get; }
|
||||
|
||||
void Route(string inputSlotKey, string outputSlotKey, eRoutingSignalType type);
|
||||
}
|
||||
}
|
||||
13
src/PepperDash.Essentials.Core/Routing/IRoutingInputSlot.cs
Normal file
13
src/PepperDash.Essentials.Core/Routing/IRoutingInputSlot.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Routing
|
||||
{
|
||||
public interface IRoutingInputSlot: IRoutingSlot, IOnline, IVideoSync
|
||||
{
|
||||
string TxDeviceKey { get; }
|
||||
}
|
||||
}
|
||||
14
src/PepperDash.Essentials.Core/Routing/IRoutingOutputSlot.cs
Normal file
14
src/PepperDash.Essentials.Core/Routing/IRoutingOutputSlot.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Routing
|
||||
{
|
||||
public interface IRoutingOutputSlot:IRoutingSlot
|
||||
{
|
||||
event EventHandler<EventArgs> OutputSlotChanged;
|
||||
|
||||
string RxDeviceKey { get; }
|
||||
|
||||
Dictionary<eRoutingSignalType, IRoutingInputSlot> CurrentRoutes { get; }
|
||||
}
|
||||
}
|
||||
16
src/PepperDash.Essentials.Core/Routing/IRoutingSlot.cs
Normal file
16
src/PepperDash.Essentials.Core/Routing/IRoutingSlot.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using PepperDash.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Routing
|
||||
{
|
||||
public interface IRoutingSlot:IKeyName
|
||||
{
|
||||
int SlotNumber { get; }
|
||||
|
||||
eRoutingSignalType SupportedSignalTypes { get; }
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,8 @@ namespace PepperDash.Essentials.Core
|
||||
Video = 2,
|
||||
AudioVideo = Audio | Video,
|
||||
UsbOutput = 8,
|
||||
UsbInput = 16
|
||||
UsbInput = 16,
|
||||
SecondaryAudio = 32
|
||||
}
|
||||
|
||||
public enum eRoutingPortConnectionType
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace PepperDash.Essentials.Core.Web
|
||||
{
|
||||
public class EssentialsWebApi : EssentialsDevice
|
||||
{
|
||||
private readonly WebApiServer _server;
|
||||
private readonly WebApiServer _server;
|
||||
|
||||
///<example>
|
||||
/// http(s)://{ipaddress}/cws/{basePath}
|
||||
@@ -67,8 +67,6 @@ namespace PepperDash.Essentials.Core.Web
|
||||
_server = new WebApiServer(Key, Name, BasePath);
|
||||
|
||||
SetupRoutes();
|
||||
|
||||
Initialize();
|
||||
}
|
||||
|
||||
private void SetupRoutes()
|
||||
@@ -168,10 +166,27 @@ namespace PepperDash.Essentials.Core.Web
|
||||
|
||||
};
|
||||
|
||||
foreach (var route in routes.Where(route => route != null))
|
||||
AddRoute(routes);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add a single route to the API. MUST be done during the activation phase
|
||||
/// </summary>
|
||||
/// <param name="route"></param>
|
||||
public void AddRoute(HttpCwsRoute route)
|
||||
{
|
||||
_server.AddRoute(route);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add a collection of routes to the API. MUST be done during the activation phase
|
||||
/// </summary>
|
||||
/// <param name="routes"></param>
|
||||
public void AddRoute(List<HttpCwsRoute> routes)
|
||||
{
|
||||
foreach (var route in routes)
|
||||
{
|
||||
var r = route;
|
||||
_server.AddRoute(r);
|
||||
AddRoute(route);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,12 +6,13 @@ using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.DSP
|
||||
{
|
||||
public abstract class DspBase : EssentialsDevice
|
||||
public abstract class DspBase : EssentialsDevice, ILevelControls
|
||||
{
|
||||
public Dictionary<string, DspControlPoint> LevelControlPoints { get; private set; }
|
||||
public Dictionary<string,IBasicVolumeWithFeedback> LevelControlPoints { get; private set; }
|
||||
|
||||
public Dictionary<string, DspControlPoint> DialerControlPoints { get; private set; }
|
||||
|
||||
@@ -40,15 +41,36 @@ namespace PepperDash.Essentials.Devices.Common.DSP
|
||||
// Typical presets:
|
||||
// call default preset to restore levels and mutes
|
||||
|
||||
public abstract class DspControlPoint
|
||||
public abstract class DspControlPoint :IKeyed
|
||||
{
|
||||
string Key { get; set; }
|
||||
public string Key { get; }
|
||||
|
||||
protected DspControlPoint(string key) => Key = key;
|
||||
}
|
||||
|
||||
public abstract class DspLevelControlPoint :DspControlPoint, IBasicVolumeWithFeedback
|
||||
{
|
||||
public BoolFeedback MuteFeedback { get; }
|
||||
public IntFeedback VolumeLevelFeedback { get; }
|
||||
|
||||
public class DspDialerBase
|
||||
protected DspLevelControlPoint(string key, Func<bool> muteFeedbackFunc, Func<int> volumeLevelFeedbackFunc) : base(key)
|
||||
{
|
||||
MuteFeedback = new BoolFeedback(muteFeedbackFunc);
|
||||
VolumeLevelFeedback = new IntFeedback(volumeLevelFeedbackFunc);
|
||||
}
|
||||
|
||||
public abstract void MuteOff();
|
||||
public abstract void MuteOn();
|
||||
public abstract void MuteToggle();
|
||||
public abstract void SetVolume(ushort level);
|
||||
public abstract void VolumeDown(bool pressRelease);
|
||||
public abstract void VolumeUp(bool pressRelease);
|
||||
}
|
||||
|
||||
|
||||
public abstract class DspDialerBase:DspControlPoint
|
||||
{
|
||||
|
||||
protected DspDialerBase(string key) : base(key) { }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -8,10 +8,16 @@ using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
using Feedback = PepperDash.Essentials.Core.Feedback;
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.Displays
|
||||
{
|
||||
public abstract class DisplayBase : EssentialsDevice, IHasFeedback, IRoutingSinkWithSwitching, IHasPowerControl, IWarmingCooling, IUsageTracking
|
||||
public abstract class DisplayBase : EssentialsDevice
|
||||
, IHasFeedback
|
||||
, IRoutingSinkWithSwitching
|
||||
, IHasPowerControl
|
||||
, IWarmingCooling
|
||||
, IUsageTracking
|
||||
{
|
||||
public event SourceInfoChangeHandler CurrentSourceChange;
|
||||
|
||||
|
||||
@@ -1,21 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||
using PepperDash.Essentials.Core.Routing;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.Displays
|
||||
{
|
||||
public class MockDisplay : TwoWayDisplayBase, IBasicVolumeWithFeedback, IBridgeAdvanced
|
||||
|
||||
public class MockDisplay : TwoWayDisplayBase, IBasicVolumeWithFeedback, IBridgeAdvanced, IHasInputs<string, string>
|
||||
{
|
||||
public RoutingInputPort HdmiIn1 { get; private set; }
|
||||
public RoutingInputPort HdmiIn2 { get; private set; }
|
||||
public RoutingInputPort HdmiIn3 { get; private set; }
|
||||
public RoutingInputPort ComponentIn1 { get; private set; }
|
||||
public RoutingInputPort VgaIn1 { get; private set; }
|
||||
public ISelectableItems<string> Inputs { get; private set; }
|
||||
|
||||
bool _PowerIsOn;
|
||||
bool _IsWarmingUp;
|
||||
@@ -53,7 +51,7 @@ namespace PepperDash.Essentials.Devices.Common.Displays
|
||||
};
|
||||
}
|
||||
}
|
||||
protected override Func<string> CurrentInputFeedbackFunc { get { return () => "Not Implemented"; } }
|
||||
protected override Func<string> CurrentInputFeedbackFunc { get { return () => Inputs.CurrentItem; } }
|
||||
|
||||
int VolumeHeldRepeatInterval = 200;
|
||||
ushort VolumeInterval = 655;
|
||||
@@ -63,17 +61,31 @@ namespace PepperDash.Essentials.Devices.Common.Displays
|
||||
public MockDisplay(string key, string name)
|
||||
: base(key, name)
|
||||
{
|
||||
HdmiIn1 = new RoutingInputPort(RoutingPortNames.HdmiIn1, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||
eRoutingPortConnectionType.Hdmi, null, this);
|
||||
HdmiIn2 = new RoutingInputPort(RoutingPortNames.HdmiIn2, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||
eRoutingPortConnectionType.Hdmi, null, this);
|
||||
HdmiIn3 = new RoutingInputPort(RoutingPortNames.HdmiIn3, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||
eRoutingPortConnectionType.Hdmi, null, this);
|
||||
ComponentIn1 = new RoutingInputPort(RoutingPortNames.ComponentIn, eRoutingSignalType.Video,
|
||||
eRoutingPortConnectionType.Component, null, this);
|
||||
VgaIn1 = new RoutingInputPort(RoutingPortNames.VgaIn, eRoutingSignalType.Video,
|
||||
eRoutingPortConnectionType.Composite, null, this);
|
||||
InputPorts.AddRange(new[] { HdmiIn1, HdmiIn2, HdmiIn3, ComponentIn1, VgaIn1 });
|
||||
Inputs = new MockDisplayInputs
|
||||
{
|
||||
Items = new Dictionary<string, ISelectableItem>
|
||||
{
|
||||
{ "HDMI1", new MockDisplayInput ( "HDMI1", "HDMI 1",this ) },
|
||||
{ "HDMI2", new MockDisplayInput ("HDMI2", "HDMI 2",this ) },
|
||||
{ "HDMI3", new MockDisplayInput ("HDMI3", "HDMI 3",this ) },
|
||||
{ "HDMI4", new MockDisplayInput ("HDMI4", "HDMI 4",this )},
|
||||
{ "DP", new MockDisplayInput ("DP", "DisplayPort", this ) }
|
||||
}
|
||||
};
|
||||
|
||||
Inputs.CurrentItemChanged += (o, a) => CurrentInputFeedback.FireUpdate();
|
||||
|
||||
var hdmiIn1 = new RoutingInputPort(RoutingPortNames.HdmiIn1, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.Hdmi, "HDMI1", this);
|
||||
var hdmiIn2 = new RoutingInputPort(RoutingPortNames.HdmiIn2, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.Hdmi, "HDMI2", this);
|
||||
var hdmiIn3 = new RoutingInputPort(RoutingPortNames.HdmiIn3, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.Hdmi, "HDMI3", this);
|
||||
var hdmiIn4 = new RoutingInputPort(RoutingPortNames.ComponentIn, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.Hdmi, "HDMI4", this);
|
||||
var dpIn = new RoutingInputPort(RoutingPortNames.DisplayPortIn, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.DisplayPort, "DP", this);
|
||||
InputPorts.AddRange(new[] { hdmiIn1, hdmiIn2, hdmiIn3, hdmiIn4, dpIn });
|
||||
|
||||
VolumeLevelFeedback = new IntFeedback(() => { return _FakeVolumeLevel; });
|
||||
MuteFeedback = new BoolFeedback("MuteOn", () => _IsMuted);
|
||||
@@ -135,13 +147,43 @@ namespace PepperDash.Essentials.Devices.Common.Displays
|
||||
{
|
||||
PowerOn();
|
||||
}
|
||||
|
||||
if (!Inputs.Items.TryGetValue(selector.ToString(), out var input))
|
||||
return;
|
||||
|
||||
input.Select();
|
||||
}
|
||||
|
||||
public void SetInput(string selector)
|
||||
{
|
||||
ISelectableItem currentInput = null;
|
||||
|
||||
try
|
||||
{
|
||||
currentInput = Inputs.Items.SingleOrDefault(Inputs => Inputs.Value.IsSelected).Value;
|
||||
}
|
||||
catch { }
|
||||
|
||||
|
||||
if (currentInput != null)
|
||||
{
|
||||
Debug.Console(2, this, "SetInput: {0}", selector);
|
||||
currentInput.IsSelected = false;
|
||||
}
|
||||
|
||||
if (!Inputs.Items.TryGetValue(selector, out var input))
|
||||
return;
|
||||
|
||||
input.IsSelected = true;
|
||||
|
||||
Inputs.CurrentItem = selector;
|
||||
}
|
||||
|
||||
|
||||
#region IBasicVolumeWithFeedback Members
|
||||
|
||||
public IntFeedback VolumeLevelFeedback { get; private set; }
|
||||
#region IBasicVolumeWithFeedback Members
|
||||
|
||||
public IntFeedback VolumeLevelFeedback { get; private set; }
|
||||
|
||||
public void SetVolume(ushort level)
|
||||
{
|
||||
@@ -163,11 +205,12 @@ namespace PepperDash.Essentials.Devices.Common.Displays
|
||||
|
||||
public BoolFeedback MuteFeedback { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region IBasicVolumeControls Members
|
||||
#endregion
|
||||
|
||||
public void VolumeUp(bool pressRelease)
|
||||
#region IBasicVolumeControls Members
|
||||
|
||||
public void VolumeUp(bool pressRelease)
|
||||
{
|
||||
//while (pressRelease)
|
||||
//{
|
||||
@@ -207,5 +250,7 @@ namespace PepperDash.Essentials.Devices.Common.Displays
|
||||
{
|
||||
LinkDisplayToApi(this, trilist, joinStart, joinMapKey, bridge);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.Displays
|
||||
{
|
||||
public class MockDisplayInputs : ISelectableItems<string>
|
||||
{
|
||||
private Dictionary<string, ISelectableItem> _items;
|
||||
|
||||
public Dictionary<string, ISelectableItem> Items
|
||||
{
|
||||
get
|
||||
{
|
||||
return _items;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (_items == value)
|
||||
return;
|
||||
|
||||
_items = value;
|
||||
|
||||
ItemsUpdated?.Invoke(this, null);
|
||||
}
|
||||
}
|
||||
|
||||
private string _currentItem;
|
||||
|
||||
public string CurrentItem
|
||||
{
|
||||
get
|
||||
{
|
||||
return _currentItem;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (_currentItem == value)
|
||||
return;
|
||||
|
||||
_currentItem = value;
|
||||
|
||||
CurrentItemChanged?.Invoke(this, null);
|
||||
}
|
||||
}
|
||||
|
||||
public event EventHandler ItemsUpdated;
|
||||
public event EventHandler CurrentItemChanged;
|
||||
}
|
||||
|
||||
public class MockDisplayInput : ISelectableItem
|
||||
{
|
||||
private IHasInputs<string, string> _parent;
|
||||
|
||||
|
||||
private bool _isSelected;
|
||||
|
||||
public bool IsSelected
|
||||
{
|
||||
get
|
||||
{
|
||||
return _isSelected;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (_isSelected == value)
|
||||
return;
|
||||
|
||||
_isSelected = value;
|
||||
|
||||
ItemUpdated?.Invoke(this, null);
|
||||
}
|
||||
}
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public string Key { get; set; }
|
||||
|
||||
public event EventHandler ItemUpdated;
|
||||
|
||||
public MockDisplayInput(string key, string name, MockDisplay parent)
|
||||
{
|
||||
Key = key;
|
||||
Name = name;
|
||||
_parent = parent;
|
||||
}
|
||||
|
||||
public void Select()
|
||||
{
|
||||
_parent.SetInput(Key);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,11 +7,11 @@
|
||||
<TargetFrameworks>net472;net6</TargetFrameworks>
|
||||
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
|
||||
<OutputPath>bin\$(Configuration)\</OutputPath>
|
||||
<AssemblyName>PepperDash.Essentials.Devices.Common</AssemblyName>
|
||||
<AssemblyName>Essentials Devices Common</AssemblyName>
|
||||
<RootNamespace>PepperDash.Essentials.Devices.Common</RootNamespace>
|
||||
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
|
||||
<Title>PepperDash Essentials Devices Common</Title>
|
||||
<PackageId>$(AssemblyName)</PackageId>
|
||||
<PackageId>PepperDash.Essentials.Devices.Common</PackageId>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugType>full</DebugType>
|
||||
@@ -27,6 +27,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Crestron.SimplSharp.SDK.ProgramLibrary" Version="2.20.42" />
|
||||
<PackageReference Include="PepperDashCore" Version="2.0.0-beta-385" />
|
||||
<PackageReference Include="PepperDashCore" Version="2.0.0-alpha-392" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -35,7 +35,7 @@ namespace PepperDash.Essentials
|
||||
SecretsManager.Initialize();
|
||||
SystemMonitor.ProgramInitialization.ProgramInitializationUnderUserControl = true;
|
||||
|
||||
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomainOnAssemblyResolve;
|
||||
// AppDomain.CurrentDomain.AssemblyResolve += CurrentDomainOnAssemblyResolve;
|
||||
}
|
||||
|
||||
private System.Reflection.Assembly CurrentDomainOnAssemblyResolve(object sender, ResolveEventArgs args)
|
||||
@@ -366,11 +366,11 @@ namespace PepperDash.Essentials
|
||||
|
||||
LoadTieLines();
|
||||
|
||||
var mobileControl = GetMobileControlDevice();
|
||||
/*var mobileControl = GetMobileControlDevice();
|
||||
|
||||
if (mobileControl == null) return;
|
||||
|
||||
mobileControl.LinkSystemMonitorToAppServer();
|
||||
mobileControl.LinkSystemMonitorToAppServer();*/
|
||||
|
||||
}
|
||||
|
||||
@@ -480,14 +480,14 @@ namespace PepperDash.Essentials
|
||||
continue;
|
||||
}
|
||||
|
||||
BuildMC(room as IEssentialsRoom);
|
||||
// BuildMC(room as IEssentialsRoom);
|
||||
}
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Rooms Loaded.");
|
||||
|
||||
}
|
||||
|
||||
private static void BuildMC(IEssentialsRoom room)
|
||||
/*private static void BuildMC(IEssentialsRoom room)
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, $"Attempting to build Mobile Control Bridge for {room?.Key}");
|
||||
|
||||
@@ -528,7 +528,7 @@ namespace PepperDash.Essentials
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Mobile Control not enabled for this system");
|
||||
return null;
|
||||
}
|
||||
}*/
|
||||
|
||||
/// <summary>
|
||||
/// Fires up a logo server if not already running
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<RootNamespace>PepperDash.Essentials</RootNamespace>
|
||||
<AssemblyName>PepperDash.Essentials</AssemblyName>
|
||||
<AssemblyName>PepperDashEssentials</AssemblyName>
|
||||
<TargetFrameworks>net472;net6</TargetFrameworks>
|
||||
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
|
||||
<OutputPath>bin\$(Configuration)\</OutputPath>
|
||||
@@ -47,7 +47,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Crestron.SimplSharp.SDK.Program" Version="2.20.42" />
|
||||
<PackageReference Include="PepperDashCore" Version="2.0.0-beta-385" />
|
||||
<PackageReference Include="PepperDashCore" Version="2.0.0-alpha-392" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\PepperDash.Essentials.Core\PepperDash.Essentials.Core.csproj" />
|
||||
|
||||
Reference in New Issue
Block a user