2
0

SessionInfoDto.cs 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. using MediaBrowser.Model.Entities;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Diagnostics;
  6. namespace MediaBrowser.Model.Session
  7. {
  8. [DebuggerDisplay("Client = {Client}, Username = {UserName}")]
  9. public class SessionInfoDto : INotifyPropertyChanged
  10. {
  11. /// <summary>
  12. /// Gets or sets a value indicating whether this instance can seek.
  13. /// </summary>
  14. /// <value><c>true</c> if this instance can seek; otherwise, <c>false</c>.</value>
  15. public bool CanSeek { get; set; }
  16. /// <summary>
  17. /// Gets or sets the supported commands.
  18. /// </summary>
  19. /// <value>The supported commands.</value>
  20. public List<string> SupportedCommands { get; set; }
  21. /// <summary>
  22. /// Gets or sets the remote end point.
  23. /// </summary>
  24. /// <value>The remote end point.</value>
  25. public string RemoteEndPoint { get; set; }
  26. /// <summary>
  27. /// Gets or sets the queueable media types.
  28. /// </summary>
  29. /// <value>The queueable media types.</value>
  30. public List<string> QueueableMediaTypes { get; set; }
  31. /// <summary>
  32. /// Gets or sets the playable media types.
  33. /// </summary>
  34. /// <value>The playable media types.</value>
  35. public List<string> PlayableMediaTypes { get; set; }
  36. /// <summary>
  37. /// Gets or sets the id.
  38. /// </summary>
  39. /// <value>The id.</value>
  40. public string Id { get; set; }
  41. /// <summary>
  42. /// Gets or sets the user id.
  43. /// </summary>
  44. /// <value>The user id.</value>
  45. public string UserId { get; set; }
  46. /// <summary>
  47. /// Gets or sets the user primary image tag.
  48. /// </summary>
  49. /// <value>The user primary image tag.</value>
  50. public Guid? UserPrimaryImageTag { get; set; }
  51. /// <summary>
  52. /// Gets or sets the name of the user.
  53. /// </summary>
  54. /// <value>The name of the user.</value>
  55. public string UserName { get; set; }
  56. /// <summary>
  57. /// Gets or sets the additional users present.
  58. /// </summary>
  59. /// <value>The additional users present.</value>
  60. public List<SessionUserInfo> AdditionalUsers { get; set; }
  61. /// <summary>
  62. /// Gets or sets the application version.
  63. /// </summary>
  64. /// <value>The application version.</value>
  65. public string ApplicationVersion { get; set; }
  66. /// <summary>
  67. /// Gets or sets the type of the client.
  68. /// </summary>
  69. /// <value>The type of the client.</value>
  70. public string Client { get; set; }
  71. /// <summary>
  72. /// Gets or sets the last activity date.
  73. /// </summary>
  74. /// <value>The last activity date.</value>
  75. public DateTime LastActivityDate { get; set; }
  76. /// <summary>
  77. /// Gets or sets the now viewing context.
  78. /// </summary>
  79. /// <value>The now viewing context.</value>
  80. public string NowViewingContext { get; set; }
  81. /// <summary>
  82. /// Gets or sets the now viewing item.
  83. /// </summary>
  84. /// <value>The now viewing item.</value>
  85. public BaseItemInfo NowViewingItem { get; set; }
  86. /// <summary>
  87. /// Gets or sets the name of the device.
  88. /// </summary>
  89. /// <value>The name of the device.</value>
  90. public string DeviceName { get; set; }
  91. /// <summary>
  92. /// Gets or sets a value indicating whether this instance is paused.
  93. /// </summary>
  94. /// <value><c>true</c> if this instance is paused; otherwise, <c>false</c>.</value>
  95. public bool IsPaused { get; set; }
  96. /// <summary>
  97. /// Gets or sets a value indicating whether this instance is muted.
  98. /// </summary>
  99. /// <value><c>true</c> if this instance is muted; otherwise, <c>false</c>.</value>
  100. public bool IsMuted { get; set; }
  101. /// <summary>
  102. /// Gets or sets the now playing item.
  103. /// </summary>
  104. /// <value>The now playing item.</value>
  105. public BaseItemInfo NowPlayingItem { get; set; }
  106. /// <summary>
  107. /// Gets or sets the now playing position ticks.
  108. /// </summary>
  109. /// <value>The now playing position ticks.</value>
  110. public long? NowPlayingPositionTicks { get; set; }
  111. /// <summary>
  112. /// Gets or sets the device id.
  113. /// </summary>
  114. /// <value>The device id.</value>
  115. public string DeviceId { get; set; }
  116. /// <summary>
  117. /// Gets or sets a value indicating whether [supports remote control].
  118. /// </summary>
  119. /// <value><c>true</c> if [supports remote control]; otherwise, <c>false</c>.</value>
  120. public bool SupportsRemoteControl { get; set; }
  121. public PlayerStateInfo PlayState { get; set; }
  122. public event PropertyChangedEventHandler PropertyChanged;
  123. public SessionInfoDto()
  124. {
  125. AdditionalUsers = new List<SessionUserInfo>();
  126. PlayableMediaTypes = new List<string>();
  127. QueueableMediaTypes = new List<string>();
  128. SupportedCommands = new List<string>();
  129. }
  130. }
  131. /// <summary>
  132. /// Class SessionUserInfo.
  133. /// </summary>
  134. public class SessionUserInfo
  135. {
  136. /// <summary>
  137. /// Gets or sets the user identifier.
  138. /// </summary>
  139. /// <value>The user identifier.</value>
  140. public string UserId { get; set; }
  141. /// <summary>
  142. /// Gets or sets the name of the user.
  143. /// </summary>
  144. /// <value>The name of the user.</value>
  145. public string UserName { get; set; }
  146. }
  147. public class ClientCapabilities
  148. {
  149. public List<string> PlayableMediaTypes { get; set; }
  150. public List<string> SupportedCommands { get; set; }
  151. public ClientCapabilities()
  152. {
  153. PlayableMediaTypes = new List<string>();
  154. SupportedCommands = new List<string>();
  155. }
  156. }
  157. public class PlayerStateInfo
  158. {
  159. /// <summary>
  160. /// Gets or sets the now playing position ticks.
  161. /// </summary>
  162. /// <value>The now playing position ticks.</value>
  163. public long? PositionTicks { get; set; }
  164. /// <summary>
  165. /// Gets or sets a value indicating whether this instance can seek.
  166. /// </summary>
  167. /// <value><c>true</c> if this instance can seek; otherwise, <c>false</c>.</value>
  168. public bool CanSeek { get; set; }
  169. /// <summary>
  170. /// Gets or sets a value indicating whether this instance is paused.
  171. /// </summary>
  172. /// <value><c>true</c> if this instance is paused; otherwise, <c>false</c>.</value>
  173. public bool IsPaused { get; set; }
  174. /// <summary>
  175. /// Gets or sets a value indicating whether this instance is muted.
  176. /// </summary>
  177. /// <value><c>true</c> if this instance is muted; otherwise, <c>false</c>.</value>
  178. public bool IsMuted { get; set; }
  179. /// <summary>
  180. /// Gets or sets the volume level.
  181. /// </summary>
  182. /// <value>The volume level.</value>
  183. public int? VolumeLevel { get; set; }
  184. /// <summary>
  185. /// Gets or sets the index of the now playing audio stream.
  186. /// </summary>
  187. /// <value>The index of the now playing audio stream.</value>
  188. public int? AudioStreamIndex { get; set; }
  189. /// <summary>
  190. /// Gets or sets the index of the now playing subtitle stream.
  191. /// </summary>
  192. /// <value>The index of the now playing subtitle stream.</value>
  193. public int? SubtitleStreamIndex { get; set; }
  194. /// <summary>
  195. /// Gets or sets the now playing media version identifier.
  196. /// </summary>
  197. /// <value>The now playing media version identifier.</value>
  198. public string MediaSourceId { get; set; }
  199. /// <summary>
  200. /// Gets or sets the play method.
  201. /// </summary>
  202. /// <value>The play method.</value>
  203. public PlayMethod? PlayMethod { get; set; }
  204. }
  205. }