mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-09 17:54:59 +00:00
Combining repos
This commit is contained in:
47
Essentials DM/Essentials_DM/Config/DMChassisConfig.cs
Normal file
47
Essentials DM/Essentials_DM/Config/DMChassisConfig.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.DM.Cards;
|
||||
|
||||
namespace PepperDash.Essentials.DM.Config
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the "properties" property of a DM device config
|
||||
/// </summary>
|
||||
public class DMChassisPropertiesConfig
|
||||
{
|
||||
[JsonProperty("control")]
|
||||
public ControlPropertiesConfig Control { get; set; }
|
||||
|
||||
[JsonProperty("volumeControls")]
|
||||
public Dictionary<uint, DmCardAudioPropertiesConfig> VolumeControls { get; set; }
|
||||
|
||||
[JsonProperty("inputSlots")]
|
||||
public Dictionary<uint, string> InputSlots { get; set; }
|
||||
|
||||
[JsonProperty("outputSlots")]
|
||||
public Dictionary<uint, string> OutputSlots { get; set; }
|
||||
|
||||
[JsonProperty("inputNames")]
|
||||
public Dictionary<uint, string> InputNames { get; set; }
|
||||
|
||||
[JsonProperty("outputNames")]
|
||||
public Dictionary<uint, string> OutputNames { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class DmCardAudioPropertiesConfig
|
||||
{
|
||||
[JsonProperty("outLevel")]
|
||||
public int OutLevel { get; set; }
|
||||
|
||||
[JsonProperty("isVolumeControlPoint")]
|
||||
public bool IsVolumeControlPoint { get; set; }
|
||||
}
|
||||
}
|
||||
56
Essentials DM/Essentials_DM/Config/DeviceFactory.cs
Normal file
56
Essentials DM/Essentials_DM/Config/DeviceFactory.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
public class DeviceFactory
|
||||
{
|
||||
public static IKeyed GetDevice(DeviceConfig dc)
|
||||
{
|
||||
var key = dc.Key;
|
||||
var name = dc.Name;
|
||||
var type = dc.Type;
|
||||
var properties = dc.Properties;
|
||||
|
||||
var typeName = dc.Type.ToLower();
|
||||
|
||||
if (typeName == "dmmd8x8")
|
||||
{
|
||||
var props = JsonConvert.DeserializeObject
|
||||
<PepperDash.Essentials.DM.Config.DMChassisPropertiesConfig>(properties.ToString());
|
||||
return PepperDash.Essentials.DM.DmChassisController.
|
||||
GetDmChassisController(key, name, type, props);
|
||||
}
|
||||
|
||||
// Hand off to DmTxHelper class
|
||||
else if (typeName.StartsWith("dmtx"))
|
||||
{
|
||||
var props = JsonConvert.DeserializeObject
|
||||
<PepperDash.Essentials.DM.Config.DmTxPropertiesConfig>(properties.ToString());
|
||||
return PepperDash.Essentials.DM.DmTxHelper.GetDmTxController(key, name, type, props);
|
||||
}
|
||||
|
||||
// Hand off to DmRmcHelper class
|
||||
else if (typeName.StartsWith("dmrmc"))
|
||||
{
|
||||
var props = JsonConvert.DeserializeObject
|
||||
<PepperDash.Essentials.DM.Config.DmRmcPropertiesConfig>(properties.ToString());
|
||||
return PepperDash.Essentials.DM.DmRmcHelper.GetDmRmcController(key, name, type, props);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
25
Essentials DM/Essentials_DM/Config/DmRmcConfig.cs
Normal file
25
Essentials DM/Essentials_DM/Config/DmRmcConfig.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.DM.Cards;
|
||||
|
||||
namespace PepperDash.Essentials.DM.Config
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the "properties" property of a DM TX device config
|
||||
/// </summary>
|
||||
public class DmRmcPropertiesConfig
|
||||
{
|
||||
[JsonProperty("control")]
|
||||
public ControlPropertiesConfig Control { get; set; }
|
||||
|
||||
[JsonProperty("parentDeviceKey")]
|
||||
public string ParentDeviceKey { get; set; }
|
||||
|
||||
[JsonProperty("parentOutputNumber")]
|
||||
public uint ParentOutputNumber { get; set; }
|
||||
}
|
||||
}
|
||||
28
Essentials DM/Essentials_DM/Config/DmTxConfig.cs
Normal file
28
Essentials DM/Essentials_DM/Config/DmTxConfig.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.DM.Cards;
|
||||
|
||||
namespace PepperDash.Essentials.DM.Config
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the "properties" property of a DM TX device config
|
||||
/// </summary>
|
||||
public class DmTxPropertiesConfig
|
||||
{
|
||||
[JsonProperty("control")]
|
||||
public ControlPropertiesConfig Control { get; set; }
|
||||
|
||||
[JsonProperty("parentDeviceKey")]
|
||||
public string ParentDeviceKey { get; set; }
|
||||
|
||||
[JsonProperty("parentInputNumber")]
|
||||
public uint ParentInputNumber { get; set; }
|
||||
|
||||
[JsonProperty("autoSwitching")]
|
||||
public bool AutoSwitching { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user