2020-11-14 22:40:01 +00:00
|
|
|
using System;
|
2020-11-13 14:13:32 +00:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
2020-09-24 21:04:21 +00:00
|
|
|
namespace MediaBrowser.Model.SyncPlay
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Class PlayQueueUpdate.
|
|
|
|
/// </summary>
|
|
|
|
public class PlayQueueUpdate
|
|
|
|
{
|
2020-11-14 22:40:01 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Initializes a new instance of the <see cref="PlayQueueUpdate"/> class.
|
|
|
|
/// </summary>
|
2020-11-15 16:03:27 +00:00
|
|
|
/// <param name="reason">The reason for the update.</param>
|
|
|
|
/// <param name="lastUpdate">The UTC time of the last change to the playing queue.</param>
|
|
|
|
/// <param name="playlist">The playlist.</param>
|
|
|
|
/// <param name="playingItemIndex">The playing item index in the playlist.</param>
|
|
|
|
/// <param name="startPositionTicks">The start position ticks.</param>
|
2021-03-29 09:29:48 +00:00
|
|
|
/// <param name="isPlaying">The playing item status.</param>
|
2020-11-15 16:03:27 +00:00
|
|
|
/// <param name="shuffleMode">The shuffle mode.</param>
|
|
|
|
/// <param name="repeatMode">The repeat mode.</param>
|
2021-03-29 09:29:48 +00:00
|
|
|
public PlayQueueUpdate(PlayQueueUpdateReason reason, DateTime lastUpdate, IReadOnlyList<QueueItem> playlist, int playingItemIndex, long startPositionTicks, bool isPlaying, GroupShuffleMode shuffleMode, GroupRepeatMode repeatMode)
|
2020-11-14 22:40:01 +00:00
|
|
|
{
|
2020-11-15 16:03:27 +00:00
|
|
|
Reason = reason;
|
|
|
|
LastUpdate = lastUpdate;
|
|
|
|
Playlist = playlist;
|
|
|
|
PlayingItemIndex = playingItemIndex;
|
|
|
|
StartPositionTicks = startPositionTicks;
|
2021-03-29 09:29:48 +00:00
|
|
|
IsPlaying = isPlaying;
|
2020-11-15 16:03:27 +00:00
|
|
|
ShuffleMode = shuffleMode;
|
|
|
|
RepeatMode = repeatMode;
|
2020-11-14 22:40:01 +00:00
|
|
|
}
|
|
|
|
|
2020-09-24 21:04:21 +00:00
|
|
|
/// <summary>
|
2020-11-15 16:03:27 +00:00
|
|
|
/// Gets the request type that originated this update.
|
2020-09-24 21:04:21 +00:00
|
|
|
/// </summary>
|
|
|
|
/// <value>The reason for the update.</value>
|
2020-11-15 16:03:27 +00:00
|
|
|
public PlayQueueUpdateReason Reason { get; }
|
2020-09-24 21:04:21 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2020-11-15 16:03:27 +00:00
|
|
|
/// Gets the UTC time of the last change to the playing queue.
|
2020-09-24 21:04:21 +00:00
|
|
|
/// </summary>
|
|
|
|
/// <value>The UTC time of the last change to the playing queue.</value>
|
2020-11-15 16:03:27 +00:00
|
|
|
public DateTime LastUpdate { get; }
|
2020-09-24 21:04:21 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2020-11-15 16:03:27 +00:00
|
|
|
/// Gets the playlist.
|
2020-09-24 21:04:21 +00:00
|
|
|
/// </summary>
|
|
|
|
/// <value>The playlist.</value>
|
2020-11-15 16:03:27 +00:00
|
|
|
public IReadOnlyList<QueueItem> Playlist { get; }
|
2020-09-24 21:04:21 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2020-11-15 16:03:27 +00:00
|
|
|
/// Gets the playing item index in the playlist.
|
2020-09-24 21:04:21 +00:00
|
|
|
/// </summary>
|
|
|
|
/// <value>The playing item index in the playlist.</value>
|
2020-11-15 16:03:27 +00:00
|
|
|
public int PlayingItemIndex { get; }
|
2020-09-24 21:04:21 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2020-11-15 16:03:27 +00:00
|
|
|
/// Gets the start position ticks.
|
2020-09-24 21:04:21 +00:00
|
|
|
/// </summary>
|
|
|
|
/// <value>The start position ticks.</value>
|
2020-11-15 16:03:27 +00:00
|
|
|
public long StartPositionTicks { get; }
|
2020-09-24 21:04:21 +00:00
|
|
|
|
2021-03-29 09:29:48 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Gets a value indicating whether the current item is playing.
|
|
|
|
/// </summary>
|
|
|
|
/// <value>The playing item status.</value>
|
|
|
|
public bool IsPlaying { get; }
|
|
|
|
|
2020-09-24 21:04:21 +00:00
|
|
|
/// <summary>
|
2020-11-15 16:03:27 +00:00
|
|
|
/// Gets the shuffle mode.
|
2020-09-24 21:04:21 +00:00
|
|
|
/// </summary>
|
|
|
|
/// <value>The shuffle mode.</value>
|
2020-11-15 16:03:27 +00:00
|
|
|
public GroupShuffleMode ShuffleMode { get; }
|
2020-09-24 21:04:21 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2020-11-15 16:03:27 +00:00
|
|
|
/// Gets the repeat mode.
|
2020-09-24 21:04:21 +00:00
|
|
|
/// </summary>
|
|
|
|
/// <value>The repeat mode.</value>
|
2020-11-15 16:03:27 +00:00
|
|
|
public GroupRepeatMode RepeatMode { get; }
|
2020-09-24 21:04:21 +00:00
|
|
|
}
|
|
|
|
}
|