| 459 | } |
| 460 | |
| 461 | void 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 | |
| 499 | float Scale::RationalizeNumber(float input) |
| 500 | { |
no test coverage detected