mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-10 18:24:50 +00:00
Refactored for source change handler updates
This commit is contained in:
@@ -95,6 +95,9 @@ namespace PepperDash.Essentials.Core
|
||||
[JsonProperty("disableRoutedSharing")]
|
||||
public bool DisableRoutedSharing { get; set; }
|
||||
|
||||
[JsonProperty("destinations")]
|
||||
public List<eSourceListItemDestinationTypes> Destinations { get; set; }
|
||||
|
||||
public SourceListItem()
|
||||
{
|
||||
Icon = "Blank";
|
||||
@@ -112,4 +115,16 @@ namespace PepperDash.Essentials.Core
|
||||
[JsonProperty("type")]
|
||||
public eRoutingSignalType Type { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines the valid destination types for SourceListItems in a room
|
||||
/// </summary>
|
||||
public enum eSourceListItemDestinationTypes
|
||||
{
|
||||
defaultDisplay,
|
||||
leftDisplay,
|
||||
rightDisplay,
|
||||
programAudio,
|
||||
codecContent
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ using PepperDash.Essentials.Core.Routing;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public class BasicIrDisplay : DisplayBase, IBasicVolumeControls, IPower, IWarmingCooling, IRoutingSinkWithSwitching
|
||||
public class BasicIrDisplay : DisplayBase, IBasicVolumeControls, IPower, IWarmingCooling
|
||||
{
|
||||
public IrOutputPortController IrPort { get; private set; }
|
||||
public ushort IrPulseTime { get; set; }
|
||||
|
||||
@@ -20,8 +20,29 @@ namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public event SourceInfoChangeHandler CurrentSourceChange;
|
||||
|
||||
public string CurrentSourceInfoKey { get; protected set; }
|
||||
public SourceListItem CurrentSourceInfo { get; protected set; }
|
||||
public string CurrentSourceInfoKey { get; set; }
|
||||
public SourceListItem CurrentSourceInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
return _CurrentSourceInfo;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == _CurrentSourceInfo) return;
|
||||
|
||||
var handler = CurrentSourceChange;
|
||||
|
||||
if (handler != null)
|
||||
handler(_CurrentSourceInfo, ChangeType.WillChange);
|
||||
|
||||
_CurrentSourceInfo = value;
|
||||
|
||||
if (handler != null)
|
||||
handler(_CurrentSourceInfo, ChangeType.DidChange);
|
||||
}
|
||||
}
|
||||
SourceListItem _CurrentSourceInfo;
|
||||
|
||||
public BoolFeedback PowerIsOnFeedback { get; protected set; }
|
||||
public BoolFeedback IsCoolingDownFeedback { get; protected set; }
|
||||
|
||||
@@ -1387,7 +1387,7 @@ namespace PepperDash.Essentials.Core.Fusion
|
||||
/// <summary>
|
||||
/// Event handler for when room source changes
|
||||
/// </summary>
|
||||
protected void Room_CurrentSourceInfoChange(EssentialsRoomBase room, SourceListItem info, ChangeType type)
|
||||
protected void Room_CurrentSourceInfoChange(SourceListItem info, ChangeType type)
|
||||
{
|
||||
// Handle null. Nothing to do when switching from or to null
|
||||
if (info == null || info.SourceDevice == null)
|
||||
@@ -1403,7 +1403,7 @@ namespace PepperDash.Essentials.Core.Fusion
|
||||
{
|
||||
if (SourceToFeedbackSigs.ContainsKey(dev))
|
||||
SourceToFeedbackSigs[dev].BoolValue = true;
|
||||
var name = (room == null ? "" : room.Name);
|
||||
//var name = (room == null ? "" : room.Name);
|
||||
CurrentRoomSourceNameSig.InputSig.StringValue = info.SourceDevice.Name;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,8 @@ namespace PepperDash.Essentials.Core
|
||||
void RunRouteAction(string routeKey);
|
||||
|
||||
void RunRouteAction(string routeKey, Action successCallback);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace PepperDash.Essentials.Core
|
||||
/// <summary>
|
||||
/// The handler type for a Room's SourceInfoChange
|
||||
/// </summary>
|
||||
public delegate void SourceInfoChangeHandler(EssentialsRoomBase room, SourceListItem info, ChangeType type);
|
||||
public delegate void SourceInfoChangeHandler(/*EssentialsRoomBase room,*/ SourceListItem info, ChangeType type);
|
||||
|
||||
|
||||
//*******************************************************************************************
|
||||
@@ -26,8 +26,8 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
public interface IHasCurrentSourceInfoChange
|
||||
{
|
||||
string CurrentSourceInfoKey { get; }
|
||||
SourceListItem CurrentSourceInfo { get; }
|
||||
string CurrentSourceInfoKey { get; set; }
|
||||
SourceListItem CurrentSourceInfo { get; set; }
|
||||
event SourceInfoChangeHandler CurrentSourceChange;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace PepperDash.Essentials.Core
|
||||
/// <summary>
|
||||
/// For fixed-source endpoint devices
|
||||
/// </summary>
|
||||
public interface IRoutingSinkNoSwitching : IRoutingInputs
|
||||
public interface IRoutingSinkNoSwitching : IRoutingInputs, IHasCurrentSourceInfoChange
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user