ILiveTvService.cs 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. using System.Collections.Generic;
  2. using System.Threading;
  3. using System.Threading.Tasks;
  4. namespace MediaBrowser.Controller.LiveTv
  5. {
  6. /// <summary>
  7. /// Represents a single live tv back end (next pvr, media portal, etc).
  8. /// </summary>
  9. public interface ILiveTvService
  10. {
  11. /// <summary>
  12. /// Gets the name.
  13. /// </summary>
  14. /// <value>The name.</value>
  15. string Name { get; }
  16. /// <summary>
  17. /// Gets the channels async.
  18. /// </summary>
  19. /// <param name="cancellationToken">The cancellation token.</param>
  20. /// <returns>Task{IEnumerable{ChannelInfo}}.</returns>
  21. Task<IEnumerable<ChannelInfo>> GetChannelsAsync(CancellationToken cancellationToken);
  22. /// <summary>
  23. /// Cancels the timer asynchronous.
  24. /// </summary>
  25. /// <param name="timerId">The timer identifier.</param>
  26. /// <param name="cancellationToken">The cancellation token.</param>
  27. /// <returns>Task.</returns>
  28. Task CancelTimerAsync(string timerId, CancellationToken cancellationToken);
  29. /// <summary>
  30. /// Cancels the series timer asynchronous.
  31. /// </summary>
  32. /// <param name="timerId">The timer identifier.</param>
  33. /// <param name="cancellationToken">The cancellation token.</param>
  34. /// <returns>Task.</returns>
  35. Task CancelSeriesTimerAsync(string timerId, CancellationToken cancellationToken);
  36. /// <summary>
  37. /// Deletes the recording asynchronous.
  38. /// </summary>
  39. /// <param name="recordingId">The recording identifier.</param>
  40. /// <param name="cancellationToken">The cancellation token.</param>
  41. /// <returns>Task.</returns>
  42. Task DeleteRecordingAsync(string recordingId, CancellationToken cancellationToken);
  43. /// <summary>
  44. /// Creates the timer asynchronous.
  45. /// </summary>
  46. /// <param name="info">The information.</param>
  47. /// <param name="cancellationToken">The cancellation token.</param>
  48. /// <returns>Task.</returns>
  49. Task CreateTimerAsync(TimerInfo info, CancellationToken cancellationToken);
  50. /// <summary>
  51. /// Creates the series timer asynchronous.
  52. /// </summary>
  53. /// <param name="info">The information.</param>
  54. /// <param name="cancellationToken">The cancellation token.</param>
  55. /// <returns>Task.</returns>
  56. Task CreateSeriesTimerAsync(SeriesTimerInfo info, CancellationToken cancellationToken);
  57. /// <summary>
  58. /// Updates the timer asynchronous.
  59. /// </summary>
  60. /// <param name="info">The information.</param>
  61. /// <param name="cancellationToken">The cancellation token.</param>
  62. /// <returns>Task.</returns>
  63. Task UpdateTimerAsync(TimerInfo info, CancellationToken cancellationToken);
  64. /// <summary>
  65. /// Updates the series timer asynchronous.
  66. /// </summary>
  67. /// <param name="info">The information.</param>
  68. /// <param name="cancellationToken">The cancellation token.</param>
  69. /// <returns>Task.</returns>
  70. Task UpdateSeriesTimerAsync(SeriesTimerInfo info, CancellationToken cancellationToken);
  71. /// <summary>
  72. /// Gets the channel image asynchronous. This only needs to be implemented if an image path or url cannot be supplied to ChannelInfo
  73. /// </summary>
  74. /// <param name="channelId">The channel identifier.</param>
  75. /// <param name="cancellationToken">The cancellation token.</param>
  76. /// <returns>Task{Stream}.</returns>
  77. Task<StreamResponseInfo> GetChannelImageAsync(string channelId, CancellationToken cancellationToken);
  78. /// <summary>
  79. /// Gets the recording image asynchronous. This only needs to be implemented if an image path or url cannot be supplied to RecordingInfo
  80. /// </summary>
  81. /// <param name="recordingId">The recording identifier.</param>
  82. /// <param name="cancellationToken">The cancellation token.</param>
  83. /// <returns>Task{ImageResponseInfo}.</returns>
  84. Task<StreamResponseInfo> GetRecordingImageAsync(string recordingId, CancellationToken cancellationToken);
  85. /// <summary>
  86. /// Gets the program image asynchronous. This only needs to be implemented if an image path or url cannot be supplied to ProgramInfo
  87. /// </summary>
  88. /// <param name="programId">The program identifier.</param>
  89. /// <param name="channelId">The channel identifier.</param>
  90. /// <param name="cancellationToken">The cancellation token.</param>
  91. /// <returns>Task{ImageResponseInfo}.</returns>
  92. Task<StreamResponseInfo> GetProgramImageAsync(string programId, string channelId, CancellationToken cancellationToken);
  93. /// <summary>
  94. /// Gets the recordings asynchronous.
  95. /// </summary>
  96. /// <param name="cancellationToken">The cancellation token.</param>
  97. /// <returns>Task{IEnumerable{RecordingInfo}}.</returns>
  98. Task<IEnumerable<RecordingInfo>> GetRecordingsAsync(CancellationToken cancellationToken);
  99. /// <summary>
  100. /// Gets the recordings asynchronous.
  101. /// </summary>
  102. /// <param name="cancellationToken">The cancellation token.</param>
  103. /// <returns>Task{IEnumerable{RecordingInfo}}.</returns>
  104. Task<IEnumerable<TimerInfo>> GetTimersAsync(CancellationToken cancellationToken);
  105. /// <summary>
  106. /// Gets the timer defaults asynchronous.
  107. /// </summary>
  108. /// <param name="cancellationToken">The cancellation token.</param>
  109. /// <returns>Task{TimerInfo}.</returns>
  110. Task<SeriesTimerInfo> GetNewTimerDefaultsAsync(CancellationToken cancellationToken);
  111. /// <summary>
  112. /// Gets the series timers asynchronous.
  113. /// </summary>
  114. /// <param name="cancellationToken">The cancellation token.</param>
  115. /// <returns>Task{IEnumerable{SeriesTimerInfo}}.</returns>
  116. Task<IEnumerable<SeriesTimerInfo>> GetSeriesTimersAsync(CancellationToken cancellationToken);
  117. /// <summary>
  118. /// Gets the programs asynchronous.
  119. /// </summary>
  120. /// <param name="channelId">The channel identifier.</param>
  121. /// <param name="cancellationToken">The cancellation token.</param>
  122. /// <returns>Task{IEnumerable{ProgramInfo}}.</returns>
  123. Task<IEnumerable<ProgramInfo>> GetProgramsAsync(string channelId, CancellationToken cancellationToken);
  124. /// <summary>
  125. /// Gets the recording stream.
  126. /// </summary>
  127. /// <param name="recordingId">The recording identifier.</param>
  128. /// <param name="cancellationToken">The cancellation token.</param>
  129. /// <returns>Task{Stream}.</returns>
  130. Task<StreamResponseInfo> GetRecordingStream(string recordingId, CancellationToken cancellationToken);
  131. /// <summary>
  132. /// Gets the channel stream.
  133. /// </summary>
  134. /// <param name="recordingId">The recording identifier.</param>
  135. /// <param name="cancellationToken">The cancellation token.</param>
  136. /// <returns>Task{Stream}.</returns>
  137. Task<StreamResponseInfo> GetChannelStream(string recordingId, CancellationToken cancellationToken);
  138. }
  139. }