mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 13:15:03 +00:00
#637 Updates LinkToApi method to map configured tuners
This commit is contained in:
@@ -54,7 +54,7 @@ namespace PepperDash.Essentials.Room.Config
|
|||||||
/// Indicates which tuners should mirror preset recall when two rooms are configured in a primary->secondary scenario
|
/// Indicates which tuners should mirror preset recall when two rooms are configured in a primary->secondary scenario
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("mirroredTuners")]
|
[JsonProperty("mirroredTuners")]
|
||||||
public List<string> MirroredTuners { get; set; }
|
public Dictionary<uint, string> MirroredTuners { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates the room
|
/// Indicates the room
|
||||||
|
|||||||
@@ -373,13 +373,30 @@ Params: {2}"
|
|||||||
uint i;
|
uint i;
|
||||||
if (_config.IsPrimary)
|
if (_config.IsPrimary)
|
||||||
{
|
{
|
||||||
i = 0;
|
|
||||||
foreach (var feedback in CurrentPresetsFeedbacks)
|
if (_config.MirroredTuners != null && _config.MirroredTuners.Count > 0)
|
||||||
{
|
{
|
||||||
feedback.Value.LinkInputSig(trilist.StringInput[(uint) (joinMap.CurrentPreset.JoinNumber + i)]);
|
foreach (var tuner in _config.MirroredTuners)
|
||||||
i++;
|
{
|
||||||
|
var f = CurrentPresetsFeedbacks[tuner.Value];
|
||||||
|
|
||||||
|
if (f == null)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Unable to find feedback with key: {0}", tuner.Value);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
f.LinkInputSig(trilist.StringInput[(uint)(joinMap.CurrentPreset.JoinNumber + tuner.Key)]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//i = 0;
|
||||||
|
//foreach (var feedback in CurrentPresetsFeedbacks)
|
||||||
|
//{
|
||||||
|
// feedback.Value.LinkInputSig(trilist.StringInput[(uint) (joinMap.CurrentPreset.JoinNumber + i)]);
|
||||||
|
// i++;
|
||||||
|
//}
|
||||||
|
|
||||||
trilist.OnlineStatusChange += (device, args) =>
|
trilist.OnlineStatusChange += (device, args) =>
|
||||||
{
|
{
|
||||||
if (!args.DeviceOnLine)
|
if (!args.DeviceOnLine)
|
||||||
@@ -396,14 +413,29 @@ Params: {2}"
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
i = 0;
|
|
||||||
foreach (var setTopBox in _tuners)
|
if (_config.MirroredTuners != null && _config.MirroredTuners.Count > 0)
|
||||||
{
|
{
|
||||||
var tuner = setTopBox;
|
foreach (var tuner in _config.MirroredTuners)
|
||||||
|
{
|
||||||
|
var t = _tuners[tuner.Value];
|
||||||
|
|
||||||
trilist.SetStringSigAction(joinMap.CurrentPreset.JoinNumber + i, s => _tunerPresets.Dial(s, tuner.Value));
|
if (t == null)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Unable to find tuner with key: {0}", tuner.Value);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
i++;
|
trilist.SetStringSigAction(joinMap.CurrentPreset.JoinNumber + tuner.Key, s => _tunerPresets.Dial(s, t));
|
||||||
|
}
|
||||||
|
|
||||||
|
//foreach (var setTopBox in _tuners)
|
||||||
|
//{
|
||||||
|
// var tuner = setTopBox;
|
||||||
|
|
||||||
|
// trilist.SetStringSigAction(joinMap.CurrentPreset.JoinNumber + i, s => _tunerPresets.Dial(s, tuner.Value));
|
||||||
|
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user