2
0

ISessionManager.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. using MediaBrowser.Controller.Entities;
  2. using MediaBrowser.Controller.Library;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Threading.Tasks;
  6. namespace MediaBrowser.Controller.Session
  7. {
  8. /// <summary>
  9. /// Interface ISessionManager
  10. /// </summary>
  11. public interface ISessionManager
  12. {
  13. /// <summary>
  14. /// Occurs when [playback start].
  15. /// </summary>
  16. event EventHandler<PlaybackProgressEventArgs> PlaybackStart;
  17. /// <summary>
  18. /// Occurs when [playback progress].
  19. /// </summary>
  20. event EventHandler<PlaybackProgressEventArgs> PlaybackProgress;
  21. /// <summary>
  22. /// Occurs when [playback stopped].
  23. /// </summary>
  24. event EventHandler<PlaybackProgressEventArgs> PlaybackStopped;
  25. /// <summary>
  26. /// Gets the sessions.
  27. /// </summary>
  28. /// <value>The sessions.</value>
  29. IEnumerable<SessionInfo> Sessions { get; }
  30. /// <summary>
  31. /// Logs the user activity.
  32. /// </summary>
  33. /// <param name="clientType">Type of the client.</param>
  34. /// <param name="deviceId">The device id.</param>
  35. /// <param name="deviceName">Name of the device.</param>
  36. /// <param name="user">The user.</param>
  37. /// <returns>Task.</returns>
  38. /// <exception cref="System.ArgumentNullException">user</exception>
  39. Task LogConnectionActivity(string clientType, string deviceId, string deviceName, User user);
  40. /// <summary>
  41. /// Used to report that playback has started for an item
  42. /// </summary>
  43. /// <param name="user">The user.</param>
  44. /// <param name="item">The item.</param>
  45. /// <param name="clientType">Type of the client.</param>
  46. /// <param name="deviceId">The device id.</param>
  47. /// <param name="deviceName">Name of the device.</param>
  48. /// <exception cref="System.ArgumentNullException"></exception>
  49. Task OnPlaybackStart(User user, BaseItem item, string clientType, string deviceId, string deviceName);
  50. /// <summary>
  51. /// Used to report playback progress for an item
  52. /// </summary>
  53. /// <param name="user">The user.</param>
  54. /// <param name="item">The item.</param>
  55. /// <param name="positionTicks">The position ticks.</param>
  56. /// <param name="isPaused">if set to <c>true</c> [is paused].</param>
  57. /// <param name="clientType">Type of the client.</param>
  58. /// <param name="deviceId">The device id.</param>
  59. /// <param name="deviceName">Name of the device.</param>
  60. /// <returns>Task.</returns>
  61. /// <exception cref="System.ArgumentNullException"></exception>
  62. Task OnPlaybackProgress(User user, BaseItem item, long? positionTicks, bool isPaused, string clientType, string deviceId, string deviceName);
  63. /// <summary>
  64. /// Used to report that playback has ended for an item
  65. /// </summary>
  66. /// <param name="user">The user.</param>
  67. /// <param name="item">The item.</param>
  68. /// <param name="positionTicks">The position ticks.</param>
  69. /// <param name="clientType">Type of the client.</param>
  70. /// <param name="deviceId">The device id.</param>
  71. /// <param name="deviceName">Name of the device.</param>
  72. /// <returns>Task.</returns>
  73. /// <exception cref="System.ArgumentNullException"></exception>
  74. Task OnPlaybackStopped(User user, BaseItem item, long? positionTicks, string clientType, string deviceId, string deviceName);
  75. }
  76. }