Fixed volume up/down; Working on linking display power fb to room on fb

This commit is contained in:
Heath Volmer
2017-08-18 12:20:22 -06:00
parent 394be710a4
commit 25122abed1
16 changed files with 331 additions and 146 deletions

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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);
}
}
}

View File

@@ -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
{