示例#1
0
                @"C:\test\beethoven.cue" };

            foreach (string path in testFileArray) {
                CueSheetReader csr = new CueSheetReader();
                result = csr.ReadFromFile(path);
                System.Console.WriteLine("{0} result={1}", path, result);
            }
        }
    }
}
示例#2
0
        /// <summary>
        /// CUEシートを読み込む。
        /// </summary>
        /// <returns>エラーの発生回数を戻す</returns>
        private int ReadCueSheet(string path)
        {
            PlaylistReader plr = null;

            switch (Path.GetExtension(path).ToUpperInvariant())
            {
            case ".CUE":
                plr = new CueSheetReader(mEncoding);
                break;

            case ".M3U":
            case ".M3U8":
                plr = new M3uReader();
                break;

            default:
                System.Diagnostics.Debug.Assert(false);
                break;
            }

            bool result = plr.ReadFromFile(path);

            if (!result)
            {
                LoadErrorMessageAdd(string.Format(CultureInfo.InvariantCulture, Properties.Resources.ReadFileFailed + ": {1}{2}",
                                                  Path.GetExtension(path), path, Environment.NewLine));
                return(1);
            }

            int errCount = 0;

            for (int i = 0; i < plr.GetTrackInfoCount(); ++i)
            {
                var plti = plr.GetTrackInfo(i);
                errCount += ReadFileHeader1(plti.path, ReadHeaderMode.OnlyConcreteFile, plti, null);
            }
            return(errCount);
        }
示例#3
0
        /// <summary>
        /// CUEシートを読み込む。
        /// </summary>
        /// <returns>エラーの発生回数を戻す</returns>
        private int ReadCueSheet(string path)
        {
            PlaylistReader plr = null;
            switch (Path.GetExtension(path).ToUpperInvariant()) {
            case ".CUE":
                plr = new CueSheetReader(mEncoding);
                break;
            case ".M3U":
            case ".M3U8":
                plr = new M3uReader();
                break;
            default:
                System.Diagnostics.Debug.Assert(false);
                break;
            }

            bool result = plr.ReadFromFile(path);
            if (!result) {
                LoadErrorMessageAdd(string.Format(CultureInfo.InvariantCulture, Properties.Resources.ReadFileFailed + ": {1}{2}",
                        Path.GetExtension(path), path, Environment.NewLine));
                return 1;
            }

            int errCount = 0;
            for (int i = 0; i < plr.GetTrackInfoCount(); ++i) {
                var plti = plr.GetTrackInfo(i);
                errCount += ReadFileHeader1(plti.path, ReadHeaderMode.OnlyConcreteFile, plti, null);
            }
            return errCount;
        }