diff options
author | Max Kellermann <max@duempel.org> | 2009-02-10 17:21:19 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-02-10 17:21:19 +0100 |
commit | e8787ac4a4430bb30bfba0b5154111370e89133b (patch) | |
tree | e24f22b7d9d4b04ea7ef06b167c7862bc079b26b /src/audio.c | |
parent | 3e87033145fc090f147d17b0bde1bc5e0e61baab (diff) | |
download | mpd-e8787ac4a4430bb30bfba0b5154111370e89133b.tar.gz mpd-e8787ac4a4430bb30bfba0b5154111370e89133b.tar.xz mpd-e8787ac4a4430bb30bfba0b5154111370e89133b.zip |
audio: added output enumeration functions
Added audio_output_get(), audio_output_find().
Diffstat (limited to 'src/audio.c')
-rw-r--r-- | src/audio.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/audio.c b/src/audio.c index 7f51a31d9..c0ead9ddc 100644 --- a/src/audio.c +++ b/src/audio.c @@ -45,6 +45,28 @@ unsigned int audio_output_count(void) return audioOutputArraySize; } +struct audio_output * +audio_output_get(unsigned i) +{ + assert(i < audioOutputArraySize); + + return &audioOutputArray[i]; +} + +struct audio_output * +audio_output_find(const char *name) +{ + for (unsigned i = 0; i < audioOutputArraySize; ++i) { + struct audio_output *ao = audio_output_get(i); + + if (strcmp(ao->name, name) == 0) + return ao; + } + + /* name not found */ + return NULL; +} + static unsigned audio_output_config_count(void) { |