Exemplo n.º 1
0
        public M4AWrappedSample(int offset)
        {
            this.offset = offset;

            if (offset == 0 || !ROM.IsValidRomOffset(offset))
            {
                goto fail;
            }

            sample = ROM.Instance.Reader.ReadObject <M4AMLSSSample>(offset);

            if (!ROM.IsValidRomOffset(sample.Length + (offset + 0x10)))
            {
                goto fail;
            }

            gSample = new WrappedSample(sample.DoesLoop == 0x40000000, sample.LoopPoint, sample.Length, sample.Frequency >> 10, false);
            gSample.SetOffset(offset + 0x10);
            return;

fail:
            sample  = new M4AMLSSSample();
            gSample = null;
            Console.WriteLine("Error loading instrument at 0x{0:X}.", offset);
        }
Exemplo n.º 2
0
        internal M4ASSample(uint offset)
        {
            Offset = offset;
            sample = ROM.Instance.ReadStruct <M4AMLSSSample>(offset);

            if (offset == 0 || !ROM.IsValidRomOffset(offset - ROM.Pak) || !ROM.IsValidRomOffset(sample.Length + (offset + 0x10) - ROM.Pak))
            {
                goto fail;
            }

            gSample = new Sample(sample.DoesLoop == 0x40000000, sample.LoopPoint, sample.Length, sample.Frequency >> 10, offset + 0x10, false);
            return;

fail:
            Console.WriteLine("Error loading instrument at 0x{0:X}.", offset);
        }
Exemplo n.º 3
0
 public MLSSWrappedSample(int offset)
 {
     sample  = ROM.Instance.Reader.ReadObject <M4AMLSSSample>(offset);
     gSample = new WrappedSample(sample.DoesLoop == 0x40000000, sample.LoopPoint, sample.Length, sample.Frequency >> 10, true);
     SetOffset(offset);
 }
Exemplo n.º 4
0
 internal MLSSSSample(uint offset)
 {
     Offset  = offset;
     sample  = ROM.Instance.ReadStruct <M4AMLSSSample>(offset);
     gSample = new Sample(sample.DoesLoop == 0x40000000, sample.LoopPoint, sample.Length, sample.Frequency >> 10, offset + 0x10, true);
 }