MCPcopy Create free account
hub / github.com/EasyRPG/Player / create_synth

Function create_synth

src/decoder_fluidsynth.cpp:173–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171}
172
173static 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
194FluidSynthDecoder::FluidSynthDecoder() {
195 ++instances;

Callers 3

FluidSynthDecoderMethod · 0.85
InitializeMethod · 0.85
ChangeGlobalSoundfontMethod · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected