ILiveTvService.cs 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using System;
  2. using System.IO;
  3. using MediaBrowser.Model.LiveTv;
  4. using System.Collections.Generic;
  5. using System.Threading;
  6. using System.Threading.Tasks;
  7. namespace MediaBrowser.Controller.LiveTv
  8. {
  9. /// <summary>
  10. /// Represents a single live tv back end (next pvr, media portal, etc).
  11. /// </summary>
  12. public interface ILiveTvService
  13. {
  14. /// <summary>
  15. /// Gets the name.
  16. /// </summary>
  17. /// <value>The name.</value>
  18. string Name { get; }
  19. /// <summary>
  20. /// Gets the channels async.
  21. /// </summary>
  22. /// <param name="cancellationToken">The cancellation token.</param>
  23. /// <returns>Task{IEnumerable{ChannelInfo}}.</returns>
  24. Task<IEnumerable<ChannelInfo>> GetChannelsAsync(CancellationToken cancellationToken);
  25. /// <summary>
  26. /// Cancels the recording asynchronous.
  27. /// </summary>
  28. /// <param name="recordingId">The recording identifier.</param>
  29. /// <param name="cancellationToken">The cancellation token.</param>
  30. /// <returns>Task.</returns>
  31. Task CancelRecordingAsync(string recordingId, CancellationToken cancellationToken);
  32. /// <summary>
  33. /// Schedules the recording asynchronous.
  34. /// </summary>
  35. /// <param name="channelId">The channel identifier.</param>
  36. /// <param name="startTime">The start time.</param>
  37. /// <param name="duration">The duration.</param>
  38. /// <param name="cancellationToken">The cancellation token.</param>
  39. /// <returns>Task.</returns>
  40. Task ScheduleRecordingAsync(string channelId, DateTime startTime, TimeSpan duration, CancellationToken cancellationToken);
  41. /// <summary>
  42. /// Gets the channel image asynchronous.
  43. /// </summary>
  44. /// <param name="channelId">The channel identifier.</param>
  45. /// <param name="cancellationToken">The cancellation token.</param>
  46. /// <returns>Task{Stream}.</returns>
  47. Task<Stream> GetChannelImageAsync(string channelId, CancellationToken cancellationToken);
  48. /// <summary>
  49. /// Gets the recordings asynchronous.
  50. /// </summary>
  51. /// <param name="query">The query.</param>
  52. /// <param name="cancellationToken">The cancellation token.</param>
  53. /// <returns>Task{IEnumerable{RecordingInfo}}.</returns>
  54. Task<IEnumerable<RecordingInfo>> GetRecordingsAsync(RecordingQuery query, CancellationToken cancellationToken);
  55. /// <summary>
  56. /// Gets the channel guides.
  57. /// </summary>
  58. /// <param name="channelIdList">The channel identifier list.</param>
  59. /// <param name="cancellationToken">The cancellation token.</param>
  60. /// <returns>Task{IEnumerable{ChannelGuide}}.</returns>
  61. Task<IEnumerable<ChannelGuide>> GetChannelGuidesAsync(IEnumerable<string> channelIdList, CancellationToken cancellationToken);
  62. }
  63. }