2014-01-12 16:58:47 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2013-09-26 17:48:14 +02:00
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.LiveTv
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Represents a single live tv back end (next pvr, media portal, etc).
|
|
|
|
|
/// </summary>
|
|
|
|
|
public interface ILiveTvService
|
|
|
|
|
{
|
2014-01-15 06:38:08 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Occurs when [data source changed].
|
|
|
|
|
/// </summary>
|
|
|
|
|
event EventHandler DataSourceChanged;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Occurs when [recording status changed].
|
|
|
|
|
/// </summary>
|
|
|
|
|
event EventHandler<RecordingStatusChangedEventArgs> RecordingStatusChanged;
|
|
|
|
|
|
2013-09-26 17:48:14 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the name.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The name.</value>
|
|
|
|
|
string Name { get; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the channels async.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task{IEnumerable{ChannelInfo}}.</returns>
|
|
|
|
|
Task<IEnumerable<ChannelInfo>> GetChannelsAsync(CancellationToken cancellationToken);
|
2013-10-31 21:45:58 +01:00
|
|
|
|
|
2013-11-20 18:10:02 +01:00
|
|
|
|
/// <summary>
|
2013-11-26 22:36:11 +01:00
|
|
|
|
/// Cancels the timer asynchronous.
|
2013-11-20 18:10:02 +01:00
|
|
|
|
/// </summary>
|
2013-11-26 22:36:11 +01:00
|
|
|
|
/// <param name="timerId">The timer identifier.</param>
|
2013-11-20 18:10:02 +01:00
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
2013-11-26 22:36:11 +01:00
|
|
|
|
Task CancelTimerAsync(string timerId, CancellationToken cancellationToken);
|
2013-11-20 18:10:02 +01:00
|
|
|
|
|
2013-12-15 15:19:24 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Cancels the series timer asynchronous.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="timerId">The timer identifier.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task CancelSeriesTimerAsync(string timerId, CancellationToken cancellationToken);
|
2014-01-12 16:58:47 +01:00
|
|
|
|
|
2013-11-25 21:39:23 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Deletes the recording asynchronous.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="recordingId">The recording identifier.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task DeleteRecordingAsync(string recordingId, CancellationToken cancellationToken);
|
2013-11-26 22:36:11 +01:00
|
|
|
|
|
2013-11-20 18:10:02 +01:00
|
|
|
|
/// <summary>
|
2013-11-26 22:36:11 +01:00
|
|
|
|
/// Creates the timer asynchronous.
|
2013-11-20 18:10:02 +01:00
|
|
|
|
/// </summary>
|
2013-11-26 22:36:11 +01:00
|
|
|
|
/// <param name="info">The information.</param>
|
2013-11-20 18:10:02 +01:00
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
2013-11-26 22:36:11 +01:00
|
|
|
|
Task CreateTimerAsync(TimerInfo info, CancellationToken cancellationToken);
|
2013-11-25 21:39:23 +01:00
|
|
|
|
|
2013-12-01 07:25:19 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Creates the series timer asynchronous.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="info">The information.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task CreateSeriesTimerAsync(SeriesTimerInfo info, CancellationToken cancellationToken);
|
|
|
|
|
|
2013-12-15 02:17:57 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Updates the timer asynchronous.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="info">The information.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task UpdateTimerAsync(TimerInfo info, CancellationToken cancellationToken);
|
|
|
|
|
|
2013-12-01 07:25:19 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Updates the series timer asynchronous.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="info">The information.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task UpdateSeriesTimerAsync(SeriesTimerInfo info, CancellationToken cancellationToken);
|
2014-01-12 16:58:47 +01:00
|
|
|
|
|
2013-11-20 04:15:48 +01:00
|
|
|
|
/// <summary>
|
2013-12-19 22:51:32 +01:00
|
|
|
|
/// Gets the channel image asynchronous. This only needs to be implemented if an image path or url cannot be supplied to ChannelInfo
|
2013-11-20 04:15:48 +01:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="channelId">The channel identifier.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task{Stream}.</returns>
|
2013-12-22 19:58:51 +01:00
|
|
|
|
Task<StreamResponseInfo> GetChannelImageAsync(string channelId, CancellationToken cancellationToken);
|
2013-11-20 04:15:48 +01:00
|
|
|
|
|
2013-12-14 16:49:11 +01:00
|
|
|
|
/// <summary>
|
2013-12-19 22:51:32 +01:00
|
|
|
|
/// Gets the recording image asynchronous. This only needs to be implemented if an image path or url cannot be supplied to RecordingInfo
|
2013-12-14 16:49:11 +01:00
|
|
|
|
/// </summary>
|
2013-12-18 06:44:46 +01:00
|
|
|
|
/// <param name="recordingId">The recording identifier.</param>
|
2013-12-14 16:49:11 +01:00
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task{ImageResponseInfo}.</returns>
|
2013-12-22 19:58:51 +01:00
|
|
|
|
Task<StreamResponseInfo> GetRecordingImageAsync(string recordingId, CancellationToken cancellationToken);
|
2013-12-14 16:49:11 +01:00
|
|
|
|
|
2013-12-02 22:46:22 +01:00
|
|
|
|
/// <summary>
|
2013-12-19 22:51:32 +01:00
|
|
|
|
/// Gets the program image asynchronous. This only needs to be implemented if an image path or url cannot be supplied to ProgramInfo
|
2013-12-02 22:46:22 +01:00
|
|
|
|
/// </summary>
|
2013-12-18 06:44:46 +01:00
|
|
|
|
/// <param name="programId">The program identifier.</param>
|
2013-12-14 16:49:11 +01:00
|
|
|
|
/// <param name="channelId">The channel identifier.</param>
|
2013-12-02 22:46:22 +01:00
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task{ImageResponseInfo}.</returns>
|
2013-12-22 19:58:51 +01:00
|
|
|
|
Task<StreamResponseInfo> GetProgramImageAsync(string programId, string channelId, CancellationToken cancellationToken);
|
2014-01-12 16:58:47 +01:00
|
|
|
|
|
2013-11-11 20:36:48 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the recordings asynchronous.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task{IEnumerable{RecordingInfo}}.</returns>
|
2013-11-25 21:39:23 +01:00
|
|
|
|
Task<IEnumerable<RecordingInfo>> GetRecordingsAsync(CancellationToken cancellationToken);
|
2013-11-02 22:38:21 +01:00
|
|
|
|
|
2013-11-26 22:36:11 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the recordings asynchronous.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task{IEnumerable{RecordingInfo}}.</returns>
|
|
|
|
|
Task<IEnumerable<TimerInfo>> GetTimersAsync(CancellationToken cancellationToken);
|
2013-11-30 07:49:38 +01:00
|
|
|
|
|
2013-12-17 21:02:12 +01:00
|
|
|
|
/// <summary>
|
2014-01-13 21:31:09 +01:00
|
|
|
|
/// Gets the new timer defaults asynchronous.
|
2013-12-17 21:02:12 +01:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
2014-01-13 21:31:09 +01:00
|
|
|
|
/// <param name="program">The program.</param>
|
|
|
|
|
/// <returns>Task{SeriesTimerInfo}.</returns>
|
|
|
|
|
Task<SeriesTimerInfo> GetNewTimerDefaultsAsync(CancellationToken cancellationToken, ProgramInfo program = null);
|
|
|
|
|
|
2013-11-30 07:49:38 +01:00
|
|
|
|
/// <summary>
|
2013-12-01 07:25:19 +01:00
|
|
|
|
/// Gets the series timers asynchronous.
|
2013-11-30 07:49:38 +01:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
2013-12-01 07:25:19 +01:00
|
|
|
|
/// <returns>Task{IEnumerable{SeriesTimerInfo}}.</returns>
|
|
|
|
|
Task<IEnumerable<SeriesTimerInfo>> GetSeriesTimersAsync(CancellationToken cancellationToken);
|
2014-01-12 16:58:47 +01:00
|
|
|
|
|
2013-11-11 20:36:48 +01:00
|
|
|
|
/// <summary>
|
2013-11-25 21:39:23 +01:00
|
|
|
|
/// Gets the programs asynchronous.
|
2013-11-11 20:36:48 +01:00
|
|
|
|
/// </summary>
|
2013-11-25 17:15:31 +01:00
|
|
|
|
/// <param name="channelId">The channel identifier.</param>
|
2014-01-12 16:58:47 +01:00
|
|
|
|
/// <param name="startDateUtc">The start date UTC.</param>
|
|
|
|
|
/// <param name="endDateUtc">The end date UTC.</param>
|
2013-11-11 20:36:48 +01:00
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
2013-11-25 17:15:31 +01:00
|
|
|
|
/// <returns>Task{IEnumerable{ProgramInfo}}.</returns>
|
2014-01-12 16:58:47 +01:00
|
|
|
|
Task<IEnumerable<ProgramInfo>> GetProgramsAsync(string channelId, DateTime startDateUtc, DateTime endDateUtc, CancellationToken cancellationToken);
|
2013-12-22 18:16:24 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the recording stream.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="recordingId">The recording identifier.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task{Stream}.</returns>
|
2014-01-03 00:07:37 +01:00
|
|
|
|
Task<LiveStreamInfo> GetRecordingStream(string recordingId, CancellationToken cancellationToken);
|
2013-12-22 18:16:24 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the channel stream.
|
|
|
|
|
/// </summary>
|
2013-12-29 19:53:56 +01:00
|
|
|
|
/// <param name="channelId">The channel identifier.</param>
|
2013-12-22 18:16:24 +01:00
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task{Stream}.</returns>
|
2014-01-03 00:07:37 +01:00
|
|
|
|
Task<LiveStreamInfo> GetChannelStream(string channelId, CancellationToken cancellationToken);
|
2014-01-05 04:50:29 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Closes the live stream.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">The identifier.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task CloseLiveStream(string id, CancellationToken cancellationToken);
|
2014-01-12 16:58:47 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Records the live stream.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">The identifier.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task RecordLiveStream(string id, CancellationToken cancellationToken);
|
2013-09-26 17:48:14 +02:00
|
|
|
|
}
|
|
|
|
|
}
|