Beispiel #1
0
		public void Load(Instrument[] instruments)
		{
			foreach (Generator g in Generators)
			{
				if (g.GeneratorType == GeneratorEnum.Instrument)
				{
					g.Instrument = instruments[g.UInt16Amount];
				}
			}
		}
Beispiel #2
0
		public override object Read(BinaryReader br)
		{
			var i = new Instrument();
			string s = Encoding.ASCII.GetString(br.ReadBytes(20));
			if (s.IndexOf('\0') >= 0)
			{
				s = s.Substring(0, s.IndexOf('\0'));
			}
			i.Name = s;
			i.startInstrumentZoneIndex = br.ReadUInt16();
			if (lastInstrument != null)
			{
				lastInstrument.endInstrumentZoneIndex = (ushort) (i.startInstrumentZoneIndex - 1);
			}
			data.Add(i);
			lastInstrument = i;
			return i;
		}