using System;
using System.Collections.Generic;
namespace PepperDash.Essentials.Core.Routing
{
///
/// The current sources for the room, keyed by eRoutingSignalType.
/// This allows for multiple sources to be tracked, such as audio and video.
/// Intended to be implemented on a DestinationListItem to provide access to the current sources for the room in its context.
///
///
/// This interface is used to provide access to the current sources in a room,
/// allowing for more complex routing scenarios where multiple signal types are involved.
///
public interface ICurrentSources
{
///
/// Gets the current sources for the room, keyed by eRoutingSignalType.
/// This dictionary contains the current source for each signal type, such as audio, video, and control signals.
///
Dictionary CurrentSources { get; }
///
/// Gets the current source keys for the room, keyed by eRoutingSignalType.
/// This dictionary contains the keys for the current source for each signal type, such as audio, video, and control signals.
///
Dictionary CurrentSourceKeys { get; }
///
/// Event raised when the current sources change.
///
event EventHandler CurrentSourcesChanged;
///
/// Sets the current source for a specific signal type.
/// This method updates the current source for the specified signal type and notifies any subscribers of the change.
///
/// The signal type to update.
///
/// The source device to set as the current source.
void SetCurrentSource(eRoutingSignalType signalType, IRoutingSource sourceDevice);
}
///
/// Event arguments for the CurrentSourcesChanged event, providing details about the signal type and the previous and new sources.
///
public class CurrentSourcesChangedEventArgs : EventArgs
{
///
/// Gets the signal type for which the current source has changed.
///
public eRoutingSignalType SignalType { get; }
///
/// Gets the previous source for the signal type before the change occurred.
///
public IRoutingSource PreviousSource { get; }
///
/// Gets the new source for the signal type after the change occurred.
///
public IRoutingSource NewSource { get; }
///
/// Initializes a new instance of the CurrentSourcesChangedEventArgs class with the specified signal type, previous source, and new source.
///
/// The signal type for which the current source has changed.
/// The previous source for the signal type before the change occurred.
/// The new source for the signal type after the change occurred.
public CurrentSourcesChangedEventArgs(eRoutingSignalType signalType, IRoutingSource previousSource, IRoutingSource newSource)
{
SignalType = signalType;
PreviousSource = previousSource;
NewSource = newSource;
}
}
}