MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / LoadState

Method LoadState

Source/EnvelopeModulator.cpp:171–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171void EnvelopeModulator::LoadState(FileStreamIn& in, int rev)
172{
173 if (rev < 1)
174 {
175 // Temporary additional cable source
176 mTargetCable = new PatchCableSource(this, kConnectionType_Modulator);
177 mTargetCable->SetModulatorOwner(this);
178 AddPatchCableSource(mTargetCable);
179 }
180
181 IDrawableModule::LoadState(in, rev);
182
183 if (rev < 1)
184 {
185 const auto target = GetPatchCableSource(1)->GetTarget();
186 if (target != nullptr)
187 GetPatchCableSource()->SetTarget(target);
188 RemovePatchCableSource(GetPatchCableSource(1));
189 mTargetCable = GetPatchCableSource();
190 }
191
192 if (ModularSynth::sLoadingFileSaveStateRev < 423)
193 in >> rev;
194 LoadStateValidate(rev <= GetModuleSaveStateRev());
195
196 mAdsr.LoadState(in);
197}

Callers

nothing calls this directly

Calls 4

LoadStateValidateFunction · 0.85
SetModulatorOwnerMethod · 0.80
GetTargetMethod · 0.45
SetTargetMethod · 0.45

Tested by

no test coverage detected