OpenTTD Source 20241224-master-gf74b0cf984
fluidsynth.cpp File Reference

Playing music via the fluidsynth library. More...

#include "../stdafx.h"
#include "../openttd.h"
#include "../sound_type.h"
#include "../debug.h"
#include "fluidsynth.h"
#include "midifile.hpp"
#include "../mixer.h"
#include <mutex>

Go to the source code of this file.

Functions

static void RenderMusicStream (int16_t *buffer, size_t samples)
 

Variables

struct { 
 
   fluid_settings_t *   settings 
 FluidSynth settings handle. More...
 
   fluid_synth_t *   synth 
 FluidSynth synthesizer handle. More...
 
   fluid_player_t *   player 
 FluidSynth MIDI player handle. More...
 
   std::mutex   synth_mutex 
 Guard mutex for synth access. More...
 
_midi 
 Metadata about the midi we're playing.
 
static FMusicDriver_FluidSynth iFMusicDriver_FluidSynth
 Factory for the FluidSynth driver.
 
static const char * default_sf []
 List of sound fonts to try by default.
 

Detailed Description

Playing music via the fluidsynth library.

Definition in file fluidsynth.cpp.

Function Documentation

◆ RenderMusicStream()

static void RenderMusicStream ( int16_t *  buffer,
size_t  samples 
)
static

Definition at line 53 of file fluidsynth.cpp.

Variable Documentation

◆ default_sf

const char* default_sf[]
static
Initial value:
= {
"/usr/share/soundfonts/default.sf2",
"/usr/share/sounds/sf3/default-GM.sf3",
"/usr/share/sounds/sf2/FluidR3_GM.sf2",
"/usr/share/soundfonts/FluidR3_GM.sf2",
"/usr/share/sounds/sf2/TimGM6mb.sf2",
"/usr/share/sounds/sf2/FluidR3_GS.sf2",
nullptr
}

List of sound fonts to try by default.

Definition at line 31 of file fluidsynth.cpp.

Referenced by MusicDriver_FluidSynth::Start().

◆ iFMusicDriver_FluidSynth

FMusicDriver_FluidSynth iFMusicDriver_FluidSynth
static

Factory for the FluidSynth driver.

Definition at line 28 of file fluidsynth.cpp.

◆ player

fluid_player_t* player

FluidSynth MIDI player handle.

Definition at line 23 of file fluidsynth.cpp.

◆ settings

◆ synth

fluid_synth_t* synth

FluidSynth synthesizer handle.

Definition at line 22 of file fluidsynth.cpp.

◆ synth_mutex

std::mutex synth_mutex

Guard mutex for synth access.

Definition at line 24 of file fluidsynth.cpp.