diff options
author | Max Kellermann <max@duempel.org> | 2009-01-18 19:37:27 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-18 19:37:27 +0100 |
commit | a531a1e65075d27574bc31d4bac7ab20cb750efd (patch) | |
tree | f06ad8e7359f0845d94d2b8a6f655a0cceb744c2 /src/mixer | |
parent | 73e466cfef6497aff840cfac35d80d74e7b0fd0c (diff) | |
download | mpd-a531a1e65075d27574bc31d4bac7ab20cb750efd.tar.gz mpd-a531a1e65075d27574bc31d4bac7ab20cb750efd.tar.xz mpd-a531a1e65075d27574bc31d4bac7ab20cb750efd.zip |
conf: added config_get_block_string()
This replaces lots of getBlockParam() invocations.
Diffstat (limited to '')
-rw-r--r-- | src/mixer/alsa_mixer.c | 13 | ||||
-rw-r--r-- | src/mixer/oss_mixer.c | 14 |
2 files changed, 15 insertions, 12 deletions
diff --git a/src/mixer/alsa_mixer.c b/src/mixer/alsa_mixer.c index 72924058b..7dafd22cc 100644 --- a/src/mixer/alsa_mixer.c +++ b/src/mixer/alsa_mixer.c @@ -46,18 +46,21 @@ static void alsa_mixer_configure(struct mixer_data *data, struct config_param *param) { struct alsa_mixer *am = (struct alsa_mixer *)data; - struct block_param *bp; + const char *value; if (param == NULL) return; - if ((bp = getBlockParam(param, "mixer_device"))) { + value = config_get_block_string(param, "mixer_device", NULL); + if (value != NULL) { g_free(am->device); - am->device = g_strdup(bp->value); + am->device = g_strdup(value); } - if ((bp = getBlockParam(param, "mixer_control"))) { + + value = config_get_block_string(param, "mixer_control", NULL); + if (value != NULL) { g_free(am->control); - am->control = g_strdup(bp->value); + am->control = g_strdup(value); } } diff --git a/src/mixer/oss_mixer.c b/src/mixer/oss_mixer.c index 0ee44a693..5e3b65f46 100644 --- a/src/mixer/oss_mixer.c +++ b/src/mixer/oss_mixer.c @@ -50,21 +50,21 @@ static void oss_mixer_configure(struct mixer_data *data, struct config_param *param) { struct oss_mixer *om = (struct oss_mixer *) data; - struct block_param *bp; + const char *value; if (param == NULL) return; - bp = getBlockParam(param, "mixer_device"); - if (bp) { + value = config_get_block_string(param, "mixer_device", NULL); + if (value != NULL) { g_free(om->device); - om->device = g_strdup(bp->value); + om->device = g_strdup(value); } - bp = getBlockParam(param, "mixer_control"); - if (bp) { + value = config_get_block_string(param, "mixer_control", NULL); + if (value != NULL) { g_free(om->control); - om->control = g_strdup(bp->value); + om->control = g_strdup(value); } } |