mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-10 10:15:01 +00:00
feat: Adds ISelectableItems/Item and IHasSurroundSoundModes, modfies IHasInputs, Updates MockDisplay to implement IHasInputs
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using PepperDash.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -10,8 +11,14 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||
/// <summary>
|
||||
/// Describes a device that has selectable inputs
|
||||
/// </summary>
|
||||
public interface IHasInputs
|
||||
/// <typeparam name="TKey">the type to use as the key for each input item. Most likely an enum or string</typeparam>\
|
||||
/// <example>
|
||||
/// See MockDisplay for example implemntation
|
||||
/// </example>
|
||||
public interface IHasInputs<TKey, TSelector>: IKeyName
|
||||
{
|
||||
ISelectableItems<string> Inputs { get; }
|
||||
ISelectableItems<TKey> Inputs { get; }
|
||||
|
||||
void SetInput(TSelector selector);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using PepperDash.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -10,7 +11,7 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||
/// 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>
|
||||
public interface IHasSurroundSoundModes<TKey>: IKeyName
|
||||
{
|
||||
ISelectableItems<TKey> SurroundSoundModes { get; }
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||
event EventHandler ItemUpdated;
|
||||
|
||||
[JsonProperty("isSelected")]
|
||||
bool IsSelected { get; }
|
||||
bool IsSelected { get; set; }
|
||||
void Select();
|
||||
}
|
||||
}
|
||||
@@ -14,9 +14,9 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||
event EventHandler CurrentItemChanged;
|
||||
|
||||
|
||||
Dictionary<TKey, ISelectableItem> Items { get; }
|
||||
Dictionary<TKey, ISelectableItem> Items { get; set; }
|
||||
|
||||
[JsonProperty("currentItem")]
|
||||
string CurrentItem { get; }
|
||||
string CurrentItem { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user