예제 #1
0
            private void _read()
            {
                _type     = ((InstTypes)m_io.ReadU1());
                _filename = KaitaiStream.BytesTerminate(m_io.ReadBytes(12), 0, false);
                switch (Type)
                {
                case InstTypes.Sample: {
                    _body = new Sampled(m_io, this, m_root);
                    break;
                }

                default: {
                    _body = new Adlib(m_io, this, m_root);
                    break;
                }
                }
                _tuningHz   = m_io.ReadU4le();
                _reserved2  = m_io.ReadBytes(12);
                _sampleName = KaitaiStream.BytesTerminate(m_io.ReadBytes(28), 0, false);
                _magic      = m_io.ReadBytes(4);
                if (!((KaitaiStream.ByteArrayCompare(Magic, new byte[] { 83, 67, 82, 83 }) == 0)))
                {
                    throw new ValidationNotEqualError(new byte[] { 83, 67, 82, 83 }, Magic, M_Io, "/types/instrument/seq/6");
                }
            }
예제 #2
0
 private void _read()
 {
     _version = m_io.ReadU4be();
     if (!(Version == 2))
     {
         throw new ValidationNotEqualError(2, Version, M_Io, "/types/header/seq/0");
     }
     _width = m_io.ReadU4be();
     if (!(Width >= 1))
     {
         throw new ValidationLessThanError(1, Width, M_Io, "/types/header/seq/1");
     }
     if (!(Width <= 10000))
     {
         throw new ValidationGreaterThanError(10000, Width, M_Io, "/types/header/seq/1");
     }
     _height = m_io.ReadU4be();
     if (!(Height >= 1))
     {
         throw new ValidationLessThanError(1, Height, M_Io, "/types/header/seq/2");
     }
     if (!(Height <= 10000))
     {
         throw new ValidationGreaterThanError(10000, Height, M_Io, "/types/header/seq/2");
     }
     _bytesPerPixel = ((GimpBrush.ColorDepth)m_io.ReadU4be());
     _magic         = m_io.ReadBytes(4);
     if (!((KaitaiStream.ByteArrayCompare(Magic, new byte[] { 71, 73, 77, 80 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 71, 73, 77, 80 }, Magic, M_Io, "/types/header/seq/4");
     }
     _spacing   = m_io.ReadU4be();
     _brushName = System.Text.Encoding.GetEncoding("UTF-8").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytesFull(), 0, false));
 }
예제 #3
0
 private void _read()
 {
     _timestamp = m_io.ReadU4le();
     _offsetIdx = m_io.ReadU2le();
     _flags     = m_io.ReadU1();
     _name      = System.Text.Encoding.GetEncoding("ASCII").GetString(KaitaiStream.BytesTerminate(KaitaiStream.BytesStripRight(m_io.ReadBytes(25), 0), 0, false));
 }
예제 #4
0
 private void _read()
 {
     _songName = KaitaiStream.BytesTerminate(m_io.ReadBytes(28), 0, false);
     _magic1   = m_io.ReadBytes(1);
     if (!((KaitaiStream.ByteArrayCompare(Magic1, new byte[] { 26 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 26 }, Magic1, M_Io, "/seq/1");
     }
     _fileType       = m_io.ReadU1();
     _reserved1      = m_io.ReadBytes(2);
     _numOrders      = m_io.ReadU2le();
     _numInstruments = m_io.ReadU2le();
     _numPatterns    = m_io.ReadU2le();
     _flags          = m_io.ReadU2le();
     _version        = m_io.ReadU2le();
     _samplesFormat  = m_io.ReadU2le();
     _magic2         = m_io.ReadBytes(4);
     if (!((KaitaiStream.ByteArrayCompare(Magic2, new byte[] { 83, 67, 82, 77 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 83, 67, 82, 77 }, Magic2, M_Io, "/seq/10");
     }
     _globalVolume = m_io.ReadU1();
     _initialSpeed = m_io.ReadU1();
     _initialTempo = m_io.ReadU1();
     _isStereo     = m_io.ReadBitsIntBe(1) != 0;
     _masterVolume = m_io.ReadBitsIntBe(7);
     m_io.AlignToByte();
     _ultraClickRemoval = m_io.ReadU1();
     _hasCustomPan      = m_io.ReadU1();
     _reserved2         = m_io.ReadBytes(8);
     _ofsSpecial        = m_io.ReadU2le();
     _channels          = new List <Channel>();
     for (var i = 0; i < 32; i++)
     {
         _channels.Add(new Channel(m_io, this, m_root));
     }
     _orders      = m_io.ReadBytes(NumOrders);
     _instruments = new List <InstrumentPtr>();
     for (var i = 0; i < NumInstruments; i++)
     {
         _instruments.Add(new InstrumentPtr(m_io, this, m_root));
     }
     _patterns = new List <PatternPtr>();
     for (var i = 0; i < NumPatterns; i++)
     {
         _patterns.Add(new PatternPtr(m_io, this, m_root));
     }
     if (HasCustomPan == 252)
     {
         _channelPans = new List <ChannelPan>();
         for (var i = 0; i < 32; i++)
         {
             _channelPans.Add(new ChannelPan(m_io, this, m_root));
         }
     }
 }
예제 #5
0
 private void _read()
 {
     _version   = new Version(m_io, this, m_root);
     _productId = System.Text.Encoding.GetEncoding("utf-8").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(12), 0, false));
     _compHw    = new List <HwCompInfo>();
     for (var i = 0; i < 4; i++)
     {
         _compHw.Add(new HwCompInfo(m_io, this, m_root));
     }
     _reserved = m_io.ReadBytes(32);
 }
예제 #6
0
 private void _read()
 {
     _bboxMin  = new MdlVertex(m_io, this, m_root);
     _bboxMax  = new MdlVertex(m_io, this, m_root);
     _name     = System.Text.Encoding.GetEncoding("ASCII").GetString(KaitaiStream.BytesTerminate(KaitaiStream.BytesStripRight(m_io.ReadBytes(16), 0), 0, false));
     _vertices = new List <MdlVertex>();
     for (var i = 0; i < M_Root.Header.NumVerts; i++)
     {
         _vertices.Add(new MdlVertex(m_io, this, m_root));
     }
 }
예제 #7
0
 private void _read()
 {
     _name          = System.Text.Encoding.GetEncoding("ASCII").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(11), 0, false));
     _datatype      = m_io.ReadU1();
     _dataAddress   = m_io.ReadU4le();
     _length        = m_io.ReadU1();
     _decimalCount  = m_io.ReadU1();
     _reserved1     = m_io.ReadBytes(2);
     _workAreaId    = m_io.ReadU1();
     _reserved2     = m_io.ReadBytes(2);
     _setFieldsFlag = m_io.ReadU1();
     _reserved3     = m_io.ReadBytes(8);
 }
예제 #8
0
 private void _read()
 {
     _songName       = KaitaiStream.BytesTerminate(m_io.ReadBytes(28), 0, false);
     _magic1         = m_io.EnsureFixedContents(new byte[] { 26 });
     _fileType       = m_io.ReadU1();
     _reserved1      = m_io.ReadBytes(2);
     _numOrders      = m_io.ReadU2le();
     _numInstruments = m_io.ReadU2le();
     _numPatterns    = m_io.ReadU2le();
     _flags          = m_io.ReadU2le();
     _version        = m_io.ReadU2le();
     _samplesFormat  = m_io.ReadU2le();
     _magic2         = m_io.EnsureFixedContents(new byte[] { 83, 67, 82, 77 });
     _globalVolume   = m_io.ReadU1();
     _initialSpeed   = m_io.ReadU1();
     _initialTempo   = m_io.ReadU1();
     _isStereo       = m_io.ReadBitsInt(1) != 0;
     _masterVolume   = m_io.ReadBitsInt(7);
     m_io.AlignToByte();
     _ultraClickRemoval = m_io.ReadU1();
     _hasCustomPan      = m_io.ReadU1();
     _reserved2         = m_io.ReadBytes(8);
     _ofsSpecial        = m_io.ReadU2le();
     _channels          = new List <Channel>((int)(32));
     for (var i = 0; i < 32; i++)
     {
         _channels.Add(new Channel(m_io, this, m_root));
     }
     _orders      = m_io.ReadBytes(NumOrders);
     _instruments = new List <InstrumentPtr>((int)(NumInstruments));
     for (var i = 0; i < NumInstruments; i++)
     {
         _instruments.Add(new InstrumentPtr(m_io, this, m_root));
     }
     _patterns = new List <PatternPtr>((int)(NumPatterns));
     for (var i = 0; i < NumPatterns; i++)
     {
         _patterns.Add(new PatternPtr(m_io, this, m_root));
     }
     if (HasCustomPan == 252)
     {
         _channelPans = new List <ChannelPan>((int)(32));
         for (var i = 0; i < 32; i++)
         {
             _channelPans.Add(new ChannelPan(m_io, this, m_root));
         }
     }
 }
예제 #9
0
 private void _read()
 {
     _signature0 = m_io.ReadBytes(17);
     if (!((KaitaiStream.ByteArrayCompare(Signature0, new byte[] { 69, 120, 116, 101, 110, 100, 101, 100, 32, 77, 111, 100, 117, 108, 101, 58, 32 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 69, 120, 116, 101, 110, 100, 101, 100, 32, 77, 111, 100, 117, 108, 101, 58, 32 }, Signature0, M_Io, "/types/preheader/seq/0");
     }
     _moduleName = System.Text.Encoding.GetEncoding("utf-8").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(20), 0, false));
     _signature1 = m_io.ReadBytes(1);
     if (!((KaitaiStream.ByteArrayCompare(Signature1, new byte[] { 26 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 26 }, Signature1, M_Io, "/types/preheader/seq/2");
     }
     _trackerName   = System.Text.Encoding.GetEncoding("utf-8").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(20), 0, false));
     _versionNumber = new Version(m_io, this, m_root);
     _headerSize    = m_io.ReadU4le();
 }
예제 #10
0
            private void _read()
            {
                _type     = ((InstTypes)m_io.ReadU1());
                _filename = KaitaiStream.BytesTerminate(m_io.ReadBytes(12), 0, false);
                switch (Type)
                {
                case InstTypes.Sample: {
                    _body = new Sampled(m_io, this, m_root);
                    break;
                }

                default: {
                    _body = new Adlib(m_io, this, m_root);
                    break;
                }
                }
                _tuningHz   = m_io.ReadU4le();
                _reserved2  = m_io.ReadBytes(12);
                _sampleName = KaitaiStream.BytesTerminate(m_io.ReadBytes(28), 0, false);
                _magic      = m_io.EnsureFixedContents(new byte[] { 83, 67, 82, 83 });
            }
예제 #11
0
 private void _read()
 {
     _marChannelName = System.Text.Encoding.GetEncoding("UTF-8").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(64), 0, false));
     _productVersion = System.Text.Encoding.GetEncoding("UTF-8").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(32), 0, false));
 }
예제 #12
0
 private void _read()
 {
     _lenStr    = m_io.ReadU4le();
     _str       = System.Text.Encoding.GetEncoding("ascii").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(LenStr), 0, false));
     _alignment = new Alignment(m_io, this, m_root);
 }
예제 #13
0
 private void _read()
 {
     _name = System.Text.Encoding.GetEncoding("UTF-8").GetString(KaitaiStream.BytesTerminate(KaitaiStream.BytesStripRight(m_io.ReadBytes(56), 0), 0, false));
     _ofs  = m_io.ReadU4le();
     _size = m_io.ReadU4le();
 }
예제 #14
0
 private void _read()
 {
     _name             = System.Text.Encoding.GetEncoding("UTF-8").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(36), 0, false));
     _flagSlotSuffixed = m_io.ReadBitsIntLe(1) != 0;
     _flagsReserved    = m_io.ReadBitsIntLe(31);
     m_io.AlignToByte();
     _maximumSize = m_io.ReadU8le();
 }
예제 #15
0
 private void _read()
 {
     _magic = m_io.ReadBytes(4);
     if (!((KaitaiStream.ByteArrayCompare(Magic, new byte[] { 60, 214, 26, 206 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 60, 214, 26, 206 }, Magic, M_Io, "/types/meta_hdr/seq/0");
     }
     _version        = new Version(m_io, this, m_root);
     _imageVersion   = System.Text.Encoding.GetEncoding("ASCII").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(64), 0, false));
     _lenMetaHeader  = m_io.ReadU2le();
     _lenImageHeader = m_io.ReadU2le();
 }
 private void _read()
 {
     _magic              = m_io.EnsureFixedContents(new byte[] { 80, 77 });
     _reserved1          = m_io.ReadBytes(2);
     _numberOfPartitions = m_io.ReadU4be();
     _partitionStart     = m_io.ReadU4be();
     _partitionSize      = m_io.ReadU4be();
     _partitionName      = System.Text.Encoding.GetEncoding("ascii").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(32), 0, false));
     _partitionType      = System.Text.Encoding.GetEncoding("ascii").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(32), 0, false));
     _dataStart          = m_io.ReadU4be();
     _dataSize           = m_io.ReadU4be();
     _partitionStatus    = m_io.ReadU4be();
     _bootCodeStart      = m_io.ReadU4be();
     _bootCodeSize       = m_io.ReadU4be();
     _bootLoaderAddress  = m_io.ReadU4be();
     _reserved2          = m_io.ReadBytes(4);
     _bootCodeEntry      = m_io.ReadU4be();
     _reserved3          = m_io.ReadBytes(4);
     _bootCodeCksum      = m_io.ReadU4be();
     _processorType      = System.Text.Encoding.GetEncoding("ascii").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(16), 0, false));
 }
예제 #17
0
 private void _read()
 {
     _name       = System.Text.Encoding.GetEncoding("utf-8").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(22), 0, false));
     _type       = m_io.ReadU1();
     _numSamples = m_io.ReadU2le();
     if (NumSamples > 0)
     {
         _extraHeader = new ExtraHeader(m_io, this, m_root);
     }
 }
예제 #18
0
 private void _read()
 {
     _version             = m_io.ReadU4le();
     _cwd                 = System.Text.Encoding.GetEncoding("UTF-8").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(256), 0, false));
     _dictsPos            = m_io.ReadU4le();
     _masksPos            = m_io.ReadU4le();
     _padding             = m_io.ReadBytes(4);
     _currentRestorePoint = m_io.ReadU8le();
     _argc                = m_io.ReadU4le();
     _padding2            = m_io.ReadBytes(12);
     _argv                = new List <string>();
     for (var i = 0; i < Argc; i++)
     {
         _argv.Add(System.Text.Encoding.GetEncoding("UTF-8").GetString(m_io.ReadBytesTerm(10, false, true, true)));
     }
 }
예제 #19
0
 private void _read()
 {
     _firstLogicalSector = m_io.ReadU8le();
     _alignment          = m_io.ReadU4le();
     _alignmentOffset    = m_io.ReadU4le();
     _size             = m_io.ReadU8le();
     _partitionName    = System.Text.Encoding.GetEncoding("UTF-8").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(36), 0, false));
     _flagSlotSuffixed = m_io.ReadBitsIntLe(1) != 0;
     _flagsReserved    = m_io.ReadBitsIntLe(31);
 }
예제 #20
0
 private void _read()
 {
     _magic = m_io.ReadBytes(2);
     if (!((KaitaiStream.ByteArrayCompare(Magic, new byte[] { 80, 77 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 80, 77 }, Magic, M_Io, "/types/partition_entry/seq/0");
     }
     _reserved1          = m_io.ReadBytes(2);
     _numberOfPartitions = m_io.ReadU4be();
     _partitionStart     = m_io.ReadU4be();
     _partitionSize      = m_io.ReadU4be();
     _partitionName      = System.Text.Encoding.GetEncoding("ascii").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(32), 0, false));
     _partitionType      = System.Text.Encoding.GetEncoding("ascii").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(32), 0, false));
     _dataStart          = m_io.ReadU4be();
     _dataSize           = m_io.ReadU4be();
     _partitionStatus    = m_io.ReadU4be();
     _bootCodeStart      = m_io.ReadU4be();
     _bootCodeSize       = m_io.ReadU4be();
     _bootLoaderAddress  = m_io.ReadU4be();
     _reserved2          = m_io.ReadBytes(4);
     _bootCodeEntry      = m_io.ReadU4be();
     _reserved3          = m_io.ReadBytes(4);
     _bootCodeCksum      = m_io.ReadU4be();
     _processorType      = System.Text.Encoding.GetEncoding("ascii").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(16), 0, false));
 }
예제 #21
0
 private void _read()
 {
     _magic = m_io.ReadBytes(8);
     if (!((KaitaiStream.ByteArrayCompare(Magic, new byte[] { 35, 79, 80, 76, 95, 73, 73, 35 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 35, 79, 80, 76, 95, 73, 73, 35 }, Magic, M_Io, "/seq/0");
     }
     _instruments = new List <InstrumentEntry>();
     for (var i = 0; i < 175; i++)
     {
         _instruments.Add(new InstrumentEntry(m_io, this, m_root));
     }
     _instrumentNames = new List <string>();
     for (var i = 0; i < 175; i++)
     {
         _instrumentNames.Add(System.Text.Encoding.GetEncoding("ASCII").GetString(KaitaiStream.BytesTerminate(KaitaiStream.BytesStripRight(m_io.ReadBytes(32), 0), 0, false)));
     }
 }
예제 #22
0
 private void _read()
 {
     _magic       = m_io.EnsureFixedContents(new byte[] { 35, 79, 80, 76, 95, 73, 73, 35 });
     _instruments = new List <InstrumentEntry>((int)(175));
     for (var i = 0; i < 175; i++)
     {
         _instruments.Add(new InstrumentEntry(m_io, this, m_root));
     }
     _instrumentNames = new List <string>((int)(175));
     for (var i = 0; i < 175; i++)
     {
         _instrumentNames.Add(System.Text.Encoding.GetEncoding("ASCII").GetString(KaitaiStream.BytesTerminate(KaitaiStream.BytesStripRight(m_io.ReadBytes(32), 0), 0, false)));
     }
 }
예제 #23
0
 private void _read()
 {
     _name    = System.Text.Encoding.GetEncoding("ASCII").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(72), 0, false));
     _ofsBody = m_io.ReadU4le();
     _lenBody = m_io.ReadU4le();
 }
예제 #24
0
 private void _read()
 {
     _sampleLength       = m_io.ReadU4le();
     _sampleLoopStart    = m_io.ReadU4le();
     _sampleLoopLength   = m_io.ReadU4le();
     _volume             = m_io.ReadU1();
     _fineTune           = m_io.ReadS1();
     _type               = new LoopType(m_io, this, m_root);
     _panning            = m_io.ReadU1();
     _relativeNoteNumber = m_io.ReadS1();
     _reserved           = m_io.ReadU1();
     _name               = System.Text.Encoding.GetEncoding("utf-8").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(22), 0, false));
 }
예제 #25
0
 private void _read()
 {
     _description         = System.Text.Encoding.GetEncoding("ASCII").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(256), 0, false));
     _originator          = System.Text.Encoding.GetEncoding("ASCII").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(32), 0, false));
     _originatorReference = System.Text.Encoding.GetEncoding("ASCII").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(32), 0, false));
     _originationDate     = System.Text.Encoding.GetEncoding("ASCII").GetString(m_io.ReadBytes(10));
     _originationTime     = System.Text.Encoding.GetEncoding("ASCII").GetString(m_io.ReadBytes(8));
     _timeReferenceLow    = m_io.ReadU4le();
     _timeReferenceHigh   = m_io.ReadU4le();
     _version             = m_io.ReadU2le();
     _umid                 = m_io.ReadBytes(64);
     _loudnessValue        = m_io.ReadU2le();
     _loudnessRange        = m_io.ReadU2le();
     _maxTruePeakLevel     = m_io.ReadU2le();
     _maxMomentaryLoudness = m_io.ReadU2le();
     _maxShortTermLoudness = m_io.ReadU2le();
 }
예제 #26
0
 private void _read()
 {
     _name             = System.Text.Encoding.GetEncoding("UTF-8").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(36), 0, false));
     _attrReadonly     = m_io.ReadBitsIntLe(1) != 0;
     _attrSlotSuffixed = m_io.ReadBitsIntLe(1) != 0;
     _attrUpdated      = m_io.ReadBitsIntLe(1) != 0;
     _attrDisabled     = m_io.ReadBitsIntLe(1) != 0;
     _attrsReserved    = m_io.ReadBitsIntLe(28);
     m_io.AlignToByte();
     _firstExtentIndex = m_io.ReadU4le();
     _numExtents       = m_io.ReadU4le();
     _groupIndex       = m_io.ReadU4le();
 }