示例#1
0
        public RiffDls_Wsmp(string aId, UInt32 aSize, AByteArray aByteArray, RiffChunkList aParent)
            : base(aId, aSize, aByteArray, aParent)
        {
            lsize       = aByteArray.ReadUInt32();
            unityNote   = aByteArray.ReadUInt16();
            fineTune    = aByteArray.ReadInt16();
            attenuation = aByteArray.ReadInt32();
            options     = aByteArray.ReadUInt32();
            sampleLoops = aByteArray.ReadUInt32();

            informationList.Add("Size:" + lsize);
            informationList.Add("Unity Note:" + unityNote);
            informationList.Add("Fine Tune:" + fineTune);
            informationList.Add("Attenuation:" + attenuation);
            informationList.Add("Options:" + options);
            informationList.Add("Sample Loops:" + sampleLoops);

            waveSampleLoop = new WaveSampleLoop[sampleLoops];

            for (int i = 0; i < sampleLoops; i++)
            {
                informationList.Add("Wave Sample Loop:");

                waveSampleLoop[i] = new WaveSampleLoop(aByteArray, informationList);
            }
        }
示例#2
0
        public RiffWaveBext(string aId, UInt32 aSize, AByteArray aByteArray, RiffChunkList aParent)
            : base(aId, aSize, aByteArray, aParent)
        {
            description         = aByteArray.ReadString(256);
            originator          = aByteArray.ReadString(32);
            originatorReference = aByteArray.ReadString(32);
            originationDate     = aByteArray.ReadString(10);
            originationTime     = aByteArray.ReadString(8);
            timeReferenceLow    = aByteArray.ReadUInt32();
            timeReferenceHigh   = aByteArray.ReadUInt32();
            version             = aByteArray.ReadUInt16();
            umid          = aByteArray.ReadBytes(64);
            reserved      = aByteArray.ReadBytes(190);
            codingHistory = aByteArray.ReadString(( int )(Size - 256 - 32 - 32 - 10 - 8 - 4 - 4 - 2 - 64 - 190));

            informationList.Add("Description:" + description);
            informationList.Add("Originator:" + originator);
            informationList.Add("Originator Reference:" + originatorReference);
            informationList.Add("Origination Date:" + originationDate);
            informationList.Add("Origination Time:" + originationTime);
            informationList.Add("Time Reference Low:" + timeReferenceLow.ToString());
            informationList.Add("Time Reference High:" + timeReferenceHigh.ToString());
            informationList.Add("Version:" + version.ToString());
            informationList.Add("UMID:" + umid.ToString());
            informationList.Add("Reserved:" + reserved.ToString());
            informationList.Add("Coding History:" + codingHistory);
        }
示例#3
0
        public RiffDls_Art2(string aId, UInt32 aSize, AByteArray aByteArray, RiffChunkList aParent)
            : base(aId, aSize, aByteArray, aParent)
        {
            tuning = 0;
            count  = 0;

            // To Be Fixed.
            lsize            = aByteArray.ReadUInt32();
            collectionBlocks = aByteArray.ReadUInt32();

            informationList.Add("Size:" + lsize);
            informationList.Add("Collection Blocks:" + collectionBlocks);

            collectionBlock = new CollectionBlock[collectionBlocks];

            for (int i = 0; i < collectionBlocks; i++)
            {
                collectionBlock[i] = new CollectionBlock(aByteArray, informationList);

                if (collectionBlock[i].destination == 3 && count < 1)
                {
                    tuning = collectionBlock[i].scale;

                    count++;
                }
            }
        }
示例#4
0
        public ShdrData(AByteArray aByteArray, List <string> aInformationList)
        {
            sampleName      = aByteArray.ReadString(20);
            start           = aByteArray.ReadUInt32();
            end             = aByteArray.ReadUInt32();
            startLoop       = aByteArray.ReadUInt32();
            endLoop         = aByteArray.ReadUInt32();
            sampleRate      = aByteArray.ReadUInt32();
            originalPitch   = aByteArray.ReadByte();
            pitchCorrection = aByteArray.ReadSByte();
            sampleLink      = aByteArray.ReadUInt16();
            sampleType      = ( SampleType )aByteArray.ReadUInt16();

            aInformationList.Add("Sample Name:" + sampleName);
            aInformationList.Add("Start:" + start);
            aInformationList.Add("End:" + end);
            aInformationList.Add("Start Loop:" + startLoop);
            aInformationList.Add("End Loop:" + endLoop);
            aInformationList.Add("Sample Rate:" + sampleRate);
            aInformationList.Add("Original Pitch:" + originalPitch);
            aInformationList.Add("Pitch Correction:" + pitchCorrection);
            aInformationList.Add("Sample Link:" + sampleLink);
            aInformationList.Add("Sample Type:" + sampleType);

            if (sampleType != SampleType.monoSample)
            {
                Logger.Warning(sampleName + "/" + "Not Mono Sample:" + sampleType);
            }
        }
示例#5
0
        public MidiLocal(AByteArray aByteArray, List <string> aInformationList)
        {
            bank       = aByteArray.ReadUInt32();
            instrument = aByteArray.ReadUInt32();

            aInformationList.Add("Bank:" + bank);
            aInformationList.Add("Instrument:" + instrument);
        }
示例#6
0
        public RiffDls_Vers(string aId, UInt32 aSize, AByteArray aByteArray, RiffChunkList aParent)
            : base(aId, aSize, aByteArray, aParent)
        {
            versionMs = aByteArray.ReadUInt32();
            versionLs = aByteArray.ReadUInt32();

            informationList.Add("Version Ms:" + versionMs);
            informationList.Add("Version Ls:" + versionLs);
        }
示例#7
0
        public PlaySegment(AByteArray aByteArray, List <string> aInformationList)
        {
            name   = aByteArray.ReadUInt32();
            length = aByteArray.ReadUInt32();
            loops  = aByteArray.ReadUInt32();

            aInformationList.Add("    Name:" + name);
            aInformationList.Add("    Length:" + length);
            aInformationList.Add("    Loops:" + loops);
        }
示例#8
0
        public RiffWaveSmpl(string aId, UInt32 aSize, AByteArray aByteArray, RiffChunkList aParent)
            : base(aId, aSize, aByteArray, aParent)
        {
            manufacturer      = aByteArray.ReadUInt32();
            product           = aByteArray.ReadUInt32();
            samplePeriod      = aByteArray.ReadUInt32();
            midiUnityNote     = aByteArray.ReadUInt32();
            midiPitchFraction = aByteArray.ReadUInt32();
            smpteFormat       = aByteArray.ReadUInt32();
            smpteOffset       = aByteArray.ReadUInt32();
            sampleLoops       = aByteArray.ReadUInt32();
            samplerData       = aByteArray.ReadUInt32();

            informationList.Add("Manufacturer:" + manufacturer);
            informationList.Add("Product:" + product);
            informationList.Add("Sample Period:" + samplePeriod);
            informationList.Add("Midi Unity Note:" + midiUnityNote);
            informationList.Add("Midi Pitch Fraction:" + midiPitchFraction);
            informationList.Add("SMPTE Format:" + smpteFormat);
            informationList.Add("SMPTE Offset:" + smpteOffset);
            informationList.Add("Sample Loops:" + sampleLoops);
            informationList.Add("Sampler Data:" + samplerData);

            sampleLoopList = new List <SampleLoop>();

            for (int i = 0; i < sampleLoops; i++)
            {
                informationList.Add("----------------");

                sampleLoopList.Add(new SampleLoop(aByteArray, informationList));
            }
        }
示例#9
0
        public WaveSampleLoop(AByteArray aByteArray, List <string> aInformationList)
        {
            size       = aByteArray.ReadUInt32();
            loopType   = aByteArray.ReadUInt32();
            loopStart  = aByteArray.ReadUInt32();
            loopLength = aByteArray.ReadUInt32();

            aInformationList.Add("\tSize:" + size);
            aInformationList.Add("\tLoop Type:" + loopType);
            aInformationList.Add("\tLoop Start:" + loopStart);
            aInformationList.Add("\tLoop Length:" + loopLength);
        }
示例#10
0
        public RiffDls_Wlnk(string aId, UInt32 aSize, AByteArray aByteArray, RiffChunkList aParent)
            : base(aId, aSize, aByteArray, aParent)
        {
            options    = aByteArray.ReadUInt16();
            phaseGroup = aByteArray.ReadUInt16();
            channel    = aByteArray.ReadUInt32();
            tableIndex = aByteArray.ReadUInt32();

            informationList.Add("Options:" + options);
            informationList.Add("Phase Group:" + phaseGroup);
            informationList.Add("Channel:" + channel);
            informationList.Add("Table Index:" + tableIndex);
        }
示例#11
0
        public FormAiffSsnd(string aId, UInt32 aSize, AByteArray aByteArray, FormChunkList aParent)
            : base(aId, aSize, aByteArray, aParent)
        {
            offset    = aByteArray.ReadUInt32();
            blockSize = aByteArray.ReadUInt32();
            comment   = aByteArray.ReadString(( int )offset);

            dataSize = ( int )(Size - offset - 8);
            aByteArray.AddPosition(dataSize);

            informationList.Add("Offset:" + offset);
            informationList.Add("Block Size:" + blockSize);
            informationList.Add("Comment:" + comment);
        }
示例#12
0
        public RiffWaveFact(string aId, UInt32 aSize, AByteArray aByteArray, RiffChunkList aParent)
            : base(aId, aSize, aByteArray, aParent)
        {
            sampleLength = aByteArray.ReadUInt32();

            informationList.Add("Sample Length:" + sampleLength);
        }
示例#13
0
        public CuePoint(AByteArray aByteArray, List <string> aInformationList)
        {
            name         = aByteArray.ReadUInt32();
            position     = aByteArray.ReadUInt32();
            chunk        = aByteArray.ReadString(4);
            chunkStart   = aByteArray.ReadUInt32();
            blockStart   = aByteArray.ReadUInt32();
            sampleOffset = aByteArray.ReadUInt32();

            aInformationList.Add("    Name:" + name);
            aInformationList.Add("    Position:" + position);
            aInformationList.Add("    Chunk:" + chunk);
            aInformationList.Add("    Chunk Start:" + chunkStart);
            aInformationList.Add("    Block Start:" + blockStart);
            aInformationList.Add("    Sample Offset:" + sampleOffset);
        }
示例#14
0
        public RiffDls_Ptbl(string aId, UInt32 aSize, AByteArray aByteArray, RiffChunkList aParent)
            : base(aId, aSize, aByteArray, aParent)
        {
            lsize = aByteArray.ReadUInt32();
            cues  = aByteArray.ReadUInt32();

            informationList.Add("size:" + lsize);
            informationList.Add("Cues:" + cues);

            poolCues = new PoolCue[cues];

            for (int i = 0; i < cues; i++)
            {
                poolCues[i] = new PoolCue(aByteArray, informationList);
            }
        }
示例#15
0
        private void ReadChunk(AByteArray aByteArray)
        {
            string lId = aByteArray.ReadString(4);

            UInt32 lSize = aByteArray.ReadUInt32();

            int lPositionStart = aByteArray.Position;

            // Check Padding.
            if (lSize % 2 == 1)
            {
                if (lPositionStart + lSize <= aByteArray.Length && aByteArray.ReadByte(( int )(lPositionStart + lSize)) == 0x00)
                {
                    lSize++;

                    Logger.Debug("Padding:" + lSize);
                }
                else
                {
                    Logger.Debug("No Padding:" + lSize);
                }

                aByteArray.SetPosition(lPositionStart);
            }

            FormChunk lRiffWave = Construct(lId, lSize, aByteArray, this);

            chunkList.Add(lRiffWave);

            if (aByteArray.Position != lPositionStart + lSize)
            {
                Logger.Debug("Modify Position:" + aByteArray.Position + "->" + (lPositionStart + lSize));
                aByteArray.SetPosition(( int )(lPositionStart + lSize));
            }
        }
示例#16
0
        public RiffDls_Colh(string aId, UInt32 aSize, AByteArray aByteArray, RiffChunkList aParent)
            : base(aId, aSize, aByteArray, aParent)
        {
            instruments = aByteArray.ReadUInt32();

            informationList.Add("Instruments:" + instruments);
        }
示例#17
0
        public RiffDls_Msyn(string aId, UInt32 aSize, AByteArray aByteArray, RiffChunkList aParent)
            : base(aId, aSize, aByteArray, aParent)
        {
            msyn = aByteArray.ReadUInt32();

            informationList.Add("Msyn:" + msyn);
        }
示例#18
0
        // MIDIヘッダを読み込む.
        private void ReadMidiHeader(AByteArray byteArray)
        {
            string lId   = byteArray.ReadString(4);
            UInt32 lSize = byteArray.ReadUInt32();

            mthdChunk = new MthdChunk(lId, ( int )lSize);
            mthdChunk.Read(byteArray);
        }
示例#19
0
        public RiffWaveNote(string aId, UInt32 aSize, AByteArray aByteArray, RiffChunkList aParent)
            : base(aId, aSize, aByteArray, aParent)
        {
            name = aByteArray.ReadUInt32();
            data = aByteArray.ReadString(( int )Size - 4);

            informationList.Add("    Name:" + name);
            informationList.Add("    Data:" + data);
        }
示例#20
0
        public RiffDls_Insh(string aId, UInt32 aSize, AByteArray aByteArray, RiffChunkList aParent)
            : base(aId, aSize, aByteArray, aParent)
        {
            regions = aByteArray.ReadUInt32();

            informationList.Add("Regions:" + regions);

            midiLocal = new MidiLocal(aByteArray, informationList);
        }
示例#21
0
        public RiffWaveFmt_(string aId, UInt32 aSize, AByteArray aByteArray, RiffChunkList aParent)
            : base(aId, aSize, aByteArray, aParent)
        {
            formatTag          = ( FormatTag )aByteArray.ReadUInt16();
            channels           = aByteArray.ReadUInt16();
            samplesPerSec      = aByteArray.ReadUInt32();
            averageBytesPerSec = aByteArray.ReadUInt32();
            blockAlign         = aByteArray.ReadUInt16();
            bitsPerSample      = aByteArray.ReadUInt16();

            informationList.Add("Format Tag:" + formatTag);
            informationList.Add("Channels:" + channels);
            informationList.Add("Samples Per Sec:" + samplesPerSec);
            informationList.Add("Average Bytes Per Sec:" + averageBytesPerSec);
            informationList.Add("Block Align:" + blockAlign);
            informationList.Add("Bits Per Sample:" + bitsPerSample);

            Logger.BreakDebug("Size" + aSize);
        }
示例#22
0
        public RiffDls_Fmt_(string aId, UInt32 aSize, AByteArray aByteArray, RiffChunkList aParent)
            : base(aId, aSize, aByteArray, aParent)
        {
            tag                = aByteArray.ReadUInt16();
            channles           = aByteArray.ReadUInt16();
            samplesPerSec      = aByteArray.ReadUInt32();
            averageBytesPerSec = aByteArray.ReadUInt32();
            blockAlign         = aByteArray.ReadUInt16();
            bitsPerSample      = aByteArray.ReadUInt16();

            informationList.Add("Tag:" + tag);
            informationList.Add("Channels:" + channles);
            informationList.Add("Samples Per Sec:" + samplesPerSec);
            informationList.Add("Average Bytes Per Sec:" + averageBytesPerSec);
            informationList.Add("Block Align:" + blockAlign);
            informationList.Add("Bits Per Sample:" + bitsPerSample);

            aByteArray.SetPosition(( int )(position + Size));
        }
示例#23
0
        public RiffWaveLtxt(string aId, UInt32 aSize, AByteArray aByteArray, RiffChunkList aParent)
            : base(aId, aSize, aByteArray, aParent)
        {
            name         = aByteArray.ReadUInt32();
            sampleLength = aByteArray.ReadUInt32();
            purpose      = aByteArray.ReadUInt32();
            country      = aByteArray.ReadUInt16();
            language     = aByteArray.ReadUInt16();
            dialect      = aByteArray.ReadUInt16();
            codePage     = aByteArray.ReadUInt16();
            data         = aByteArray.ReadBytes(Size - 20);

            informationList.Add("    Name:" + name);
            informationList.Add("    Sample Length:" + sampleLength);
            informationList.Add("    Purpose:" + purpose);
            informationList.Add("    Country:" + country);
            informationList.Add("    Language:" + language);
            informationList.Add("    Dialect:" + dialect);
            informationList.Add("    CodePage:" + codePage);
            informationList.Add("    Data:" + data.Length);
        }
示例#24
0
        public PhdrData(AByteArray aByteArray, List <string> aInformationList)
        {
            name       = aByteArray.ReadString(20);
            preset     = aByteArray.ReadUInt16();
            bank       = aByteArray.ReadUInt16();
            bagNdx     = aByteArray.ReadUInt16();
            library    = aByteArray.ReadUInt32();
            genre      = aByteArray.ReadUInt32();
            morphology = aByteArray.ReadUInt32();

            instrumentList = new List <UInt16>();

            aInformationList.Add("Name:" + name);
            aInformationList.Add("Preset:" + preset);
            aInformationList.Add("Bank:" + bank);
            aInformationList.Add("Bag Ndx:" + bagNdx);
            aInformationList.Add("Library:" + library);
            aInformationList.Add("Genre:" + genre);
            aInformationList.Add("Morphology:" + morphology);
            aInformationList.Add("End Of Presets:" + endOfPresets);
        }
示例#25
0
        public FormAiffComm(string aId, UInt32 aSize, AByteArray aByteArray, FormChunkList aParent)
            : base(aId, aSize, aByteArray, aParent)
        {
            numberOfChannels = aByteArray.ReadUInt16();
            numberOfFrames   = aByteArray.ReadUInt32();
            bitsPerSamples   = aByteArray.ReadUInt16();
            sampleRate       = aByteArray.ReadExtendedFloatPoint();

            informationList.Add("Number Of Channels:" + numberOfChannels);
            informationList.Add("Number Of Frames:" + numberOfFrames);
            informationList.Add("Bits Per Samples:" + bitsPerSamples);
            informationList.Add("Sample Rate:" + sampleRate);
        }
示例#26
0
        public RiffDls_Dlid(string aId, UInt32 aSize, AByteArray aByteArray, RiffChunkList aParent)
            : base(aId, aSize, aByteArray, aParent)
        {
            data1 = aByteArray.ReadUInt32();
            data2 = aByteArray.ReadUInt16();
            data3 = aByteArray.ReadUInt16();
            data4 = aByteArray.ReadBytes(8);

            informationList.Add("Data1:" + data1);
            informationList.Add("Data2:" + data2);
            informationList.Add("Data3:" + data3);
            informationList.Add("Data4:" + data4);
        }
示例#27
0
        // MIDIトラックを読み込む.
        private void ReadMidiTrack(AByteArray byteArray)
        {
            mtrkChunkArray = new MtrkChunk[mthdChunk.GetTracks()];

            for (int i = 0; i < mthdChunk.GetTracks(); i++)
            {
                string lId   = byteArray.ReadString(4);
                UInt32 lSize = byteArray.ReadUInt32();

                mtrkChunkArray[i] = new MtrkChunk(lId, ( int )lSize);
                mtrkChunkArray[i].Read(byteArray);
            }
        }
示例#28
0
        public RiffWaveCue_(string aId, UInt32 aSize, AByteArray aByteArray, RiffChunkList aParent)
            : base(aId, aSize, aByteArray, aParent)
        {
            points = aByteArray.ReadUInt32();

            informationList.Add("Points:" + points);

            cuePoints = new List <CuePoint>();

            for (int i = 0; i < points; i++)
            {
                informationList.Add("----------------");

                cuePoints.Add(new CuePoint(aByteArray, informationList));
            }
        }
示例#29
0
        public RiffWavePlst(string aId, UInt32 aSize, AByteArray aByteArray, RiffChunkList aParent)
            : base(aId, aSize, aByteArray, aParent)
        {
            segments = aByteArray.ReadUInt32();

            informationList.Add("Segments:" + segments);

            PlaySegments = new List <PlaySegment>();

            for (int i = 0; i < segments; i++)
            {
                informationList.Add("----------------");

                PlaySegments.Add(new PlaySegment(aByteArray, informationList));
            }
        }
示例#30
0
        public SampleLoop(AByteArray aByteArray, List <string> aInformationList)
        {
            cuePointId = aByteArray.ReadUInt32();
            type       = aByteArray.ReadUInt32();
            start      = aByteArray.ReadUInt32();
            end        = aByteArray.ReadUInt32();
            fraction   = aByteArray.ReadUInt32();
            playCount  = aByteArray.ReadUInt32();

            aInformationList.Add("Cue Point ID:" + cuePointId);
            aInformationList.Add("Type:" + type);
            aInformationList.Add("Start:" + start);
            aInformationList.Add("End:" + end);
            aInformationList.Add("Fraction:" + fraction);
            aInformationList.Add("Play Count:" + playCount);
        }