using System.Threading;
using MediaBrowser.Controller.Session;
using MediaBrowser.Controller.SyncPlay.PlaybackRequests;
using MediaBrowser.Model.SyncPlay;
namespace MediaBrowser.Controller.SyncPlay
{
///
/// Interface IGroupState.
///
public interface IGroupState
{
///
/// Gets the group state type.
///
/// The group state type.
GroupStateType Type { get; }
///
/// Handles a session that joined the group.
///
/// The context of the state.
/// The previous state.
/// The session.
/// The cancellation token.
void SessionJoined(IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken);
///
/// Handles a session that is leaving the group.
///
/// The context of the state.
/// The previous state.
/// The session.
/// The cancellation token.
void SessionLeaving(IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken);
///
/// Generic handler. Context's state can change.
///
/// The generic request.
/// The context of the state.
/// The previous state.
/// The session.
/// The cancellation token.
void HandleRequest(IGroupPlaybackRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken);
///
/// Handles a play request from a session. Context's state can change.
///
/// The play request.
/// The context of the state.
/// The previous state.
/// The session.
/// The cancellation token.
void HandleRequest(PlayGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken);
///
/// Handles a set-playlist-item request from a session. Context's state can change.
///
/// The set-playlist-item request.
/// The context of the state.
/// The previous state.
/// The session.
/// The cancellation token.
void HandleRequest(SetPlaylistItemGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken);
///
/// Handles a remove-items request from a session. Context's state can change.
///
/// The remove-items request.
/// The context of the state.
/// The previous state.
/// The session.
/// The cancellation token.
void HandleRequest(RemoveFromPlaylistGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken);
///
/// Handles a move-playlist-item request from a session. Context's state should not change.
///
/// The move-playlist-item request.
/// The context of the state.
/// The previous state.
/// The session.
/// The cancellation token.
void HandleRequest(MovePlaylistItemGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken);
///
/// Handles a queue request from a session. Context's state should not change.
///
/// The queue request.
/// The context of the state.
/// The previous state.
/// The session.
/// The cancellation token.
void HandleRequest(QueueGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken);
///
/// Handles an unpause request from a session. Context's state can change.
///
/// The unpause request.
/// The context of the state.
/// The previous state.
/// The session.
/// The cancellation token.
void HandleRequest(UnpauseGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken);
///
/// Handles a pause request from a session. Context's state can change.
///
/// The pause request.
/// The context of the state.
/// The previous state.
/// The session.
/// The cancellation token.
void HandleRequest(PauseGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken);
///
/// Handles a stop request from a session. Context's state can change.
///
/// The stop request.
/// The context of the state.
/// The previous state.
/// The session.
/// The cancellation token.
void HandleRequest(StopGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken);
///
/// Handles a seek request from a session. Context's state can change.
///
/// The seek request.
/// The context of the state.
/// The previous state.
/// The session.
/// The cancellation token.
void HandleRequest(SeekGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken);
///
/// Handles a buffer request from a session. Context's state can change.
///
/// The buffer request.
/// The context of the state.
/// The previous state.
/// The session.
/// The cancellation token.
void HandleRequest(BufferGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken);
///
/// Handles a ready request from a session. Context's state can change.
///
/// The ready request.
/// The context of the state.
/// The previous state.
/// The session.
/// The cancellation token.
void HandleRequest(ReadyGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken);
///
/// Handles a next-item request from a session. Context's state can change.
///
/// The next-item request.
/// The context of the state.
/// The previous state.
/// The session.
/// The cancellation token.
void HandleRequest(NextItemGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken);
///
/// Handles a previous-item request from a session. Context's state can change.
///
/// The previous-item request.
/// The context of the state.
/// The previous state.
/// The session.
/// The cancellation token.
void HandleRequest(PreviousItemGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken);
///
/// Handles a set-repeat-mode request from a session. Context's state should not change.
///
/// The repeat-mode request.
/// The context of the state.
/// The previous state.
/// The session.
/// The cancellation token.
void HandleRequest(SetRepeatModeGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken);
///
/// Handles a set-shuffle-mode request from a session. Context's state should not change.
///
/// The shuffle-mode request.
/// The context of the state.
/// The previous state.
/// The session.
/// The cancellation token.
void HandleRequest(SetShuffleModeGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken);
///
/// Updates the ping of a session. Context's state should not change.
///
/// The ping request.
/// The context of the state.
/// The previous state.
/// The session.
/// The cancellation token.
void HandleRequest(PingGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken);
///
/// Handles a ignore-wait request from a session. Context's state can change.
///
/// The ignore-wait request.
/// The context of the state.
/// The previous state.
/// The session.
/// The cancellation token.
void HandleRequest(IgnoreWaitGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken);
}
}