GetStreams() public method

public GetStreams ( string location ) : List
location string
return List
示例#1
0
        public override List <ChapterInfo> GetStreams(string location)
        {
            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);

            string vol = Pathing.VolumeInfo.GetVolumeLabel(new DirectoryInfo(location));

            foreach (string file in Directory.GetFiles(path, "*.xpl"))
            {
                var pgc = ex.GetStreams(file)[0];
                if (!string.IsNullOrEmpty(vol))
                {
                    pgc.VolumeName = vol;
                }
                pgcs.Add(pgc);
            }

            pgcs = pgcs.OrderByDescending(p => p.Duration).ToList();
            OnExtractionComplete();
            return(pgcs);
        }
        public override List<ChapterInfo> GetStreams(string location)
        {
            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)[0]);
              }

              pgcs = pgcs.OrderByDescending(p => p.Duration).ToList();
              OnExtractionComplete();
              return pgcs;
        }