OpenTTD Source: src/music/fluidsynth.cpp File Reference

OpenTTD Source 15.0-RC2

Functions | Variables
fluidsynth.cpp File Reference

Playing music via the fluidsynth library. More...

`#include "../stdafx.h"`
`#include "fluidsynth.h"`
`#include <filesystem>`
`#include <mutex>`
`#include "../debug.h"`
`#include "../mixer.h"`
`#include "midifile.hpp"`
`#include "../safeguards.h"`

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_soundfonts []
| 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 55 of file fluidsynth.cpp.

## Variable Documentation

## ◆ _default_soundfonts

const char* _default_soundfonts[]
| 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",
}

List of sound fonts to try by default.

Definition at line 35 of file fluidsynth.cpp.

Referenced by MusicDriver_FluidSynth::Start().

## ◆ iFMusicDriver_FluidSynth

FMusicDriver_FluidSynth iFMusicDriver_FluidSynth
| static

Factory for the FluidSynth driver.

Definition at line 32 of file fluidsynth.cpp.

## ◆ player

fluid_player_t* player

FluidSynth MIDI player handle.

Definition at line 27 of file fluidsynth.cpp.

## ◆ settings

fluid_settings_t* settings

FluidSynth settings handle.

Definition at line 25 of file fluidsynth.cpp.

Referenced by CmdBuildAircraft(), CmdBuildRailVehicle(), CmdBuildRoadVehicle(), CmdBuildShip(), CmdChangeCompanySetting(), DemandCalculator::DemandCalculator(), FontProviderManager::FindFallbackFont(), GetFontCacheFontName(), GetSaveLoadFromSettingTable(), GetSettingFromName(), GetSettingsDesc(), PATSChunkHandler::LoadCheck(), FreeTypeFontCacheFactory::LoadFont(), CoreTextFontCacheFactory::LoadFont(), Win32FontCacheFactory::LoadFont(), LoadSettings(), VideoDriver_Win32Base::MakeWindow(), ReplaceVehicleWindow::OnClick(), Packet::Recv_string(), SaveSettings(), LanguagePackGlyphSearcher::SetFontNames(), TextfileWindow::SetFontNames(), SlStdString(), StrMakeValid(), StrMakeValid(), StrMakeValidInPlace(), and StrMakeValidInPlace().

## ◆ synth

fluid_synth_t* synth

FluidSynth synthesizer handle.

Definition at line 26 of file fluidsynth.cpp.

## ◆ synth_mutex

std::mutex synth_mutex

Guard mutex for synth access.

Definition at line 28 of file fluidsynth.cpp.