mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-09 09:45:06 +00:00
Fixed volume up/down; Working on linking display power fb to room on fb
This commit is contained in:
Binary file not shown.
@@ -14,6 +14,23 @@ namespace PepperDash.Essentials
|
||||
public event EventHandler<VolumeDeviceChangeEventArgs> CurrentVolumeDeviceChange;
|
||||
public event SourceInfoChangeHandler CurrentSingleSourceChange;
|
||||
|
||||
protected override Func<bool> OnFeedbackFunc
|
||||
{
|
||||
get
|
||||
{
|
||||
return () =>
|
||||
{
|
||||
var disp = DefaultDisplay as DisplayBase;
|
||||
var val = CurrentSourceInfo != null
|
||||
&& CurrentSourceInfo.Type == eSourceListItemType.Route
|
||||
&& disp != null
|
||||
&& disp.PowerIsOnFeedback.BoolValue;
|
||||
Debug.Console(2, this, "************** ROOM POWER {0}", val);
|
||||
return val;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public EssentialsRoomPropertiesConfig Config { get; private set; }
|
||||
|
||||
public IRoutingSinkWithSwitching DefaultDisplay { get; private set; }
|
||||
@@ -91,11 +108,6 @@ namespace PepperDash.Essentials
|
||||
|
||||
public string CurrentSourceInfoKey { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public BoolFeedback OnFeedback { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -115,13 +127,19 @@ namespace PepperDash.Essentials
|
||||
CurrentVolumeControls = DefaultVolumeControls;
|
||||
|
||||
var disp = DefaultDisplay as DisplayBase;
|
||||
OnFeedback = new BoolFeedback(() =>
|
||||
{
|
||||
return CurrentSourceInfo != null
|
||||
&& CurrentSourceInfo.Type == eSourceListItemType.Route
|
||||
&& disp != null
|
||||
&& disp.PowerIsOnFeedback.BoolValue;
|
||||
});
|
||||
if (disp != null)
|
||||
{
|
||||
disp.PowerIsOnFeedback.OutputChange += (o, a) =>
|
||||
{
|
||||
if (disp.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
|
||||
{
|
||||
if (!disp.PowerIsOnFeedback.BoolValue)
|
||||
CurrentSourceInfo = null;
|
||||
OnFeedback.FireUpdate();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
SourceListKey = "default";
|
||||
EnablePowerOnToLastSource = true;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,14 @@ namespace PepperDash.Essentials
|
||||
public event SourceInfoChangeHandler CurrentDisplay1SourceChange;
|
||||
public event SourceInfoChangeHandler CurrentDisplay2SourceChange;
|
||||
|
||||
protected override Func<bool> OnFeedbackFunc { get {
|
||||
return () => (CurrentSingleSourceInfo != null
|
||||
&& CurrentSingleSourceInfo.Type != eSourceListItemType.Off)
|
||||
|| (Display1SourceInfo != null
|
||||
&& Display1SourceInfo.Type != eSourceListItemType.Off)
|
||||
|| (Display2SourceInfo != null
|
||||
&& Display2SourceInfo.Type != eSourceListItemType.Off); } }
|
||||
|
||||
public EssentialsPresentationRoomPropertiesConfig Config { get; private set; }
|
||||
|
||||
public Dictionary<uint, IRoutingSinkNoSwitching> Displays { get; private set; }
|
||||
@@ -141,16 +149,10 @@ namespace PepperDash.Essentials
|
||||
}
|
||||
SourceListItem _Display2SourceInfo;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public BoolFeedback OnFeedback { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// If an audio dialer is available for this room
|
||||
/// </summary>
|
||||
public bool HasAudioDialer { get { return false; } }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -173,15 +175,7 @@ namespace PepperDash.Essentials
|
||||
//else if (defaultAudio is IHasVolumeDevice)
|
||||
// DefaultVolumeControls = (defaultAudio as IHasVolumeDevice).VolumeDevice;
|
||||
|
||||
OnFeedback = new BoolFeedback(() =>
|
||||
{ return (CurrentSingleSourceInfo != null
|
||||
&& CurrentSingleSourceInfo.Type != eSourceListItemType.Off)
|
||||
|| (Display1SourceInfo != null
|
||||
&& Display1SourceInfo.Type != eSourceListItemType.Off)
|
||||
|| (Display2SourceInfo != null
|
||||
&& Display2SourceInfo.Type != eSourceListItemType.Off);
|
||||
|
||||
});
|
||||
|
||||
SourceListKey = "default";
|
||||
EnablePowerOnToLastSource = true;
|
||||
}
|
||||
|
||||
@@ -20,11 +20,23 @@ namespace PepperDash.Essentials
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class EssentialsRoomBase : Device
|
||||
public abstract class EssentialsRoomBase : Device
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public BoolFeedback OnFeedback { get; private set; }
|
||||
|
||||
public BoolFeedback IsWarmingFeedback { get; private set; }
|
||||
public BoolFeedback IsCoolingFeedback { get; private set; }
|
||||
public BoolFeedback ShutdownPendingFeedback { get; private set; }
|
||||
|
||||
protected abstract Func<bool> OnFeedbackFunc { get; }
|
||||
|
||||
|
||||
public EssentialsRoomBase(string key, string name) : base(key, name)
|
||||
{
|
||||
|
||||
OnFeedback = new BoolFeedback(OnFeedbackFunc);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -147,13 +147,7 @@ namespace PepperDash.Essentials
|
||||
: base(parent.TriList)
|
||||
{
|
||||
Config = config;
|
||||
Parent = parent;
|
||||
|
||||
//SelectASourceVisibleFeedback = new BoolFeedback(() =>
|
||||
// CurrentRoom != null && !CurrentRoom.OnFeedback.BoolValue && this.IsVisible);
|
||||
|
||||
//SourcesDynamicList = new SmartObjectDynamicList(
|
||||
// TriList.SmartObjects[UISmartObjectJoin.SourceList], true, 3200);
|
||||
Parent = parent;
|
||||
|
||||
SourcesSrl = new SubpageReferenceList(TriList, 3200, 3, 3, 3);
|
||||
ActivityFooterSrl = new SubpageReferenceList(TriList, 15022, 3, 3, 3);
|
||||
@@ -242,12 +236,16 @@ namespace PepperDash.Essentials
|
||||
base.Show();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handler for room on/off feedback
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
void OnFeedback_OutputChange(object sender, EventArgs e)
|
||||
{
|
||||
if (CurrentRoom.OnFeedback.BoolValue)
|
||||
{
|
||||
TriList.BooleanInput[UIBoolJoin.VolumeSingleMute1Visible].BoolValue = true;
|
||||
//TriList.BooleanInput[UIBoolJoin.StagingPageVisible].BoolValue = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user