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

Method FluidSynthDecoder

src/decoder_fluidsynth.cpp:194–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192}
193
194FluidSynthDecoder::FluidSynthDecoder() {
195 ++instances;
196
197 // Optimisation: Only create the soundfont once and share the synth
198 // Sharing is only not possible when a Midi is played as a SE (unlikely)
199 if (instances > 1) {
200 std::string error_message;
201 local_synth = create_synth(error_message);
202 if (!local_synth) {
203 // unlikely, the SF was already allocated once
204 Output::Debug("FluidSynth failed: {}", error_message);
205 }
206 } else {
207 use_global_synth = true;
208 fluid_synth_program_reset(global_synth.get());
209 }
210}
211
212FluidSynthDecoder::~FluidSynthDecoder() {
213 --instances;

Callers

nothing calls this directly

Calls 2

create_synthFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected