Use a macro to declare disabled audio output plugins

git-svn-id: https://svn.musicpd.org/mpd/trunk@4321 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
J. Alexander Treuman 2006-07-14 17:39:14 +00:00
parent 26447de0ce
commit ba9a2c349f
8 changed files with 26 additions and 94 deletions

View File

@ -26,6 +26,18 @@
#include "tag.h"
#include "conf.h"
#define DISABLED_AUDIO_OUTPUT_PLUGIN(plugin) \
AudioOutputPlugin plugin = { \
NULL, \
NULL, \
NULL, \
NULL, \
NULL, \
NULL, \
NULL, \
NULL, \
};
typedef struct _AudioOutput AudioOutput;
typedef int (* AudioOutputTestDefaultDeviceFunc) ();
@ -80,7 +92,7 @@ typedef struct _AudioOutputPlugin {
AudioOutputPlayFunc playFunc;
AudioOutputDropBufferedAudioFunc dropBufferedAudioFunc;
AudioOutputCloseDeviceFunc closeDeviceFunc;
AudioOutputSendMetadataFunc sendMetdataFunc;
AudioOutputSendMetadataFunc sendMetdataFunc;
} AudioOutputPlugin;
void initAudioOutputPlugins();

View File

@ -371,23 +371,11 @@ AudioOutputPlugin alsaPlugin =
alsa_playAudio,
alsa_dropBufferedAudio,
alsa_closeDevice,
NULL /* sendMetadataFunc */
NULL, /* sendMetadataFunc */
};
#else /* HAVE ALSA */
AudioOutputPlugin alsaPlugin =
{
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL /* sendMetadataFunc */
};
DISABLED_AUDIO_OUTPUT_PLUGIN(alsaPlugin)
#endif /* HAVE_ALSA */

View File

@ -244,24 +244,13 @@ AudioOutputPlugin aoPlugin =
audioOutputAo_play,
audioOutputAo_dropBufferedAudio,
audioOutputAo_closeDevice,
NULL /* sendMetadataFunc */
NULL, /* sendMetadataFunc */
};
#else
#include <stdio.h>
AudioOutputPlugin aoPlugin =
{
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
};
DISABLED_AUDIO_OUTPUT_PLUGIN(aoPlugin)
#endif

View File

@ -274,23 +274,11 @@ AudioOutputPlugin mvpPlugin =
mvp_playAudio,
mvp_dropBufferedAudio,
mvp_closeDevice,
NULL /* sendMetadataFunc */
NULL, /* sendMetadataFunc */
};
#else /* HAVE_MVP */
AudioOutputPlugin mvpPlugin =
{
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL /* sendMetadataFunc */
};
DISABLED_AUDIO_OUTPUT_PLUGIN(mvpPlugin)
#endif /* HAVE_MVP */

View File

@ -555,24 +555,11 @@ AudioOutputPlugin ossPlugin =
oss_playAudio,
oss_dropBufferedAudio,
oss_closeDevice,
NULL /* sendMetadataFunc */
NULL, /* sendMetadataFunc */
};
#else /* HAVE OSS */
AudioOutputPlugin ossPlugin =
{
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL /* sendMetadataFunc */
};
DISABLED_AUDIO_OUTPUT_PLUGIN(ossPlugin)
#endif /* HAVE_OSS */

View File

@ -351,24 +351,13 @@ AudioOutputPlugin osxPlugin =
osx_play,
osx_dropBufferedAudio,
osx_closeDevice,
NULL /* sendMetadataFunc */
NULL, /* sendMetadataFunc */
};
#else
#include <stdio.h>
AudioOutputPlugin osxPlugin =
{
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
};
DISABLED_AUDIO_OUTPUT_PLUGIN(osxPlugin)
#endif

View File

@ -196,16 +196,6 @@ AudioOutputPlugin pulsePlugin = {
#else /* HAVE_PULSE */
AudioOutputPlugin pulsePlugin =
{
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
};
DISABLED_AUDIO_OUTPUT_PLUGIN(pulsePlugin)
#endif /* HAVE_PULSE */

View File

@ -604,22 +604,11 @@ AudioOutputPlugin shoutPlugin =
myShout_play,
myShout_dropBufferedAudio,
myShout_closeDevice,
myShout_setTag
myShout_setTag,
};
#else
AudioOutputPlugin shoutPlugin =
{
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
};
DISABLED_AUDIO_OUTPUT_PLUGIN(shoutPlugin)
#endif