From 35a7986b3f2c40e66bb7da6a9ae91b38cc763422 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 9 May 2013 18:43:11 -0400 Subject: added model classes for remote control --- MediaBrowser.Model/Session/BrowseRequest.cs | 37 +++++++++++++++ MediaBrowser.Model/Session/PlayRequest.cs | 46 +++++++++++++++++++ MediaBrowser.Model/Session/PlaystateRequest.cs | 53 ++++++++++++++++++++++ MediaBrowser.Model/Session/SessionInfo.cs | 59 ------------------------ MediaBrowser.Model/Session/SessionInfoDto.cs | 62 ++++++++++++++++++++++++++ 5 files changed, 198 insertions(+), 59 deletions(-) create mode 100644 MediaBrowser.Model/Session/BrowseRequest.cs create mode 100644 MediaBrowser.Model/Session/PlayRequest.cs create mode 100644 MediaBrowser.Model/Session/PlaystateRequest.cs delete mode 100644 MediaBrowser.Model/Session/SessionInfo.cs create mode 100644 MediaBrowser.Model/Session/SessionInfoDto.cs (limited to 'MediaBrowser.Model/Session') diff --git a/MediaBrowser.Model/Session/BrowseRequest.cs b/MediaBrowser.Model/Session/BrowseRequest.cs new file mode 100644 index 0000000000..3d10b3bfd7 --- /dev/null +++ b/MediaBrowser.Model/Session/BrowseRequest.cs @@ -0,0 +1,37 @@ + +namespace MediaBrowser.Model.Session +{ + /// + /// Class BrowseRequest + /// + public class BrowseRequest + { + /// + /// Artist, Genre, Studio, Person, or any kind of BaseItem + /// + /// The type of the item. + public string ItemType { get; set; } + + /// + /// Artist name, genre name, item Id, etc + /// + /// The item identifier. + public string ItemIdentifier { get; set; } + + /// + /// Gets or sets the context (Movies, Music, Tv, etc) + /// Applicable to genres, studios and persons only because the context of items and artists can be inferred. + /// This is optional to supply and clients are free to ignore it. + /// + /// The context. + public string Context { get; set; } + } + + public class ItemContext + { + public const string Music = "Music"; + public const string Movies = "Movies"; + public const string TvShows = "TvShows"; + public const string Games = "Games"; + } +} diff --git a/MediaBrowser.Model/Session/PlayRequest.cs b/MediaBrowser.Model/Session/PlayRequest.cs new file mode 100644 index 0000000000..c9bb586931 --- /dev/null +++ b/MediaBrowser.Model/Session/PlayRequest.cs @@ -0,0 +1,46 @@ + +namespace MediaBrowser.Model.Session +{ + /// + /// Class PlayRequest + /// + public class PlayRequest + { + /// + /// Gets or sets the item ids. + /// + /// The item ids. + public string[] ItemIds { get; set; } + + /// + /// Gets or sets the start position ticks that the first item should be played at + /// + /// The start position ticks. + public long? StartPositionTicks { get; set; } + + /// + /// Gets or sets the play command. + /// + /// The play command. + public PlayCommand PlayCommand { get; set; } + } + + /// + /// Enum PlayCommand + /// + public enum PlayCommand + { + /// + /// The play now + /// + PlayNow, + /// + /// The play next + /// + PlayNext, + /// + /// The play last + /// + PlayLast + } +} diff --git a/MediaBrowser.Model/Session/PlaystateRequest.cs b/MediaBrowser.Model/Session/PlaystateRequest.cs new file mode 100644 index 0000000000..4db06c3d68 --- /dev/null +++ b/MediaBrowser.Model/Session/PlaystateRequest.cs @@ -0,0 +1,53 @@ + +namespace MediaBrowser.Model.Session +{ + /// + /// Class PlaystateRequest + /// + public class PlaystateRequest + { + /// + /// Gets or sets the command. + /// + /// The command. + public PlaystateCommand Command { get; set; } + + /// + /// Gets or sets the seek position. + /// Only applicable to seek commands. + /// + /// The seek position. + public long SeekPosition { get; set; } + } + + /// + /// Enum PlaystateCommand + /// + public enum PlaystateCommand + { + /// + /// The stop + /// + Stop, + /// + /// The pause + /// + Pause, + /// + /// The unpause + /// + Unpause, + /// + /// The next track + /// + NextTrack, + /// + /// The previous track + /// + PreviousTrack, + /// + /// The seek + /// + Seek + } +} diff --git a/MediaBrowser.Model/Session/SessionInfo.cs b/MediaBrowser.Model/Session/SessionInfo.cs deleted file mode 100644 index f74db90583..0000000000 --- a/MediaBrowser.Model/Session/SessionInfo.cs +++ /dev/null @@ -1,59 +0,0 @@ -using MediaBrowser.Model.Entities; -using System; - -namespace MediaBrowser.Model.Session -{ - /// - /// Class SessionInfo - /// - public class SessionInfo - { - /// - /// Gets or sets the id. - /// - /// The id. - public Guid Id { get; set; } - - /// - /// Gets or sets the user id. - /// - /// The user id. - public string UserId { get; set; } - - /// - /// Gets or sets the type of the client. - /// - /// The type of the client. - public string Client { get; set; } - - /// - /// Gets or sets the last activity date. - /// - /// The last activity date. - public DateTime LastActivityDate { get; set; } - - /// - /// Gets or sets the name of the device. - /// - /// The name of the device. - public string DeviceName { get; set; } - - /// - /// Gets or sets the now playing item. - /// - /// The now playing item. - public BaseItemInfo NowPlayingItem { get; set; } - - /// - /// Gets or sets the now playing position ticks. - /// - /// The now playing position ticks. - public long? NowPlayingPositionTicks { get; set; } - - /// - /// Gets or sets the device id. - /// - /// The device id. - public string DeviceId { get; set; } - } -} diff --git a/MediaBrowser.Model/Session/SessionInfoDto.cs b/MediaBrowser.Model/Session/SessionInfoDto.cs new file mode 100644 index 0000000000..0548876a11 --- /dev/null +++ b/MediaBrowser.Model/Session/SessionInfoDto.cs @@ -0,0 +1,62 @@ +using MediaBrowser.Model.Entities; +using System; + +namespace MediaBrowser.Model.Session +{ + public class SessionInfoDto + { + /// + /// Gets or sets the id. + /// + /// The id. + public Guid Id { get; set; } + + /// + /// Gets or sets the user id. + /// + /// The user id. + public string UserId { get; set; } + + /// + /// Gets or sets the type of the client. + /// + /// The type of the client. + public string Client { get; set; } + + /// + /// Gets or sets the last activity date. + /// + /// The last activity date. + public DateTime LastActivityDate { get; set; } + + /// + /// Gets or sets the name of the device. + /// + /// The name of the device. + public string DeviceName { get; set; } + + /// + /// Gets or sets the now playing item. + /// + /// The now playing item. + public BaseItemInfo NowPlayingItem { get; set; } + + /// + /// Gets or sets the now playing position ticks. + /// + /// The now playing position ticks. + public long? NowPlayingPositionTicks { get; set; } + + /// + /// Gets or sets the device id. + /// + /// The device id. + public string DeviceId { get; set; } + + /// + /// Gets or sets a value indicating whether [supports remote control]. + /// + /// true if [supports remote control]; otherwise, false. + public bool SupportsRemoteControl { get; set; } + } +} -- cgit v1.2.3