mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-08-31 19:08:29 +00:00
Refactor audio codec and display messaging interfaces
- Introduced IDialerCallStatus interface to streamline call status handling in audio codecs. - Updated AudioCodecBase to implement IDialerCallStatus, providing a common structure for call status events. - Added IDisplayCurrentInput interface for display devices to expose current input information. - Created corresponding messenger classes for IDialerCallStatus and IDisplayCurrentInput to facilitate communication. - Implemented CameraControlMessenger for camera devices to manage camera controls and presets. - Added IWarmingCoolingMessenger for warming and cooling devices to handle status updates. - Updated MessengerFactoryRegistry to register new messenger classes and ensure proper device messaging. - Cleaned up CameraBase and removed unnecessary comments and whitespace in various files. Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
parent
dfc1d2bb21
commit
f80aa95649
14 changed files with 185 additions and 60 deletions
|
|
@ -6,11 +6,19 @@ using PepperDash.Essentials.Devices.Common.Codec;
|
|||
|
||||
namespace PepperDash.Essentials.Devices.Common.AudioCodec;
|
||||
|
||||
public abstract class AudioCodecBase : EssentialsDevice, IHasDialer, IUsageTracking, IAudioCodecInfo
|
||||
/// <summary>
|
||||
/// Base class for audio codecs. Provides common properties and methods for audio codecs,
|
||||
/// as well as a common implementation of IDialerCallStatus to allow the AudioCodecBaseMessenger
|
||||
/// to get call status information without requiring the full AudioCodecBase class.
|
||||
/// This is useful for devices that have dialer call status information but do not need to implement
|
||||
/// the full AudioCodecBase class.
|
||||
/// </summary>
|
||||
public abstract class AudioCodecBase : EssentialsDevice, IDialerCallStatus, IUsageTracking, IAudioCodecInfo
|
||||
{
|
||||
|
||||
/// <inheritdoc />
|
||||
public event EventHandler<CodecCallStatusItemChangeEventArgs> CallStatusChange;
|
||||
|
||||
/// <inheritdoc />
|
||||
public AudioCodecInfo CodecInfo { get; protected set; }
|
||||
|
||||
#region IUsageTracking Members
|
||||
|
|
@ -41,8 +49,14 @@ public abstract class AudioCodecBase : EssentialsDevice, IHasDialer, IUsageTrack
|
|||
}
|
||||
|
||||
// In most cases only a single call can be active
|
||||
/// <inheritdoc />
|
||||
public List<CodecActiveCallItem> ActiveCalls { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="name"></param>
|
||||
public AudioCodecBase(string key, string name)
|
||||
: base(key, name)
|
||||
{
|
||||
|
|
@ -83,16 +97,22 @@ public abstract class AudioCodecBase : EssentialsDevice, IHasDialer, IUsageTrack
|
|||
|
||||
#region IHasDialer Members
|
||||
|
||||
/// <inheritdoc />
|
||||
public abstract void Dial(string number);
|
||||
|
||||
/// <inheritdoc />
|
||||
public abstract void EndCall(CodecActiveCallItem activeCall);
|
||||
|
||||
/// <inheritdoc />
|
||||
public abstract void EndAllCalls();
|
||||
|
||||
/// <inheritdoc />
|
||||
public abstract void AcceptCall(CodecActiveCallItem item);
|
||||
|
||||
|
||||
public abstract void RejectCall(CodecActiveCallItem item);
|
||||
|
||||
|
||||
public abstract void SendDtmf(string digit);
|
||||
|
||||
#endregion
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
using System.Collections.Generic;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.AudioCodec;
|
||||
|
||||
/// <summary>
|
||||
/// Defines the contract for a device that has dialer call status information. This is used to provide a common interface for the AudioCodecBaseMessenger to get call status information without requiring the full AudioCodecBase class
|
||||
/// </summary>
|
||||
public interface IDialerCallStatus : IHasDialer
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
AudioCodecInfo CodecInfo { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the list of active calls for the device.
|
||||
/// </summary>
|
||||
List<CodecActiveCallItem> ActiveCalls { get; set; }
|
||||
}
|
||||
|
|
@ -1,6 +1,4 @@
|
|||
|
||||
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the contract for a display device that has current input information. This is used to provide a common interface for the TwoWayDisplayBaseMessenger to get current input information without requiring the full TwoWayDisplayBase class
|
||||
/// </summary>
|
||||
public interface IDisplayCurrentInput : IKeyName
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the Current Input feedback for the display device.
|
||||
/// </summary>
|
||||
StringFeedback CurrentInputFeedback { get; }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue