2013-10-02 18:22:50 -07:00
|
|
|
|
using MediaBrowser.Model.Entities;
|
|
|
|
|
using MediaBrowser.Model.Session;
|
2014-05-18 12:58:42 -07:00
|
|
|
|
using MediaBrowser.Model.System;
|
2013-09-24 08:42:30 -07:00
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Session
|
|
|
|
|
{
|
2013-10-02 12:08:58 -07:00
|
|
|
|
public interface ISessionController
|
2013-09-24 08:42:30 -07:00
|
|
|
|
{
|
2013-10-02 18:22:50 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets a value indicating whether this instance is session active.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value><c>true</c> if this instance is session active; otherwise, <c>false</c>.</value>
|
|
|
|
|
bool IsSessionActive { get; }
|
2013-09-24 08:42:30 -07:00
|
|
|
|
|
2014-05-17 11:37:40 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets a value indicating whether [supports media remote control].
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value><c>true</c> if [supports media remote control]; otherwise, <c>false</c>.</value>
|
|
|
|
|
bool SupportsMediaControl { get; }
|
|
|
|
|
|
2013-09-24 12:54:42 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sends the play command.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="command">The command.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
2013-10-02 18:22:50 -07:00
|
|
|
|
Task SendPlayCommand(PlayRequest command, CancellationToken cancellationToken);
|
2013-09-24 12:54:42 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sends the playstate command.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="command">The command.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
2013-10-02 18:22:50 -07:00
|
|
|
|
Task SendPlaystateCommand(PlaystateRequest command, CancellationToken cancellationToken);
|
|
|
|
|
|
2014-03-28 12:58:18 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sends the generic command.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="command">The command.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
2014-03-31 14:04:22 -07:00
|
|
|
|
Task SendGeneralCommand(GeneralCommand command, CancellationToken cancellationToken);
|
2014-03-28 12:58:18 -07:00
|
|
|
|
|
2013-10-02 18:22:50 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sends the library update info.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="info">The info.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task SendLibraryUpdateInfo(LibraryUpdateInfo info, CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sends the restart required message.
|
|
|
|
|
/// </summary>
|
2014-05-18 12:58:42 -07:00
|
|
|
|
/// <param name="info">The information.</param>
|
2013-10-02 18:22:50 -07:00
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
2014-05-18 12:58:42 -07:00
|
|
|
|
Task SendRestartRequiredNotification(SystemInfo info, CancellationToken cancellationToken);
|
2013-10-03 11:02:23 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sends the user data change info.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="info">The info.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task SendUserDataChangeInfo(UserDataChangeInfo info, CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sends the server shutdown notification.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task SendServerShutdownNotification(CancellationToken cancellationToken);
|
|
|
|
|
|
2014-04-06 10:53:23 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sends the session ended notification.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sessionInfo">The session information.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task SendSessionEndedNotification(SessionInfoDto sessionInfo, CancellationToken cancellationToken);
|
2014-04-12 10:27:53 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sends the playback start notification.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sessionInfo">The session information.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task SendPlaybackStartNotification(SessionInfoDto sessionInfo, CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sends the playback start notification.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sessionInfo">The session information.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task SendPlaybackStoppedNotification(SessionInfoDto sessionInfo, CancellationToken cancellationToken);
|
2014-04-06 10:53:23 -07:00
|
|
|
|
|
2013-10-03 11:02:23 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sends the server restart notification.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task SendServerRestartNotification(CancellationToken cancellationToken);
|
2015-01-12 20:46:44 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sends the message.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <typeparam name="T"></typeparam>
|
|
|
|
|
/// <param name="name">The name.</param>
|
|
|
|
|
/// <param name="data">The data.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task SendMessage<T>(string name, T data, CancellationToken cancellationToken);
|
2015-03-21 09:10:02 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Called when [activity].
|
|
|
|
|
/// </summary>
|
|
|
|
|
void OnActivity();
|
2013-09-24 08:42:30 -07:00
|
|
|
|
}
|
|
|
|
|
}
|