using System;
using System.Collections.Generic;
using System.Threading;
using MediaBrowser.Controller.Session;
using MediaBrowser.Model.SyncPlay;
namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
{
///
/// Class PlayGroupRequest.
///
public class PlayGroupRequest : IGroupPlaybackRequest
{
///
/// Initializes a new instance of the class.
///
/// The playing queue.
/// The playing item position.
/// The start position ticks.
public PlayGroupRequest(IReadOnlyList playingQueue, int playingItemPosition, long startPositionTicks)
{
PlayingQueue = playingQueue ?? Array.Empty();
PlayingItemPosition = playingItemPosition;
StartPositionTicks = startPositionTicks;
}
///
/// Gets the playing queue.
///
/// The playing queue.
public IReadOnlyList PlayingQueue { get; }
///
/// Gets the position of the playing item in the queue.
///
/// The playing item position.
public int PlayingItemPosition { get; }
///
/// Gets the start position ticks.
///
/// The start position ticks.
public long StartPositionTicks { get; }
///
public PlaybackRequestType Type { get; } = PlaybackRequestType.Play;
///
public void Apply(IGroupStateContext context, IGroupState state, SessionInfo session, CancellationToken cancellationToken)
{
state.HandleRequest(context, state.Type, this, session, cancellationToken);
}
}
}