mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-12 03:57:27 +00:00
Merge pull request #916 from PepperDash/feature/split-volume-interfaces-for-composition
Feature/split volume interfaces for composition
This commit is contained in:
commit
397c0f250b
3 changed files with 47 additions and 15 deletions
|
|
@ -7,25 +7,53 @@ using Crestron.SimplSharp;
|
||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Defines minimal volume control methods
|
/// Defines minimal volume and mute control methods
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IBasicVolumeControls
|
public interface IBasicVolumeControls : IHasVolumeControl, IHasMuteControl
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines basic volume control methods
|
||||||
|
/// </summary>
|
||||||
|
public interface IHasVolumeControl
|
||||||
{
|
{
|
||||||
void VolumeUp(bool pressRelease);
|
void VolumeUp(bool pressRelease);
|
||||||
void VolumeDown(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();
|
void MuteToggle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines mute control methods and properties with feedback
|
||||||
|
/// </summary>
|
||||||
|
public interface IHasMuteControlWithFeedback : IHasMuteControl
|
||||||
|
{
|
||||||
|
BoolFeedback MuteFeedback { get; }
|
||||||
|
void MuteOn();
|
||||||
|
void MuteOff();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds feedback and direct volume level set to IBasicVolumeControls
|
/// Adds feedback and direct volume level set to IBasicVolumeControls
|
||||||
/// </summary>
|
/// </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>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -308,7 +308,7 @@ namespace PepperDash.Essentials.Devices.Displays
|
||||||
//Send((string)selector);
|
//Send((string)selector);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetVolume(ushort level)
|
public void SetVolume(ushort level)
|
||||||
{
|
{
|
||||||
var levelString = string.Format("{0}{1:X4}\x03", VolumeLevelPartialCmd, level);
|
var levelString = string.Format("{0}{1:X4}\x03", VolumeLevelPartialCmd, level);
|
||||||
AppendChecksumAndSend(levelString);
|
AppendChecksumAndSend(levelString);
|
||||||
|
|
@ -333,10 +333,13 @@ namespace PepperDash.Essentials.Devices.Displays
|
||||||
Send(MuteOnCmd);
|
Send(MuteOnCmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IBasicVolumeWithFeedback.SetVolume(ushort level)
|
|
||||||
|
/*
|
||||||
|
public void IBasicVolumeWithFeedback.SetVolume(ushort level)
|
||||||
{
|
{
|
||||||
SetVolume(level);
|
SetVolume(level);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -290,7 +290,7 @@ namespace PepperDash.Essentials.Devices.Displays
|
||||||
//Send((string)selector);
|
//Send((string)selector);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetVolume(ushort level)
|
public void SetVolume(ushort level)
|
||||||
{
|
{
|
||||||
var levelString = string.Format("{0}{1:X3}\x03", VolumeLevelPartialCmd, level);
|
var levelString = string.Format("{0}{1:X3}\x03", VolumeLevelPartialCmd, level);
|
||||||
|
|
||||||
|
|
@ -315,11 +315,12 @@ namespace PepperDash.Essentials.Devices.Displays
|
||||||
Send(MuteOnCmd);
|
Send(MuteOnCmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
void IBasicVolumeWithFeedback.SetVolume(ushort level)
|
void IBasicVolumeWithFeedback.SetVolume(ushort level)
|
||||||
{
|
{
|
||||||
SetVolume(level);
|
SetVolume(level);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region IBasicVolumeControls Members
|
#region IBasicVolumeControls Members
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue