// deserializing protected void LoadFromReader(BinaryReader reader) { int count; voice0 = new Voice(reader); voice1 = new Voice(reader); voice2 = new Voice(reader); voice0.wave.UpdateAfterLoad(voice0, voice1, voice2); voice1.wave.UpdateAfterLoad(voice0, voice1, voice2); voice2.wave.UpdateAfterLoad(voice0, voice1, voice2); filter = new Filter(reader); extfilt = new ExternalFilter(reader); bus_value = reader.ReadInt32(); bus_value_ttl = reader.ReadInt32(); clock_frequency = reader.ReadDouble(); ext_in = reader.ReadInt32(); sampling = (SIDDefs.sampling_method)reader.ReadInt16(); cycles_per_sample = reader.ReadInt32(); sample_offset = reader.ReadInt32(); sample_index = reader.ReadInt32(); sample_prev = reader.ReadInt16(); fir_N = reader.ReadInt32(); fir_RES = reader.ReadInt32(); count = reader.ReadInt32(); if (count == -1) { sample = null; } else { sample = new short[count]; for (int i = 0; i < count; i++) { sample[i] = reader.ReadInt16(); } } count = reader.ReadInt32(); if (count == -1) { fir = null; } else { fir = new short[count]; for (int i = 0; i < count; i++) { fir[i] = reader.ReadInt16(); } } }
/// <summary> /// Constructor /// </summary> public SID() { voice0 = new Voice(); voice1 = new Voice(); voice2 = new Voice(); filter = new Filter(); extfilt = new ExternalFilter(); // Initialize pointers. sample = null; fir = null; voice0.set_sync_source(voice2); voice1.set_sync_source(voice0); voice2.set_sync_source(voice1); set_sampling_parameters(985248, SIDDefs.sampling_method.SAMPLE_FAST, 44100, -1, 0.97); bus_value = 0; bus_value_ttl = 0; ext_in = 0; }