public static NativeFileInfo FromPath(string path)
        {
            string fileType = PathUtils.GetExtension(path);

            if (MediaRenderer.AllMediaTypes.Contains(fileType))
            {
                return(MediaFileInfo.FromPath(path, true));
            }

            return(new NativeFileInfo(path, true));
        }
 public static ITaggedMediaFileInfo GetTaggedMediaFileInfo(string path, bool deepLoad)
 {
     try
     {
         MediaFileInfo mfi = MediaFileInfo.FromPath(path, deepLoad);
         return(mfi as ITaggedMediaFileInfo);
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
         return(null);
     }
 }
Ejemplo n.º 3
0
 public CDAFileInfoSlim(MediaFileInfo mfi)
     : base(mfi)
 {
 }
Ejemplo n.º 4
0
 public ID3FileInfoSlim(MediaFileInfo mfi) 
     : base(mfi)
 {
 }
Ejemplo n.º 5
0
 public VideoFileInfoSlim(MediaFileInfo mfi)
     : base(mfi)
 {
 }
Ejemplo n.º 6
0
 public MediaFileInfoSlim(MediaFileInfo mfi)
 {
     _mfi = mfi;
 }
Ejemplo n.º 7
0
        public static MediaFileInfo FromPath(string path, bool deepLoad)
        {
            MediaFileInfo mi = new MediaFileInfo(path, true);

            if (!mi.IsURI)
            {
                try
                {
                    if (!MediaRenderer.AllMediaTypes.Contains(mi.MediaType))
                    {
                        throw new FileLoadException("Unexpected file type: " + mi.MediaType,
                            path);
                    }
                }
                catch (FileLoadException)
                {
                    throw;
                }
                catch
                {
                }
            }

            if (MediaRenderer.SupportedVideoTypes.Contains(mi.MediaType))
            {
                // video file
                return MediaRenderer.DefaultInstance.QueryVideoMediaInfo(path);
            }
            else
            {
                // audio file or playlist
                switch (mi.MediaType)
                {
                    case "cda":
                        return new CDAFileInfo(path, deepLoad);

                    case "mp1":
                    case "mp2":
                    case "mp3":
                        // MPEG 1 Layer 1/2/3 with ID3 metadata
                        return new ID3FileInfo(path, deepLoad);

                    case "wav":
                    case "mpa":
                    case "au":
                    case "aif":
                    case "aiff":
                    case "snd":
                    case "mid":
                    case "midi":
                    case "rmi":
                    case "raw":
                    case "wma":
                    case "dctmp":
                    case "dat":
                    default:
                        // Other formats (no metadata available)
                        return mi;
                }
            }
        }
 public CDAFileInfoSlim(MediaFileInfo mfi)
     : base(mfi)
 {
 }
 public ID3FileInfoSlim(MediaFileInfo mfi)
     : base(mfi)
 {
 }
 public VideoFileInfoSlim(MediaFileInfo mfi)
     : base(mfi)
 {
 }
 public MediaFileInfoSlim(MediaFileInfo mfi)
 {
     _mfi = mfi;
 }
        public static MediaFileInfo FromPath(string path, bool deepLoad)
        {
            MediaFileInfo mi = new MediaFileInfo(path, true);

            if (!mi.IsURI)
            {
                try
                {
                    if (!MediaRenderer.AllMediaTypes.Contains(mi.MediaType))
                    {
                        throw new FileLoadException("Unexpected file type: " + mi.MediaType,
                                                    path);
                    }
                }
                catch (FileLoadException)
                {
                    throw;
                }
                catch
                {
                }
            }

            if (MediaRenderer.SupportedVideoTypes.Contains(mi.MediaType))
            {
                // video file
                return(MediaRenderer.DefaultInstance.QueryVideoMediaInfo(path));
            }
            else
            {
                // audio file or playlist
                switch (mi.MediaType)
                {
                case "cda":
                    return(new CDAFileInfo(path, deepLoad));

                case "mp1":
                case "mp2":
                case "mp3":
                    // MPEG 1 Layer 1/2/3 with ID3 metadata
                    return(new ID3FileInfo(path, deepLoad));

                case "wav":
                case "mpa":
                case "au":
                case "aif":
                case "aiff":
                case "snd":
                case "mid":
                case "midi":
                case "rmi":
                case "raw":
                case "wma":
                case "dctmp":
                case "dat":
                default:
                    // Other formats (no metadata available)
                    return(mi);
                }
            }
        }
Ejemplo n.º 13
0
 public PlaylistItem(string itemPath, bool isDvd, bool deepLoad)
 {
     if (isDvd)
         mi = new VideoDvdInformation(itemPath);
     else
         mi = MediaFileInfo.FromPath(itemPath, deepLoad);
 }