PlayQueueUpdate.cs 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. using System;
  2. using System.Collections.Generic;
  3. namespace MediaBrowser.Model.SyncPlay
  4. {
  5. /// <summary>
  6. /// Class PlayQueueUpdate.
  7. /// </summary>
  8. public class PlayQueueUpdate
  9. {
  10. /// <summary>
  11. /// Initializes a new instance of the <see cref="PlayQueueUpdate"/> class.
  12. /// </summary>
  13. /// <param name="reason">The reason for the update.</param>
  14. /// <param name="lastUpdate">The UTC time of the last change to the playing queue.</param>
  15. /// <param name="playlist">The playlist.</param>
  16. /// <param name="playingItemIndex">The playing item index in the playlist.</param>
  17. /// <param name="startPositionTicks">The start position ticks.</param>
  18. /// <param name="isPlaying">The playing item status.</param>
  19. /// <param name="shuffleMode">The shuffle mode.</param>
  20. /// <param name="repeatMode">The repeat mode.</param>
  21. public PlayQueueUpdate(PlayQueueUpdateReason reason, DateTime lastUpdate, IReadOnlyList<SyncPlayQueueItem> playlist, int playingItemIndex, long startPositionTicks, bool isPlaying, GroupShuffleMode shuffleMode, GroupRepeatMode repeatMode)
  22. {
  23. Reason = reason;
  24. LastUpdate = lastUpdate;
  25. Playlist = playlist;
  26. PlayingItemIndex = playingItemIndex;
  27. StartPositionTicks = startPositionTicks;
  28. IsPlaying = isPlaying;
  29. ShuffleMode = shuffleMode;
  30. RepeatMode = repeatMode;
  31. }
  32. /// <summary>
  33. /// Gets the request type that originated this update.
  34. /// </summary>
  35. /// <value>The reason for the update.</value>
  36. public PlayQueueUpdateReason Reason { get; }
  37. /// <summary>
  38. /// Gets the UTC time of the last change to the playing queue.
  39. /// </summary>
  40. /// <value>The UTC time of the last change to the playing queue.</value>
  41. public DateTime LastUpdate { get; }
  42. /// <summary>
  43. /// Gets the playlist.
  44. /// </summary>
  45. /// <value>The playlist.</value>
  46. public IReadOnlyList<SyncPlayQueueItem> Playlist { get; }
  47. /// <summary>
  48. /// Gets the playing item index in the playlist.
  49. /// </summary>
  50. /// <value>The playing item index in the playlist.</value>
  51. public int PlayingItemIndex { get; }
  52. /// <summary>
  53. /// Gets the start position ticks.
  54. /// </summary>
  55. /// <value>The start position ticks.</value>
  56. public long StartPositionTicks { get; }
  57. /// <summary>
  58. /// Gets a value indicating whether the current item is playing.
  59. /// </summary>
  60. /// <value>The playing item status.</value>
  61. public bool IsPlaying { get; }
  62. /// <summary>
  63. /// Gets the shuffle mode.
  64. /// </summary>
  65. /// <value>The shuffle mode.</value>
  66. public GroupShuffleMode ShuffleMode { get; }
  67. /// <summary>
  68. /// Gets the repeat mode.
  69. /// </summary>
  70. /// <value>The repeat mode.</value>
  71. public GroupRepeatMode RepeatMode { get; }
  72. }
  73. }