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

Method LoadState

Source/RadioSequencer.cpp:389–454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

387}
388
389void RadioSequencer::LoadState(FileStreamIn& in, int rev)
390{
391 mLoadRev = rev;
392
393 if (ModularSynth::sLoadingFileSaveStateRev == 422)
394 {
395 in >> mLoadRev;
396 LoadStateValidate(mLoadRev <= GetModuleSaveStateRev());
397 }
398
399 IDrawableModule::LoadState(in, rev);
400
401 if (ModularSynth::sLoadingFileSaveStateRev <= 421)
402 {
403 in >> mLoadRev;
404 LoadStateValidate(mLoadRev <= GetModuleSaveStateRev());
405 }
406
407 if (rev <= 1)
408 {
409 int size;
410 in >> size;
411 mControlCables.resize(size);
412 for (auto cable : mControlCables)
413 {
414 std::string path;
415 in >> path;
416 }
417 }
418
419 mGrid->LoadState(in);
420
421 if (mLoadRev >= 1)
422 {
423 float width, height;
424 in >> width;
425 in >> height;
426 mGrid->SetDimensions(width, height);
427 }
428
429 if (mLoadRev == 0)
430 {
431 //port old data
432 float len = 0;
433 if (mOldLengthStr == "4")
434 len = 4;
435 if (mOldLengthStr == "6")
436 len = 6;
437 if (mOldLengthStr == "8")
438 len = 8;
439 if (mOldLengthStr == "16")
440 len = 16;
441 if (mOldLengthStr == "32")
442 len = 32;
443 if (mOldLengthStr == "64")
444 len = 64;
445 if (mOldLengthStr == "128")
446 len = 128;

Callers

nothing calls this directly

Calls 6

LoadStateValidateFunction · 0.85
resizeMethod · 0.80
SetDimensionsMethod · 0.45
GetRangeMethod · 0.45
SetExtentsMethod · 0.45

Tested by

no test coverage detected