From 29fd559f0a87dfe4667293251397f8a758a3c826 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 30 Sep 2013 11:05:07 -0400 Subject: made session a little more flexible for playing non-library items --- MediaBrowser.Controller/Session/ISessionManager.cs | 14 +++----- .../Session/PlaybackProgressInfo.cs | 38 ++++++++++++++++++++++ .../Session/PlaybackStopInfo.cs | 26 +++++++++++++++ 3 files changed, 68 insertions(+), 10 deletions(-) create mode 100644 MediaBrowser.Controller/Session/PlaybackProgressInfo.cs create mode 100644 MediaBrowser.Controller/Session/PlaybackStopInfo.cs (limited to 'MediaBrowser.Controller/Session') diff --git a/MediaBrowser.Controller/Session/ISessionManager.cs b/MediaBrowser.Controller/Session/ISessionManager.cs index 0932ee52d5..138aa1fc36 100644 --- a/MediaBrowser.Controller/Session/ISessionManager.cs +++ b/MediaBrowser.Controller/Session/ISessionManager.cs @@ -62,24 +62,18 @@ namespace MediaBrowser.Controller.Session /// /// Used to report playback progress for an item /// - /// The item. - /// The position ticks. - /// if set to true [is paused]. - /// if set to true [is muted]. - /// The session id. + /// The info. /// Task. /// - Task OnPlaybackProgress(BaseItem item, long? positionTicks, bool isPaused, bool isMuted, Guid sessionId); + Task OnPlaybackProgress(PlaybackProgressInfo info); /// /// Used to report that playback has ended for an item /// - /// The item. - /// The position ticks. - /// The session id. + /// The info. /// Task. /// - Task OnPlaybackStopped(BaseItem item, long? positionTicks, Guid sessionId); + Task OnPlaybackStopped(PlaybackStopInfo info); /// /// Sends the system command. diff --git a/MediaBrowser.Controller/Session/PlaybackProgressInfo.cs b/MediaBrowser.Controller/Session/PlaybackProgressInfo.cs new file mode 100644 index 0000000000..a075432605 --- /dev/null +++ b/MediaBrowser.Controller/Session/PlaybackProgressInfo.cs @@ -0,0 +1,38 @@ +using MediaBrowser.Controller.Entities; +using System; + +namespace MediaBrowser.Controller.Session +{ + public class PlaybackProgressInfo + { + /// + /// Gets or sets the item. + /// + /// The item. + public BaseItem Item { get; set; } + + /// + /// Gets or sets the session id. + /// + /// The session id. + public Guid SessionId { get; set; } + + /// + /// Gets or sets a value indicating whether this instance is paused. + /// + /// true if this instance is paused; otherwise, false. + public bool IsPaused { get; set; } + + /// + /// Gets or sets a value indicating whether this instance is muted. + /// + /// true if this instance is muted; otherwise, false. + public bool IsMuted { get; set; } + + /// + /// Gets or sets the position ticks. + /// + /// The position ticks. + public long? PositionTicks { get; set; } + } +} diff --git a/MediaBrowser.Controller/Session/PlaybackStopInfo.cs b/MediaBrowser.Controller/Session/PlaybackStopInfo.cs new file mode 100644 index 0000000000..5d1ce01315 --- /dev/null +++ b/MediaBrowser.Controller/Session/PlaybackStopInfo.cs @@ -0,0 +1,26 @@ +using MediaBrowser.Controller.Entities; +using System; + +namespace MediaBrowser.Controller.Session +{ + public class PlaybackStopInfo + { + /// + /// Gets or sets the item. + /// + /// The item. + public BaseItem Item { get; set; } + + /// + /// Gets or sets the session id. + /// + /// The session id. + public Guid SessionId { get; set; } + + /// + /// Gets or sets the position ticks. + /// + /// The position ticks. + public long? PositionTicks { get; set; } + } +} -- cgit v1.2.3