jellyfin-server/MediaBrowser.Controller/LiveTv/ILiveTvService.cs

249 lines
11 KiB
C#
Raw Normal View History

2015-04-11 21:34:05 +00:00
using MediaBrowser.Controller.Drawing;
using MediaBrowser.Model.Dto;
using System;
2014-01-12 15:58:47 +00:00
using System.Collections.Generic;
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 05:38:08 +00:00
/// <summary>
/// Occurs when [data source changed].
/// </summary>
event EventHandler DataSourceChanged;
/// <summary>
/// Occurs when [recording status changed].
/// </summary>
event EventHandler<RecordingStatusChangedEventArgs> RecordingStatusChanged;
/// <summary>
/// Gets the name.
/// </summary>
/// <value>The name.</value>
string Name { get; }
2014-01-17 20:51:29 +00:00
/// <summary>
/// Gets the home page URL.
/// </summary>
/// <value>The home page URL.</value>
string HomePageUrl { get; }
2014-01-16 17:23:30 +00:00
/// <summary>
/// Gets the status information asynchronous.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{LiveTvServiceStatusInfo}.</returns>
Task<LiveTvServiceStatusInfo> GetStatusInfoAsync(CancellationToken cancellationToken);
/// <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 20:45:58 +00:00
/// <summary>
2013-11-26 21:36:11 +00:00
/// Cancels the timer asynchronous.
/// </summary>
2013-11-26 21:36:11 +00:00
/// <param name="timerId">The timer identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
2013-11-26 21:36:11 +00:00
Task CancelTimerAsync(string timerId, CancellationToken cancellationToken);
2013-12-15 14:19:24 +00: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 15:58:47 +00:00
2013-11-25 20:39:23 +00: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 21:36:11 +00:00
/// <summary>
2013-11-26 21:36:11 +00:00
/// Creates the timer asynchronous.
/// </summary>
2013-11-26 21:36:11 +00:00
/// <param name="info">The information.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
2013-11-26 21:36:11 +00:00
Task CreateTimerAsync(TimerInfo info, CancellationToken cancellationToken);
2013-11-25 20:39:23 +00:00
2013-12-01 06:25:19 +00: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 01:17:57 +00: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 06:25:19 +00: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 15:58:47 +00:00
/// <summary>
2013-12-19 21:51:32 +00:00
/// Gets the channel image asynchronous. This only needs to be implemented if an image path or url cannot be supplied to ChannelInfo
/// </summary>
/// <param name="channelId">The channel identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{Stream}.</returns>
2014-11-30 19:01:33 +00:00
Task<ImageStream> GetChannelImageAsync(string channelId, CancellationToken cancellationToken);
2013-12-14 15:49:11 +00:00
/// <summary>
2013-12-19 21:51:32 +00: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 15:49:11 +00:00
/// </summary>
2013-12-18 05:44:46 +00:00
/// <param name="recordingId">The recording identifier.</param>
2013-12-14 15:49:11 +00:00
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{ImageResponseInfo}.</returns>
2014-11-30 19:01:33 +00:00
Task<ImageStream> GetRecordingImageAsync(string recordingId, CancellationToken cancellationToken);
2013-12-14 15:49:11 +00:00
2013-12-02 21:46:22 +00:00
/// <summary>
2013-12-19 21:51:32 +00: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 21:46:22 +00:00
/// </summary>
2013-12-18 05:44:46 +00:00
/// <param name="programId">The program identifier.</param>
2013-12-14 15:49:11 +00:00
/// <param name="channelId">The channel identifier.</param>
2013-12-02 21:46:22 +00:00
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{ImageResponseInfo}.</returns>
2014-11-30 19:01:33 +00:00
Task<ImageStream> GetProgramImageAsync(string programId, string channelId, CancellationToken cancellationToken);
2014-01-12 15:58:47 +00:00
2013-11-11 19:36:48 +00:00
/// <summary>
/// Gets the recordings asynchronous.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{IEnumerable{RecordingInfo}}.</returns>
2013-11-25 20:39:23 +00:00
Task<IEnumerable<RecordingInfo>> GetRecordingsAsync(CancellationToken cancellationToken);
2013-11-26 21:36:11 +00: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 06:49:38 +00:00
2013-12-17 20:02:12 +00:00
/// <summary>
/// Gets the new timer defaults asynchronous.
2013-12-17 20:02:12 +00:00
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <param name="program">The program.</param>
/// <returns>Task{SeriesTimerInfo}.</returns>
Task<SeriesTimerInfo> GetNewTimerDefaultsAsync(CancellationToken cancellationToken, ProgramInfo program = null);
2013-11-30 06:49:38 +00:00
/// <summary>
2013-12-01 06:25:19 +00:00
/// Gets the series timers asynchronous.
2013-11-30 06:49:38 +00:00
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
2013-12-01 06:25:19 +00:00
/// <returns>Task{IEnumerable{SeriesTimerInfo}}.</returns>
Task<IEnumerable<SeriesTimerInfo>> GetSeriesTimersAsync(CancellationToken cancellationToken);
2014-01-12 15:58:47 +00:00
2013-11-11 19:36:48 +00:00
/// <summary>
2013-11-25 20:39:23 +00:00
/// Gets the programs asynchronous.
2013-11-11 19:36:48 +00:00
/// </summary>
2013-11-25 16:15:31 +00:00
/// <param name="channelId">The channel identifier.</param>
2014-01-12 15:58:47 +00:00
/// <param name="startDateUtc">The start date UTC.</param>
/// <param name="endDateUtc">The end date UTC.</param>
2013-11-11 19:36:48 +00:00
/// <param name="cancellationToken">The cancellation token.</param>
2013-11-25 16:15:31 +00:00
/// <returns>Task{IEnumerable{ProgramInfo}}.</returns>
2014-01-12 15:58:47 +00:00
Task<IEnumerable<ProgramInfo>> GetProgramsAsync(string channelId, DateTime startDateUtc, DateTime endDateUtc, CancellationToken cancellationToken);
2013-12-22 17:16:24 +00:00
/// <summary>
/// Gets the recording stream.
/// </summary>
/// <param name="recordingId">The recording identifier.</param>
2015-03-20 05:40:51 +00:00
/// <param name="streamId">The stream identifier.</param>
2013-12-22 17:16:24 +00:00
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{Stream}.</returns>
2015-03-20 05:40:51 +00:00
Task<MediaSourceInfo> GetRecordingStream(string recordingId, string streamId, CancellationToken cancellationToken);
2013-12-22 17:16:24 +00:00
/// <summary>
/// Gets the channel stream.
/// </summary>
2013-12-29 18:53:56 +00:00
/// <param name="channelId">The channel identifier.</param>
2015-03-20 05:40:51 +00:00
/// <param name="streamId">The stream identifier.</param>
2013-12-22 17:16:24 +00:00
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{Stream}.</returns>
2015-03-20 05:40:51 +00:00
Task<MediaSourceInfo> GetChannelStream(string channelId, string streamId, CancellationToken cancellationToken);
2014-01-05 03:50:29 +00:00
2015-03-20 05:40:51 +00:00
/// <summary>
/// Gets the channel stream media sources.
/// </summary>
/// <param name="channelId">The channel identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task&lt;List&lt;MediaSourceInfo&gt;&gt;.</returns>
Task<List<MediaSourceInfo>> GetChannelStreamMediaSources(string channelId, CancellationToken cancellationToken);
/// <summary>
/// Gets the recording stream media sources.
/// </summary>
/// <param name="recordingId">The recording identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task&lt;List&lt;MediaSourceInfo&gt;&gt;.</returns>
Task<List<MediaSourceInfo>> GetRecordingStreamMediaSources(string recordingId, CancellationToken cancellationToken);
2014-01-05 03:50:29 +00: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 15:58:47 +00: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);
/// <summary>
/// Resets the tuner.
/// </summary>
/// <param name="id">The identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task ResetTuner(string id, CancellationToken cancellationToken);
}
2016-06-08 21:04:52 +00:00
public interface ISupportsNewTimerIds
{
/// <summary>
/// Creates the timer asynchronous.
/// </summary>
/// <param name="info">The information.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task<string> CreateTimer(TimerInfo info, CancellationToken cancellationToken);
/// <summary>
/// Creates the series timer asynchronous.
/// </summary>
/// <param name="info">The information.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task<string> CreateSeriesTimer(SeriesTimerInfo info, CancellationToken cancellationToken);
}
}