using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; using MediaBrowser.Model.Session; using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; namespace MediaBrowser.Controller.Session { /// /// Interface ISessionManager /// public interface ISessionManager { /// /// Occurs when [playback start]. /// event EventHandler PlaybackStart; /// /// Occurs when [playback progress]. /// event EventHandler PlaybackProgress; /// /// Occurs when [playback stopped]. /// event EventHandler PlaybackStopped; /// /// Occurs when [session started]. /// event EventHandler SessionStarted; /// /// Occurs when [session ended]. /// event EventHandler SessionEnded; /// /// Gets the sessions. /// /// The sessions. IEnumerable Sessions { get; } /// /// Adds the parts. /// /// The session factories. void AddParts(IEnumerable sessionFactories); /// /// Logs the user activity. /// /// Type of the client. /// The app version. /// The device id. /// Name of the device. /// The remote end point. /// The user. /// Task. /// user Task LogSessionActivity(string clientType, string appVersion, string deviceId, string deviceName, string remoteEndPoint, User user); /// /// Used to report that playback has started for an item /// /// The info. /// Task. Task OnPlaybackStart(PlaybackInfo info); /// /// Used to report playback progress for an item /// /// The info. /// Task. /// Task OnPlaybackProgress(PlaybackProgressInfo info); /// /// Used to report that playback has ended for an item /// /// The info. /// Task. /// Task OnPlaybackStopped(PlaybackStopInfo info); /// /// Reports the session ended. /// /// The session identifier. /// Task. Task ReportSessionEnded(Guid sessionId); /// /// Gets the session info dto. /// /// The session. /// SessionInfoDto. SessionInfoDto GetSessionInfoDto(SessionInfo session); /// /// Sends the general command. /// /// The controlling session identifier. /// The session identifier. /// The command. /// The cancellation token. /// Task. Task SendGeneralCommand(Guid controllingSessionId, Guid sessionId, GeneralCommand command, CancellationToken cancellationToken); /// /// Sends the message command. /// /// The controlling session identifier. /// The session id. /// The command. /// The cancellation token. /// Task. Task SendMessageCommand(Guid controllingSessionId, Guid sessionId, MessageCommand command, CancellationToken cancellationToken); /// /// Sends the play command. /// /// The controlling session identifier. /// The session id. /// The command. /// The cancellation token. /// Task. Task SendPlayCommand(Guid controllingSessionId, Guid sessionId, PlayRequest command, CancellationToken cancellationToken); /// /// Sends the browse command. /// /// The controlling session identifier. /// The session id. /// The command. /// The cancellation token. /// Task. Task SendBrowseCommand(Guid controllingSessionId, Guid sessionId, BrowseRequest command, CancellationToken cancellationToken); /// /// Sends the playstate command. /// /// The controlling session identifier. /// The session id. /// The command. /// The cancellation token. /// Task. Task SendPlaystateCommand(Guid controllingSessionId, Guid sessionId, PlaystateRequest command, CancellationToken cancellationToken); /// /// Sends the restart required message. /// /// The cancellation token. /// Task. Task SendRestartRequiredNotification(CancellationToken cancellationToken); /// /// Sends the server shutdown notification. /// /// The cancellation token. /// Task. Task SendServerShutdownNotification(CancellationToken cancellationToken); /// /// Sends the server restart notification. /// /// The cancellation token. /// Task. Task SendServerRestartNotification(CancellationToken cancellationToken); /// /// Adds the additional user. /// /// The session identifier. /// The user identifier. void AddAdditionalUser(Guid sessionId, Guid userId); /// /// Removes the additional user. /// /// The session identifier. /// The user identifier. void RemoveAdditionalUser(Guid sessionId, Guid userId); /// /// Authenticates the new session. /// /// The user. /// The password. /// Type of the client. /// The application version. /// The device identifier. /// Name of the device. /// The remote end point. /// Task{SessionInfo}. Task AuthenticateNewSession(User user, string password, string clientType, string appVersion, string deviceId, string deviceName, string remoteEndPoint); /// /// Reports the capabilities. /// /// The session identifier. /// The capabilities. void ReportCapabilities(Guid sessionId, SessionCapabilities capabilities); } }