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 that is raised when the list of room presets has changed.
///
event EventHandler CodecRoomPresetsListHasChanged;
///
/// List of near end presets that can be recalled.
///
List NearEndPresets { get; }
///
/// List of far end presets that can be recalled.
///
List FarEndRoomPresets { get; }
///
/// Selects a near end preset by its ID.
///
///
void CodecRoomPresetSelect(int preset);
///
/// Stores a near end preset with the given ID and description.
///
///
///
void CodecRoomPresetStore(int preset, string description);
///
/// Selects a far end preset by its ID. This is typically used to recall a preset that has been defined on the far end codec.
///
///
void SelectFarEndPreset(int preset);
}
///
/// Static class for converting non-generic RoomPresets to generic CameraPresets.
///
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)
{
}
}
}