mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 12:44:58 +00:00
feat: adds more generic ISelectableItems and ISelectableItem interfaces and implements on new IHasInputs and IHasSurroundSoundModes
This commit is contained in:
@@ -1,11 +1,17 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Describes a device that has selectable inputs
|
||||||
|
/// </summary>
|
||||||
public interface IHasInputs
|
public interface IHasInputs
|
||||||
{
|
{
|
||||||
event EventHandler InputsUpdated;
|
ISelectableItems<string> Inputs { get; }
|
||||||
IDictionary<string, IInput> Inputs { get; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Describes a device that has selectable surround sound modes
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="TKey">the type to use as the key for each input item. Most likely an enum or string</typeparam>
|
||||||
|
public interface IHasSurroundSoundModes<TKey>
|
||||||
|
{
|
||||||
|
ISelectableItems<TKey> SurroundSoundModes { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
using System;
|
|
||||||
using PepperDash.Core;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
|
||||||
{
|
|
||||||
public interface IInput : IKeyName
|
|
||||||
{
|
|
||||||
event EventHandler InputUpdated;
|
|
||||||
bool IsSelected { get; }
|
|
||||||
void Select();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
using System;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Describes an item that can be selected
|
||||||
|
/// </summary>
|
||||||
|
public interface ISelectableItem : IKeyName
|
||||||
|
{
|
||||||
|
event EventHandler ItemUpdated;
|
||||||
|
|
||||||
|
[JsonProperty("isSelected")]
|
||||||
|
bool IsSelected { get; }
|
||||||
|
void Select();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Describes a collection of items that can be selected
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="TKey">type for the keys in the collection. Probably a string or enum</typeparam>
|
||||||
|
public interface ISelectableItems<TKey>
|
||||||
|
{
|
||||||
|
event EventHandler ItemsUpdated;
|
||||||
|
event EventHandler CurrentItemChanged;
|
||||||
|
|
||||||
|
|
||||||
|
Dictionary<TKey, ISelectableItem> Items { get; }
|
||||||
|
|
||||||
|
[JsonProperty("currentItem")]
|
||||||
|
string CurrentItem { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user