| 171 | } |
| 172 | |
| 173 | static fluid_synth_t* create_synth(std::string& status_message) { |
| 174 | fluid_synth_t* syn = new_fluid_synth(global_settings.get()); |
| 175 | if (!syn) { |
| 176 | status_message = "new_fluid_synth failed"; |
| 177 | return nullptr; |
| 178 | } |
| 179 | |
| 180 | #if defined(HAVE_FLUIDSYNTH) && FLUIDSYNTH_VERSION_MAJOR > 1 |
| 181 | // Fluidsynth 1.x does not support VIO API for soundfonts |
| 182 | // owned by fluid_synth |
| 183 | auto* loader = new_fluid_defsfloader(global_settings.get()); |
| 184 | fluid_sfloader_set_callbacks(loader, |
| 185 | vio_open, vio_read, vio_seek, vio_tell, vio_close); |
| 186 | fluid_synth_add_sfloader(syn, loader); |
| 187 | #endif |
| 188 | |
| 189 | fluid_synth_set_interp_method(syn, -1, FLUID_INTERP_LINEAR); |
| 190 | |
| 191 | return syn; |
| 192 | } |
| 193 | |
| 194 | FluidSynthDecoder::FluidSynthDecoder() { |
| 195 | ++instances; |
no test coverage detected