Commit ba9a2c34 authored by J. Alexander Treuman's avatar J. Alexander Treuman

Use a macro to declare disabled audio output plugins

git-svn-id: https://svn.musicpd.org/mpd/trunk@4321 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent 26447de0
...@@ -26,6 +26,18 @@ ...@@ -26,6 +26,18 @@
#include "tag.h" #include "tag.h"
#include "conf.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 struct _AudioOutput AudioOutput;
typedef int (* AudioOutputTestDefaultDeviceFunc) (); typedef int (* AudioOutputTestDefaultDeviceFunc) ();
...@@ -80,7 +92,7 @@ typedef struct _AudioOutputPlugin { ...@@ -80,7 +92,7 @@ typedef struct _AudioOutputPlugin {
AudioOutputPlayFunc playFunc; AudioOutputPlayFunc playFunc;
AudioOutputDropBufferedAudioFunc dropBufferedAudioFunc; AudioOutputDropBufferedAudioFunc dropBufferedAudioFunc;
AudioOutputCloseDeviceFunc closeDeviceFunc; AudioOutputCloseDeviceFunc closeDeviceFunc;
AudioOutputSendMetadataFunc sendMetdataFunc; AudioOutputSendMetadataFunc sendMetdataFunc;
} AudioOutputPlugin; } AudioOutputPlugin;
void initAudioOutputPlugins(); void initAudioOutputPlugins();
......
...@@ -371,23 +371,11 @@ AudioOutputPlugin alsaPlugin = ...@@ -371,23 +371,11 @@ AudioOutputPlugin alsaPlugin =
alsa_playAudio, alsa_playAudio,
alsa_dropBufferedAudio, alsa_dropBufferedAudio,
alsa_closeDevice, alsa_closeDevice,
NULL /* sendMetadataFunc */ NULL, /* sendMetadataFunc */
}; };
#else /* HAVE ALSA */ #else /* HAVE ALSA */
AudioOutputPlugin alsaPlugin = DISABLED_AUDIO_OUTPUT_PLUGIN(alsaPlugin)
{
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL /* sendMetadataFunc */
};
#endif /* HAVE_ALSA */ #endif /* HAVE_ALSA */
...@@ -244,24 +244,13 @@ AudioOutputPlugin aoPlugin = ...@@ -244,24 +244,13 @@ AudioOutputPlugin aoPlugin =
audioOutputAo_play, audioOutputAo_play,
audioOutputAo_dropBufferedAudio, audioOutputAo_dropBufferedAudio,
audioOutputAo_closeDevice, audioOutputAo_closeDevice,
NULL /* sendMetadataFunc */ NULL, /* sendMetadataFunc */
}; };
#else #else
#include <stdio.h> #include <stdio.h>
AudioOutputPlugin aoPlugin = DISABLED_AUDIO_OUTPUT_PLUGIN(aoPlugin)
{
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
};
#endif #endif
...@@ -274,23 +274,11 @@ AudioOutputPlugin mvpPlugin = ...@@ -274,23 +274,11 @@ AudioOutputPlugin mvpPlugin =
mvp_playAudio, mvp_playAudio,
mvp_dropBufferedAudio, mvp_dropBufferedAudio,
mvp_closeDevice, mvp_closeDevice,
NULL /* sendMetadataFunc */ NULL, /* sendMetadataFunc */
}; };
#else /* HAVE_MVP */ #else /* HAVE_MVP */
AudioOutputPlugin mvpPlugin = DISABLED_AUDIO_OUTPUT_PLUGIN(mvpPlugin)
{
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL /* sendMetadataFunc */
};
#endif /* HAVE_MVP */ #endif /* HAVE_MVP */
...@@ -555,24 +555,11 @@ AudioOutputPlugin ossPlugin = ...@@ -555,24 +555,11 @@ AudioOutputPlugin ossPlugin =
oss_playAudio, oss_playAudio,
oss_dropBufferedAudio, oss_dropBufferedAudio,
oss_closeDevice, oss_closeDevice,
NULL /* sendMetadataFunc */ NULL, /* sendMetadataFunc */
}; };
#else /* HAVE OSS */ #else /* HAVE OSS */
AudioOutputPlugin ossPlugin = DISABLED_AUDIO_OUTPUT_PLUGIN(ossPlugin)
{
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL /* sendMetadataFunc */
};
#endif /* HAVE_OSS */ #endif /* HAVE_OSS */
...@@ -351,24 +351,13 @@ AudioOutputPlugin osxPlugin = ...@@ -351,24 +351,13 @@ AudioOutputPlugin osxPlugin =
osx_play, osx_play,
osx_dropBufferedAudio, osx_dropBufferedAudio,
osx_closeDevice, osx_closeDevice,
NULL /* sendMetadataFunc */ NULL, /* sendMetadataFunc */
}; };
#else #else
#include <stdio.h> #include <stdio.h>
AudioOutputPlugin osxPlugin = DISABLED_AUDIO_OUTPUT_PLUGIN(osxPlugin)
{
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
};
#endif #endif
...@@ -196,16 +196,6 @@ AudioOutputPlugin pulsePlugin = { ...@@ -196,16 +196,6 @@ AudioOutputPlugin pulsePlugin = {
#else /* HAVE_PULSE */ #else /* HAVE_PULSE */
AudioOutputPlugin pulsePlugin = DISABLED_AUDIO_OUTPUT_PLUGIN(pulsePlugin)
{
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
};
#endif /* HAVE_PULSE */ #endif /* HAVE_PULSE */
...@@ -604,22 +604,11 @@ AudioOutputPlugin shoutPlugin = ...@@ -604,22 +604,11 @@ AudioOutputPlugin shoutPlugin =
myShout_play, myShout_play,
myShout_dropBufferedAudio, myShout_dropBufferedAudio,
myShout_closeDevice, myShout_closeDevice,
myShout_setTag myShout_setTag,
}; };
#else #else
AudioOutputPlugin shoutPlugin = DISABLED_AUDIO_OUTPUT_PLUGIN(shoutPlugin)
{
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
};
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment