From c60103df64104459883f1244363cc9cd39187545 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 6 Apr 2014 13:53:23 -0400 Subject: chromecast updates --- MediaBrowser.Controller/Dto/IDtoService.cs | 9 --------- MediaBrowser.Controller/MediaBrowser.Controller.csproj | 1 + MediaBrowser.Controller/Session/ISessionController.cs | 8 ++++++++ MediaBrowser.Controller/Session/ISessionManager.cs | 17 +++++++++++++++++ MediaBrowser.Controller/Session/PlaybackInfo.cs | 12 ++++++++++++ .../Session/PlaybackProgressInfo.cs | 18 ++++++++++++++++++ MediaBrowser.Controller/Session/SessionEventArgs.cs | 9 +++++++++ MediaBrowser.Controller/Session/SessionInfo.cs | 11 ++++++++++- 8 files changed, 75 insertions(+), 10 deletions(-) create mode 100644 MediaBrowser.Controller/Session/SessionEventArgs.cs (limited to 'MediaBrowser.Controller') diff --git a/MediaBrowser.Controller/Dto/IDtoService.cs b/MediaBrowser.Controller/Dto/IDtoService.cs index 2704959e40..d07deaf233 100644 --- a/MediaBrowser.Controller/Dto/IDtoService.cs +++ b/MediaBrowser.Controller/Dto/IDtoService.cs @@ -1,9 +1,7 @@ using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.Session; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Querying; -using MediaBrowser.Model.Session; using System; using System.Collections.Generic; @@ -21,13 +19,6 @@ namespace MediaBrowser.Controller.Dto /// UserDto. UserDto GetUserDto(User user); - /// - /// Gets the session info dto. - /// - /// The session. - /// SessionInfoDto. - SessionInfoDto GetSessionInfoDto(SessionInfo session); - /// /// Gets the dto id. /// diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 760d07611d..3082d12ca5 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -253,6 +253,7 @@ + diff --git a/MediaBrowser.Controller/Session/ISessionController.cs b/MediaBrowser.Controller/Session/ISessionController.cs index cf57f6621e..1d5fbf3590 100644 --- a/MediaBrowser.Controller/Session/ISessionController.cs +++ b/MediaBrowser.Controller/Session/ISessionController.cs @@ -89,6 +89,14 @@ namespace MediaBrowser.Controller.Session /// Task. Task SendServerShutdownNotification(CancellationToken cancellationToken); + /// + /// Sends the session ended notification. + /// + /// The session information. + /// The cancellation token. + /// Task. + Task SendSessionEndedNotification(SessionInfoDto sessionInfo, CancellationToken cancellationToken); + /// /// Sends the server restart notification. /// diff --git a/MediaBrowser.Controller/Session/ISessionManager.cs b/MediaBrowser.Controller/Session/ISessionManager.cs index 434c513360..f2edca082c 100644 --- a/MediaBrowser.Controller/Session/ISessionManager.cs +++ b/MediaBrowser.Controller/Session/ISessionManager.cs @@ -28,6 +28,16 @@ namespace MediaBrowser.Controller.Session /// event EventHandler PlaybackStopped; + /// + /// Occurs when [session started]. + /// + event EventHandler SessionStarted; + + /// + /// Occurs when [session ended]. + /// + event EventHandler SessionEnded; + /// /// Gets the sessions. /// @@ -83,6 +93,13 @@ namespace MediaBrowser.Controller.Session /// Task. Task ReportSessionEnded(Guid sessionId); + /// + /// Gets the session info dto. + /// + /// The session. + /// SessionInfoDto. + SessionInfoDto GetSessionInfoDto(SessionInfo session); + /// /// Sends the general command. /// diff --git a/MediaBrowser.Controller/Session/PlaybackInfo.cs b/MediaBrowser.Controller/Session/PlaybackInfo.cs index a97f9e0d03..2e59b6b729 100644 --- a/MediaBrowser.Controller/Session/PlaybackInfo.cs +++ b/MediaBrowser.Controller/Session/PlaybackInfo.cs @@ -40,5 +40,17 @@ namespace MediaBrowser.Controller.Session /// /// The media version identifier. public string MediaSourceId { get; set; } + + /// + /// Gets or sets the index of the audio stream. + /// + /// The index of the audio stream. + public int? AudioStreamIndex { get; set; } + + /// + /// Gets or sets the index of the subtitle stream. + /// + /// The index of the subtitle stream. + public int? SubtitleStreamIndex { get; set; } } } diff --git a/MediaBrowser.Controller/Session/PlaybackProgressInfo.cs b/MediaBrowser.Controller/Session/PlaybackProgressInfo.cs index 3d402aa6ff..9f82fcdffc 100644 --- a/MediaBrowser.Controller/Session/PlaybackProgressInfo.cs +++ b/MediaBrowser.Controller/Session/PlaybackProgressInfo.cs @@ -40,5 +40,23 @@ namespace MediaBrowser.Controller.Session /// /// The media version identifier. public string MediaSourceId { get; set; } + + /// + /// Gets or sets the volume level. + /// + /// The volume level. + public int? VolumeLevel { get; set; } + + /// + /// Gets or sets the index of the audio stream. + /// + /// The index of the audio stream. + public int? AudioStreamIndex { get; set; } + + /// + /// Gets or sets the index of the subtitle stream. + /// + /// The index of the subtitle stream. + public int? SubtitleStreamIndex { get; set; } } } diff --git a/MediaBrowser.Controller/Session/SessionEventArgs.cs b/MediaBrowser.Controller/Session/SessionEventArgs.cs new file mode 100644 index 0000000000..96daa6ec93 --- /dev/null +++ b/MediaBrowser.Controller/Session/SessionEventArgs.cs @@ -0,0 +1,9 @@ +using System; + +namespace MediaBrowser.Controller.Session +{ + public class SessionEventArgs : EventArgs + { + public SessionInfo SessionInfo { get; set; } + } +} diff --git a/MediaBrowser.Controller/Session/SessionInfo.cs b/MediaBrowser.Controller/Session/SessionInfo.cs index ef39977f03..9fcb024e8f 100644 --- a/MediaBrowser.Controller/Session/SessionInfo.cs +++ b/MediaBrowser.Controller/Session/SessionInfo.cs @@ -126,7 +126,6 @@ namespace MediaBrowser.Controller.Session /// The now playing media version identifier. public string NowPlayingMediaSourceId { get; set; } - /// /// Gets or sets the now playing run time ticks. /// @@ -150,6 +149,16 @@ namespace MediaBrowser.Controller.Session /// true if this instance is muted; otherwise, false. public bool IsMuted { get; set; } + /// + /// Gets or sets the volume level, on a scale of 0-100 + /// + /// The volume level. + public int? VolumeLevel { get; set; } + + public int? NowPlayingAudioStreamIndex { get; set; } + + public int? NowPlayingSubtitleStreamIndex { get; set; } + /// /// Gets or sets the device id. /// -- cgit v1.2.3