Reorder parameters in HandleRequest
This commit is contained in:
parent
23473ef8fb
commit
cc64ee483d
|
@ -332,6 +332,16 @@ namespace Emby.Server.Implementations.SyncPlay
|
|||
// and notify clients of state changes. The actual syncing of media playback
|
||||
// happens client side. Clients are aware of the server's time and use it to sync.
|
||||
_logger.LogInformation("Session {SessionId} requested {RequestType} in group {GroupId} that is {StateType}.", session.Id, request.Action, GroupId.ToString(), _state.Type);
|
||||
|
||||
// Apply requested changes to this group given its current state.
|
||||
// Every request has a slightly different outcome depending on the group's state.
|
||||
// There are currently four different group states that accomplish different goals:
|
||||
// - Idle: in this state no media is playing and clients should be idle (playback is stopped).
|
||||
// - Waiting: in this state the group is waiting for all the clients to be ready to start the playback,
|
||||
// that is, they've either finished loading the media for the first time or they've finished buffering.
|
||||
// Once all clients report to be ready the group's state can change to Playing or Paused.
|
||||
// - Playing: clients have some media loaded and playback is unpaused.
|
||||
// - Paused: clients have some media loaded but playback is currently paused.
|
||||
request.Apply(this, _state, session, cancellationToken);
|
||||
}
|
||||
|
||||
|
|
|
@ -305,6 +305,7 @@ namespace Emby.Server.Implementations.SyncPlay
|
|||
return;
|
||||
}
|
||||
|
||||
// Apply requested changes to group.
|
||||
group.HandleRequest(session, request, cancellationToken);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,27 +44,27 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
|||
public abstract void SessionLeaving(IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken);
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual void HandleRequest(IGroupStateContext context, GroupStateType prevState, IGroupPlaybackRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public virtual void HandleRequest(IGroupPlaybackRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
UnhandledRequest(request);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual void HandleRequest(IGroupStateContext context, GroupStateType prevState, PlayGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public virtual void HandleRequest(PlayGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
UnhandledRequest(request);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual void HandleRequest(IGroupStateContext context, GroupStateType prevState, SetPlaylistItemGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public virtual void HandleRequest(SetPlaylistItemGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
var waitingState = new WaitingGroupState(LoggerFactory);
|
||||
context.SetState(waitingState);
|
||||
waitingState.HandleRequest(context, Type, request, session, cancellationToken);
|
||||
waitingState.HandleRequest(request, context, Type, session, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual void HandleRequest(IGroupStateContext context, GroupStateType prevState, RemoveFromPlaylistGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public virtual void HandleRequest(RemoveFromPlaylistGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
var playingItemRemoved = context.RemoveFromPlayQueue(request.PlaylistItemIds);
|
||||
|
||||
|
@ -79,12 +79,12 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
|||
IGroupState idleState = new IdleGroupState(LoggerFactory);
|
||||
context.SetState(idleState);
|
||||
var stopRequest = new StopGroupRequest();
|
||||
idleState.HandleRequest(context, Type, stopRequest, session, cancellationToken);
|
||||
idleState.HandleRequest(stopRequest, context, Type, session, cancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual void HandleRequest(IGroupStateContext context, GroupStateType prevState, MovePlaylistItemGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public virtual void HandleRequest(MovePlaylistItemGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
var result = context.MoveItemInPlayQueue(request.PlaylistItemId, request.NewIndex);
|
||||
|
||||
|
@ -100,7 +100,7 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual void HandleRequest(IGroupStateContext context, GroupStateType prevState, QueueGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public virtual void HandleRequest(QueueGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
var result = context.AddToPlayQueue(request.ItemIds, request.Mode);
|
||||
|
||||
|
@ -121,55 +121,55 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual void HandleRequest(IGroupStateContext context, GroupStateType prevState, UnpauseGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public virtual void HandleRequest(UnpauseGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
UnhandledRequest(request);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual void HandleRequest(IGroupStateContext context, GroupStateType prevState, PauseGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public virtual void HandleRequest(PauseGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
UnhandledRequest(request);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual void HandleRequest(IGroupStateContext context, GroupStateType prevState, StopGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public virtual void HandleRequest(StopGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
UnhandledRequest(request);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual void HandleRequest(IGroupStateContext context, GroupStateType prevState, SeekGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public virtual void HandleRequest(SeekGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
UnhandledRequest(request);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual void HandleRequest(IGroupStateContext context, GroupStateType prevState, BufferGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public virtual void HandleRequest(BufferGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
UnhandledRequest(request);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual void HandleRequest(IGroupStateContext context, GroupStateType prevState, ReadyGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public virtual void HandleRequest(ReadyGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
UnhandledRequest(request);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual void HandleRequest(IGroupStateContext context, GroupStateType prevState, NextItemGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public virtual void HandleRequest(NextItemGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
UnhandledRequest(request);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual void HandleRequest(IGroupStateContext context, GroupStateType prevState, PreviousItemGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public virtual void HandleRequest(PreviousItemGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
UnhandledRequest(request);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual void HandleRequest(IGroupStateContext context, GroupStateType prevState, SetRepeatModeGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public virtual void HandleRequest(SetRepeatModeGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
context.SetRepeatMode(request.Mode);
|
||||
var playQueueUpdate = context.GetPlayQueueUpdate(PlayQueueUpdateReason.RepeatMode);
|
||||
|
@ -178,7 +178,7 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual void HandleRequest(IGroupStateContext context, GroupStateType prevState, SetShuffleModeGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public virtual void HandleRequest(SetShuffleModeGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
context.SetShuffleMode(request.Mode);
|
||||
var playQueueUpdate = context.GetPlayQueueUpdate(PlayQueueUpdateReason.ShuffleMode);
|
||||
|
@ -187,14 +187,14 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual void HandleRequest(IGroupStateContext context, GroupStateType prevState, PingGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public virtual void HandleRequest(PingGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
// Collected pings are used to account for network latency when unpausing playback.
|
||||
context.UpdatePing(session, request.Ping);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual void HandleRequest(IGroupStateContext context, GroupStateType prevState, IgnoreWaitGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public virtual void HandleRequest(IgnoreWaitGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
context.SetIgnoreGroupWait(session, request.IgnoreWait);
|
||||
}
|
||||
|
|
|
@ -45,69 +45,69 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, PlayGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(PlayGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
// Change state.
|
||||
var waitingState = new WaitingGroupState(LoggerFactory);
|
||||
context.SetState(waitingState);
|
||||
waitingState.HandleRequest(context, Type, request, session, cancellationToken);
|
||||
waitingState.HandleRequest(request, context, Type, session, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, UnpauseGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(UnpauseGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
// Change state.
|
||||
var waitingState = new WaitingGroupState(LoggerFactory);
|
||||
context.SetState(waitingState);
|
||||
waitingState.HandleRequest(context, Type, request, session, cancellationToken);
|
||||
waitingState.HandleRequest(request, context, Type, session, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, PauseGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(PauseGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
SendStopCommand(context, prevState, session, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, StopGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(StopGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
SendStopCommand(context, prevState, session, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, SeekGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(SeekGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
SendStopCommand(context, prevState, session, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, BufferGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(BufferGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
SendStopCommand(context, prevState, session, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, ReadyGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(ReadyGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
SendStopCommand(context, prevState, session, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, NextItemGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(NextItemGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
// Change state.
|
||||
var waitingState = new WaitingGroupState(LoggerFactory);
|
||||
context.SetState(waitingState);
|
||||
waitingState.HandleRequest(context, Type, request, session, cancellationToken);
|
||||
waitingState.HandleRequest(request, context, Type, session, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, PreviousItemGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(PreviousItemGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
// Change state.
|
||||
var waitingState = new WaitingGroupState(LoggerFactory);
|
||||
context.SetState(waitingState);
|
||||
waitingState.HandleRequest(context, Type, request, session, cancellationToken);
|
||||
waitingState.HandleRequest(request, context, Type, session, cancellationToken);
|
||||
}
|
||||
|
||||
private void SendStopCommand(IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
|
|
|
@ -49,25 +49,25 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, PlayGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(PlayGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
// Change state.
|
||||
var waitingState = new WaitingGroupState(LoggerFactory);
|
||||
context.SetState(waitingState);
|
||||
waitingState.HandleRequest(context, Type, request, session, cancellationToken);
|
||||
waitingState.HandleRequest(request, context, Type, session, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, UnpauseGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(UnpauseGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
// Change state.
|
||||
var playingState = new PlayingGroupState(LoggerFactory);
|
||||
context.SetState(playingState);
|
||||
playingState.HandleRequest(context, Type, request, session, cancellationToken);
|
||||
playingState.HandleRequest(request, context, Type, session, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, PauseGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(PauseGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
if (!prevState.Equals(Type))
|
||||
{
|
||||
|
@ -98,34 +98,34 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, StopGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(StopGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
// Change state.
|
||||
var idleState = new IdleGroupState(LoggerFactory);
|
||||
context.SetState(idleState);
|
||||
idleState.HandleRequest(context, Type, request, session, cancellationToken);
|
||||
idleState.HandleRequest(request, context, Type, session, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, SeekGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(SeekGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
// Change state.
|
||||
var waitingState = new WaitingGroupState(LoggerFactory);
|
||||
context.SetState(waitingState);
|
||||
waitingState.HandleRequest(context, Type, request, session, cancellationToken);
|
||||
waitingState.HandleRequest(request, context, Type, session, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, BufferGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(BufferGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
// Change state.
|
||||
var waitingState = new WaitingGroupState(LoggerFactory);
|
||||
context.SetState(waitingState);
|
||||
waitingState.HandleRequest(context, Type, request, session, cancellationToken);
|
||||
waitingState.HandleRequest(request, context, Type, session, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, ReadyGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(ReadyGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
if (prevState.Equals(Type))
|
||||
{
|
||||
|
@ -145,21 +145,21 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, NextItemGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(NextItemGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
// Change state.
|
||||
var waitingState = new WaitingGroupState(LoggerFactory);
|
||||
context.SetState(waitingState);
|
||||
waitingState.HandleRequest(context, Type, request, session, cancellationToken);
|
||||
waitingState.HandleRequest(request, context, Type, session, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, PreviousItemGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(PreviousItemGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
// Change state.
|
||||
var waitingState = new WaitingGroupState(LoggerFactory);
|
||||
context.SetState(waitingState);
|
||||
waitingState.HandleRequest(context, Type, request, session, cancellationToken);
|
||||
waitingState.HandleRequest(request, context, Type, session, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,16 +54,16 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, PlayGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(PlayGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
// Change state.
|
||||
var waitingState = new WaitingGroupState(LoggerFactory);
|
||||
context.SetState(waitingState);
|
||||
waitingState.HandleRequest(context, Type, request, session, cancellationToken);
|
||||
waitingState.HandleRequest(request, context, Type, session, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, UnpauseGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(UnpauseGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
if (!prevState.Equals(Type))
|
||||
{
|
||||
|
@ -91,34 +91,34 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, PauseGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(PauseGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
// Change state.
|
||||
var pausedState = new PausedGroupState(LoggerFactory);
|
||||
context.SetState(pausedState);
|
||||
pausedState.HandleRequest(context, Type, request, session, cancellationToken);
|
||||
pausedState.HandleRequest(request, context, Type, session, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, StopGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(StopGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
// Change state.
|
||||
var idleState = new IdleGroupState(LoggerFactory);
|
||||
context.SetState(idleState);
|
||||
idleState.HandleRequest(context, Type, request, session, cancellationToken);
|
||||
idleState.HandleRequest(request, context, Type, session, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, SeekGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(SeekGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
// Change state.
|
||||
var waitingState = new WaitingGroupState(LoggerFactory);
|
||||
context.SetState(waitingState);
|
||||
waitingState.HandleRequest(context, Type, request, session, cancellationToken);
|
||||
waitingState.HandleRequest(request, context, Type, session, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, BufferGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(BufferGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
if (IgnoreBuffering)
|
||||
{
|
||||
|
@ -128,11 +128,11 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
|||
// Change state.
|
||||
var waitingState = new WaitingGroupState(LoggerFactory);
|
||||
context.SetState(waitingState);
|
||||
waitingState.HandleRequest(context, Type, request, session, cancellationToken);
|
||||
waitingState.HandleRequest(request, context, Type, session, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, ReadyGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(ReadyGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
if (prevState.Equals(Type))
|
||||
{
|
||||
|
@ -148,21 +148,21 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, NextItemGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(NextItemGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
// Change state.
|
||||
var waitingState = new WaitingGroupState(LoggerFactory);
|
||||
context.SetState(waitingState);
|
||||
waitingState.HandleRequest(context, Type, request, session, cancellationToken);
|
||||
waitingState.HandleRequest(request, context, Type, session, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, PreviousItemGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(PreviousItemGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
// Change state.
|
||||
var waitingState = new WaitingGroupState(LoggerFactory);
|
||||
context.SetState(waitingState);
|
||||
waitingState.HandleRequest(context, Type, request, session, cancellationToken);
|
||||
waitingState.HandleRequest(request, context, Type, session, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
|||
var playingState = new PlayingGroupState(LoggerFactory);
|
||||
context.SetState(playingState);
|
||||
var unpauseRequest = new UnpauseGroupRequest();
|
||||
playingState.HandleRequest(context, Type, unpauseRequest, session, cancellationToken);
|
||||
playingState.HandleRequest(unpauseRequest, context, Type, session, cancellationToken);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -122,7 +122,7 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, PlayGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(PlayGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
// Save state if first event.
|
||||
if (!InitialStateSet)
|
||||
|
@ -160,7 +160,7 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, SetPlaylistItemGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(SetPlaylistItemGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
// Save state if first event.
|
||||
if (!InitialStateSet)
|
||||
|
@ -198,7 +198,7 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, UnpauseGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(UnpauseGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
// Save state if first event.
|
||||
if (!InitialStateSet)
|
||||
|
@ -236,7 +236,7 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
|||
IgnoreBuffering = true
|
||||
};
|
||||
context.SetState(playingState);
|
||||
playingState.HandleRequest(context, Type, request, session, cancellationToken);
|
||||
playingState.HandleRequest(request, context, Type, session, cancellationToken);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -250,7 +250,7 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, PauseGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(PauseGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
// Save state if first event.
|
||||
if (!InitialStateSet)
|
||||
|
@ -267,7 +267,7 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, StopGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(StopGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
// Save state if first event.
|
||||
if (!InitialStateSet)
|
||||
|
@ -279,11 +279,11 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
|||
// Change state.
|
||||
var idleState = new IdleGroupState(LoggerFactory);
|
||||
context.SetState(idleState);
|
||||
idleState.HandleRequest(context, Type, request, session, cancellationToken);
|
||||
idleState.HandleRequest(request, context, Type, session, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, SeekGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(SeekGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
// Save state if first event.
|
||||
if (!InitialStateSet)
|
||||
|
@ -319,7 +319,7 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, BufferGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(BufferGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
// Save state if first event.
|
||||
if (!InitialStateSet)
|
||||
|
@ -393,7 +393,7 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, ReadyGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(ReadyGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
// Save state if first event.
|
||||
if (!InitialStateSet)
|
||||
|
@ -511,7 +511,7 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
|||
// Change state.
|
||||
var playingState = new PlayingGroupState(LoggerFactory);
|
||||
context.SetState(playingState);
|
||||
playingState.HandleRequest(context, Type, request, session, cancellationToken);
|
||||
playingState.HandleRequest(request, context, Type, session, cancellationToken);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -548,19 +548,19 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
|||
if (InitialState.Equals(GroupStateType.Playing))
|
||||
{
|
||||
// Group went from playing to waiting state and a pause request occured while waiting.
|
||||
var pauserequest = new PauseGroupRequest();
|
||||
pausedState.HandleRequest(context, Type, pauserequest, session, cancellationToken);
|
||||
var pauseRequest = new PauseGroupRequest();
|
||||
pausedState.HandleRequest(pauseRequest, context, Type, session, cancellationToken);
|
||||
}
|
||||
else if (InitialState.Equals(GroupStateType.Paused))
|
||||
{
|
||||
pausedState.HandleRequest(context, Type, request, session, cancellationToken);
|
||||
pausedState.HandleRequest(request, context, Type, session, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, NextItemGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(NextItemGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
// Save state if first event.
|
||||
if (!InitialStateSet)
|
||||
|
@ -606,7 +606,7 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, PreviousItemGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(PreviousItemGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
// Save state if first event.
|
||||
if (!InitialStateSet)
|
||||
|
@ -652,7 +652,7 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void HandleRequest(IGroupStateContext context, GroupStateType prevState, IgnoreWaitGroupRequest request, SessionInfo session, CancellationToken cancellationToken)
|
||||
public override void HandleRequest(IgnoreWaitGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
context.SetIgnoreGroupWait(session, request.IgnoreWait);
|
||||
|
||||
|
@ -666,7 +666,7 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
|||
var playingState = new PlayingGroupState(LoggerFactory);
|
||||
context.SetState(playingState);
|
||||
var unpauseRequest = new UnpauseGroupRequest();
|
||||
playingState.HandleRequest(context, Type, unpauseRequest, session, cancellationToken);
|
||||
playingState.HandleRequest(unpauseRequest, context, Type, session, cancellationToken);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -37,181 +37,181 @@ namespace MediaBrowser.Controller.SyncPlay
|
|||
/// <summary>
|
||||
/// Generic handler. Context's state can change.
|
||||
/// </summary>
|
||||
/// <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="request">The generic request.</param>
|
||||
/// <param name="session">The session.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
void HandleRequest(IGroupStateContext context, GroupStateType prevState, IGroupPlaybackRequest request, SessionInfo session, CancellationToken cancellationToken);
|
||||
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>
|
||||
/// <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="request">The play request.</param>
|
||||
/// <param name="session">The session.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
void HandleRequest(IGroupStateContext context, GroupStateType prevState, PlayGroupRequest request, SessionInfo session, CancellationToken cancellationToken);
|
||||
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>
|
||||
/// <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="request">The set-playlist-item request.</param>
|
||||
/// <param name="session">The session.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
void HandleRequest(IGroupStateContext context, GroupStateType prevState, SetPlaylistItemGroupRequest request, SessionInfo session, CancellationToken cancellationToken);
|
||||
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>
|
||||
/// <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="request">The remove-items request.</param>
|
||||
/// <param name="session">The session.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
void HandleRequest(IGroupStateContext context, GroupStateType prevState, RemoveFromPlaylistGroupRequest request, SessionInfo session, CancellationToken cancellationToken);
|
||||
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>
|
||||
/// <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="request">The move-playlist-item request.</param>
|
||||
/// <param name="session">The session.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
void HandleRequest(IGroupStateContext context, GroupStateType prevState, MovePlaylistItemGroupRequest request, SessionInfo session, CancellationToken cancellationToken);
|
||||
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>
|
||||
/// <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="request">The queue request.</param>
|
||||
/// <param name="session">The session.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
void HandleRequest(IGroupStateContext context, GroupStateType prevState, QueueGroupRequest request, SessionInfo session, CancellationToken cancellationToken);
|
||||
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>
|
||||
/// <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="request">The unpause request.</param>
|
||||
/// <param name="session">The session.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
void HandleRequest(IGroupStateContext context, GroupStateType prevState, UnpauseGroupRequest request, SessionInfo session, CancellationToken cancellationToken);
|
||||
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>
|
||||
/// <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="request">The pause request.</param>
|
||||
/// <param name="session">The session.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
void HandleRequest(IGroupStateContext context, GroupStateType prevState, PauseGroupRequest request, SessionInfo session, CancellationToken cancellationToken);
|
||||
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>
|
||||
/// <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="request">The stop request.</param>
|
||||
/// <param name="session">The session.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
void HandleRequest(IGroupStateContext context, GroupStateType prevState, StopGroupRequest request, SessionInfo session, CancellationToken cancellationToken);
|
||||
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>
|
||||
/// <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="request">The seek request.</param>
|
||||
/// <param name="session">The session.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
void HandleRequest(IGroupStateContext context, GroupStateType prevState, SeekGroupRequest request, SessionInfo session, CancellationToken cancellationToken);
|
||||
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>
|
||||
/// <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="request">The buffer request.</param>
|
||||
/// <param name="session">The session.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
void HandleRequest(IGroupStateContext context, GroupStateType prevState, BufferGroupRequest request, SessionInfo session, CancellationToken cancellationToken);
|
||||
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>
|
||||
/// <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="request">The ready request.</param>
|
||||
/// <param name="session">The session.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
void HandleRequest(IGroupStateContext context, GroupStateType prevState, ReadyGroupRequest request, SessionInfo session, CancellationToken cancellationToken);
|
||||
void HandleRequest(ReadyGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Handles a next-item request from a session. Context's state can change.
|
||||
/// </summary>
|
||||
/// <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="request">The next-item request.</param>
|
||||
/// <param name="session">The session.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
void HandleRequest(IGroupStateContext context, GroupStateType prevState, NextItemGroupRequest request, SessionInfo session, CancellationToken cancellationToken);
|
||||
void HandleRequest(NextItemGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Handles a previous-item request from a session. Context's state can change.
|
||||
/// </summary>
|
||||
/// <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="request">The previous-item request.</param>
|
||||
/// <param name="session">The session.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
void HandleRequest(IGroupStateContext context, GroupStateType prevState, PreviousItemGroupRequest request, SessionInfo session, CancellationToken cancellationToken);
|
||||
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>
|
||||
/// <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="request">The repeat-mode request.</param>
|
||||
/// <param name="session">The session.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
void HandleRequest(IGroupStateContext context, GroupStateType prevState, SetRepeatModeGroupRequest request, SessionInfo session, CancellationToken cancellationToken);
|
||||
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>
|
||||
/// <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="request">The shuffle-mode request.</param>
|
||||
/// <param name="session">The session.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
void HandleRequest(IGroupStateContext context, GroupStateType prevState, SetShuffleModeGroupRequest request, SessionInfo session, CancellationToken cancellationToken);
|
||||
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>
|
||||
/// <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="request">The ping request.</param>
|
||||
/// <param name="session">The session.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
void HandleRequest(IGroupStateContext context, GroupStateType prevState, PingGroupRequest request, SessionInfo session, CancellationToken cancellationToken);
|
||||
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>
|
||||
/// <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="request">The ignore-wait request.</param>
|
||||
/// <param name="session">The session.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
void HandleRequest(IGroupStateContext context, GroupStateType prevState, IgnoreWaitGroupRequest request, SessionInfo session, CancellationToken cancellationToken);
|
||||
void HandleRequest(IgnoreWaitGroupRequest request, IGroupStateContext context, GroupStateType prevState, SessionInfo session, CancellationToken cancellationToken);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
|||
/// <inheritdoc />
|
||||
public override void Apply(IGroupStateContext context, IGroupState state, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
state.HandleRequest(context, state.Type, this, session, cancellationToken);
|
||||
state.HandleRequest(this, context, state.Type, session, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
|||
/// <inheritdoc />
|
||||
public override void Apply(IGroupStateContext context, IGroupState state, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
state.HandleRequest(context, state.Type, this, session, cancellationToken);
|
||||
state.HandleRequest(this, context, state.Type, session, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
|||
/// <inheritdoc />
|
||||
public override void Apply(IGroupStateContext context, IGroupState state, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
state.HandleRequest(context, state.Type, this, session, cancellationToken);
|
||||
state.HandleRequest(this, context, state.Type, session, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
|||
/// <inheritdoc />
|
||||
public override void Apply(IGroupStateContext context, IGroupState state, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
state.HandleRequest(context, state.Type, this, session, cancellationToken);
|
||||
state.HandleRequest(this, context, state.Type, session, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
|||
/// <inheritdoc />
|
||||
public override void Apply(IGroupStateContext context, IGroupState state, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
state.HandleRequest(context, state.Type, this, session, cancellationToken);
|
||||
state.HandleRequest(this, context, state.Type, session, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
|||
/// <inheritdoc />
|
||||
public override void Apply(IGroupStateContext context, IGroupState state, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
state.HandleRequest(context, state.Type, this, session, cancellationToken);
|
||||
state.HandleRequest(this, context, state.Type, session, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
|||
/// <inheritdoc />
|
||||
public override void Apply(IGroupStateContext context, IGroupState state, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
state.HandleRequest(context, state.Type, this, session, cancellationToken);
|
||||
state.HandleRequest(this, context, state.Type, session, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
|||
/// <inheritdoc />
|
||||
public override void Apply(IGroupStateContext context, IGroupState state, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
state.HandleRequest(context, state.Type, this, session, cancellationToken);
|
||||
state.HandleRequest(this, context, state.Type, session, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
|||
/// <inheritdoc />
|
||||
public override void Apply(IGroupStateContext context, IGroupState state, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
state.HandleRequest(context, state.Type, this, session, cancellationToken);
|
||||
state.HandleRequest(this, context, state.Type, session, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
|||
/// <inheritdoc />
|
||||
public override void Apply(IGroupStateContext context, IGroupState state, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
state.HandleRequest(context, state.Type, this, session, cancellationToken);
|
||||
state.HandleRequest(this, context, state.Type, session, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
|||
/// <inheritdoc />
|
||||
public override void Apply(IGroupStateContext context, IGroupState state, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
state.HandleRequest(context, state.Type, this, session, cancellationToken);
|
||||
state.HandleRequest(this, context, state.Type, session, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
|||
/// <inheritdoc />
|
||||
public override void Apply(IGroupStateContext context, IGroupState state, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
state.HandleRequest(context, state.Type, this, session, cancellationToken);
|
||||
state.HandleRequest(this, context, state.Type, session, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
|||
/// <inheritdoc />
|
||||
public override void Apply(IGroupStateContext context, IGroupState state, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
state.HandleRequest(context, state.Type, this, session, cancellationToken);
|
||||
state.HandleRequest(this, context, state.Type, session, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
|||
/// <inheritdoc />
|
||||
public override void Apply(IGroupStateContext context, IGroupState state, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
state.HandleRequest(context, state.Type, this, session, cancellationToken);
|
||||
state.HandleRequest(this, context, state.Type, session, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
|||
/// <inheritdoc />
|
||||
public override void Apply(IGroupStateContext context, IGroupState state, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
state.HandleRequest(context, state.Type, this, session, cancellationToken);
|
||||
state.HandleRequest(this, context, state.Type, session, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
|||
/// <inheritdoc />
|
||||
public override void Apply(IGroupStateContext context, IGroupState state, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
state.HandleRequest(context, state.Type, this, session, cancellationToken);
|
||||
state.HandleRequest(this, context, state.Type, session, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
|||
/// <inheritdoc />
|
||||
public override void Apply(IGroupStateContext context, IGroupState state, SessionInfo session, CancellationToken cancellationToken)
|
||||
{
|
||||
state.HandleRequest(context, state.Type, this, session, cancellationToken);
|
||||
state.HandleRequest(this, context, state.Type, session, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user