ILiveTvService.cs 3.2 KB

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