Compare commits

...

6 Commits

Author SHA1 Message Date
Trevor Payne
397c0f250b Merge pull request #916 from PepperDash/feature/split-volume-interfaces-for-composition
Feature/split volume interfaces for composition
2022-03-14 23:17:26 -05:00
Trevor Payne
a1dce1bb17 Merge branch 'development' into feature/split-volume-interfaces-for-composition 2022-03-14 22:58:13 -05:00
Nick Genovese
15aacbd8c8 Merge pull request #910 from PepperDash/bugfix/lightingBase-sceneIndex
Updates to forEach loop sceneIndex to include local sceneIndex context
2022-03-14 20:32:42 -04:00
Nick Genovese
34a695ba95 feat (essentials): fixed a few build issues with the new volume interfaces 2022-03-14 19:51:55 -04:00
Nick Genovese
0ab1ece445 feat (essentials): split up volume interfaces for better composition
fix (essentials): fixed a few misc devices that are probably deprecated anyhow
2022-03-14 19:26:50 -04:00
Jonathan Arndt
747c68bd1e Updates to forEach loop sceneIndex to include local sceneIndex context 2022-02-16 22:17:45 -08:00
4 changed files with 54 additions and 17 deletions

View File

@@ -7,25 +7,53 @@ using Crestron.SimplSharp;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// Defines minimal volume control methods
/// Defines minimal volume and mute control methods
/// </summary>
public interface IBasicVolumeControls
public interface IBasicVolumeControls : IHasVolumeControl, IHasMuteControl
{
void VolumeUp(bool pressRelease);
void VolumeDown(bool pressRelease);
void MuteToggle();
}
/// <summary>
/// Defines basic volume control methods
/// </summary>
public interface IHasVolumeControl
{
void VolumeUp(bool pressRelease);
void VolumeDown(bool pressRelease);
}
/// <summary>
/// Defines volume control methods and properties with feedback
/// </summary>
public interface IHasVolumeControlWithFeedback : IHasVolumeControl
{
void SetVolume(ushort level);
IntFeedback VolumeLevelFeedback { get; }
}
/// <summary>
/// Defines basic mute control methods
/// </summary>
public interface IHasMuteControl
{
void MuteToggle();
}
/// <summary>
/// Defines mute control methods and properties with feedback
/// </summary>
public interface IHasMuteControlWithFeedback : IHasMuteControl
{
BoolFeedback MuteFeedback { get; }
void MuteOn();
void MuteOff();
}
/// <summary>
/// Adds feedback and direct volume level set to IBasicVolumeControls
/// </summary>
public interface IBasicVolumeWithFeedback : IBasicVolumeControls
public interface IBasicVolumeWithFeedback : IBasicVolumeControls, IHasVolumeControlWithFeedback, IHasMuteControlWithFeedback
{
void SetVolume(ushort level);
void MuteOn();
void MuteOff();
IntFeedback VolumeLevelFeedback { get; }
BoolFeedback MuteFeedback { get; }
}
/// <summary>

View File

@@ -99,13 +99,18 @@ namespace PepperDash.Essentials.Core.Lighting
var sceneIndex = 0;
foreach (var scene in lightingDevice.LightingScenes)
{
trilist.SetSigTrueAction((uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex), () => lightingDevice.SelectScene(lightingDevice.LightingScenes[sceneIndex]));
var index1 = sceneIndex;
trilist.SetSigTrueAction((uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex), () =>
{
var index = index1;
Debug.Console(2, this, "LightingDevice: sceneIndex: {0} index: {1} > inside action", index1, index);
lightingDevice.SelectScene(lightingDevice.LightingScenes[index]);
});
scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex)]);
trilist.StringInput[(uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex)].StringValue = scene.Name;
trilist.BooleanInput[(uint)(joinMap.ButtonVisibility.JoinNumber + sceneIndex)].BoolValue = true;
sceneIndex++;
}
return joinMap;
}

View File

@@ -308,7 +308,7 @@ namespace PepperDash.Essentials.Devices.Displays
//Send((string)selector);
}
void SetVolume(ushort level)
public void SetVolume(ushort level)
{
var levelString = string.Format("{0}{1:X4}\x03", VolumeLevelPartialCmd, level);
AppendChecksumAndSend(levelString);
@@ -333,10 +333,13 @@ namespace PepperDash.Essentials.Devices.Displays
Send(MuteOnCmd);
}
void IBasicVolumeWithFeedback.SetVolume(ushort level)
/*
public void IBasicVolumeWithFeedback.SetVolume(ushort level)
{
SetVolume(level);
}
*/
#endregion

View File

@@ -290,7 +290,7 @@ namespace PepperDash.Essentials.Devices.Displays
//Send((string)selector);
}
void SetVolume(ushort level)
public void SetVolume(ushort level)
{
var levelString = string.Format("{0}{1:X3}\x03", VolumeLevelPartialCmd, level);
@@ -315,11 +315,12 @@ namespace PepperDash.Essentials.Devices.Displays
Send(MuteOnCmd);
}
/*
void IBasicVolumeWithFeedback.SetVolume(ushort level)
{
SetVolume(level);
}
*/
#endregion
#region IBasicVolumeControls Members