MCPcopy Create free account
hub / github.com/amsynth/amsynth / select_program

Function select_program

src/plugins/dssi/dssiplugin.cpp:138–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138static void select_program(LADSPA_Handle Instance, unsigned long Bank, unsigned long Index)
139{
140 amsynth_wrapper * a = (amsynth_wrapper *) Instance;
141
142 TRACE_ARGS("Bank = %d Index = %d", Bank, Index);
143
144 const std::vector<BankInfo> &banks = PresetController::getPresetBanks();
145
146 if (Bank < banks.size() && Index < PresetController::kNumPresets) {
147 s_presetController->loadPresets(banks[Bank].file_path.c_str());
148 a->synth->setPresetNumber(Index);
149 // now update DSSI host's view of the parameters
150 for (unsigned i = 0; i < kAmsynthParameterCount; i++) {
151 float value = a->synth->getParameterValue((Param)i);
152 if (*(a->params[i]) != value) {
153 *(a->params[i]) = value;
154 }
155 }
156 }
157}
158
159//////////////////// LADSPA port setup /////////////////////////////////////////
160

Callers 1

run_synthFunction · 0.85

Calls 3

loadPresetsMethod · 0.80
setPresetNumberMethod · 0.80
getParameterValueMethod · 0.80

Tested by

no test coverage detected