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); }
public void SetOffset(int newOffset) { offset = newOffset; gSample.SetOffset(offset + 0x10); }
public void SetOffset(int newOffset) { offset = newOffset; // Yes there will be errors if you set the offset of a bad sample, but only for now gSample.SetOffset(offset + 0x10); }