mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-13 03:35:00 +00:00
Compare commits
15 Commits
1.15.4-alp
...
1.15.6-hot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f2a02aeeb3 | ||
|
|
44add9aac6 | ||
|
|
5bb6405874 | ||
|
|
fed3d7e13a | ||
|
|
af848b9ca4 | ||
|
|
b52c13d8e8 | ||
|
|
26f9118154 | ||
|
|
bba3c347c6 | ||
|
|
be96adcc06 | ||
|
|
9c7777fbaa | ||
|
|
5530c91b75 | ||
|
|
67e0378806 | ||
|
|
1c5aca03d2 | ||
|
|
6f5fa2c3b8 | ||
|
|
d6334538c0 |
@@ -0,0 +1,85 @@
|
||||
using System.Collections.Generic;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.GeneralIO;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
|
||||
namespace PepperDash.Essentials.Core.CrestronIO
|
||||
{
|
||||
/// <summary>
|
||||
/// Wrapper class for CEN-IO-COM-Xxx expander module
|
||||
/// </summary>
|
||||
[Description("Wrapper class for the CEN-IO-COM-102 & CEN-IO-COM-202 expander module")]
|
||||
public class CenIoComController : CrestronGenericBaseDevice, IComPorts
|
||||
{
|
||||
private readonly CenIoCom _cenIoCom;
|
||||
|
||||
public CenIoComController(string key, string name, CenIoCom cenIo)
|
||||
:base(key, name, cenIo)
|
||||
{
|
||||
_cenIoCom = cenIo;
|
||||
}
|
||||
|
||||
#region Implementation of IComPorts
|
||||
|
||||
public CrestronCollection<ComPort> ComPorts
|
||||
{
|
||||
get { return _cenIoCom.ComPorts; }
|
||||
}
|
||||
|
||||
public int NumberOfComPorts
|
||||
{
|
||||
get { return _cenIoCom.NumberOfComPorts; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
public class CenIoCom102ControllerFactory : EssentialsDeviceFactory<CenIoComController>
|
||||
{
|
||||
private const string CenIoCom102Type = "ceniocom102";
|
||||
private const string CenIoCom202Type = "ceniocom202";
|
||||
|
||||
public CenIoCom102ControllerFactory()
|
||||
{
|
||||
TypeNames = new List<string> { CenIoCom102Type, CenIoCom202Type };
|
||||
}
|
||||
|
||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||
{
|
||||
Debug.Console(1, "Factory Attempting to create new CEN-IO-COM-Xxx Device");
|
||||
|
||||
var control = CommFactory.GetControlPropertiesConfig(dc);
|
||||
if (control == null)
|
||||
{
|
||||
Debug.Console(1, "Factory failed to create a new CEN-IO-COM-Xxx Device, control properties not found");
|
||||
return null;
|
||||
}
|
||||
|
||||
var ipid = control.IpIdInt;
|
||||
if (ipid < 2)
|
||||
{
|
||||
Debug.Console(1, "Factory failed to create a new CEN-IO-COM-Xxx Device, invalid IP-ID found");
|
||||
return null;
|
||||
}
|
||||
|
||||
switch (dc.Type)
|
||||
{
|
||||
case CenIoCom102Type:
|
||||
{
|
||||
return new CenIoComController(dc.Key, dc.Name, new CenIoCom102(ipid, Global.ControlSystem));
|
||||
}
|
||||
case CenIoCom202Type:
|
||||
{
|
||||
return new CenIoComController(dc.Key, dc.Name, new CenIoCom202(ipid, Global.ControlSystem));
|
||||
}
|
||||
default:
|
||||
{
|
||||
Debug.Console(1, "Factory failed to create a new CEN-IO-COM-Xxx Device, invalid type '{0}'", dc.Type);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -185,6 +185,7 @@
|
||||
</Compile>
|
||||
<Compile Include="Crestron IO\Cards\CenCi33Controller.cs" />
|
||||
<Compile Include="Crestron IO\Cards\InternalCardCageController.cs" />
|
||||
<Compile Include="Crestron IO\CenIoCom\CenIoComController.cs" />
|
||||
<Compile Include="Crestron IO\DinCenCn\DinCenCnController.cs" />
|
||||
<Compile Include="Crestron IO\DinCenCn\IHasCresnetBranches.cs" />
|
||||
<Compile Include="Crestron IO\DinIo8\DinIo8Controller.cs" />
|
||||
|
||||
@@ -7,39 +7,47 @@ using PepperDash.Essentials.Core;
|
||||
namespace PepperDash_Essentials_DM.Chassis
|
||||
{
|
||||
public class HdPsXxxAnalogAuxMixerController : IKeyed,
|
||||
IHasVolumeControlWithFeedback, IHasMuteControlWithFeedback // || IBasicVolumeWithFeedback
|
||||
IHasVolumeControlWithFeedback, IHasMuteControlWithFeedback
|
||||
{
|
||||
public string Key { get; private set; }
|
||||
|
||||
public HdPsXxxAnalogAuxMixer Mixer { get; private set; }
|
||||
private readonly HdPsXxxAnalogAuxMixer _mixer;
|
||||
|
||||
public HdPsXxxAnalogAuxMixerController(string parent, uint mixer, HdPsXxx chassis)
|
||||
{
|
||||
Key = string.Format("{0}-analogMixer{1}", parent, mixer);
|
||||
|
||||
Mixer = chassis.AnalogAuxiliaryMixer[mixer];
|
||||
_mixer = chassis.AnalogAuxiliaryMixer[mixer];
|
||||
|
||||
Mixer.AuxMixerPropertyChange += OnAuxMixerPropertyChange;
|
||||
Mixer.AuxiliaryMuteControl.MuteAndVolumeControlPropertyChange += OnMuteAndVolumeControlPropertyChange;
|
||||
_mixer.AuxMixerPropertyChange += OnAuxMixerPropertyChange;
|
||||
_mixer.AuxiliaryMuteControl.MuteAndVolumeControlPropertyChange += OnMuteAndVolumeControlPropertyChange;
|
||||
|
||||
VolumeLevelFeedback = new IntFeedback(() => VolumeLevel);
|
||||
MuteFeedback = new BoolFeedback(() => IsMuted);
|
||||
|
||||
VolumeLevel = Mixer.VolumeFeedback.ShortValue;
|
||||
IsMuted = Mixer.AuxiliaryMuteControl.MuteOnFeedback.BoolValue;
|
||||
}
|
||||
|
||||
#region Volume
|
||||
|
||||
private void OnAuxMixerPropertyChange(object sender, GenericEventArgs args)
|
||||
{
|
||||
Debug.Console(2, this, "AuxMixerPropertyChange: {0} > Index-{1}, EventId-{2}", sender.GetType().ToString(), args.Index, args.EventId);
|
||||
Debug.Console(2, this, "OnAuxMixerPropertyChange: {0} > Index-{1}, EventId-{2}", sender.ToString(), args.Index, args.EventId);
|
||||
|
||||
switch (args.EventId)
|
||||
{
|
||||
case (3):
|
||||
case MuteAndVolumeContorlEventIds.VolumeFeedbackEventId:
|
||||
{
|
||||
VolumeLevel = Mixer.VolumeFeedback.ShortValue;
|
||||
VolumeLevel = _mixer.VolumeFeedback.ShortValue;
|
||||
break;
|
||||
}
|
||||
case MuteAndVolumeContorlEventIds.MuteOnEventId:
|
||||
case MuteAndVolumeContorlEventIds.MuteOffEventId:
|
||||
{
|
||||
IsMuted = _mixer.AuxiliaryMuteControl.MuteOnFeedback.BoolValue;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
Debug.Console(1, this, "OnAuxMixerPropertyChange: {0} > Index-{1}, EventId-{2} - unhandled eventId", sender.ToString(), args.Index, args.EventId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -58,11 +66,12 @@ namespace PepperDash_Essentials_DM.Chassis
|
||||
public int VolumeLevel
|
||||
{
|
||||
get { return _volumeLevel; }
|
||||
set
|
||||
private set
|
||||
{
|
||||
var level = value;
|
||||
|
||||
_volumeLevel = CrestronEnvironment.ScaleWithLimits(level, DeviceLevelMax, DeviceLevelMin, CrestronLevelMax, CrestronLevelMin);
|
||||
|
||||
|
||||
Debug.Console(1, this, "VolumeFeedback: level-'{0}', scaled-'{1}'", level, _volumeLevel);
|
||||
|
||||
VolumeLevelFeedback.FireUpdate();
|
||||
@@ -70,26 +79,25 @@ namespace PepperDash_Essentials_DM.Chassis
|
||||
}
|
||||
|
||||
public IntFeedback VolumeLevelFeedback { get; private set; }
|
||||
|
||||
|
||||
public void SetVolume(ushort level)
|
||||
{
|
||||
var scaled = CrestronEnvironment.ScaleWithLimits(level, CrestronLevelMax, CrestronLevelMin, DeviceLevelMax,
|
||||
DeviceLevelMin);
|
||||
var levelScaled = CrestronEnvironment.ScaleWithLimits(level, CrestronLevelMax, CrestronLevelMin, DeviceLevelMax, DeviceLevelMin);
|
||||
|
||||
Debug.Console(1, this, "SetVolume: level-'{0}', scaled-'{1}'", level, scaled);
|
||||
|
||||
Mixer.Volume.ShortValue = (short)scaled;
|
||||
Debug.Console(1, this, "SetVolume: level-'{0}', levelScaled-'{1}'", level, levelScaled);
|
||||
|
||||
_mixer.Volume.ShortValue = (short)levelScaled;
|
||||
}
|
||||
|
||||
public void VolumeUp(bool pressRelease)
|
||||
{
|
||||
if (pressRelease)
|
||||
{
|
||||
Mixer.Volume.CreateSignedRamp(DeviceLevelMax, RampTime);
|
||||
_mixer.Volume.CreateSignedRamp(DeviceLevelMax, RampTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
Mixer.Volume.StopRamp();
|
||||
_mixer.Volume.StopRamp();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,14 +105,11 @@ namespace PepperDash_Essentials_DM.Chassis
|
||||
{
|
||||
if (pressRelease)
|
||||
{
|
||||
//var remainingRatio = Mixer.Volume.UShortValue/CrestronLevelMax;
|
||||
//Mixer.Volume.CreateRamp(CrestronLevelMin, (uint)(RampTime * remainingRatio));
|
||||
|
||||
Mixer.Volume.CreateSignedRamp(DeviceLevelMin, RampTime);
|
||||
_mixer.Volume.CreateSignedRamp(DeviceLevelMin, RampTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
Mixer.Volume.StopRamp();
|
||||
_mixer.Volume.StopRamp();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,12 +126,22 @@ namespace PepperDash_Essentials_DM.Chassis
|
||||
|
||||
switch (args.EventId)
|
||||
{
|
||||
case (1):
|
||||
case (2):
|
||||
case MuteAndVolumeContorlEventIds.VolumeFeedbackEventId:
|
||||
{
|
||||
IsMuted = Mixer.AuxiliaryMuteControl.MuteOnFeedback.BoolValue;
|
||||
VolumeLevel = _mixer.VolumeFeedback.ShortValue;
|
||||
break;
|
||||
}
|
||||
case MuteAndVolumeContorlEventIds.MuteOnEventId:
|
||||
case MuteAndVolumeContorlEventIds.MuteOffEventId:
|
||||
{
|
||||
IsMuted = _mixer.AuxiliaryMuteControl.MuteOnFeedback.BoolValue;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
Debug.Console(1, this, "OnMuteAndVolumeControlPropertyChange: {0} > Index-{1}, EventId-{2} - unhandled eventId", device.ToString(), args.Index, args.EventId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,12 +164,12 @@ namespace PepperDash_Essentials_DM.Chassis
|
||||
|
||||
public void MuteOn()
|
||||
{
|
||||
Mixer.AuxiliaryMuteControl.MuteOn();
|
||||
_mixer.AuxiliaryMuteControl.MuteOn();
|
||||
}
|
||||
|
||||
public void MuteOff()
|
||||
{
|
||||
Mixer.AuxiliaryMuteControl.MuteOff();
|
||||
_mixer.AuxiliaryMuteControl.MuteOff();
|
||||
}
|
||||
|
||||
public void MuteToggle()
|
||||
|
||||
@@ -86,11 +86,13 @@ namespace PepperDash_Essentials_DM.Chassis
|
||||
foreach (var item in _chassis.HdmiDmLiteOutputs)
|
||||
{
|
||||
var audioDevice = new HdPsXxxOutputAudioController(Key, item.Number, _chassis);
|
||||
Debug.Console(2, this, "Adding HdPsXxxOutputAudioController '{0}' for output '{1}'", audioDevice.Key, item.Number);
|
||||
DeviceManager.AddDevice(audioDevice);
|
||||
}
|
||||
}
|
||||
foreach (var item in _chassis.AnalogAuxiliaryMixer)
|
||||
{
|
||||
var audioDevice = new HdPsXxxAnalogAuxMixerController(Key, item.MixerNumber, _chassis);
|
||||
var audioDevice = new HdPsXxxAnalogAuxMixerController(Key, item.MixerNumber, _chassis);
|
||||
Debug.Console(2, this, "Adding HdPsXxAnalogAuxMixerCOntorller '{0}' for output '{1}'", audioDevice.Key, item.MixerNumber);
|
||||
DeviceManager.AddDevice(audioDevice);
|
||||
}
|
||||
}
|
||||
@@ -214,14 +216,14 @@ namespace PepperDash_Essentials_DM.Chassis
|
||||
VideoOutputRouteFeedbacks.Add(new IntFeedback(index.ToString(CultureInfo.InvariantCulture),
|
||||
() => output.VideoOutFeedback == null ? 0 : (int)output.VideoOutFeedback.Number));
|
||||
}
|
||||
|
||||
Debug.Console(0, this, "----> AnalogAuxillaryMixer.Count-{0}", _chassis.AnalogAuxiliaryMixer.Count);
|
||||
/*
|
||||
Debug.Console(2, this, "----> AnalogAuxillaryMixer.Count-{0}", _chassis.AnalogAuxiliaryMixer.Count);
|
||||
foreach (var item in _chassis.AnalogAuxiliaryMixer)
|
||||
{
|
||||
Debug.Console(0, this, "----> AnalogAuxillaryMixer[{0}].LineMuteVolumeControl.Count-{1}", item.MixerNumber, item.LineMuteVolumeControl.Count);
|
||||
Debug.Console(0, this, "----> AnalogAuxillaryMixer[{0}].SourceMuteVolumeControl.Count-{1}", item.MixerNumber, item.SourceMuteVolumeControl.Count);
|
||||
Debug.Console(2, this, "----> AnalogAuxillaryMixer[{0}].LineMuteVolumeControl.Count-{1}", item.MixerNumber, item.LineMuteVolumeControl.Count);
|
||||
Debug.Console(2, this, "----> AnalogAuxillaryMixer[{0}].SourceMuteVolumeControl.Count-{1}", item.MixerNumber, item.SourceMuteVolumeControl.Count);
|
||||
}
|
||||
|
||||
*/
|
||||
_chassis.DMOutputChange += _chassis_OutputChange;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,25 +6,56 @@ using PepperDash.Essentials.Core;
|
||||
namespace PepperDash_Essentials_DM.Chassis
|
||||
{
|
||||
public class HdPsXxxOutputAudioController : IKeyed,
|
||||
IHasVolumeControlWithFeedback, IHasMuteControlWithFeedback // || IBasicVolumeWithFeedback
|
||||
IHasVolumeControlWithFeedback, IHasMuteControlWithFeedback
|
||||
{
|
||||
public string Key { get; private set; }
|
||||
|
||||
public HdPsXxxOutputPort Port { get; private set; }
|
||||
private readonly HdPsXxxHdmiDmLiteOutputMixer _mixer; // volume/volumeFeedback
|
||||
private readonly HdPsXxxOutputPort _port; // mute/muteFeedback
|
||||
|
||||
public HdPsXxxOutputAudioController(string parent, uint output, HdPsXxx chassis)
|
||||
{
|
||||
Key = string.Format("{0}-audioOut{1}", parent, output);
|
||||
|
||||
Port = chassis.HdmiDmLiteOutputs[output].OutputPort;
|
||||
_port = chassis.HdmiDmLiteOutputs[output].OutputPort;
|
||||
_mixer = chassis.HdmiDmLiteOutputs[output].Mixer;
|
||||
|
||||
chassis.DMOutputChange += ChassisOnDmOutputChange;
|
||||
|
||||
VolumeLevelFeedback = new IntFeedback(() => VolumeLevel);
|
||||
MuteFeedback = new BoolFeedback(() => IsMuted);
|
||||
}
|
||||
|
||||
//if(Port.AudioOutput.Volume != null)
|
||||
// VolumeLevel = Port.AudioOutput.VolumeFeedback.UShortValue;
|
||||
private void ChassisOnDmOutputChange(Switch device, DMOutputEventArgs args)
|
||||
{
|
||||
switch (args.EventId)
|
||||
{
|
||||
case (DMOutputEventIds.VolumeEventId):
|
||||
{
|
||||
Debug.Console(2, this, "HdPsXxxOutputAudioController: {0} > Index-{1}, Number-{3}, EventId-{2} - AudioMute/UnmuteEventId",
|
||||
device.ToString(), args.Index, args.EventId, args.Number);
|
||||
|
||||
IsMuted = Port.MuteOnFeedback.BoolValue;
|
||||
VolumeLevel = _mixer.VolumeFeedback.ShortValue;
|
||||
|
||||
break;
|
||||
}
|
||||
case DMOutputEventIds.MuteOnEventId:
|
||||
case DMOutputEventIds.MuteOffEventId:
|
||||
{
|
||||
Debug.Console(2, this, "HdPsXxxOutputAudioController: {0} > Index-{1}, Number-{3}, EventId-{2} - MuteOnEventId/MuteOffEventId",
|
||||
device.ToString(), args.Index, args.EventId, args.Number);
|
||||
|
||||
IsMuted = _port.MuteOnFeedback.BoolValue;
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
Debug.Console(1, this, "HdPsXxxOutputAudioController: {0} > Index-{1}, Number-{3}, EventId-{2} - unhandled eventId",
|
||||
device.ToString(), args.Index, args.EventId, args.Number);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region Volume
|
||||
@@ -42,11 +73,11 @@ namespace PepperDash_Essentials_DM.Chassis
|
||||
public int VolumeLevel
|
||||
{
|
||||
get { return _volumeLevel; }
|
||||
set
|
||||
private set
|
||||
{
|
||||
var level = value;
|
||||
//_volumeLevel = CrestronEnvironment.ScaleWithLimits(level, DeviceLevelMax, DeviceLevelMin, CrestronLevelMax, CrestronLevelMin);
|
||||
_volumeLevel = CrestronEnvironment.ScaleWithLimits(level, CrestronLevelMax, CrestronLevelMin, DeviceLevelMax, DeviceLevelMin);
|
||||
|
||||
_volumeLevel = CrestronEnvironment.ScaleWithLimits(level, DeviceLevelMax, DeviceLevelMin, CrestronLevelMax, CrestronLevelMin);
|
||||
|
||||
Debug.Console(2, this, "VolumeFeedback: level-'{0}', scaled-'{1}'", level, _volumeLevel);
|
||||
|
||||
@@ -58,23 +89,22 @@ namespace PepperDash_Essentials_DM.Chassis
|
||||
|
||||
public void SetVolume(ushort level)
|
||||
{
|
||||
var scaled = CrestronEnvironment.ScaleWithLimits(level, CrestronLevelMax, CrestronLevelMin, DeviceLevelMax,
|
||||
DeviceLevelMin);
|
||||
var levelScaled = CrestronEnvironment.ScaleWithLimits(level, CrestronLevelMax, CrestronLevelMin, DeviceLevelMax, DeviceLevelMin);
|
||||
|
||||
Debug.Console(1, this, "SetVolume: level-'{0}', scaled-'{1}'", level, scaled);
|
||||
Debug.Console(1, this, "SetVolume: level-'{0}', levelScaled-'{1}'", level, levelScaled);
|
||||
|
||||
Port.AudioOutput.Volume.ShortValue = (short)scaled;
|
||||
_mixer.Volume.ShortValue = (short)levelScaled;
|
||||
}
|
||||
|
||||
public void VolumeUp(bool pressRelease)
|
||||
{
|
||||
if (pressRelease)
|
||||
{
|
||||
Port.AudioOutput.Volume.CreateSignedRamp(DeviceLevelMax, RampTime);
|
||||
_mixer.Volume.CreateSignedRamp(DeviceLevelMax, RampTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
Port.AudioOutput.Volume.StopRamp();
|
||||
_mixer.Volume.StopRamp();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,11 +112,11 @@ namespace PepperDash_Essentials_DM.Chassis
|
||||
{
|
||||
if (pressRelease)
|
||||
{
|
||||
Port.AudioOutput.Volume.CreateSignedRamp(DeviceLevelMin, RampTime);
|
||||
_mixer.Volume.CreateSignedRamp(DeviceLevelMin, RampTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
Port.AudioOutput.Volume.StopRamp();
|
||||
_mixer.Volume.StopRamp();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,12 +146,12 @@ namespace PepperDash_Essentials_DM.Chassis
|
||||
|
||||
public void MuteOn()
|
||||
{
|
||||
Port.MuteOn();
|
||||
_port.MuteOn();
|
||||
}
|
||||
|
||||
public void MuteOff()
|
||||
{
|
||||
Port.MuteOff();
|
||||
_port.MuteOff();
|
||||
}
|
||||
|
||||
public void MuteToggle()
|
||||
|
||||
@@ -994,7 +994,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
|
||||
//Special Change for protected directory clear
|
||||
|
||||
trilist.SetBoolSigAction(joinMap.DirectoryClearSelected.JoinNumber, (b) => SelectDirectoryEntry(_directoryCodec, 0, _directoryTrilist, _directoryJoinmap));
|
||||
trilist.SetBoolSigAction(joinMap.DirectoryClearSelected.JoinNumber, (b) => SelectDirectoryEntry(codec, 0, trilist, joinMap));
|
||||
|
||||
// Report feedback for number of contact methods for selected contact
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<packages>
|
||||
<package id="PepperDashCore" version="1.3.1" targetFramework="net35" allowedVersions="[1.0,2.0)"/>
|
||||
<package id="PepperDashCore" version="1.3.2" targetFramework="net35" allowedVersions="[1.0,2.0)"/>
|
||||
</packages>
|
||||
|
||||
Reference in New Issue
Block a user