From 0db3588529e1602f3f974cf3ffabc34ee5b4b214 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 13 Mar 2014 15:08:02 -0400 Subject: expand on dlna profiles --- MediaBrowser.Controller/Dlna/DirectPlayProfile.cs | 25 ++++++++++ MediaBrowser.Controller/Dlna/DlnaProfile.cs | 54 ++++++++++++++++++++++ MediaBrowser.Controller/Dlna/IDlnaManager.cs | 28 +++++++++++ MediaBrowser.Controller/Dlna/TranscodingProfile.cs | 16 +++++++ MediaBrowser.Controller/Entities/BaseItem.cs | 5 ++ .../MediaBrowser.Controller.csproj | 4 ++ 6 files changed, 132 insertions(+) create mode 100644 MediaBrowser.Controller/Dlna/DirectPlayProfile.cs create mode 100644 MediaBrowser.Controller/Dlna/DlnaProfile.cs create mode 100644 MediaBrowser.Controller/Dlna/IDlnaManager.cs create mode 100644 MediaBrowser.Controller/Dlna/TranscodingProfile.cs (limited to 'MediaBrowser.Controller') diff --git a/MediaBrowser.Controller/Dlna/DirectPlayProfile.cs b/MediaBrowser.Controller/Dlna/DirectPlayProfile.cs new file mode 100644 index 0000000000..f1922dd323 --- /dev/null +++ b/MediaBrowser.Controller/Dlna/DirectPlayProfile.cs @@ -0,0 +1,25 @@ + +namespace MediaBrowser.Controller.Dlna +{ + public class DirectPlayProfile + { + public string[] Containers { get; set; } + public string[] AudioCodecs { get; set; } + public string[] VideoCodecs { get; set; } + public string MimeType { get; set; } + public DlnaProfileType Type { get; set; } + + public DirectPlayProfile() + { + Containers = new string[] { }; + AudioCodecs = new string[] { }; + VideoCodecs = new string[] { }; + } + } + + public enum DlnaProfileType + { + Audio = 0, + Video = 1 + } +} diff --git a/MediaBrowser.Controller/Dlna/DlnaProfile.cs b/MediaBrowser.Controller/Dlna/DlnaProfile.cs new file mode 100644 index 0000000000..33f95b7944 --- /dev/null +++ b/MediaBrowser.Controller/Dlna/DlnaProfile.cs @@ -0,0 +1,54 @@ + +namespace MediaBrowser.Controller.Dlna +{ + public class DlnaProfile + { + /// + /// Gets or sets the name. + /// + /// The name. + public string Name { get; set; } + + /// + /// Gets or sets the type of the client. + /// + /// The type of the client. + public string ClientType { get; set; } + + /// + /// Gets or sets the name of the friendly. + /// + /// The name of the friendly. + public string FriendlyName { get; set; } + + /// + /// Gets or sets the model number. + /// + /// The model number. + public string ModelNumber { get; set; } + + /// + /// Gets or sets the name of the model. + /// + /// The name of the model. + public string ModelName { get; set; } + + /// + /// Gets or sets the transcoding profiles. + /// + /// The transcoding profiles. + public TranscodingProfile[] TranscodingProfiles { get; set; } + + /// + /// Gets or sets the direct play profiles. + /// + /// The direct play profiles. + public DirectPlayProfile[] DirectPlayProfiles { get; set; } + + public DlnaProfile() + { + DirectPlayProfiles = new DirectPlayProfile[] { }; + TranscodingProfiles = new TranscodingProfile[] { }; + } + } +} diff --git a/MediaBrowser.Controller/Dlna/IDlnaManager.cs b/MediaBrowser.Controller/Dlna/IDlnaManager.cs new file mode 100644 index 0000000000..017dbc8746 --- /dev/null +++ b/MediaBrowser.Controller/Dlna/IDlnaManager.cs @@ -0,0 +1,28 @@ +using System.Collections.Generic; + +namespace MediaBrowser.Controller.Dlna +{ + public interface IDlnaManager + { + /// + /// Gets the dlna profiles. + /// + /// IEnumerable{DlnaProfile}. + IEnumerable GetProfiles(); + + /// + /// Gets the default profile. + /// + /// DlnaProfile. + DlnaProfile GetDefaultProfile(); + + /// + /// Gets the profile. + /// + /// Name of the friendly. + /// Name of the model. + /// The model number. + /// DlnaProfile. + DlnaProfile GetProfile(string friendlyName, string modelName, string modelNumber); + } +} diff --git a/MediaBrowser.Controller/Dlna/TranscodingProfile.cs b/MediaBrowser.Controller/Dlna/TranscodingProfile.cs new file mode 100644 index 0000000000..abc8868fb9 --- /dev/null +++ b/MediaBrowser.Controller/Dlna/TranscodingProfile.cs @@ -0,0 +1,16 @@ + +namespace MediaBrowser.Controller.Dlna +{ + public class TranscodingProfile + { + public string Container { get; set; } + + public DlnaProfileType Type { get; set; } + + public string MimeType { get; set; } + + public string VideoCodec { get; set; } + + public string AudioCodec { get; set; } + } +} diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 23f8ac31a5..e0c792307e 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -1332,6 +1332,11 @@ namespace MediaBrowser.Controller.Entities return ImageInfos.Where(i => i.Type == imageType); } + public bool AddImages(ImageType imageType, IEnumerable images) + { + return AddImages(imageType, images.Cast()); + } + /// /// Adds the images. /// diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 16c54861ee..21a501b08e 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -73,6 +73,10 @@ + + + + -- cgit v1.2.3