aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/fluidsynth_decoder_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-08-15 00:51:45 +0200
committerMax Kellermann <max@duempel.org>2012-08-15 00:51:45 +0200
commit02325d2edec3c8ac733f4565595d27127cb5c9c1 (patch)
treef43923505f5a28fd426d301f087037451e6ff5da /src/decoder/fluidsynth_decoder_plugin.c
parent9c83464b95a6e8145fee0a03bd151f4bc7a6cac7 (diff)
downloadmpd-02325d2edec3c8ac733f4565595d27127cb5c9c1.tar.gz
mpd-02325d2edec3c8ac733f4565595d27127cb5c9c1.tar.xz
mpd-02325d2edec3c8ac733f4565595d27127cb5c9c1.zip
decoder/fluidsynth: add "soundfont" setting
Replaces the old global "soundfont" which never worked.
Diffstat (limited to 'src/decoder/fluidsynth_decoder_plugin.c')
-rw-r--r--src/decoder/fluidsynth_decoder_plugin.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/decoder/fluidsynth_decoder_plugin.c b/src/decoder/fluidsynth_decoder_plugin.c
index 1fef209bc..ed0efdd99 100644
--- a/src/decoder/fluidsynth_decoder_plugin.c
+++ b/src/decoder/fluidsynth_decoder_plugin.c
@@ -28,6 +28,8 @@
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "fluidsynth"
+static const char *soundfont_path;
+
/**
* Convert a fluidsynth log level to a GLib log level.
*/
@@ -65,8 +67,12 @@ fluidsynth_mpd_log_function(int level, char *message, G_GNUC_UNUSED void *data)
}
static bool
-fluidsynth_init(G_GNUC_UNUSED const struct config_param *param)
+fluidsynth_init(const struct config_param *param)
{
+ soundfont_path =
+ config_get_block_string(param, "soundfont",
+ "/usr/share/sounds/sf2/FluidR3_GM.sf2");
+
fluid_set_log_function(LAST_LOG_LEVEL,
fluidsynth_mpd_log_function, NULL);
@@ -86,17 +92,12 @@ fluidsynth_file_decode(struct decoder *decoder, const char *path_fs)
char setting_verbose[] = "synth.verbose";
char setting_yes[] = "yes";
*/
- const char *soundfont_path;
fluid_settings_t *settings;
fluid_synth_t *synth;
fluid_player_t *player;
int ret;
enum decoder_command cmd;
- soundfont_path =
- config_get_string("soundfont",
- "/usr/share/sounds/sf2/FluidR3_GM.sf2");
-
/* set up fluid settings */
settings = new_fluid_settings();