diff options
| author | tikuf <admin@nyalindee.com> | 2014-04-02 08:55:36 +1100 |
|---|---|---|
| committer | tikuf <admin@nyalindee.com> | 2014-04-02 08:55:36 +1100 |
| commit | 8882925dab080eb236a5cc896f48ed99711d76a8 (patch) | |
| tree | cbfa2811dfff4c818d34de926f68be2ef8a78948 /MediaBrowser.Controller | |
| parent | 241be6dd93f6e0ec96ef88f0182b8985eb275995 (diff) | |
| parent | 4afe2c3f731562efbe42147d1bcbdc0a7542cfeb (diff) | |
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.Controller')
| -rw-r--r-- | MediaBrowser.Controller/Dlna/DeviceProfile.cs | 16 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Dlna/ResponseProfile.cs (renamed from MediaBrowser.Controller/Dlna/MediaProfile.cs) | 4 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Dlna/TranscodingProfile.cs | 23 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Dto/IDtoService.cs | 7 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Library/IMusicManager.cs | 38 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/ILiveTvRecording.cs | 4 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Localization/ILocalizationManager.cs | 39 | ||||
| -rw-r--r-- | MediaBrowser.Controller/MediaBrowser.Controller.csproj | 6 | ||||
| -rw-r--r-- | MediaBrowser.Controller/MediaEncoding/EncodingOptions.cs | 79 | ||||
| -rw-r--r-- | MediaBrowser.Controller/MediaEncoding/EncodingResult.cs | 13 | ||||
| -rw-r--r-- | MediaBrowser.Controller/MediaEncoding/VideoEncodingOptions.cs | 26 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Session/ISessionController.cs | 10 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Session/ISessionManager.cs | 8 |
13 files changed, 226 insertions, 47 deletions
diff --git a/MediaBrowser.Controller/Dlna/DeviceProfile.cs b/MediaBrowser.Controller/Dlna/DeviceProfile.cs index c1fc713e4..bb9629c28 100644 --- a/MediaBrowser.Controller/Dlna/DeviceProfile.cs +++ b/MediaBrowser.Controller/Dlna/DeviceProfile.cs @@ -74,13 +74,13 @@ namespace MediaBrowser.Controller.Dlna public ContainerProfile[] ContainerProfiles { get; set; } public CodecProfile[] CodecProfiles { get; set; } - public MediaProfile[] MediaProfiles { get; set; } + public ResponseProfile[] ResponseProfiles { get; set; } public DeviceProfile() { DirectPlayProfiles = new DirectPlayProfile[] { }; TranscodingProfiles = new TranscodingProfile[] { }; - MediaProfiles = new MediaProfile[] { }; + ResponseProfiles = new ResponseProfile[] { }; CodecProfiles = new CodecProfile[] { }; ContainerProfiles = new ContainerProfile[] { }; @@ -147,11 +147,11 @@ namespace MediaBrowser.Controller.Dlna }); } - public MediaProfile GetAudioMediaProfile(string container, string audioCodec, MediaStream audioStream) + public ResponseProfile GetAudioMediaProfile(string container, string audioCodec, MediaStream audioStream) { container = (container ?? string.Empty).TrimStart('.'); - return MediaProfiles.FirstOrDefault(i => + return ResponseProfiles.FirstOrDefault(i => { if (i.Type != DlnaProfileType.Audio) { @@ -174,11 +174,11 @@ namespace MediaBrowser.Controller.Dlna }); } - public MediaProfile GetVideoMediaProfile(string container, string audioCodec, string videoCodec, MediaStream audioStream, MediaStream videoStream) + public ResponseProfile GetVideoMediaProfile(string container, string audioCodec, string videoCodec, MediaStream audioStream, MediaStream videoStream) { container = (container ?? string.Empty).TrimStart('.'); - return MediaProfiles.FirstOrDefault(i => + return ResponseProfiles.FirstOrDefault(i => { if (i.Type != DlnaProfileType.Video) { @@ -207,11 +207,11 @@ namespace MediaBrowser.Controller.Dlna }); } - public MediaProfile GetPhotoMediaProfile(string container) + public ResponseProfile GetPhotoMediaProfile(string container) { container = (container ?? string.Empty).TrimStart('.'); - return MediaProfiles.FirstOrDefault(i => + return ResponseProfiles.FirstOrDefault(i => { if (i.Type != DlnaProfileType.Photo) { diff --git a/MediaBrowser.Controller/Dlna/MediaProfile.cs b/MediaBrowser.Controller/Dlna/ResponseProfile.cs index bf3057294..163a95d5a 100644 --- a/MediaBrowser.Controller/Dlna/MediaProfile.cs +++ b/MediaBrowser.Controller/Dlna/ResponseProfile.cs @@ -4,7 +4,7 @@ using System.Xml.Serialization; namespace MediaBrowser.Controller.Dlna { - public class MediaProfile + public class ResponseProfile { [XmlAttribute("container")] public string Container { get; set; } @@ -26,7 +26,7 @@ namespace MediaBrowser.Controller.Dlna public ProfileCondition[] Conditions { get; set; } - public MediaProfile() + public ResponseProfile() { Conditions = new ProfileCondition[] {}; } diff --git a/MediaBrowser.Controller/Dlna/TranscodingProfile.cs b/MediaBrowser.Controller/Dlna/TranscodingProfile.cs index 707f0c573..704ba54d2 100644 --- a/MediaBrowser.Controller/Dlna/TranscodingProfile.cs +++ b/MediaBrowser.Controller/Dlna/TranscodingProfile.cs @@ -30,13 +30,8 @@ namespace MediaBrowser.Controller.Dlna [XmlAttribute("transcodeSeekInfo")] public TranscodeSeekInfo TranscodeSeekInfo { get; set; } - public TranscodingSetting[] Settings { get; set; } - - public TranscodingProfile() - { - Settings = new TranscodingSetting[] { }; - } - + [XmlAttribute("videoProfile")] + public string VideoProfile { get; set; } public List<string> GetAudioCodecs() { @@ -44,20 +39,6 @@ namespace MediaBrowser.Controller.Dlna } } - public class TranscodingSetting - { - [XmlAttribute("name")] - public TranscodingSettingType Name { get; set; } - - [XmlAttribute("value")] - public string Value { get; set; } - } - - public enum TranscodingSettingType - { - VideoProfile = 0 - } - public enum TranscodeSeekInfo { Auto = 0, diff --git a/MediaBrowser.Controller/Dto/IDtoService.cs b/MediaBrowser.Controller/Dto/IDtoService.cs index a02851a9f..2704959e4 100644 --- a/MediaBrowser.Controller/Dto/IDtoService.cs +++ b/MediaBrowser.Controller/Dto/IDtoService.cs @@ -86,6 +86,13 @@ namespace MediaBrowser.Controller.Dto ChapterInfoDto GetChapterInfoDto(ChapterInfo chapterInfo, BaseItem item); /// <summary> + /// Gets the media sources. + /// </summary> + /// <param name="item">The item.</param> + /// <returns>List{MediaSourceInfo}.</returns> + List<MediaSourceInfo> GetMediaSources(BaseItem item); + + /// <summary> /// Gets the item by name dto. /// </summary> /// <param name="item">The item.</param> diff --git a/MediaBrowser.Controller/Library/IMusicManager.cs b/MediaBrowser.Controller/Library/IMusicManager.cs new file mode 100644 index 000000000..192ce2e83 --- /dev/null +++ b/MediaBrowser.Controller/Library/IMusicManager.cs @@ -0,0 +1,38 @@ +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Entities.Audio; +using System.Collections.Generic; + +namespace MediaBrowser.Controller.Library +{ + public interface IMusicManager + { + /// <summary> + /// Gets the instant mix from song. + /// </summary> + /// <param name="item">The item.</param> + /// <param name="user">The user.</param> + /// <returns>IEnumerable{Audio}.</returns> + IEnumerable<Audio> GetInstantMixFromSong(Audio item, User user); + /// <summary> + /// Gets the instant mix from artist. + /// </summary> + /// <param name="name">The name.</param> + /// <param name="user">The user.</param> + /// <returns>IEnumerable{Audio}.</returns> + IEnumerable<Audio> GetInstantMixFromArtist(string name, User user); + /// <summary> + /// Gets the instant mix from album. + /// </summary> + /// <param name="item">The item.</param> + /// <param name="user">The user.</param> + /// <returns>IEnumerable{Audio}.</returns> + IEnumerable<Audio> GetInstantMixFromAlbum(MusicAlbum item, User user); + /// <summary> + /// Gets the instant mix from genre. + /// </summary> + /// <param name="genres">The genres.</param> + /// <param name="user">The user.</param> + /// <returns>IEnumerable{Audio}.</returns> + IEnumerable<Audio> GetInstantMixFromGenres(IEnumerable<string> genres, User user); + } +} diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvRecording.cs b/MediaBrowser.Controller/LiveTv/ILiveTvRecording.cs index edf86cae8..f8cdc6eee 100644 --- a/MediaBrowser.Controller/LiveTv/ILiveTvRecording.cs +++ b/MediaBrowser.Controller/LiveTv/ILiveTvRecording.cs @@ -1,8 +1,8 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Providers; +using MediaBrowser.Model.Library; using System.Threading; using System.Threading.Tasks; -using MediaBrowser.Model.Library; namespace MediaBrowser.Controller.LiveTv { @@ -14,6 +14,8 @@ namespace MediaBrowser.Controller.LiveTv RecordingInfo RecordingInfo { get; set; } + long? RunTimeTicks { get; set; } + string GetClientTypeName(); string GetUserDataKey(); diff --git a/MediaBrowser.Controller/Localization/ILocalizationManager.cs b/MediaBrowser.Controller/Localization/ILocalizationManager.cs index dde2f7878..f41940ed4 100644 --- a/MediaBrowser.Controller/Localization/ILocalizationManager.cs +++ b/MediaBrowser.Controller/Localization/ILocalizationManager.cs @@ -1,7 +1,7 @@ using MediaBrowser.Model.Entities; using MediaBrowser.Model.Globalization; +using System; using System.Collections.Generic; -using System.Threading.Tasks; namespace MediaBrowser.Controller.Localization { @@ -31,5 +31,42 @@ namespace MediaBrowser.Controller.Localization /// <param name="rating">The rating.</param> /// <returns>System.Int32.</returns> int? GetRatingLevel(string rating); + + /// <summary> + /// Gets the localized string. + /// </summary> + /// <param name="phrase">The phrase.</param> + /// <param name="culture">The culture.</param> + /// <returns>System.String.</returns> + string GetLocalizedString(string phrase, string culture); + + /// <summary> + /// Gets the localized string. + /// </summary> + /// <param name="phrase">The phrase.</param> + /// <returns>System.String.</returns> + string GetLocalizedString(string phrase); + + /// <summary> + /// Localizes the document. + /// </summary> + /// <param name="document">The document.</param> + /// <param name="culture">The culture.</param> + /// <param name="tokenBuilder">The token builder.</param> + /// <returns>System.String.</returns> + string LocalizeDocument(string document, string culture, Func<string, string> tokenBuilder); + + /// <summary> + /// Gets the localization options. + /// </summary> + /// <returns>IEnumerable{LocalizatonOption}.</returns> + IEnumerable<LocalizatonOption> GetLocalizationOptions(); + + /// <summary> + /// Gets the java script localization dictionary. + /// </summary> + /// <param name="culture">The culture.</param> + /// <returns>Dictionary{System.StringSystem.String}.</returns> + Dictionary<string, string> GetJavaScriptLocalizationDictionary(string culture); } } diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 9915ac044..a233c1f12 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -84,7 +84,7 @@ <Compile Include="Dlna\DirectPlayProfile.cs" /> <Compile Include="Dlna\IDlnaManager.cs" /> <Compile Include="Dlna\DeviceProfile.cs" /> - <Compile Include="Dlna\MediaProfile.cs" /> + <Compile Include="Dlna\ResponseProfile.cs" /> <Compile Include="Dlna\TranscodingProfile.cs" /> <Compile Include="Drawing\IImageProcessor.cs" /> <Compile Include="Drawing\ImageFormat.cs" /> @@ -134,6 +134,7 @@ <Compile Include="Library\DeleteOptions.cs" /> <Compile Include="Library\ILibraryPostScanTask.cs" /> <Compile Include="Library\IMetadataSaver.cs" /> + <Compile Include="Library\IMusicManager.cs" /> <Compile Include="Library\ItemUpdateType.cs" /> <Compile Include="Library\IUserDataManager.cs" /> <Compile Include="Library\UserDataSaveEventArgs.cs" /> @@ -155,11 +156,14 @@ <Compile Include="LiveTv\SeriesTimerInfo.cs" /> <Compile Include="LiveTv\TimerInfo.cs" /> <Compile Include="Localization\ILocalizationManager.cs" /> + <Compile Include="MediaEncoding\EncodingOptions.cs" /> <Compile Include="MediaEncoding\ChapterImageRefreshOptions.cs" /> + <Compile Include="MediaEncoding\EncodingResult.cs" /> <Compile Include="MediaEncoding\IEncodingManager.cs" /> <Compile Include="MediaEncoding\ImageEncodingOptions.cs" /> <Compile Include="MediaEncoding\IMediaEncoder.cs" /> <Compile Include="MediaEncoding\InternalMediaInfoResult.cs" /> + <Compile Include="MediaEncoding\VideoEncodingOptions.cs" /> <Compile Include="Net\IHasResultFactory.cs" /> <Compile Include="Net\IHttpResultFactory.cs" /> <Compile Include="Net\IHttpServer.cs" /> diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingOptions.cs b/MediaBrowser.Controller/MediaEncoding/EncodingOptions.cs new file mode 100644 index 000000000..74235becd --- /dev/null +++ b/MediaBrowser.Controller/MediaEncoding/EncodingOptions.cs @@ -0,0 +1,79 @@ +using MediaBrowser.Controller.Dlna; + +namespace MediaBrowser.Controller.MediaEncoding +{ + public class EncodingOptions + { + /// <summary> + /// Gets or sets the item identifier. + /// </summary> + /// <value>The item identifier.</value> + public string ItemId { get; set; } + + /// <summary> + /// Gets or sets the media source identifier. + /// </summary> + /// <value>The media source identifier.</value> + public string MediaSourceId { get; set; } + + /// <summary> + /// Gets or sets the device profile. + /// </summary> + /// <value>The device profile.</value> + public DeviceProfile DeviceProfile { get; set; } + + /// <summary> + /// Gets or sets the output path. + /// </summary> + /// <value>The output path.</value> + public string OutputPath { get; set; } + + /// <summary> + /// Gets or sets the container. + /// </summary> + /// <value>The container.</value> + public string Container { get; set; } + + /// <summary> + /// Gets or sets the audio codec. + /// </summary> + /// <value>The audio codec.</value> + public string AudioCodec { get; set; } + + /// <summary> + /// Gets or sets the start time ticks. + /// </summary> + /// <value>The start time ticks.</value> + public long? StartTimeTicks { get; set; } + + /// <summary> + /// Gets or sets the maximum channels. + /// </summary> + /// <value>The maximum channels.</value> + public int? MaxAudioChannels { get; set; } + + /// <summary> + /// Gets or sets the channels. + /// </summary> + /// <value>The channels.</value> + public int? AudioChannels { get; set; } + + /// <summary> + /// Gets or sets the sample rate. + /// </summary> + /// <value>The sample rate.</value> + public int? AudioSampleRate { get; set; } + + /// <summary> + /// Gets or sets the bit rate. + /// </summary> + /// <value>The bit rate.</value> + public int? AudioBitRate { get; set; } + + /// <summary> + /// Gets or sets the maximum audio bit rate. + /// </summary> + /// <value>The maximum audio bit rate.</value> + public int? MaxAudioBitRate { get; set; } + } +} diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingResult.cs b/MediaBrowser.Controller/MediaEncoding/EncodingResult.cs new file mode 100644 index 000000000..75ee90e42 --- /dev/null +++ b/MediaBrowser.Controller/MediaEncoding/EncodingResult.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MediaBrowser.Controller.MediaEncoding +{ + public class EncodingResult + { + public string OutputPath { get; set; } + } +} diff --git a/MediaBrowser.Controller/MediaEncoding/VideoEncodingOptions.cs b/MediaBrowser.Controller/MediaEncoding/VideoEncodingOptions.cs new file mode 100644 index 000000000..773f0ea46 --- /dev/null +++ b/MediaBrowser.Controller/MediaEncoding/VideoEncodingOptions.cs @@ -0,0 +1,26 @@ + +namespace MediaBrowser.Controller.MediaEncoding +{ + public class VideoEncodingOptions : EncodingOptions + { + public string VideoCodec { get; set; } + + public string VideoProfile { get; set; } + + public double? VideoLevel { get; set; } + + public int? VideoStreamIndex { get; set; } + + public int? AudioStreamIndex { get; set; } + + public int? SubtitleStreamIndex { get; set; } + + public int? MaxWidth { get; set; } + + public int? MaxHeight { get; set; } + + public int? Height { get; set; } + + public int? Width { get; set; } + } +} diff --git a/MediaBrowser.Controller/Session/ISessionController.cs b/MediaBrowser.Controller/Session/ISessionController.cs index 02cc875bd..cf57f6621 100644 --- a/MediaBrowser.Controller/Session/ISessionController.cs +++ b/MediaBrowser.Controller/Session/ISessionController.cs @@ -20,14 +20,6 @@ namespace MediaBrowser.Controller.Session bool IsSessionActive { get; } /// <summary> - /// Sends the system command. - /// </summary> - /// <param name="command">The command.</param> - /// <param name="cancellationToken">The cancellation token.</param> - /// <returns>Task.</returns> - Task SendSystemCommand(SystemCommand command, CancellationToken cancellationToken); - - /// <summary> /// Sends the message command. /// </summary> /// <param name="command">The command.</param> @@ -65,7 +57,7 @@ namespace MediaBrowser.Controller.Session /// <param name="command">The command.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>Task.</returns> - Task SendGenericCommand(GenericCommand command, CancellationToken cancellationToken); + Task SendGeneralCommand(GeneralCommand command, CancellationToken cancellationToken); /// <summary> /// Sends the library update info. diff --git a/MediaBrowser.Controller/Session/ISessionManager.cs b/MediaBrowser.Controller/Session/ISessionManager.cs index 459e43d08..434c51336 100644 --- a/MediaBrowser.Controller/Session/ISessionManager.cs +++ b/MediaBrowser.Controller/Session/ISessionManager.cs @@ -84,15 +84,15 @@ namespace MediaBrowser.Controller.Session Task ReportSessionEnded(Guid sessionId); /// <summary> - /// Sends the system command. + /// Sends the general command. /// </summary> /// <param name="controllingSessionId">The controlling session identifier.</param> - /// <param name="sessionId">The session id.</param> + /// <param name="sessionId">The session identifier.</param> /// <param name="command">The command.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>Task.</returns> - Task SendSystemCommand(Guid controllingSessionId, Guid sessionId, SystemCommand command, CancellationToken cancellationToken); - + Task SendGeneralCommand(Guid controllingSessionId, Guid sessionId, GeneralCommand command, CancellationToken cancellationToken); + /// <summary> /// Sends the message command. /// </summary> |
