using MediaBrowser.Controller.Drawing;
using MediaBrowser.Model.Dto;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Controller.Library;
namespace MediaBrowser.Controller.LiveTv
{
///
/// Represents a single live tv back end (next pvr, media portal, etc).
///
public interface ILiveTvService
{
///
/// Occurs when [data source changed].
///
event EventHandler DataSourceChanged;
///
/// Occurs when [recording status changed].
///
event EventHandler RecordingStatusChanged;
///
/// Gets the name.
///
/// The name.
string Name { get; }
///
/// Gets the home page URL.
///
/// The home page URL.
string HomePageUrl { get; }
///
/// Gets the status information asynchronous.
///
/// The cancellation token.
/// Task{LiveTvServiceStatusInfo}.
Task GetStatusInfoAsync(CancellationToken cancellationToken);
///
/// Gets the channels async.
///
/// The cancellation token.
/// Task{IEnumerable{ChannelInfo}}.
Task> GetChannelsAsync(CancellationToken cancellationToken);
///
/// Cancels the timer asynchronous.
///
/// The timer identifier.
/// The cancellation token.
/// Task.
Task CancelTimerAsync(string timerId, CancellationToken cancellationToken);
///
/// Cancels the series timer asynchronous.
///
/// The timer identifier.
/// The cancellation token.
/// Task.
Task CancelSeriesTimerAsync(string timerId, CancellationToken cancellationToken);
///
/// Deletes the recording asynchronous.
///
/// The recording identifier.
/// The cancellation token.
/// Task.
Task DeleteRecordingAsync(string recordingId, CancellationToken cancellationToken);
///
/// Creates the timer asynchronous.
///
/// The information.
/// The cancellation token.
/// Task.
Task CreateTimerAsync(TimerInfo info, CancellationToken cancellationToken);
///
/// Creates the series timer asynchronous.
///
/// The information.
/// The cancellation token.
/// Task.
Task CreateSeriesTimerAsync(SeriesTimerInfo info, CancellationToken cancellationToken);
///
/// Updates the timer asynchronous.
///
/// The information.
/// The cancellation token.
/// Task.
Task UpdateTimerAsync(TimerInfo info, CancellationToken cancellationToken);
///
/// Updates the series timer asynchronous.
///
/// The information.
/// The cancellation token.
/// Task.
Task UpdateSeriesTimerAsync(SeriesTimerInfo info, CancellationToken cancellationToken);
///
/// Gets the channel image asynchronous. This only needs to be implemented if an image path or url cannot be supplied to ChannelInfo
///
/// The channel identifier.
/// The cancellation token.
/// Task{Stream}.
Task GetChannelImageAsync(string channelId, CancellationToken cancellationToken);
///
/// Gets the recording image asynchronous. This only needs to be implemented if an image path or url cannot be supplied to RecordingInfo
///
/// The recording identifier.
/// The cancellation token.
/// Task{ImageResponseInfo}.
Task GetRecordingImageAsync(string recordingId, CancellationToken cancellationToken);
///
/// Gets the program image asynchronous. This only needs to be implemented if an image path or url cannot be supplied to ProgramInfo
///
/// The program identifier.
/// The channel identifier.
/// The cancellation token.
/// Task{ImageResponseInfo}.
Task GetProgramImageAsync(string programId, string channelId, CancellationToken cancellationToken);
///
/// Gets the recordings asynchronous.
///
/// The cancellation token.
/// Task{IEnumerable{RecordingInfo}}.
Task> GetRecordingsAsync(CancellationToken cancellationToken);
///
/// Gets the recordings asynchronous.
///
/// The cancellation token.
/// Task{IEnumerable{RecordingInfo}}.
Task> GetTimersAsync(CancellationToken cancellationToken);
///
/// Gets the new timer defaults asynchronous.
///
/// The cancellation token.
/// The program.
/// Task{SeriesTimerInfo}.
Task GetNewTimerDefaultsAsync(CancellationToken cancellationToken, ProgramInfo program = null);
///
/// Gets the series timers asynchronous.
///
/// The cancellation token.
/// Task{IEnumerable{SeriesTimerInfo}}.
Task> GetSeriesTimersAsync(CancellationToken cancellationToken);
///
/// Gets the programs asynchronous.
///
/// The channel identifier.
/// The start date UTC.
/// The end date UTC.
/// The cancellation token.
/// Task{IEnumerable{ProgramInfo}}.
Task> GetProgramsAsync(string channelId, DateTime startDateUtc, DateTime endDateUtc, CancellationToken cancellationToken);
///
/// Gets the recording stream.
///
/// The recording identifier.
/// The stream identifier.
/// The cancellation token.
/// Task{Stream}.
Task GetRecordingStream(string recordingId, string streamId, CancellationToken cancellationToken);
///
/// Gets the channel stream.
///
/// The channel identifier.
/// The stream identifier.
/// The cancellation token.
/// Task{Stream}.
Task GetChannelStream(string channelId, string streamId, CancellationToken cancellationToken);
///
/// Gets the channel stream media sources.
///
/// The channel identifier.
/// The cancellation token.
/// Task<List<MediaSourceInfo>>.
Task> GetChannelStreamMediaSources(string channelId, CancellationToken cancellationToken);
///
/// Gets the recording stream media sources.
///
/// The recording identifier.
/// The cancellation token.
/// Task<List<MediaSourceInfo>>.
Task> GetRecordingStreamMediaSources(string recordingId, CancellationToken cancellationToken);
///
/// Closes the live stream.
///
/// The identifier.
/// The cancellation token.
/// Task.
Task CloseLiveStream(string id, CancellationToken cancellationToken);
///
/// Records the live stream.
///
/// The identifier.
/// The cancellation token.
/// Task.
Task RecordLiveStream(string id, CancellationToken cancellationToken);
///
/// Resets the tuner.
///
/// The identifier.
/// The cancellation token.
/// Task.
Task ResetTuner(string id, CancellationToken cancellationToken);
}
public interface ISupportsNewTimerIds
{
///
/// Creates the timer asynchronous.
///
/// The information.
/// The cancellation token.
/// Task.
Task CreateTimer(TimerInfo info, CancellationToken cancellationToken);
///
/// Creates the series timer asynchronous.
///
/// The information.
/// The cancellation token.
/// Task.
Task CreateSeriesTimer(SeriesTimerInfo info, CancellationToken cancellationToken);
}
public interface ISupportsDirectStreamProvider
{
Task> GetChannelStreamWithDirectStreamProvider(string channelId, string streamId, CancellationToken cancellationToken);
}
}