예제 #1
0
        public static byte[] MakePCMDataBlockType2(byte dataType, clsPcmDatSeq pds, byte[] data)
        {
            List <byte> desDat = new List <byte>();

            desDat.Add(0x67);     //Data block command
            desDat.Add(0x66);     //compatibility command

            desDat.Add(dataType); //data type

            int length = pds.SrcLength == -1 ? data.Length : pds.SrcLength;

            if (data.Length < pds.SrcStartAdr + length)
            {
                length = data.Length - pds.SrcStartAdr;
            }
            byte[] dmy = new byte[length];
            Array.Copy(data, pds.SrcStartAdr, dmy, 0, length);

            Common.Add32bits(desDat, (uint)(length + 2) | (pds.chipNumber != 0 ? 0x8000_0000 : 0x0000_0000)); //size of data, in bytes
            Common.Add16bits(desDat, (uint)pds.DesStartAdr);                                                  //start address of data

            desDat.AddRange(dmy);

            pds.DatStartAdr = pds.DesStartAdr;
            pds.DatEndAdr   = pds.DatStartAdr + length - 1;

            return(desDat.ToArray());
        }
예제 #2
0
        public override void StorePcmRawData(clsPcmDatSeq pds, byte[] buf, bool isRaw, bool is16bit, int samplerate, params object[] option)
        {
            if (!isRaw)
            {
                //Rawファイルは何もしない
                //Wavファイルはエンコ
                buf = Encode(buf, false);
            }

            pcmDataDirect.Add(Common.MakePCMDataBlockType2(dataType, pds, buf));
        }
예제 #3
0
파일: YM2608.cs 프로젝트: kuma4649/mml2vgm
        public override void StorePcmRawData(clsPcmDatSeq pds, byte[] buf, bool isRaw, bool is16bit, int samplerate, params object[] option)
        {
            if (!isRaw)
            {
                //Rawファイルは何もしない
                //Wavファイルはエンコ
                EncAdpcmA ea = new EncAdpcmA();
                buf = ea.YM_ADPCM_B_Encode(buf, is16bit, true);
            }

            pcmDataDirect.Add(Common.MakePCMDataBlock((byte)dataType, pds, buf));
        }
예제 #4
0
파일: C140.cs 프로젝트: pedipanol/mml2vgm
        public override void StorePcmRawData(clsPcmDatSeq pds, byte[] buf, bool isRaw, bool is16bit, int samplerate, params object[] option)
        {
            bool isCPCM = false;

            //Optionをチェック が0以外の場合、bufに対し13bitCompPCM向け圧縮処理を行う
            if (pds.Option != null && pds.Option.Length > 0)
            {
                isCPCM = pds.Option[0].ToString() != "0";
            }

            List <byte> dBuf = new List <byte>();

            if (isRaw)
            {
                //Rawファイル

                //圧縮指定がある時 圧縮処理を実施
                //それ以外は そのまま
                if (isCPCM)
                {
                    EncC140CompressedPCM(dBuf, buf, true, true);
                }
                else
                {
                    dBuf.AddRange(buf);
                }
            }
            else
            {
                //Wavファイル

                //16bitWavの時 圧縮処理を実施
                //それ以外は8bitLiner処理を実施
                if (is16bit)
                {
                    EncC140CompressedPCM(dBuf, buf, true, true);
                }
                else
                {
                    EncC140LinerSigned8bitPCM(dBuf, buf, false, false);
                }
            }
            buf = dBuf.ToArray();

            pcmDataDirect.Add(Common.MakePCMDataBlock(dataType, pds, buf));
        }
예제 #5
0
파일: YM2610B.cs 프로젝트: kuma4649/mml2vgm
        public override void StorePcmRawData(clsPcmDatSeq pds, byte[] buf, bool isRaw, bool is16bit, int samplerate, params object[] option)
        {
            if (!isRaw)
            {
                //Rawファイルは何もしない
                //Wavファイルはエンコ
                EncAdpcmA ea = new EncAdpcmA();
                buf = pds.DatLoopAdr == 0
                    ? ea.YM_ADPCM_A_Encode(buf, is16bit)
                    : ea.YM_ADPCM_B_Encode(buf, is16bit, true);
            }

            if (pds.DatLoopAdr == 0)
            {
                pcmDataDirectA.Add(Common.MakePCMDataBlock(dataType, pds, buf));
            }
            else
            {
                pcmDataDirectB.Add(Common.MakePCMDataBlock((byte)(dataType + 1), pds, buf));
            }
        }
예제 #6
0
 public override void StorePcmRawData(clsPcmDatSeq pds, byte[] buf, bool isRaw, bool is16bit, int samplerate, params object[] option)
 {
     throw new NotImplementedException();
 }
예제 #7
0
 public override void StorePcmRawData(clsPcmDatSeq pds, byte[] buf, bool isRaw, bool is16bit, int samplerate, params object[] option)
 {
     msgBox.setWrnMsg(msg.get("E12007"), new LinePos(null, "-"));
 }
예제 #8
0
 public virtual void StorePcmRawData(clsPcmDatSeq pds, byte[] buf, bool isRaw, bool is16bit, int samplerate, params object[] option)
 {
     throw new NotImplementedException("継承先で要実装");
 }
예제 #9
0
파일: K051649.cs 프로젝트: kuma4649/mml2vgm
 public override void StorePcmRawData(clsPcmDatSeq pds, byte[] buf, bool isRaw, bool is16bit, int samplerate, params object[] option)
 {
 }