Пример #1
0
        public override List<ChapterInfo> GetStreams(string location, int numtitle)
        {
            List<ChapterInfo> pgcs = new List<ChapterInfo>();
              string path = Path.Combine(location, "ADV_OBJ");
              if (!Directory.Exists(path))
            throw new FileNotFoundException("Could not find ADV_OBJ folder on HD-DVD disc.");

              ChapterExtractor ex = new XplExtractor();
              ex.StreamDetected += (sender, args) => OnStreamDetected(args.ProgramChain);
              ex.ChaptersLoaded += (sender, args) => OnChaptersLoaded(args.ProgramChain);

              foreach (string file in Directory.GetFiles(path, "*.xpl"))
              {
            pgcs.Add(ex.GetStreams(file , numtitle)[0]);
              }

              pgcs = pgcs.OrderByDescending(p => p.Duration).ToList();
              OnExtractionComplete();
              return pgcs;
        }
Пример #2
0
        public override List <ChapterInfo> GetStreams(string location, int numtitle)
        {
            List <ChapterInfo> pgcs = new List <ChapterInfo>();
            string             path = Path.Combine(location, "ADV_OBJ");

            if (!Directory.Exists(path))
            {
                throw new FileNotFoundException("Could not find ADV_OBJ folder on HD-DVD disc.");
            }

            ChapterExtractor ex = new XplExtractor();

            ex.StreamDetected += (sender, args) => OnStreamDetected(args.ProgramChain);
            ex.ChaptersLoaded += (sender, args) => OnChaptersLoaded(args.ProgramChain);

            foreach (string file in Directory.GetFiles(path, "*.xpl"))
            {
                pgcs.Add(ex.GetStreams(file, numtitle)[0]);
            }

            pgcs = pgcs.OrderByDescending(p => p.Duration).ToList();
            OnExtractionComplete();
            return(pgcs);
        }
Пример #3
0
        public static List<ChapterInfo> ReadPgcListFromFile(string file)
        {
            ChapterExtractor ex = null;
              string fileLower = file.ToLower();
              if (fileLower.EndsWith("txt"))
            ex = new TextExtractor();
              else if (fileLower.EndsWith("xpl"))
            ex = new XplExtractor();
              else if (fileLower.EndsWith("ifo"))
            ex = new Ifo2Extractor();
              else if (fileLower.EndsWith("mpls"))
            ex = new MplsExtractor();
              else if (fileLower.EndsWith("xml"))
            throw new Exception("Format not yet supported.");
              else if (fileLower.EndsWith("chapters"))
              {
            List<ChapterInfo> ret = new List<ChapterInfo>();
            ret.Add(ChapterInfo.Load(file));
            return ret;
              }
              else
              {
            throw new Exception("The selected file is not a recognized format.");
              }

              return ex.GetStreams(file, 1);
        }