diff options
author | Max Kellermann <max@duempel.org> | 2009-06-25 08:37:51 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-06-25 08:37:51 +0200 |
commit | b1e95b1fa8bd2bfdef34b113b1474666618f75b8 (patch) | |
tree | 299464e2809f4eeae0db4048139356ffd2ec9c12 /src/volume.c | |
parent | ce072b89d24aba8b54da5958ef73b1864ad003ae (diff) | |
download | mpd-b1e95b1fa8bd2bfdef34b113b1474666618f75b8.tar.gz mpd-b1e95b1fa8bd2bfdef34b113b1474666618f75b8.tar.xz mpd-b1e95b1fa8bd2bfdef34b113b1474666618f75b8.zip |
volume: removed support for legacy mixer configuration
The top-level "mixer_device" and "mixer_control" options have been
deprecated by MPD 0.15, and it's safe to remove them in MPD 0.16.
Diffstat (limited to 'src/volume.c')
-rw-r--r-- | src/volume.c | 87 |
1 files changed, 2 insertions, 85 deletions
diff --git a/src/volume.c b/src/volume.c index e7fa20a62..cd3cf9e4b 100644 --- a/src/volume.c +++ b/src/volume.c @@ -58,82 +58,6 @@ void volume_finish(void) g_timer_destroy(hardware_volume_timer); } -/** - * Finds the first audio_output configuration section with the - * specified type. - */ -static struct config_param * -find_output_config(const char *type) -{ - struct config_param *param = NULL; - - while ((param = config_get_next_param(CONF_AUDIO_OUTPUT, - param)) != NULL) { - const char *param_type = - config_get_block_string(param, "type", NULL); - if (param_type != NULL && strcmp(param_type, type) == 0) - return param; - } - - return NULL; -} - -/** - * Copy a (top-level) legacy mixer configuration parameter to the - * audio_output section. - */ -static void -mixer_copy_legacy_param(const char *type, const char *name) -{ - const struct config_param *param; - struct config_param *output; - const struct block_param *bp; - - /* see if the deprecated configuration exists */ - - param = config_get_param(name); - if (param == NULL) - return; - - g_warning("deprecated option '%s' found, moving to '%s' audio output", - name, type); - - /* determine the configuration section */ - - output = find_output_config(type); - if (output == NULL) { - /* if there is no output configuration at all, create - a new and empty configuration section for the - legacy mixer */ - - if (config_get_next_param(CONF_AUDIO_OUTPUT, NULL) != NULL) - /* there is an audio_output configuration, but - it does not match the mixer_type setting */ - g_error("no '%s' audio output found", type); - - output = config_new_param(NULL, param->line); - config_add_block_param(output, "type", type, param->line); - config_add_block_param(output, "name", type, param->line); - config_add_param(CONF_AUDIO_OUTPUT, output); - } - - bp = config_get_block_param(output, name); - if (bp != NULL) - g_error("the '%s' audio output already has a '%s' setting", - type, name); - - /* duplicate the parameter in the configuration section */ - - config_add_block_param(output, name, param->value, param->line); -} - -static void -mixer_reconfigure(const char *type) -{ - mixer_copy_legacy_param(type, CONF_MIXER_DEVICE); - mixer_copy_legacy_param(type, CONF_MIXER_CONTROL); -} - void volume_init(void) { const struct config_param *param = config_get_param(CONF_MIXER_TYPE); @@ -148,15 +72,8 @@ void volume_init(void) } else if (strcmp(param->value, VOLUME_MIXER_HARDWARE) == 0) { //nothing to do } else { - //fallback to old config behaviour - if (strcmp(param->value, VOLUME_MIXER_OSS) == 0) { - mixer_reconfigure(param->value); - } else if (strcmp(param->value, VOLUME_MIXER_ALSA) == 0) { - mixer_reconfigure(param->value); - } else { - g_error("unknown mixer type %s at line %i\n", - param->value, param->line); - } + g_error("unknown mixer type %s at line %i\n", + param->value, param->line); } } |