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

Method LoadState

Source/NoteLooper.cpp:431–466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

429}
430
431void NoteLooper::LoadState(FileStreamIn& in, int rev)
432{
433 IDrawableModule::LoadState(in, rev);
434
435 if (!ModuleContainer::DoesModuleHaveMoreSaveData(in))
436 return; //this was saved before we added versioning, bail out
437
438 if (ModularSynth::sLoadingFileSaveStateRev < 423)
439 in >> rev;
440 LoadStateValidate(rev <= GetModuleSaveStateRev());
441
442 in >> mWidth;
443 in >> mHeight;
444 Resize(mWidth, mHeight);
445
446 in >> mMinRow;
447 in >> mMaxRow;
448
449 int numPatterns;
450 in >> numPatterns;
451 LoadStateValidate(numPatterns == mSavedPatterns.size());
452 for (size_t i = 0; i < mSavedPatterns.size(); ++i)
453 {
454 int numNotes;
455 in >> numNotes;
456 mSavedPatterns[i].mNotes.resize(numNotes);
457 for (int j = 0; j < numNotes; ++j)
458 {
459 int col, row;
460 in >> col;
461 in >> row;
462 mSavedPatterns[i].mNotes[j] = NoteCanvasElement::Create(mCanvas, col, row);
463 mSavedPatterns[i].mNotes[j]->LoadState(in);
464 }
465 }
466}

Callers

nothing calls this directly

Calls 3

LoadStateValidateFunction · 0.85
sizeMethod · 0.80
resizeMethod · 0.80

Tested by

no test coverage detected