mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-11 19:44:52 +00:00
Compare commits
5 Commits
v2.24.4-fu
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3fb30d5561 | ||
|
|
57cd77f019 | ||
|
|
7f2bb078c8 | ||
|
|
316bb849b4 | ||
|
|
a983e2c87f |
13
.config/dotnet-tools.json
Normal file
13
.config/dotnet-tools.json
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"isRoot": true,
|
||||||
|
"tools": {
|
||||||
|
"csharpier": {
|
||||||
|
"version": "1.2.4",
|
||||||
|
"commands": [
|
||||||
|
"csharpier"
|
||||||
|
],
|
||||||
|
"rollForward": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Defines minimum functionality for an audio zone
|
||||||
|
/// </summary>
|
||||||
|
public interface IAudioZone : IBasicVolumeWithFeedback
|
||||||
|
{
|
||||||
|
void SelectInput(ushort input);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Identifies a device that contains audio zones
|
||||||
|
/// </summary>
|
||||||
|
public interface IAudioZones : IRouting
|
||||||
|
{
|
||||||
|
Dictionary<uint, IAudioZone> Zone { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Defines minimal volume and mute control methods
|
||||||
|
/// </summary>
|
||||||
|
public interface IBasicVolumeControls : IKeyName
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Increases the volume
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pressRelease">Indicates whether the volume change is a press and hold action</param>
|
||||||
|
void VolumeUp(bool pressRelease);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Decreases the volume
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pressRelease">Indicates whether the volume change is a press and hold action</param>
|
||||||
|
void VolumeDown(bool pressRelease);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Toggles the mute state
|
||||||
|
/// </summary>
|
||||||
|
void MuteToggle();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Defines the contract for IBasicVolumeWithFeedback
|
||||||
|
/// </summary>
|
||||||
|
public interface IBasicVolumeWithFeedback : IBasicVolumeControls
|
||||||
|
{
|
||||||
|
BoolFeedback MuteFeedback { get; }
|
||||||
|
void MuteOn();
|
||||||
|
void MuteOff();
|
||||||
|
void SetVolume(ushort level);
|
||||||
|
IntFeedback VolumeLevelFeedback { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Defines the contract for IBasicVolumeWithFeedbackAdvanced
|
||||||
|
/// </summary>
|
||||||
|
public interface IBasicVolumeWithFeedbackAdvanced : IBasicVolumeWithFeedback
|
||||||
|
{
|
||||||
|
int RawVolumeLevel { get; }
|
||||||
|
|
||||||
|
eVolumeLevelUnits Units { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Defines the contract for IFullAudioSettings
|
||||||
|
/// </summary>
|
||||||
|
public interface IFullAudioSettings : IBasicVolumeWithFeedback
|
||||||
|
{
|
||||||
|
void SetBalance(ushort level);
|
||||||
|
void BalanceLeft(bool pressRelease);
|
||||||
|
void BalanceRight(bool pressRelease);
|
||||||
|
|
||||||
|
void SetBass(ushort level);
|
||||||
|
void BassUp(bool pressRelease);
|
||||||
|
void BassDown(bool pressRelease);
|
||||||
|
|
||||||
|
void SetTreble(ushort level);
|
||||||
|
void TrebleUp(bool pressRelease);
|
||||||
|
void TrebleDown(bool pressRelease);
|
||||||
|
|
||||||
|
bool hasMaxVolume { get; }
|
||||||
|
void SetMaxVolume(ushort level);
|
||||||
|
void MaxVolumeUp(bool pressRelease);
|
||||||
|
void MaxVolumeDown(bool pressRelease);
|
||||||
|
|
||||||
|
bool hasDefaultVolume { get; }
|
||||||
|
void SetDefaultVolume(ushort level);
|
||||||
|
void DefaultVolumeUp(bool pressRelease);
|
||||||
|
void DefaultVolumeDown(bool pressRelease);
|
||||||
|
|
||||||
|
void LoudnessToggle();
|
||||||
|
void MonoToggle();
|
||||||
|
|
||||||
|
BoolFeedback LoudnessFeedback { get; }
|
||||||
|
BoolFeedback MonoFeedback { get; }
|
||||||
|
IntFeedback BalanceFeedback { get; }
|
||||||
|
IntFeedback BassFeedback { get; }
|
||||||
|
IntFeedback TrebleFeedback { get; }
|
||||||
|
IntFeedback MaxVolumeFeedback { get; }
|
||||||
|
IntFeedback DefaultVolumeFeedback { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Defines the contract for IHasCurrentVolumeControls
|
||||||
|
/// </summary>
|
||||||
|
public interface IHasCurrentVolumeControls
|
||||||
|
{
|
||||||
|
IBasicVolumeControls CurrentVolumeControls { get; }
|
||||||
|
event EventHandler<VolumeDeviceChangeEventArgs> CurrentVolumeDeviceChange;
|
||||||
|
|
||||||
|
void SetDefaultLevels();
|
||||||
|
|
||||||
|
bool ZeroVolumeWhenSwtichingVolumeDevices { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Defines basic mute control methods
|
||||||
|
/// </summary>
|
||||||
|
public interface IHasMuteControl
|
||||||
|
{
|
||||||
|
void MuteToggle();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Defines mute control methods and properties with feedback
|
||||||
|
/// </summary>
|
||||||
|
public interface IHasMuteControlWithFeedback : IHasMuteControl
|
||||||
|
{
|
||||||
|
BoolFeedback MuteFeedback { get; }
|
||||||
|
void MuteOn();
|
||||||
|
void MuteOff();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Defines the contract for IHasVolumeControl
|
||||||
|
/// </summary>
|
||||||
|
public interface IHasVolumeControl
|
||||||
|
{
|
||||||
|
void VolumeUp(bool pressRelease);
|
||||||
|
void VolumeDown(bool pressRelease);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Defines volume control methods and properties with feedback
|
||||||
|
/// </summary>
|
||||||
|
public interface IHasVolumeControlWithFeedback : IHasVolumeControl
|
||||||
|
{
|
||||||
|
void SetVolume(ushort level);
|
||||||
|
IntFeedback VolumeLevelFeedback { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Defines the contract for IHasVolumeDevice
|
||||||
|
/// </summary>
|
||||||
|
public interface IHasVolumeDevice
|
||||||
|
{
|
||||||
|
IBasicVolumeControls VolumeDevice { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
public enum eVolumeLevelUnits
|
||||||
|
{
|
||||||
|
Decibels,
|
||||||
|
Percent,
|
||||||
|
Relative,
|
||||||
|
Absolute
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,161 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using Crestron.SimplSharp;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Defines minimal volume and mute control methods
|
|
||||||
/// </summary>
|
|
||||||
public interface IBasicVolumeControls
|
|
||||||
{
|
|
||||||
void VolumeUp(bool pressRelease);
|
|
||||||
void VolumeDown(bool pressRelease);
|
|
||||||
void MuteToggle();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Defines the contract for IHasVolumeControl
|
|
||||||
/// </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>
|
|
||||||
/// Defines the contract for IBasicVolumeWithFeedback
|
|
||||||
/// </summary>
|
|
||||||
public interface IBasicVolumeWithFeedback : IBasicVolumeControls
|
|
||||||
{
|
|
||||||
BoolFeedback MuteFeedback { get; }
|
|
||||||
void MuteOn();
|
|
||||||
void MuteOff();
|
|
||||||
void SetVolume(ushort level);
|
|
||||||
IntFeedback VolumeLevelFeedback { get; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Defines the contract for IBasicVolumeWithFeedbackAdvanced
|
|
||||||
/// </summary>
|
|
||||||
public interface IBasicVolumeWithFeedbackAdvanced : IBasicVolumeWithFeedback
|
|
||||||
{
|
|
||||||
int RawVolumeLevel { get; }
|
|
||||||
|
|
||||||
eVolumeLevelUnits Units { get; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum eVolumeLevelUnits
|
|
||||||
{
|
|
||||||
Decibels,
|
|
||||||
Percent,
|
|
||||||
Relative,
|
|
||||||
Absolute
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Defines the contract for IHasCurrentVolumeControls
|
|
||||||
/// </summary>
|
|
||||||
public interface IHasCurrentVolumeControls
|
|
||||||
{
|
|
||||||
IBasicVolumeControls CurrentVolumeControls { get; }
|
|
||||||
event EventHandler<VolumeDeviceChangeEventArgs> CurrentVolumeDeviceChange;
|
|
||||||
|
|
||||||
void SetDefaultLevels();
|
|
||||||
|
|
||||||
bool ZeroVolumeWhenSwtichingVolumeDevices { get; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Defines the contract for IFullAudioSettings
|
|
||||||
/// </summary>
|
|
||||||
public interface IFullAudioSettings : IBasicVolumeWithFeedback
|
|
||||||
{
|
|
||||||
void SetBalance(ushort level);
|
|
||||||
void BalanceLeft(bool pressRelease);
|
|
||||||
void BalanceRight(bool pressRelease);
|
|
||||||
|
|
||||||
void SetBass(ushort level);
|
|
||||||
void BassUp(bool pressRelease);
|
|
||||||
void BassDown(bool pressRelease);
|
|
||||||
|
|
||||||
void SetTreble(ushort level);
|
|
||||||
void TrebleUp(bool pressRelease);
|
|
||||||
void TrebleDown(bool pressRelease);
|
|
||||||
|
|
||||||
bool hasMaxVolume { get; }
|
|
||||||
void SetMaxVolume(ushort level);
|
|
||||||
void MaxVolumeUp(bool pressRelease);
|
|
||||||
void MaxVolumeDown(bool pressRelease);
|
|
||||||
|
|
||||||
bool hasDefaultVolume { get; }
|
|
||||||
void SetDefaultVolume(ushort level);
|
|
||||||
void DefaultVolumeUp(bool pressRelease);
|
|
||||||
void DefaultVolumeDown(bool pressRelease);
|
|
||||||
|
|
||||||
void LoudnessToggle();
|
|
||||||
void MonoToggle();
|
|
||||||
|
|
||||||
BoolFeedback LoudnessFeedback { get; }
|
|
||||||
BoolFeedback MonoFeedback { get; }
|
|
||||||
IntFeedback BalanceFeedback { get; }
|
|
||||||
IntFeedback BassFeedback { get; }
|
|
||||||
IntFeedback TrebleFeedback { get; }
|
|
||||||
IntFeedback MaxVolumeFeedback { get; }
|
|
||||||
IntFeedback DefaultVolumeFeedback { get; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Defines the contract for IHasVolumeDevice
|
|
||||||
/// </summary>
|
|
||||||
public interface IHasVolumeDevice
|
|
||||||
{
|
|
||||||
IBasicVolumeControls VolumeDevice { get; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Identifies a device that contains audio zones
|
|
||||||
/// </summary>
|
|
||||||
public interface IAudioZones : IRouting
|
|
||||||
{
|
|
||||||
Dictionary<uint, IAudioZone> Zone { get; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Defines minimum functionality for an audio zone
|
|
||||||
/// </summary>
|
|
||||||
public interface IAudioZone : IBasicVolumeWithFeedback
|
|
||||||
{
|
|
||||||
void SelectInput(ushort input);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -100,12 +100,15 @@ namespace PepperDash.Essentials.Core.Fusion
|
|||||||
|
|
||||||
var roomConfig = reconfigurable.Config;
|
var roomConfig = reconfigurable.Config;
|
||||||
|
|
||||||
|
var updateConfig = false;
|
||||||
|
|
||||||
// Set the room name
|
// Set the room name
|
||||||
if (!string.IsNullOrEmpty(roomInfo.Name) && useFusionRoomName)
|
if (!string.IsNullOrEmpty(roomInfo.Name) && useFusionRoomName)
|
||||||
{
|
{
|
||||||
Debug.LogDebug("Current Room Name: {currentName}. New Room Name: {fusionName}", roomConfig.Name, roomInfo.Name);
|
Debug.LogDebug("Current Room Name: {currentName}. New Room Name: {fusionName}", roomConfig.Name, roomInfo.Name);
|
||||||
// Set the name in config
|
// Set the name in config
|
||||||
roomConfig.Name = roomInfo.Name;
|
roomConfig.Name = roomInfo.Name;
|
||||||
|
updateConfig = true;
|
||||||
|
|
||||||
Debug.LogDebug("Room Name Successfully Changed.");
|
Debug.LogDebug("Room Name Successfully Changed.");
|
||||||
}
|
}
|
||||||
@@ -115,9 +118,13 @@ namespace PepperDash.Essentials.Core.Fusion
|
|||||||
if (helpMessage != null)
|
if (helpMessage != null)
|
||||||
{
|
{
|
||||||
roomConfig.Properties["helpMessage"] = helpMessage.CustomFieldValue;
|
roomConfig.Properties["helpMessage"] = helpMessage.CustomFieldValue;
|
||||||
|
updateConfig = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
reconfigurable.SetConfig(roomConfig);
|
if (updateConfig)
|
||||||
|
{
|
||||||
|
reconfigurable.SetConfig(roomConfig);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -61,13 +61,18 @@ namespace PepperDash.Essentials.Devices.Common.DSP
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Base class for DSP control points
|
/// Base class for DSP control points
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class DspControlPoint : IKeyed
|
public abstract class DspControlPoint : IKeyName
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the Key
|
/// Gets or sets the Key
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Key { get; }
|
public string Key { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the Name
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the DspControlPoint class
|
/// Initializes a new instance of the DspControlPoint class
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
/// <param name="messagePath">The message path.</param>
|
/// <param name="messagePath">The message path.</param>
|
||||||
/// <param name="device">The device.</param>
|
/// <param name="device">The device.</param>
|
||||||
public DeviceVolumeMessenger(string key, string messagePath, IBasicVolumeControls device)
|
public DeviceVolumeMessenger(string key, string messagePath, IBasicVolumeControls device)
|
||||||
: base(key, messagePath, device as IKeyName)
|
: base(key, messagePath, device)
|
||||||
{
|
{
|
||||||
this.device = device;
|
this.device = device;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,6 +62,14 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
inputs = matrixDevice.InputSlots.ToDictionary(kvp => kvp.Key, kvp => new RoutingInput(kvp.Value))
|
inputs = matrixDevice.InputSlots.ToDictionary(kvp => kvp.Key, kvp => new RoutingInput(kvp.Value))
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inputSlot.IsOnline.OutputChange += (sender, args) =>
|
||||||
|
{
|
||||||
|
PostStatusMessage(JToken.FromObject(new
|
||||||
|
{
|
||||||
|
inputs = matrixDevice.InputSlots.ToDictionary(kvp => kvp.Key, kvp => new RoutingInput(kvp.Value))
|
||||||
|
}));
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the InUpPosition
|
/// Gets or sets the InUpPosition
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("isInUpPosition", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("inUpPosition", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public bool? InUpPosition { get; set; }
|
public bool? InUpPosition { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user