| 289 | } |
| 290 | |
| 291 | bool FluidSynthDecoder::ChangeGlobalSoundfont(std::string_view sf_path, std::string& status_message) { |
| 292 | if (!global_synth) { |
| 293 | return false; |
| 294 | } |
| 295 | |
| 296 | pending_global_synth.reset(create_synth(status_message)); |
| 297 | |
| 298 | if (!pending_global_synth) { |
| 299 | return false; |
| 300 | } |
| 301 | |
| 302 | if (sf_path.empty()) { |
| 303 | return load_default_sf(status_message, pending_global_synth.get()); |
| 304 | } |
| 305 | |
| 306 | if (fluid_synth_sfload(pending_global_synth.get(), ToString(sf_path).c_str(), 1) != FLUID_FAILED) { |
| 307 | status_message = fmt::format("Using soundfont {}", sf_path); |
| 308 | return true; |
| 309 | } |
| 310 | |
| 311 | pending_global_synth.reset(); |
| 312 | status_message = "Could not load soundfont."; |
| 313 | return false; |
| 314 | } |
| 315 | |
| 316 | int FluidSynthDecoder::FillBuffer(uint8_t* buffer, int length) { |
| 317 | auto* instance_synth = GetSynthInstance(); |
nothing calls this directly
no test coverage detected