Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Use FluidSynth default soundfont #8953

Merged
merged 1 commit into from Apr 7, 2021
Merged

Conversation

@ghisvail
Copy link
Contributor

@ghisvail ghisvail commented Apr 5, 2021

Motivation / Problem

FluidSynth provides a build option to set a default soundfont which may be overridden by Linux distributions such as Debian to support alternative soundfont providers (such as Fluid, OPL-3, MuseScore, ...). This PR enables OpenTTD to use this default soundfont if present, which is arguably more flexible than maintaining the hard-coded list in the OpenTTD code base.

As an immediate benefit of this, the Flatpak build of OpenTTD will no longer require patching the hard-coded list. Instead, only FluidSynth needs to be configured with an appropriate default soundfont in place inside the runtime.

Description

The implementation now loads the default soundfont configured with FluidSynth, if any. The previous find-first lookup from the hard-coded soundfont list is still used as a fallback if no suitable default soundfont is found.

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')
@ghisvail
Copy link
Contributor Author

@ghisvail ghisvail commented Apr 5, 2021

This PR complements #8948

src/music/fluidsynth.cpp Outdated Show resolved Hide resolved
@ghisvail ghisvail force-pushed the default-soundfont branch from 7d97874 to 052671f Apr 6, 2021
LordAro
LordAro approved these changes Apr 6, 2021
@ghisvail
Copy link
Contributor Author

@ghisvail ghisvail commented Apr 6, 2021

Worth backporting for future Flatpak updates. I already use this patch for v1.11.0 but would be great if I could drop it for v1.11.1 onwards.

@nielsmh nielsmh merged commit 9725bd8 into OpenTTD:master Apr 7, 2021
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants