using System;
using System.Collections.Generic;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
namespace PepperDash.Essentials.Devices.Common.DSP
{
///
/// Base class for DSP devices
///
public abstract class DspBase : EssentialsDevice, ILevelControls
{
///
/// Gets the collection of level control points
///
public Dictionary LevelControlPoints { get; private set; }
///
/// Gets the collection of dialer control points
///
public Dictionary DialerControlPoints { get; private set; }
///
/// Gets the collection of switcher control points
///
public Dictionary SwitcherControlPoints { get; private set; }
///
/// Initializes a new instance of the DspBase class
///
/// The device key
/// The device name
public DspBase(string key, string name) :
base(key, name)
{
LevelControlPoints = new Dictionary();
DialerControlPoints = new Dictionary();
SwitcherControlPoints = new Dictionary();
}
// in audio call feedback
// VOIP
// Phone dialer
}
// Fusion
// Privacy state
// Online state
// level/mutes ?
// AC Log call stats
// Typical presets:
// call default preset to restore levels and mutes
///
/// Base class for DSP control points
///
public abstract class DspControlPoint : IKeyed
{
///
/// Gets or sets the Key
///
public string Key { get; }
///
/// Initializes a new instance of the DspControlPoint class
///
/// The control point key
protected DspControlPoint(string key) => Key = key;
}
///
/// Base class for DSP level control points with volume and mute functionality
///
public abstract class DspLevelControlPoint : DspControlPoint, IBasicVolumeWithFeedback
{
///
/// Gets or sets the MuteFeedback
///
public BoolFeedback MuteFeedback { get; }
///
/// Gets or sets the VolumeLevelFeedback
///
public IntFeedback VolumeLevelFeedback { get; }
///
/// Initializes a new instance of the DspLevelControlPoint class
///
/// The control point key
/// Function to get mute status
/// Function to get volume level
protected DspLevelControlPoint(string key, Func muteFeedbackFunc, Func volumeLevelFeedbackFunc) : base(key)
{
MuteFeedback = new BoolFeedback("mute", muteFeedbackFunc);
VolumeLevelFeedback = new IntFeedback("volume", volumeLevelFeedbackFunc);
}
///
/// Turns mute off
///
public abstract void MuteOff();
///
/// Turns mute on
///
public abstract void MuteOn();
///
/// Toggles mute state
///
public abstract void MuteToggle();
///
/// Sets the volume level
///
/// The volume level to set
public abstract void SetVolume(ushort level);
///
/// Decreases volume
///
/// True when pressed, false when released
public abstract void VolumeDown(bool pressRelease);
///
/// Increases volume
///
/// True when pressed, false when released
public abstract void VolumeUp(bool pressRelease);
}
///
/// Base class for DSP dialer control points
///
public abstract class DspDialerBase : DspControlPoint
{
///
/// Initializes a new instance of the DspDialerBase class
///
/// The dialer control point key
protected DspDialerBase(string key) : base(key) { }
}
// Main program
// VTC
// ATC
// Mics, unusual
}