2013-05-09 17:38:02 +00:00
|
|
|
|
using MediaBrowser.Controller.Entities;
|
|
|
|
|
using MediaBrowser.Controller.Library;
|
2013-09-24 15:42:30 +00:00
|
|
|
|
using MediaBrowser.Model.Session;
|
2013-05-09 17:38:02 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2013-09-24 15:42:30 +00:00
|
|
|
|
using System.Threading;
|
2013-05-09 17:38:02 +00:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Session
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Interface ISessionManager
|
|
|
|
|
/// </summary>
|
|
|
|
|
public interface ISessionManager
|
|
|
|
|
{
|
2013-09-24 15:42:30 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Adds the parts.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="remoteControllers">The remote controllers.</param>
|
|
|
|
|
void AddParts(IEnumerable<ISessionRemoteController> remoteControllers);
|
|
|
|
|
|
2013-05-09 17:38:02 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Occurs when [playback start].
|
|
|
|
|
/// </summary>
|
|
|
|
|
event EventHandler<PlaybackProgressEventArgs> PlaybackStart;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Occurs when [playback progress].
|
|
|
|
|
/// </summary>
|
|
|
|
|
event EventHandler<PlaybackProgressEventArgs> PlaybackProgress;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Occurs when [playback stopped].
|
|
|
|
|
/// </summary>
|
|
|
|
|
event EventHandler<PlaybackProgressEventArgs> PlaybackStopped;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2013-05-10 12:18:07 +00:00
|
|
|
|
/// Gets the sessions.
|
2013-05-09 17:38:02 +00:00
|
|
|
|
/// </summary>
|
2013-05-10 12:18:07 +00:00
|
|
|
|
/// <value>The sessions.</value>
|
|
|
|
|
IEnumerable<SessionInfo> Sessions { get; }
|
2013-05-09 17:38:02 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Logs the user activity.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="clientType">Type of the client.</param>
|
2013-07-09 16:11:16 +00:00
|
|
|
|
/// <param name="appVersion">The app version.</param>
|
2013-05-09 17:38:02 +00:00
|
|
|
|
/// <param name="deviceId">The device id.</param>
|
|
|
|
|
/// <param name="deviceName">Name of the device.</param>
|
|
|
|
|
/// <param name="user">The user.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
/// <exception cref="System.ArgumentNullException">user</exception>
|
2013-07-09 16:11:16 +00:00
|
|
|
|
Task<SessionInfo> LogConnectionActivity(string clientType, string appVersion, string deviceId, string deviceName, User user);
|
2013-05-09 17:38:02 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Used to report that playback has started for an item
|
|
|
|
|
/// </summary>
|
2013-09-24 15:08:51 +00:00
|
|
|
|
/// <param name="info">The info.</param>
|
2013-07-09 16:11:16 +00:00
|
|
|
|
/// <returns>Task.</returns>
|
2013-09-24 15:08:51 +00:00
|
|
|
|
Task OnPlaybackStart(PlaybackInfo info);
|
2013-05-09 17:38:02 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Used to report playback progress for an item
|
|
|
|
|
/// </summary>
|
2013-09-30 15:05:07 +00:00
|
|
|
|
/// <param name="info">The info.</param>
|
2013-05-09 17:38:02 +00:00
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
/// <exception cref="System.ArgumentNullException"></exception>
|
2013-09-30 15:05:07 +00:00
|
|
|
|
Task OnPlaybackProgress(PlaybackProgressInfo info);
|
2013-05-09 17:38:02 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Used to report that playback has ended for an item
|
|
|
|
|
/// </summary>
|
2013-09-30 15:05:07 +00:00
|
|
|
|
/// <param name="info">The info.</param>
|
2013-05-09 17:38:02 +00:00
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
/// <exception cref="System.ArgumentNullException"></exception>
|
2013-09-30 15:05:07 +00:00
|
|
|
|
Task OnPlaybackStopped(PlaybackStopInfo info);
|
2013-09-24 15:42:30 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sends the system command.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sessionId">The session id.</param>
|
|
|
|
|
/// <param name="command">The command.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task SendSystemCommand(Guid sessionId, SystemCommand command, CancellationToken cancellationToken);
|
2013-09-24 19:54:42 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sends the message command.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sessionId">The session id.</param>
|
|
|
|
|
/// <param name="command">The command.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task SendMessageCommand(Guid sessionId, MessageCommand command, CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sends the play command.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sessionId">The session id.</param>
|
|
|
|
|
/// <param name="command">The command.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task SendPlayCommand(Guid sessionId, PlayRequest command, CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sends the browse command.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sessionId">The session id.</param>
|
|
|
|
|
/// <param name="command">The command.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task SendBrowseCommand(Guid sessionId, BrowseRequest command, CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sends the playstate command.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sessionId">The session id.</param>
|
|
|
|
|
/// <param name="command">The command.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task SendPlaystateCommand(Guid sessionId, PlaystateRequest command, CancellationToken cancellationToken);
|
2013-05-09 17:38:02 +00:00
|
|
|
|
}
|
|
|
|
|
}
|