/// <summary>
        /// DSDIFFファイルのヘッダ部分を読み込む。
        /// </summary>
        /// <returns>読めたらtrue</returns>
        private bool ReadDsdiffFileHeader(string path)
        {
            bool result = false;

            var r = new DsdiffReader();

            using (BinaryReader br = new BinaryReader(File.Open(path, FileMode.Open, FileAccess.Read, FileShare.Read))) {
                PcmDataLib.PcmData pd;
                var rv = r.ReadHeader(br, out pd);
                if (rv == DsdiffReader.ResultType.Success)
                {
                    if (CheckAddPcmData(path, pd, true))
                    {
                        result = true;
                    }
                }
                else
                {
                    LoadErrorMessageAdd(string.Format(CultureInfo.InvariantCulture, Properties.Resources.ReadFileFailed + " {1}: {2}{3}",
                                                      "DSDIFF", rv, path, Environment.NewLine));
                }
            }

            return(result);
        }
Beispiel #2
0
        private int StreamBeginDsdiff(string path, long startFrame)
        {
            int ercd = -1;

            mDsdiffR = new DsdiffReader();
            mBr      = new BinaryReader(
                File.Open(path, FileMode.Open, FileAccess.Read, FileShare.Read));

            DsdiffReader.ResultType result = mDsdiffR.ReadStreamBegin(mBr, out mPcmData);
            if (result == DsdiffReader.ResultType.Success)
            {
                NumFrames = mDsdiffR.OutputFrames;

                mDsdiffR.ReadStreamSkip(mBr, startFrame);
                ercd = 0;
            }

            return(ercd);
        }
Beispiel #3
0
        private int StreamBeginDsdiff(string path, long startFrame)
        {
            int ercd = -1;

            mDsdiffR = new DsdiffReader();
            mBr = new BinaryReader(
                File.Open(path, FileMode.Open, FileAccess.Read, FileShare.Read));

            DsdiffReader.ResultType result = mDsdiffR.ReadStreamBegin(mBr, out mPcmData);
            if (result == DsdiffReader.ResultType.Success) {

                NumFrames = mDsdiffR.OutputFrames;

                mDsdiffR.ReadStreamSkip(mBr, startFrame);
                ercd = 0;
            }

            return ercd;
        }
Beispiel #4
0
        /// <summary>
        /// DSDIFFファイルのヘッダ部分を読み込む。
        /// </summary>
        /// <returns>読めたらtrue</returns>
        private bool ReadDsdiffFileHeader(string path)
        {
            bool result = false;

            var r = new DsdiffReader();
            using (BinaryReader br = new BinaryReader(File.Open(path, FileMode.Open, FileAccess.Read, FileShare.Read))) {
                PcmDataLib.PcmData pd;
                var rv = r.ReadHeader(br, out pd);
                if (rv == DsdiffReader.ResultType.Success) {
                    if (CheckAddPcmData(path, pd, true)) {
                        result = true;
                    }
                } else {
                    LoadErrorMessageAdd(string.Format(CultureInfo.InvariantCulture, Properties.Resources.ReadFileFailed + " {1}: {2}{3}",
                            "DSDIFF", rv, path, Environment.NewLine));
                }
            }

            return result;
        }