using System; using System.Collections.Generic; using System.Linq; using PepperDash.Core; using PepperDash.Essentials.Core.Presets; namespace PepperDash.Essentials.Devices.Common.VideoCodec { /// /// Interface for camera presets /// public interface IHasCodecRoomPresets { event EventHandler CodecRoomPresetsListHasChanged; List NearEndPresets { get; } List FarEndRoomPresets { get; } void CodecRoomPresetSelect(int preset); void CodecRoomPresetStore(int preset, string description); void SelectFarEndPreset(int preset); } public static class RoomPresets { /// /// Converts non-generic RoomPresets to generic CameraPresets /// /// /// public static List GetGenericPresets(this List presets) where TSource : ConvertiblePreset where TDestination : PresetBase { return presets.Select(preset => preset.ConvertCodecPreset()) .Where(newPreset => newPreset != null) .Cast() .ToList(); } } /// /// Represents a room preset on a video codec. Typically stores camera position(s) and video routing. Can be recalled by Far End if enabled. /// public class CodecRoomPreset : PresetBase { public CodecRoomPreset(int id, string description, bool def, bool isDef) : base(id, description, def, isDef) { } } }