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

Method Poll

Source/Scale.cpp:461–497  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

459}
460
461void Scale::Poll()
462{
463 ComputeSliders(0);
464
465 if (mWantSetRandomRootAndScale)
466 {
467 SetRandomRootAndScale();
468 mWantSetRandomRootAndScale = false;
469 }
470
471 if (mQueuedButtonPress)
472 {
473 ClickButton* button = mQueuedButtonPress;
474 mQueuedButtonPress = nullptr;
475 if (button == mLoadSCLButton || button == mLoadKBMButton)
476 {
477 std::string prompt = "Load ";
478 prompt += (button == mLoadSCLButton) ? "SCL" : "KBM";
479 std::string pat = (button == mLoadSCLButton) ? "*.scl;*.SCL" : "*.kbm;*.KBM";
480 juce::FileChooser chooser(prompt, juce::File(""), pat, true, false, TheSynth->GetFileChooserParent());
481 if (chooser.browseForFileToOpen())
482 {
483 auto file = chooser.getResult();
484 std::cout << file.getFullPathName().toStdString() << std::endl;
485 if (button == mLoadSCLButton)
486 {
487 mSclContents = file.loadFileAsString().toStdString();
488 }
489 else
490 {
491 mKbmContents = file.loadFileAsString().toStdString();
492 }
493 UpdateTuningTable();
494 }
495 }
496 }
497}
498
499float Scale::RationalizeNumber(float input)
500{

Callers 2

timerCallbackMethod · 0.45
BasePollMethod · 0.45

Calls 1

GetFileChooserParentMethod · 0.80

Tested by

no test coverage detected