mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-09 17:54:59 +00:00
Add Source Device Selection for DMPS3-4K
This commit is contained in:
@@ -24,6 +24,15 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
public JoinDataComplete OutputAudio = new JoinDataComplete(new JoinData { JoinNumber = 301, JoinSpan = 32 },
|
||||
new JoinMetadata { Description = "DM Chassis Output Audio Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
||||
|
||||
[JoinName("OutputAudioSourceDevice")] public JoinDataComplete OutputAudioSourceDevice =
|
||||
new JoinDataComplete(new JoinData {JoinNumber = 401, JoinSpan = 32},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "DMPS HDMI/DM Output Source Device selection",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.Analog
|
||||
});
|
||||
|
||||
[JoinName("InputNames")]
|
||||
public JoinDataComplete InputNames = new JoinDataComplete(new JoinData { JoinNumber = 101, JoinSpan = 32 },
|
||||
new JoinMetadata { Description = "DM Chassis Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
||||
|
||||
@@ -32,6 +32,7 @@ namespace PepperDash.Essentials.DM
|
||||
// Feedbacks for EssentialDM
|
||||
public Dictionary<uint, IntFeedback> VideoOutputFeedbacks { get; private set; }
|
||||
public Dictionary<uint, IntFeedback> AudioOutputFeedbacks { get; private set; }
|
||||
public Dictionary<uint, IntFeedback> AudioOutputSourceDeviceFeedbacks { get; private set; }
|
||||
public Dictionary<uint, BoolFeedback> VideoInputSyncFeedbacks { get; private set; }
|
||||
public Dictionary<uint, BoolFeedback> InputEndpointOnlineFeedbacks { get; private set; }
|
||||
public Dictionary<uint, BoolFeedback> OutputEndpointOnlineFeedbacks { get; private set; }
|
||||
@@ -125,6 +126,7 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
VideoOutputFeedbacks = new Dictionary<uint, IntFeedback>();
|
||||
AudioOutputFeedbacks = new Dictionary<uint, IntFeedback>();
|
||||
AudioOutputSourceDeviceFeedbacks = new Dictionary<uint, IntFeedback>();
|
||||
VideoInputSyncFeedbacks = new Dictionary<uint, BoolFeedback>();
|
||||
InputNameFeedbacks = new Dictionary<uint, StringFeedback>();
|
||||
OutputNameFeedbacks = new Dictionary<uint, StringFeedback>();
|
||||
@@ -231,6 +233,8 @@ namespace PepperDash.Essentials.DM
|
||||
o => ExecuteNumericSwitch(o, (ushort) ioSlot, eRoutingSignalType.Video));
|
||||
trilist.SetUShortSigAction(joinMap.OutputAudio.JoinNumber + ioSlotJoin,
|
||||
o => ExecuteNumericSwitch(o, (ushort) ioSlot, eRoutingSignalType.Audio));
|
||||
trilist.SetUShortSigAction(joinMap.OutputAudioSourceDevice.JoinNumber + ioSlotJoin, u =>
|
||||
SetAudioOutputSourceDevice(ioSlot, u));
|
||||
|
||||
trilist.SetStringSigAction(joinMap.OutputNames.JoinNumber + ioSlotJoin, s =>
|
||||
{
|
||||
@@ -269,6 +273,12 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
AudioOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputAudio.JoinNumber + ioSlotJoin]);
|
||||
}
|
||||
|
||||
if (AudioOutputSourceDeviceFeedbacks[ioSlot] != null)
|
||||
{
|
||||
AudioOutputSourceDeviceFeedbacks[ioSlot].LinkInputSig(
|
||||
trilist.UShortInput[joinMap.OutputAudioSourceDevice.JoinNumber + ioSlotJoin]);
|
||||
}
|
||||
if (OutputNameFeedbacks[ioSlot] != null)
|
||||
{
|
||||
OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames.JoinNumber + ioSlotJoin]);
|
||||
@@ -291,6 +301,33 @@ namespace PepperDash.Essentials.DM
|
||||
}
|
||||
}
|
||||
|
||||
private void SetAudioOutputSourceDevice(uint output, ushort sourceDevice)
|
||||
{
|
||||
var card = Dmps.SwitcherOutputs[output];
|
||||
|
||||
if (sourceDevice > 3)
|
||||
{
|
||||
Debug.Console(1, this, "Invalid audio out device {0}. Valid values are 0 (NoSource), 1 (DigitalMixer1), 2 (DigitalMixer2), 3(AudioFollowVideo)");
|
||||
return;
|
||||
}
|
||||
//try to cast to dm output
|
||||
var dmOut = card as Card.Dmps3DmOutputBackend;
|
||||
var hdmiOut = card as Card.Dmps3HdmiOutputBackend;
|
||||
|
||||
if (dmOut != null)
|
||||
{
|
||||
dmOut.AudioOutSourceDevice = (eDmps34KAudioOutSourceDevice) sourceDevice;
|
||||
return;
|
||||
}
|
||||
|
||||
if (hdmiOut == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
hdmiOut.AudioOutSourceDevice = (eDmps34KAudioOutSourceDevice) sourceDevice;
|
||||
}
|
||||
|
||||
private void LinkInputsToApi(BasicTriList trilist, DmpsRoutingControllerJoinMap joinMap)
|
||||
{
|
||||
for (uint i = 1; i <= Dmps.SwitcherInputs.Count; i++)
|
||||
@@ -572,6 +609,11 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
var cecPort = hdmiOutputCard.HdmiOutputPort;
|
||||
|
||||
hdmiOutputCard.AudioOutSourceDevice = eDmps34KAudioOutSourceDevice.DigitalMixer1;
|
||||
|
||||
AudioOutputSourceDeviceFeedbacks.Add(outputCard.Number,
|
||||
new IntFeedback(() => (int) hdmiOutputCard.AudioOutSourceDeviceFeedback));
|
||||
|
||||
AddHdmiOutputPort(number, cecPort);
|
||||
}
|
||||
else if (outputCard is Card.Dmps3DmOutput)
|
||||
@@ -580,6 +622,11 @@ namespace PepperDash.Essentials.DM
|
||||
}
|
||||
else if (outputCard is Card.Dmps3DmOutputBackend)
|
||||
{
|
||||
var dmCard = outputCard as Card.Dmps3DmOutputBackend;
|
||||
|
||||
AudioOutputSourceDeviceFeedbacks.Add(outputCard.Number,
|
||||
new IntFeedback(() => (int) dmCard.AudioOutSourceDeviceFeedback));
|
||||
|
||||
AddDmOutputPort(number);
|
||||
}
|
||||
else if (outputCard is Card.Dmps3ProgramOutput)
|
||||
@@ -801,6 +848,12 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
AudioOutputFeedbacks[output].FireUpdate();
|
||||
}
|
||||
|
||||
if (AudioOutputSourceDeviceFeedbacks.ContainsKey(output))
|
||||
{
|
||||
AudioOutputSourceDeviceFeedbacks[output].FireUpdate();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (args.EventId == DMOutputEventIds.OutputNameEventId
|
||||
@@ -871,16 +924,10 @@ namespace PepperDash.Essentials.DM
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//DMOutput dmOutputCard = output == 0 ? null : Dmps.SwitcherOutputs[output] as DMOutput;
|
||||
|
||||
//if (inCard != null)
|
||||
//{
|
||||
// NOTE THAT BITWISE COMPARISONS - TO CATCH ALL ROUTING TYPES
|
||||
if ((sigType & eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
||||
{
|
||||
|
||||
output.VideoOut = input;
|
||||
output.VideoOut = input;
|
||||
}
|
||||
|
||||
if ((sigType & eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
|
||||
|
||||
Reference in New Issue
Block a user