From f176307e591dc8cd4fd1dabe1ebc5e22fba26d51 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 24 Sep 2013 15:54:42 -0400 Subject: support multiple remote control outputs --- .../Session/SessionManager.cs | 64 ++++++++++++++++++++++ 1 file changed, 64 insertions(+) (limited to 'MediaBrowser.Server.Implementations/Session/SessionManager.cs') diff --git a/MediaBrowser.Server.Implementations/Session/SessionManager.cs b/MediaBrowser.Server.Implementations/Session/SessionManager.cs index 5b0d957ae..79dfbc8a5 100644 --- a/MediaBrowser.Server.Implementations/Session/SessionManager.cs +++ b/MediaBrowser.Server.Implementations/Session/SessionManager.cs @@ -465,5 +465,69 @@ namespace MediaBrowser.Server.Implementations.Session return Task.WhenAll(tasks); } + + /// + /// Sends the message command. + /// + /// The session id. + /// The command. + /// The cancellation token. + /// Task. + public Task SendMessageCommand(Guid sessionId, MessageCommand command, CancellationToken cancellationToken) + { + var session = GetSessionForRemoteControl(sessionId); + + var tasks = GetControllers(session).Select(i => i.SendMessageCommand(session, command, cancellationToken)); + + return Task.WhenAll(tasks); + } + + /// + /// Sends the play command. + /// + /// The session id. + /// The command. + /// The cancellation token. + /// Task. + public Task SendPlayCommand(Guid sessionId, PlayRequest command, CancellationToken cancellationToken) + { + var session = GetSessionForRemoteControl(sessionId); + + var tasks = GetControllers(session).Select(i => i.SendPlayCommand(session, command, cancellationToken)); + + return Task.WhenAll(tasks); + } + + /// + /// Sends the browse command. + /// + /// The session id. + /// The command. + /// The cancellation token. + /// Task. + public Task SendBrowseCommand(Guid sessionId, BrowseRequest command, CancellationToken cancellationToken) + { + var session = GetSessionForRemoteControl(sessionId); + + var tasks = GetControllers(session).Select(i => i.SendBrowseCommand(session, command, cancellationToken)); + + return Task.WhenAll(tasks); + } + + /// + /// Sends the playstate command. + /// + /// The session id. + /// The command. + /// The cancellation token. + /// Task. + public Task SendPlaystateCommand(Guid sessionId, PlaystateRequest command, CancellationToken cancellationToken) + { + var session = GetSessionForRemoteControl(sessionId); + + var tasks = GetControllers(session).Select(i => i.SendPlaystateCommand(session, command, cancellationToken)); + + return Task.WhenAll(tasks); + } } } -- cgit v1.2.3