using System.Threading;
using MediaBrowser.Model.SyncPlay;
using MediaBrowser.Controller.Session;
namespace MediaBrowser.Controller.SyncPlay
{
///
/// Interface ISyncPlayState.
///
public interface ISyncPlayState
{
///
/// Gets the group state.
///
/// The group state.
GroupState GetGroupState();
///
/// Generic handle. Context's state can change.
///
/// The context of the state.
/// Whether the state has been just set.
/// The play action.
/// The session.
/// The cancellation token.
/// The operation completion status.
bool HandleRequest(ISyncPlayStateContext context, bool newState, IPlaybackGroupRequest request, SessionInfo session, CancellationToken cancellationToken);
///
/// Handles a play action requested by a session. Context's state can change.
///
/// The context of the state.
/// Whether the state has been just set.
/// The play action.
/// The session.
/// The cancellation token.
/// The operation completion status.
bool HandleRequest(ISyncPlayStateContext context, bool newState, PlayGroupRequest request, SessionInfo session, CancellationToken cancellationToken);
///
/// Handles a pause action requested by a session. Context's state can change.
///
/// The context of the state.
/// Whether the state has been just set.
/// The pause action.
/// The session.
/// The cancellation token.
/// The operation completion status.
bool HandleRequest(ISyncPlayStateContext context, bool newState, PauseGroupRequest request, SessionInfo session, CancellationToken cancellationToken);
///
/// Handles a seek action requested by a session. Context's state can change.
///
/// The context of the state.
/// Whether the state has been just set.
/// The seek action.
/// The session.
/// The cancellation token.
/// The operation completion status.
bool HandleRequest(ISyncPlayStateContext context, bool newState, SeekGroupRequest request, SessionInfo session, CancellationToken cancellationToken);
///
/// Handles a buffering action requested by a session. Context's state can change.
///
/// The context of the state.
/// Whether the state has been just set.
/// The buffering action.
/// The session.
/// The cancellation token.
/// The operation completion status.
bool HandleRequest(ISyncPlayStateContext context, bool newState, BufferGroupRequest request, SessionInfo session, CancellationToken cancellationToken);
///
/// Handles a buffering-done action requested by a session. Context's state can change.
///
/// The context of the state.
/// Whether the state has been just set.
/// The buffering-done action.
/// The session.
/// The cancellation token.
/// The operation completion status.
bool HandleRequest(ISyncPlayStateContext context, bool newState, ReadyGroupRequest request, SessionInfo session, CancellationToken cancellationToken);
///
/// Updates ping of a session. Context's state should not change.
///
/// The context of the state.
/// Whether the state has been just set.
/// The buffering-done action.
/// The session.
/// The cancellation token.
/// The operation completion status.
bool HandleRequest(ISyncPlayStateContext context, bool newState, PingGroupRequest request, SessionInfo session, CancellationToken cancellationToken);
}
}