| | | 1 | | #nullable disable |
| | | 2 | | |
| | | 3 | | using System; |
| | | 4 | | using System.Threading; |
| | | 5 | | using MediaBrowser.Controller.Session; |
| | | 6 | | using MediaBrowser.Model.SyncPlay; |
| | | 7 | | |
| | | 8 | | namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests |
| | | 9 | | { |
| | | 10 | | /// <summary> |
| | | 11 | | /// Class ReadyGroupRequest. |
| | | 12 | | /// </summary> |
| | | 13 | | public class ReadyGroupRequest : AbstractPlaybackRequest |
| | | 14 | | { |
| | | 15 | | /// <summary> |
| | | 16 | | /// Initializes a new instance of the <see cref="ReadyGroupRequest"/> class. |
| | | 17 | | /// </summary> |
| | | 18 | | /// <param name="when">When the request has been made, as reported by the client.</param> |
| | | 19 | | /// <param name="positionTicks">The position ticks.</param> |
| | | 20 | | /// <param name="isPlaying">Whether the client playback is unpaused.</param> |
| | | 21 | | /// <param name="playlistItemId">The playlist item identifier of the playing item.</param> |
| | 0 | 22 | | public ReadyGroupRequest(DateTime when, long positionTicks, bool isPlaying, Guid playlistItemId) |
| | | 23 | | { |
| | | 24 | | When = when; |
| | | 25 | | PositionTicks = positionTicks; |
| | | 26 | | IsPlaying = isPlaying; |
| | | 27 | | PlaylistItemId = playlistItemId; |
| | 0 | 28 | | } |
| | | 29 | | |
| | | 30 | | /// <summary> |
| | | 31 | | /// Gets when the request has been made by the client. |
| | | 32 | | /// </summary> |
| | | 33 | | /// <value>The date of the request.</value> |
| | | 34 | | public DateTime When { get; } |
| | | 35 | | |
| | | 36 | | /// <summary> |
| | | 37 | | /// Gets the position ticks. |
| | | 38 | | /// </summary> |
| | | 39 | | /// <value>The position ticks.</value> |
| | | 40 | | public long PositionTicks { get; } |
| | | 41 | | |
| | | 42 | | /// <summary> |
| | | 43 | | /// Gets a value indicating whether the client playback is unpaused. |
| | | 44 | | /// </summary> |
| | | 45 | | /// <value>The client playback status.</value> |
| | | 46 | | public bool IsPlaying { get; } |
| | | 47 | | |
| | | 48 | | /// <summary> |
| | | 49 | | /// Gets the playlist item identifier of the playing item. |
| | | 50 | | /// </summary> |
| | | 51 | | /// <value>The playlist item identifier.</value> |
| | | 52 | | public Guid PlaylistItemId { get; } |
| | | 53 | | |
| | | 54 | | /// <inheritdoc /> |
| | | 55 | | public override PlaybackRequestType Action { get; } = PlaybackRequestType.Ready; |
| | | 56 | | |
| | | 57 | | /// <inheritdoc /> |
| | | 58 | | public override void Apply(IGroupStateContext context, IGroupState state, SessionInfo session, CancellationToken |
| | | 59 | | { |
| | 0 | 60 | | state.HandleRequest(this, context, state.Type, session, cancellationToken); |
| | 0 | 61 | | } |
| | | 62 | | } |
| | | 63 | | } |