OutputPlugin: rename struct audio_output_plugin to AudioOutputPlugin

This commit is contained in:
Max Kellermann 2014-01-28 11:22:27 +01:00
parent 2f873edc9c
commit e0dc721324
39 changed files with 53 additions and 50 deletions

View File

@ -35,7 +35,7 @@ struct mixer_plugin {
/**
* Alocates and configures a mixer device.
*
* @param ao the pointer returned by audio_output_plugin.init
* @param ao the pointer returned by AudioOutputPlugin.init
* @param param the configuration section
* @param error_r location to store the error occurring, or
* nullptr to ignore errors

View File

@ -46,7 +46,7 @@
#define AUDIO_OUTPUT_FORMAT "format"
#define AUDIO_FILTERS "filters"
static const struct audio_output_plugin *
static const AudioOutputPlugin *
audio_output_detect(Error &error)
{
LogDefault(output_domain, "Attempt to detect audio output device");
@ -129,7 +129,7 @@ audio_output_load_mixer(struct audio_output *ao,
bool
ao_base_init(struct audio_output *ao,
const struct audio_output_plugin *plugin,
const AudioOutputPlugin *plugin,
const config_param &param, Error &error)
{
assert(ao != nullptr);
@ -284,7 +284,7 @@ audio_output_new(const config_param &param,
PlayerControl &pc,
Error &error)
{
const struct audio_output_plugin *plugin;
const AudioOutputPlugin *plugin;
if (!param.IsNull()) {
const char *p;
@ -296,7 +296,7 @@ audio_output_new(const config_param &param,
return nullptr;
}
plugin = audio_output_plugin_get(p);
plugin = AudioOutputPlugin_get(p);
if (plugin == nullptr) {
error.Format(config_domain,
"No such audio output plugin: %s", p);

View File

@ -33,6 +33,7 @@ class Filter;
class MusicPipe;
struct config_param;
struct PlayerControl;
struct AudioOutputPlugin;
enum audio_output_command {
AO_COMMAND_NONE = 0,
@ -68,7 +69,7 @@ struct audio_output {
/**
* The plugin which implements this output device.
*/
const struct audio_output_plugin *plugin;
const AudioOutputPlugin *plugin;
/**
* The #mixer object associated with this audio output device.
@ -289,7 +290,7 @@ audio_output_new(const config_param &param,
bool
ao_base_init(struct audio_output *ao,
const struct audio_output_plugin *plugin,
const AudioOutputPlugin *plugin,
const config_param &param, Error &error);
void

View File

@ -39,7 +39,7 @@
#include <string.h>
const struct audio_output_plugin *const audio_output_plugins[] = {
const AudioOutputPlugin *const audio_output_plugins[] = {
#ifdef HAVE_SHOUT
&shout_output_plugin,
#endif
@ -89,8 +89,8 @@ const struct audio_output_plugin *const audio_output_plugins[] = {
nullptr
};
const struct audio_output_plugin *
audio_output_plugin_get(const char *name)
const AudioOutputPlugin *
AudioOutputPlugin_get(const char *name)
{
audio_output_plugins_for_each(plugin)
if (strcmp(plugin->name, name) == 0)

View File

@ -20,13 +20,15 @@
#ifndef MPD_OUTPUT_LIST_HXX
#define MPD_OUTPUT_LIST_HXX
extern const struct audio_output_plugin *const audio_output_plugins[];
struct AudioOutputPlugin;
const struct audio_output_plugin *
audio_output_plugin_get(const char *name);
extern const AudioOutputPlugin *const audio_output_plugins[];
const AudioOutputPlugin *
AudioOutputPlugin_get(const char *name);
#define audio_output_plugins_for_each(plugin) \
for (const struct audio_output_plugin *plugin, \
for (const AudioOutputPlugin *plugin, \
*const*output_plugin_iterator = &audio_output_plugins[0]; \
(plugin = *output_plugin_iterator) != nullptr; ++output_plugin_iterator)

View File

@ -22,7 +22,7 @@
#include "OutputInternal.hxx"
struct audio_output *
ao_plugin_init(const struct audio_output_plugin *plugin,
ao_plugin_init(const AudioOutputPlugin *plugin,
const config_param &param,
Error &error)
{

View File

@ -32,7 +32,7 @@ class Error;
/**
* A plugin which controls an audio output device.
*/
struct audio_output_plugin {
struct AudioOutputPlugin {
/**
* the plugin's name
*/
@ -150,7 +150,7 @@ struct audio_output_plugin {
};
static inline bool
ao_plugin_test_default_device(const struct audio_output_plugin *plugin)
ao_plugin_test_default_device(const AudioOutputPlugin *plugin)
{
return plugin->test_default_device != nullptr
? plugin->test_default_device()
@ -159,7 +159,7 @@ ao_plugin_test_default_device(const struct audio_output_plugin *plugin)
gcc_malloc
struct audio_output *
ao_plugin_init(const struct audio_output_plugin *plugin,
ao_plugin_init(const AudioOutputPlugin *plugin,
const config_param &param,
Error &error);

View File

@ -848,7 +848,7 @@ alsa_play(struct audio_output *ao, const void *chunk, size_t size,
}
}
const struct audio_output_plugin alsa_output_plugin = {
const struct AudioOutputPlugin alsa_output_plugin = {
"alsa",
alsa_test_default_device,
alsa_init,

View File

@ -20,6 +20,6 @@
#ifndef MPD_ALSA_OUTPUT_PLUGIN_HXX
#define MPD_ALSA_OUTPUT_PLUGIN_HXX
extern const struct audio_output_plugin alsa_output_plugin;
extern const struct AudioOutputPlugin alsa_output_plugin;
#endif

View File

@ -267,7 +267,7 @@ ao_output_play(struct audio_output *ao, const void *chunk, size_t size,
return size;
}
const struct audio_output_plugin ao_output_plugin = {
const struct AudioOutputPlugin ao_output_plugin = {
"ao",
nullptr,
ao_output_init,

View File

@ -20,6 +20,6 @@
#ifndef MPD_AO_OUTPUT_PLUGIN_HXX
#define MPD_AO_OUTPUT_PLUGIN_HXX
extern const struct audio_output_plugin ao_output_plugin;
extern const struct AudioOutputPlugin ao_output_plugin;
#endif

View File

@ -294,7 +294,7 @@ fifo_output_play(struct audio_output *ao, const void *chunk, size_t size,
}
}
const struct audio_output_plugin fifo_output_plugin = {
const struct AudioOutputPlugin fifo_output_plugin = {
"fifo",
nullptr,
fifo_output_init,

View File

@ -20,6 +20,6 @@
#ifndef MPD_FIFO_OUTPUT_PLUGIN_HXX
#define MPD_FIFO_OUTPUT_PLUGIN_HXX
extern const struct audio_output_plugin fifo_output_plugin;
extern const struct AudioOutputPlugin fifo_output_plugin;
#endif

View File

@ -582,7 +582,7 @@ httpd_output_cancel(struct audio_output *ao)
});
}
const struct audio_output_plugin httpd_output_plugin = {
const struct AudioOutputPlugin httpd_output_plugin = {
"httpd",
nullptr,
httpd_output_init,

View File

@ -20,6 +20,6 @@
#ifndef MPD_HTTPD_OUTPUT_PLUGIN_HXX
#define MPD_HTTPD_OUTPUT_PLUGIN_HXX
extern const struct audio_output_plugin httpd_output_plugin;
extern const struct AudioOutputPlugin httpd_output_plugin;
#endif

View File

@ -746,7 +746,7 @@ mpd_jack_pause(struct audio_output *ao)
return true;
}
const struct audio_output_plugin jack_output_plugin = {
const struct AudioOutputPlugin jack_output_plugin = {
"jack",
mpd_jack_test_default_device,
mpd_jack_init,

View File

@ -20,6 +20,6 @@
#ifndef MPD_JACK_OUTPUT_PLUGIN_HXX
#define MPD_JACK_OUTPUT_PLUGIN_HXX
extern const struct audio_output_plugin jack_output_plugin;
extern const struct AudioOutputPlugin jack_output_plugin;
#endif

View File

@ -122,7 +122,7 @@ null_cancel(struct audio_output *ao)
nd->timer->Reset();
}
const struct audio_output_plugin null_output_plugin = {
const struct AudioOutputPlugin null_output_plugin = {
"null",
nullptr,
null_init,

View File

@ -20,6 +20,6 @@
#ifndef MPD_NULL_OUTPUT_PLUGIN_HXX
#define MPD_NULL_OUTPUT_PLUGIN_HXX
extern const struct audio_output_plugin null_output_plugin;
extern const struct AudioOutputPlugin null_output_plugin;
#endif

View File

@ -409,7 +409,7 @@ osx_output_play(struct audio_output *ao, const void *chunk, size_t size,
return size;
}
const struct audio_output_plugin osx_output_plugin = {
const struct AudioOutputPlugin osx_output_plugin = {
"osx",
osx_output_test_default_device,
osx_output_init,

View File

@ -20,6 +20,6 @@
#ifndef MPD_OSX_OUTPUT_PLUGIN_HXX
#define MPD_OSX_OUTPUT_PLUGIN_HXX
extern const struct audio_output_plugin osx_output_plugin;
extern const struct AudioOutputPlugin osx_output_plugin;
#endif

View File

@ -266,7 +266,7 @@ openal_cancel(struct audio_output *ao)
od->filled = 0;
}
const struct audio_output_plugin openal_output_plugin = {
const struct AudioOutputPlugin openal_output_plugin = {
"openal",
nullptr,
openal_init,

View File

@ -20,6 +20,6 @@
#ifndef MPD_OPENAL_OUTPUT_PLUGIN_HXX
#define MPD_OPENAL_OUTPUT_PLUGIN_HXX
extern const struct audio_output_plugin openal_output_plugin;
extern const struct AudioOutputPlugin openal_output_plugin;
#endif

View File

@ -751,7 +751,7 @@ oss_output_play(struct audio_output *ao, const void *chunk, size_t size,
}
}
const struct audio_output_plugin oss_output_plugin = {
const struct AudioOutputPlugin oss_output_plugin = {
"oss",
oss_output_test_default_device,
oss_output_init,

View File

@ -20,6 +20,6 @@
#ifndef MPD_OSS_OUTPUT_PLUGIN_HXX
#define MPD_OSS_OUTPUT_PLUGIN_HXX
extern const struct audio_output_plugin oss_output_plugin;
extern const struct AudioOutputPlugin oss_output_plugin;
#endif

View File

@ -128,7 +128,7 @@ pipe_output_play(struct audio_output *ao, const void *chunk, size_t size,
return ret;
}
const struct audio_output_plugin pipe_output_plugin = {
const struct AudioOutputPlugin pipe_output_plugin = {
"pipe",
nullptr,
pipe_output_init,

View File

@ -20,6 +20,6 @@
#ifndef MPD_PIPE_OUTPUT_PLUGIN_HXX
#define MPD_PIPE_OUTPUT_PLUGIN_HXX
extern const struct audio_output_plugin pipe_output_plugin;
extern const struct AudioOutputPlugin pipe_output_plugin;
#endif

View File

@ -869,7 +869,7 @@ pulse_output_test_default_device(void)
return success;
}
const struct audio_output_plugin pulse_output_plugin = {
const struct AudioOutputPlugin pulse_output_plugin = {
"pulse",
pulse_output_test_default_device,
pulse_output_init,

View File

@ -25,7 +25,7 @@ struct PulseMixer;
struct pa_cvolume;
class Error;
extern const struct audio_output_plugin pulse_output_plugin;
extern const struct AudioOutputPlugin pulse_output_plugin;
void
pulse_output_lock(PulseOutput *po);

View File

@ -243,7 +243,7 @@ recorder_output_play(struct audio_output *ao, const void *chunk, size_t size,
? size : 0;
}
const struct audio_output_plugin recorder_output_plugin = {
const struct AudioOutputPlugin recorder_output_plugin = {
"recorder",
nullptr,
recorder_output_init,

View File

@ -20,6 +20,6 @@
#ifndef MPD_RECORDER_OUTPUT_PLUGIN_HXX
#define MPD_RECORDER_OUTPUT_PLUGIN_HXX
extern const struct audio_output_plugin recorder_output_plugin;
extern const struct AudioOutputPlugin recorder_output_plugin;
#endif

View File

@ -409,7 +409,7 @@ roar_send_tag(struct audio_output *ao, const Tag *meta)
self->SendTag(*meta);
}
const struct audio_output_plugin roar_output_plugin = {
const struct AudioOutputPlugin roar_output_plugin = {
"roar",
nullptr,
roar_init,

View File

@ -22,7 +22,7 @@
class RoarOutput;
extern const struct audio_output_plugin roar_output_plugin;
extern const struct AudioOutputPlugin roar_output_plugin;
int
roar_output_get_volume(RoarOutput *roar);

View File

@ -525,7 +525,7 @@ static void my_shout_set_tag(struct audio_output *ao,
write_page(sd, IgnoreError());
}
const struct audio_output_plugin shout_output_plugin = {
const struct AudioOutputPlugin shout_output_plugin = {
"shout",
nullptr,
my_shout_init_driver,

View File

@ -20,6 +20,6 @@
#ifndef MPD_SHOUT_OUTPUT_PLUGIN_HXX
#define MPD_SHOUT_OUTPUT_PLUGIN_HXX
extern const struct audio_output_plugin shout_output_plugin;
extern const struct AudioOutputPlugin shout_output_plugin;
#endif

View File

@ -182,7 +182,7 @@ solaris_output_cancel(struct audio_output *ao)
ioctl(so->fd, I_FLUSH);
}
const struct audio_output_plugin solaris_output_plugin = {
const struct AudioOutputPlugin solaris_output_plugin = {
"solaris",
solaris_output_test_default_device,
solaris_output_init,

View File

@ -20,6 +20,6 @@
#ifndef MPD_SOLARIS_OUTPUT_PLUGIN_HXX
#define MPD_SOLARIS_OUTPUT_PLUGIN_HXX
extern const struct audio_output_plugin solaris_output_plugin;
extern const struct AudioOutputPlugin solaris_output_plugin;
#endif

View File

@ -334,7 +334,7 @@ winmm_output_cancel(struct audio_output *ao)
winmm_stop(wo);
}
const struct audio_output_plugin winmm_output_plugin = {
const struct AudioOutputPlugin winmm_output_plugin = {
"winmm",
winmm_output_test_default_device,
winmm_output_init,

View File

@ -31,7 +31,7 @@
struct WinmmOutput;
extern const struct audio_output_plugin winmm_output_plugin;
extern const struct AudioOutputPlugin winmm_output_plugin;
gcc_pure
HWAVEOUT