diff options
| author | 7illusions <z@7illusions.com> | 2014-05-12 16:55:07 +0200 |
|---|---|---|
| committer | 7illusions <z@7illusions.com> | 2014-05-12 16:55:07 +0200 |
| commit | baf5cf2544fcaad2246923f60caaf3fed4a94aaf (patch) | |
| tree | a808b700095f876e437b95c432c0220e241f9fda /MediaBrowser.Model/ApiClient | |
| parent | 8f3a6279e173dcbaaa05a56556afb410ee12dd4d (diff) | |
| parent | b9b568de13d81f9db1a8502d50940475c1d79c72 (diff) | |
Merge pull request #3 from MediaBrowser/master
Sync with Master
Diffstat (limited to 'MediaBrowser.Model/ApiClient')
| -rw-r--r-- | MediaBrowser.Model/ApiClient/GeneralCommandEventArgs.cs | 23 | ||||
| -rw-r--r-- | MediaBrowser.Model/ApiClient/IApiClient.cs | 64 | ||||
| -rw-r--r-- | MediaBrowser.Model/ApiClient/IServerEvents.cs | 57 | ||||
| -rw-r--r-- | MediaBrowser.Model/ApiClient/ServerEventArgs.cs | 177 | ||||
| -rw-r--r-- | MediaBrowser.Model/ApiClient/SessionUpdatesEventArgs.cs | 13 |
5 files changed, 110 insertions, 224 deletions
diff --git a/MediaBrowser.Model/ApiClient/GeneralCommandEventArgs.cs b/MediaBrowser.Model/ApiClient/GeneralCommandEventArgs.cs new file mode 100644 index 000000000..ce518a7cc --- /dev/null +++ b/MediaBrowser.Model/ApiClient/GeneralCommandEventArgs.cs @@ -0,0 +1,23 @@ +using MediaBrowser.Model.Session; +using System; + +namespace MediaBrowser.Model.ApiClient +{ + /// <summary> + /// Class SystemCommandEventArgs + /// </summary> + public class GeneralCommandEventArgs : EventArgs + { + /// <summary> + /// Gets or sets the command. + /// </summary> + /// <value>The command.</value> + public GeneralCommand Command { get; set; } + + /// <summary> + /// Gets or sets the type of the known command. + /// </summary> + /// <value>The type of the known command.</value> + public GeneralCommandType? KnownCommandType { get; set; } + } +} diff --git a/MediaBrowser.Model/ApiClient/IApiClient.cs b/MediaBrowser.Model/ApiClient/IApiClient.cs index dd1603d01..e12a6cf2b 100644 --- a/MediaBrowser.Model/ApiClient/IApiClient.cs +++ b/MediaBrowser.Model/ApiClient/IApiClient.cs @@ -138,7 +138,7 @@ namespace MediaBrowser.Model.ApiClient /// <param name="notificationIdList">The notification id list.</param> /// <param name="isRead">if set to <c>true</c> [is read].</param> /// <returns>Task.</returns> - Task MarkNotificationsRead(string userId, IEnumerable<Guid> notificationIdList, bool isRead); + Task MarkNotificationsRead(string userId, IEnumerable<string> notificationIdList, bool isRead); /// <summary> /// Gets the notifications summary. @@ -447,7 +447,7 @@ namespace MediaBrowser.Model.ApiClient /// <param name="id">The id.</param> /// <returns>Task{TaskInfo}.</returns> /// <exception cref="ArgumentNullException">id</exception> - Task<TaskInfo> GetScheduledTaskAsync(Guid id); + Task<TaskInfo> GetScheduledTaskAsync(string id); /// <summary> /// Gets a user by id @@ -582,6 +582,38 @@ namespace MediaBrowser.Model.ApiClient Task SendCommandAsync(string sessionId, GeneralCommand command); /// <summary> + /// Sends the string. + /// </summary> + /// <param name="sessionId">The session identifier.</param> + /// <param name="text">The text.</param> + /// <returns>Task.</returns> + Task SendString(string sessionId, string text); + + /// <summary> + /// Sets the volume. + /// </summary> + /// <param name="sessionId">The session identifier.</param> + /// <param name="volume">The volume.</param> + /// <returns>Task.</returns> + Task SetVolume(string sessionId, int volume); + + /// <summary> + /// Sets the index of the audio stream. + /// </summary> + /// <param name="sessionId">The session identifier.</param> + /// <param name="index">The index.</param> + /// <returns>Task.</returns> + Task SetAudioStreamIndex(string sessionId, int index); + + /// <summary> + /// Sets the index of the subtitle stream. + /// </summary> + /// <param name="sessionId">The session identifier.</param> + /// <param name="index">The index.</param> + /// <returns>Task.</returns> + Task SetSubtitleStreamIndex(string sessionId, int? index); + + /// <summary> /// Instructs the client to display a message to the user /// </summary> /// <param name="sessionId">The session id.</param> @@ -632,7 +664,7 @@ namespace MediaBrowser.Model.ApiClient /// <param name="triggers">The triggers.</param> /// <returns>Task{RequestResult}.</returns> /// <exception cref="ArgumentNullException">id</exception> - Task UpdateScheduledTaskTriggersAsync(Guid id, TaskTriggerInfo[] triggers); + Task UpdateScheduledTaskTriggersAsync(string id, TaskTriggerInfo[] triggers); /// <summary> /// Gets the display preferences. @@ -760,7 +792,7 @@ namespace MediaBrowser.Model.ApiClient /// </summary> /// <param name="options">The options.</param> /// <returns>System.String.</returns> - string GetSubtitleUrl(SubtitleOptions options); + string GetSubtitleUrl(SubtitleDownloadOptions options); /// <summary> /// Gets an image url that can be used to download an image from the api @@ -893,30 +925,6 @@ namespace MediaBrowser.Model.ApiClient string GetThumbImageUrl(BaseItemDto item, ImageOptions options); /// <summary> - /// Gets the url needed to stream an audio file - /// </summary> - /// <param name="options">The options.</param> - /// <returns>System.String.</returns> - /// <exception cref="ArgumentNullException">options</exception> - string GetAudioStreamUrl(StreamOptions options); - - /// <summary> - /// Gets the url needed to stream a video file - /// </summary> - /// <param name="options">The options.</param> - /// <returns>System.String.</returns> - /// <exception cref="ArgumentNullException">options</exception> - string GetVideoStreamUrl(VideoStreamOptions options); - - /// <summary> - /// Formulates a url for streaming video using the HLS protocol - /// </summary> - /// <param name="options">The options.</param> - /// <returns>System.String.</returns> - /// <exception cref="ArgumentNullException">options</exception> - string GetHlsVideoStreamUrl(VideoStreamOptions options); - - /// <summary> /// Gets the live tv information asynchronous. /// </summary> /// <param name="cancellationToken">The cancellation token.</param> diff --git a/MediaBrowser.Model/ApiClient/IServerEvents.cs b/MediaBrowser.Model/ApiClient/IServerEvents.cs index e13f3cc2c..62d8fdff3 100644 --- a/MediaBrowser.Model/ApiClient/IServerEvents.cs +++ b/MediaBrowser.Model/ApiClient/IServerEvents.cs @@ -1,4 +1,11 @@ -using System; +using MediaBrowser.Model.Dto; +using MediaBrowser.Model.Entities; +using MediaBrowser.Model.Events; +using MediaBrowser.Model.Plugins; +using MediaBrowser.Model.Session; +using MediaBrowser.Model.Tasks; +using MediaBrowser.Model.Updates; +using System; namespace MediaBrowser.Model.ApiClient { @@ -10,59 +17,55 @@ namespace MediaBrowser.Model.ApiClient /// <summary> /// Occurs when [user deleted]. /// </summary> - event EventHandler<UserDeletedEventArgs> UserDeleted; - /// <summary> - /// Occurs when [scheduled task started]. - /// </summary> - event EventHandler<ScheduledTaskStartedEventArgs> ScheduledTaskStarted; + event EventHandler<GenericEventArgs<string>> UserDeleted; /// <summary> /// Occurs when [scheduled task ended]. /// </summary> - event EventHandler<ScheduledTaskEndedEventArgs> ScheduledTaskEnded; + event EventHandler<GenericEventArgs<TaskResult>> ScheduledTaskEnded; /// <summary> /// Occurs when [package installing]. /// </summary> - event EventHandler<PackageInstallationEventArgs> PackageInstalling; + event EventHandler<GenericEventArgs<InstallationInfo>> PackageInstalling; /// <summary> /// Occurs when [package installation failed]. /// </summary> - event EventHandler<PackageInstallationEventArgs> PackageInstallationFailed; + event EventHandler<GenericEventArgs<InstallationInfo>> PackageInstallationFailed; /// <summary> /// Occurs when [package installation completed]. /// </summary> - event EventHandler<PackageInstallationEventArgs> PackageInstallationCompleted; + event EventHandler<GenericEventArgs<InstallationInfo>> PackageInstallationCompleted; /// <summary> /// Occurs when [package installation cancelled]. /// </summary> - event EventHandler<PackageInstallationEventArgs> PackageInstallationCancelled; + event EventHandler<GenericEventArgs<InstallationInfo>> PackageInstallationCancelled; /// <summary> /// Occurs when [user updated]. /// </summary> - event EventHandler<UserUpdatedEventArgs> UserUpdated; + event EventHandler<GenericEventArgs<UserDto>> UserUpdated; /// <summary> /// Occurs when [plugin uninstalled]. /// </summary> - event EventHandler<PluginUninstallEventArgs> PluginUninstalled; + event EventHandler<GenericEventArgs<PluginInfo>> PluginUninstalled; /// <summary> /// Occurs when [library changed]. /// </summary> - event EventHandler<LibraryChangedEventArgs> LibraryChanged; + event EventHandler<GenericEventArgs<LibraryUpdateInfo>> LibraryChanged; /// <summary> /// Occurs when [browse command]. /// </summary> - event EventHandler<BrowseRequestEventArgs> BrowseCommand; + event EventHandler<GenericEventArgs<BrowseRequest>> BrowseCommand; /// <summary> /// Occurs when [play command]. /// </summary> - event EventHandler<PlayRequestEventArgs> PlayCommand; + event EventHandler<GenericEventArgs<PlayRequest>> PlayCommand; /// <summary> /// Occurs when [playstate command]. /// </summary> - event EventHandler<PlaystateRequestEventArgs> PlaystateCommand; + event EventHandler<GenericEventArgs<PlaystateRequest>> PlaystateCommand; /// <summary> /// Occurs when [message command]. /// </summary> - event EventHandler<MessageCommandEventArgs> MessageCommand; + event EventHandler<GenericEventArgs<MessageCommand>> MessageCommand; /// <summary> /// Occurs when [system command]. /// </summary> @@ -88,6 +91,22 @@ namespace MediaBrowser.Model.ApiClient /// </summary> event EventHandler<EventArgs> ServerShuttingDown; /// <summary> + /// Occurs when [send text command]. + /// </summary> + event EventHandler<GenericEventArgs<string>> SendStringCommand; + /// <summary> + /// Occurs when [set volume command]. + /// </summary> + event EventHandler<GenericEventArgs<int>> SetVolumeCommand; + /// <summary> + /// Occurs when [set audio stream index command]. + /// </summary> + event EventHandler<GenericEventArgs<int>> SetAudioStreamIndexCommand; + /// <summary> + /// Occurs when [set video stream index command]. + /// </summary> + event EventHandler<GenericEventArgs<int>> SetSubtitleStreamIndexCommand; + /// <summary> /// Occurs when [sessions updated]. /// </summary> event EventHandler<SessionUpdatesEventArgs> SessionsUpdated; @@ -98,7 +117,7 @@ namespace MediaBrowser.Model.ApiClient /// <summary> /// Occurs when [user data changed]. /// </summary> - event EventHandler<UserDataChangedEventArgs> UserDataChanged; + event EventHandler<GenericEventArgs<UserDataChangeInfo>> UserDataChanged; /// <summary> /// Occurs when [connected]. /// </summary> diff --git a/MediaBrowser.Model/ApiClient/ServerEventArgs.cs b/MediaBrowser.Model/ApiClient/ServerEventArgs.cs deleted file mode 100644 index 6637edd74..000000000 --- a/MediaBrowser.Model/ApiClient/ServerEventArgs.cs +++ /dev/null @@ -1,177 +0,0 @@ -using MediaBrowser.Model.Dto; -using MediaBrowser.Model.Entities; -using MediaBrowser.Model.Plugins; -using MediaBrowser.Model.Session; -using MediaBrowser.Model.Tasks; -using MediaBrowser.Model.Updates; -using System; - -namespace MediaBrowser.Model.ApiClient -{ - /// <summary> - /// Class UserDeletedEventArgs - /// </summary> - public class UserDeletedEventArgs : EventArgs - { - /// <summary> - /// Gets or sets the id. - /// </summary> - /// <value>The id.</value> - public string Id { get; set; } - } - - public class UserDataChangedEventArgs : EventArgs - { - /// <summary> - /// Gets or sets the user. - /// </summary> - /// <value>The user.</value> - public UserDataChangeInfo ChangeInfo { get; set; } - } - - /// <summary> - /// Class UserUpdatedEventArgs - /// </summary> - public class UserUpdatedEventArgs : EventArgs - { - /// <summary> - /// Gets or sets the user. - /// </summary> - /// <value>The user.</value> - public UserDto User { get; set; } - } - - /// <summary> - /// Class ScheduledTaskStartedEventArgs - /// </summary> - public class ScheduledTaskStartedEventArgs : EventArgs - { - /// <summary> - /// Gets or sets the name. - /// </summary> - /// <value>The name.</value> - public string Name { get; set; } - } - - /// <summary> - /// Class ScheduledTaskEndedEventArgs - /// </summary> - public class ScheduledTaskEndedEventArgs : EventArgs - { - /// <summary> - /// Gets or sets the result. - /// </summary> - /// <value>The result.</value> - public TaskResult Result { get; set; } - } - - /// <summary> - /// Class PackageInstallationEventArgs - /// </summary> - public class PackageInstallationEventArgs : EventArgs - { - /// <summary> - /// Gets or sets the installation info. - /// </summary> - /// <value>The installation info.</value> - public InstallationInfo InstallationInfo { get; set; } - } - - /// <summary> - /// Class PluginUninstallEventArgs - /// </summary> - public class PluginUninstallEventArgs : EventArgs - { - /// <summary> - /// Gets or sets the plugin info. - /// </summary> - /// <value>The plugin info.</value> - public PluginInfo PluginInfo { get; set; } - } - - /// <summary> - /// Class LibraryChangedEventArgs - /// </summary> - public class LibraryChangedEventArgs : EventArgs - { - /// <summary> - /// Gets or sets the update info. - /// </summary> - /// <value>The update info.</value> - public LibraryUpdateInfo UpdateInfo { get; set; } - } - - /// <summary> - /// Class BrowseRequestEventArgs - /// </summary> - public class BrowseRequestEventArgs : EventArgs - { - /// <summary> - /// Gets or sets the request. - /// </summary> - /// <value>The request.</value> - public BrowseRequest Request { get; set; } - } - - /// <summary> - /// Class PlayRequestEventArgs - /// </summary> - public class PlayRequestEventArgs : EventArgs - { - /// <summary> - /// Gets or sets the request. - /// </summary> - /// <value>The request.</value> - public PlayRequest Request { get; set; } - } - - /// <summary> - /// Class PlaystateRequestEventArgs - /// </summary> - public class PlaystateRequestEventArgs : EventArgs - { - /// <summary> - /// Gets or sets the request. - /// </summary> - /// <value>The request.</value> - public PlaystateRequest Request { get; set; } - } - - /// <summary> - /// Class MessageCommandEventArgs - /// </summary> - public class MessageCommandEventArgs : EventArgs - { - /// <summary> - /// Gets or sets the request. - /// </summary> - /// <value>The request.</value> - public MessageCommand Request { get; set; } - } - - /// <summary> - /// Class SystemCommandEventArgs - /// </summary> - public class GeneralCommandEventArgs : EventArgs - { - /// <summary> - /// Gets or sets the command. - /// </summary> - /// <value>The command.</value> - public GeneralCommand Command { get; set; } - - /// <summary> - /// Gets or sets the type of the known command. - /// </summary> - /// <value>The type of the known command.</value> - public GeneralCommandType? KnownCommandType { get; set; } - } - - /// <summary> - /// Class SessionUpdatesEventArgs - /// </summary> - public class SessionUpdatesEventArgs : EventArgs - { - public SessionInfoDto[] Sessions { get; set; } - } -} diff --git a/MediaBrowser.Model/ApiClient/SessionUpdatesEventArgs.cs b/MediaBrowser.Model/ApiClient/SessionUpdatesEventArgs.cs new file mode 100644 index 000000000..483ee45d0 --- /dev/null +++ b/MediaBrowser.Model/ApiClient/SessionUpdatesEventArgs.cs @@ -0,0 +1,13 @@ +using System; +using MediaBrowser.Model.Session; + +namespace MediaBrowser.Model.ApiClient +{ + /// <summary> + /// Class SessionUpdatesEventArgs + /// </summary> + public class SessionUpdatesEventArgs : EventArgs + { + public SessionInfoDto[] Sessions { get; set; } + } +}
\ No newline at end of file |
