X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/b25aac593c0321473525a3e5b12f406bd3961aec..cca956b199841d754e8a78391d2e2c7efce4a3ee:/lib/mixer-alsa.c diff --git a/lib/mixer-alsa.c b/lib/mixer-alsa.c index 7cf8878..4ba684f 100644 --- a/lib/mixer-alsa.c +++ b/lib/mixer-alsa.c @@ -1,6 +1,6 @@ /* * This file is part of DisOrder - * Copyright (C) 2007 Richard Kettlewell + * Copyright (C) 2007, 2008 Richard Kettlewell * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,17 +29,12 @@ * (as I don't one). */ -#include +#include "common.h" #if HAVE_ALSA_ASOUNDLIB_H -#include "types.h" - -#include -#include #include #include -#include #include #include #include @@ -108,11 +103,13 @@ static int alsa_open(struct alsa_mixer_state *h) { snd_mixer_selem_id_set_name(id, config->channel); snd_mixer_selem_id_set_index(id, atoi(config->mixer)); if(!(h->elem = snd_mixer_find_selem(h->handle, id))) { - error(0, "snd_mixer_find_selem returned NULL"); + error(0, "device '%s' mixer control '%s,%s' does not exist", + config->device, config->channel, config->mixer); goto error; } if(!snd_mixer_selem_has_playback_volume(h->elem)) { - error(0, "configured mixer control has no playback volume"); + error(0, "device '%s' mixer control '%s,%s' has no playback volume", + config->device, config->channel, config->mixer); goto error; } if(snd_mixer_selem_is_playback_mono(h->elem)) { @@ -123,7 +120,8 @@ static int alsa_open(struct alsa_mixer_state *h) { } if(!snd_mixer_selem_has_playback_channel(h->elem, h->left) || !snd_mixer_selem_has_playback_channel(h->elem, h->right)) { - error(0, "configured mixer control lacks required playback channels"); + error(0, "device '%s' mixer control '%s,%s' lacks required playback channels", + config->device, config->channel, config->mixer); goto error; } snd_mixer_selem_get_playback_volume_range(h->elem, &h->min, &h->max);