| 49 | |
| 50 | |
| 51 | PresetController::PresetController() |
| 52 | { |
| 53 | // Load the first user-writable bank by default, falling back to first read-only one. |
| 54 | const auto &banks = getPresetBanks(); |
| 55 | if (!banks.empty()) { |
| 56 | auto it = std::find_if(banks.begin(), banks.end(), [] (const BankInfo &bi) {return !bi.read_only;}); |
| 57 | if (it == banks.end()) |
| 58 | it = banks.begin(); |
| 59 | loadPresets(it->file_path.c_str()); |
| 60 | selectPreset(0); |
| 61 | } |
| 62 | |
| 63 | currentPreset.addObserver(this); |
| 64 | } |
| 65 | |
| 66 | int |
| 67 | PresetController::selectPreset (const int presetNo) |
nothing calls this directly
no test coverage detected