From b38157fc762537329fad36a63a105d15840470e0 Mon Sep 17 00:00:00 2001 From: "J. Alexander Treuman" Date: Sun, 16 Jul 2006 14:57:26 +0000 Subject: Committing qball's patch to list supported audio outputs in --version git-svn-id: https://svn.musicpd.org/mpd/trunk@4357 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/audio.c | 13 +++++++++---- src/audio.h | 1 + src/audioOutput.c | 12 ++++++++++++ src/audioOutput.h | 1 + src/main.c | 6 ++++++ 5 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/audio.c b/src/audio.c index da2a20c80..6766159b2 100644 --- a/src/audio.c +++ b/src/audio.c @@ -79,11 +79,8 @@ extern AudioOutputPlugin pulsePlugin; extern AudioOutputPlugin mvpPlugin; extern AudioOutputPlugin shoutPlugin; -/* make sure initPlayerData is called before this function!! */ -void initAudioDriver() { - ConfigParam * param = NULL; - int i; +void loadAudioDrivers() { initAudioOutputPlugins(); loadAudioOutputPlugin(&alsaPlugin); loadAudioOutputPlugin(&aoPlugin); @@ -92,6 +89,14 @@ void initAudioDriver() { loadAudioOutputPlugin(&pulsePlugin); loadAudioOutputPlugin(&mvpPlugin); loadAudioOutputPlugin(&shoutPlugin); +} + +/* make sure initPlayerData is called before this function!! */ +void initAudioDriver() { + ConfigParam * param = NULL; + int i; + + loadAudioDrivers(); pdAudioDevicesEnabled = (getPlayerData())->audioDeviceEnabled; diff --git a/src/audio.h b/src/audio.h index 810f36110..8978615ce 100644 --- a/src/audio.h +++ b/src/audio.h @@ -79,4 +79,5 @@ void readAudioDevicesState(); void saveAudioDevicesState(); +void loadAudioDrivers(); #endif diff --git a/src/audioOutput.c b/src/audioOutput.c index fea4609a6..e3bd68c4f 100644 --- a/src/audioOutput.c +++ b/src/audioOutput.c @@ -247,3 +247,15 @@ void sendMetadataToAudioOutput(AudioOutput * audioOutput, MpdTag * tag) { if(!audioOutput->sendMetdataFunc) return; audioOutput->sendMetdataFunc(audioOutput, tag); } + +void printAllOutputPluginTypes(FILE *fp) { + ListNode *node = audioOutputPluginList->firstNode; + AudioOutputPlugin *plugin; + + while(node) { + plugin = (AudioOutputPlugin *)node->data; + myfprintf(fp, "%s ", plugin->name); + node = node->nextNode; + } + myfprintf(fp, "\n"); +} diff --git a/src/audioOutput.h b/src/audioOutput.h index 870a4760f..98e29d5ef 100644 --- a/src/audioOutput.h +++ b/src/audioOutput.h @@ -110,4 +110,5 @@ void finishAudioOutput(AudioOutput * audioOutput); int keepAudioOutputAlive(AudioOutput * audioOutput, int ms); void sendMetadataToAudioOutput(AudioOutput * audioOutput, MpdTag * tag); +void printAllOutputPluginTypes(FILE *fp); #endif diff --git a/src/main.c b/src/main.c index 321f561af..bd94f4344 100644 --- a/src/main.c +++ b/src/main.c @@ -33,6 +33,7 @@ #include "permission.h" #include "replayGain.h" #include "inputPlugin.h" +#include "audioOutput.h" #include "inputStream.h" #include "tag.h" #include "tagTracker.h" @@ -135,6 +136,11 @@ static void version(void) { initInputPlugins(); printAllInputPluginSuffixes(stdout); + + LOG("\n"); + LOG("Supported outputs:\n"); + loadAudioDrivers(); + printAllOutputPluginTypes(stdout); } static void parseOptions(int argc, char ** argv, Options * options) { -- cgit v1.2.3