public void Load(SampleHeader[] sampleHeaders) { foreach (Generator g in Generators) { if (g.GeneratorType == GeneratorEnum.SampleID) { g.SampleHeader = sampleHeaders[g.UInt16Amount]; } } }
public override object Read(BinaryReader br) { var sh = new SampleHeader(); string s = Encoding.ASCII.GetString(br.ReadBytes(20)); if (s.IndexOf('\0') >= 0) { s = s.Substring(0, s.IndexOf('\0')); } sh.SampleName = s; sh.Start = br.ReadUInt32(); sh.End = br.ReadUInt32(); sh.StartLoop = br.ReadUInt32(); sh.EndLoop = br.ReadUInt32(); sh.SampleRate = br.ReadUInt32(); sh.OriginalPitch = br.ReadByte(); sh.PitchCorrection = br.ReadSByte(); sh.SampleLink = br.ReadUInt16(); sh.SFSampleLink = (SFSampleLink) br.ReadUInt16(); data.Add(sh); return sh; }
public override object Read(BinaryReader br) { var sh = new SampleHeader(); string s = Encoding.ASCII.GetString(br.ReadBytes(20)); if (s.IndexOf('\0') >= 0) { s = s.Substring(0, s.IndexOf('\0')); } sh.SampleName = s; sh.Start = br.ReadUInt32(); sh.End = br.ReadUInt32(); sh.StartLoop = br.ReadUInt32(); sh.EndLoop = br.ReadUInt32(); sh.SampleRate = br.ReadUInt32(); sh.OriginalPitch = br.ReadByte(); sh.PitchCorrection = br.ReadSByte(); sh.SampleLink = br.ReadUInt16(); sh.SFSampleLink = (SFSampleLink)br.ReadUInt16(); data.Add(sh); return(sh); }