jellyfin/MediaBrowser.Controller/SyncPlay/IGroupState.cs

220 lines
12 KiB
C#
Raw Normal View History

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