output: rename struct audio_output to AudioOutput

This commit is contained in:
Max Kellermann 2014-01-28 11:34:09 +01:00
parent e0dc721324
commit 815d72065c
36 changed files with 278 additions and 277 deletions

View File

@ -47,7 +47,7 @@ enum class PlayerCommand : uint8_t {
CLOSE_AUDIO, CLOSE_AUDIO,
/** /**
* At least one audio_output.enabled flag has been modified; * At least one AudioOutput.enabled flag has been modified;
* commit those changes to the output threads. * commit those changes to the output threads.
*/ */
UPDATE_AUDIO, UPDATE_AUDIO,

View File

@ -42,7 +42,7 @@ const ConfigTemplate config_templates[] = {
{ "zeroconf_enabled", false, false }, { "zeroconf_enabled", false, false },
{ "password", true, false }, { "password", true, false },
{ "default_permissions", false, false }, { "default_permissions", false, false },
{ "audio_output", true, true }, { "AudioOutput", true, true },
{ "audio_output_format", false, false }, { "audio_output_format", false, false },
{ "mixer_type", false, false }, { "mixer_type", false, false },
{ "replaygain", false, false }, { "replaygain", false, false },

View File

@ -33,7 +33,7 @@
static constexpr Domain mixer_domain("mixer"); static constexpr Domain mixer_domain("mixer");
static int static int
output_mixer_get_volume(const audio_output &ao) output_mixer_get_volume(const AudioOutput &ao)
{ {
if (!ao.enabled) if (!ao.enabled)
return -1; return -1;
@ -73,7 +73,7 @@ MultipleOutputs::GetVolume() const
} }
static bool static bool
output_mixer_set_volume(audio_output &ao, unsigned volume) output_mixer_set_volume(AudioOutput &ao, unsigned volume)
{ {
assert(volume <= 100); assert(volume <= 100);
@ -108,7 +108,7 @@ MultipleOutputs::SetVolume(unsigned volume)
} }
static int static int
output_mixer_get_software_volume(const audio_output &ao) output_mixer_get_software_volume(const AudioOutput &ao)
{ {
if (!ao.enabled) if (!ao.enabled)
return -1; return -1;

View File

@ -46,7 +46,7 @@ mixer_close(Mixer *mixer);
/** /**
* Close the mixer unless the plugin's "global" flag is set. This is * Close the mixer unless the plugin's "global" flag is set. This is
* called when the #audio_output is closed. * called when the #AudioOutput is closed.
*/ */
void void
mixer_auto_close(Mixer *mixer); mixer_auto_close(Mixer *mixer);

View File

@ -50,11 +50,11 @@ MultipleOutputs::~MultipleOutputs()
} }
} }
static audio_output * static AudioOutput *
LoadOutput(PlayerControl &pc, const config_param &param) LoadOutput(PlayerControl &pc, const config_param &param)
{ {
Error error; Error error;
audio_output *output = audio_output_new(param, pc, error); AudioOutput *output = audio_output_new(param, pc, error);
if (output == nullptr) { if (output == nullptr) {
if (param.line > 0) if (param.line > 0)
FormatFatalError("line %i: %s", FormatFatalError("line %i: %s",
@ -89,7 +89,7 @@ MultipleOutputs::Configure(PlayerControl &pc)
} }
} }
audio_output * AudioOutput *
MultipleOutputs::FindByName(const char *name) const MultipleOutputs::FindByName(const char *name) const
{ {
for (auto i : outputs) for (auto i : outputs)
@ -146,7 +146,7 @@ MultipleOutputs::AllowPlay()
} }
static void static void
audio_output_reset_reopen(struct audio_output *ao) audio_output_reset_reopen(AudioOutput *ao)
{ {
const ScopeLock protect(ao->mutex); const ScopeLock protect(ao->mutex);
@ -259,7 +259,7 @@ MultipleOutputs::Open(const AudioFormat audio_format,
*/ */
gcc_pure gcc_pure
static bool static bool
chunk_is_consumed_in(const struct audio_output *ao, chunk_is_consumed_in(const AudioOutput *ao,
gcc_unused const MusicPipe *pipe, gcc_unused const MusicPipe *pipe,
const struct music_chunk *chunk) const struct music_chunk *chunk)
{ {
@ -299,7 +299,7 @@ MultipleOutputs::ClearTailChunk(gcc_unused const struct music_chunk *chunk,
assert(pipe->Contains(chunk)); assert(pipe->Contains(chunk));
for (unsigned i = 0, n = outputs.size(); i != n; ++i) { for (unsigned i = 0, n = outputs.size(); i != n; ++i) {
audio_output *ao = outputs[i]; AudioOutput *ao = outputs[i];
/* this mutex will be unlocked by the caller when it's /* this mutex will be unlocked by the caller when it's
ready */ ready */

View File

@ -39,11 +39,11 @@ class MusicBuffer;
class MusicPipe; class MusicPipe;
struct music_chunk; struct music_chunk;
struct PlayerControl; struct PlayerControl;
struct audio_output; struct AudioOutput;
class Error; class Error;
class MultipleOutputs { class MultipleOutputs {
std::vector<audio_output *> outputs; std::vector<AudioOutput *> outputs;
AudioFormat input_audio_format; AudioFormat input_audio_format;
@ -86,13 +86,13 @@ public:
/** /**
* Returns the "i"th audio output device. * Returns the "i"th audio output device.
*/ */
const audio_output &Get(unsigned i) const { const AudioOutput &Get(unsigned i) const {
assert(i < Size()); assert(i < Size());
return *outputs[i]; return *outputs[i];
} }
audio_output &Get(unsigned i) { AudioOutput &Get(unsigned i) {
assert(i < Size()); assert(i < Size());
return *outputs[i]; return *outputs[i];
@ -103,7 +103,7 @@ public:
* Returns nullptr if the name does not exist. * Returns nullptr if the name does not exist.
*/ */
gcc_pure gcc_pure
audio_output *FindByName(const char *name) const; AudioOutput *FindByName(const char *name) const;
/** /**
* Checks the "enabled" flag of all audio outputs, and if one has * Checks the "enabled" flag of all audio outputs, and if one has

View File

@ -40,7 +40,7 @@ audio_output_enable_index(MultipleOutputs &outputs, unsigned idx)
if (idx >= outputs.Size()) if (idx >= outputs.Size())
return false; return false;
audio_output &ao = outputs.Get(idx); AudioOutput &ao = outputs.Get(idx);
if (ao.enabled) if (ao.enabled)
return true; return true;
@ -60,7 +60,7 @@ audio_output_disable_index(MultipleOutputs &outputs, unsigned idx)
if (idx >= outputs.Size()) if (idx >= outputs.Size())
return false; return false;
audio_output &ao = outputs.Get(idx); AudioOutput &ao = outputs.Get(idx);
if (!ao.enabled) if (!ao.enabled)
return true; return true;
@ -86,7 +86,7 @@ audio_output_toggle_index(MultipleOutputs &outputs, unsigned idx)
if (idx >= outputs.Size()) if (idx >= outputs.Size())
return false; return false;
audio_output &ao = outputs.Get(idx); AudioOutput &ao = outputs.Get(idx);
const bool enabled = ao.enabled = !ao.enabled; const bool enabled = ao.enabled = !ao.enabled;
idle_add(IDLE_OUTPUT); idle_add(IDLE_OUTPUT);

View File

@ -41,9 +41,9 @@ struct notify audio_output_client_notify;
/** /**
* Waits for command completion. * Waits for command completion.
* *
* @param ao the #audio_output instance; must be locked * @param ao the #AudioOutput instance; must be locked
*/ */
static void ao_command_wait(struct audio_output *ao) static void ao_command_wait(AudioOutput *ao)
{ {
while (ao->command != AO_COMMAND_NONE) { while (ao->command != AO_COMMAND_NONE) {
ao->mutex.unlock(); ao->mutex.unlock();
@ -53,12 +53,12 @@ static void ao_command_wait(struct audio_output *ao)
} }
/** /**
* Sends a command to the #audio_output object, but does not wait for * Sends a command to the #AudioOutput object, but does not wait for
* completion. * completion.
* *
* @param ao the #audio_output instance; must be locked * @param ao the #AudioOutput instance; must be locked
*/ */
static void ao_command_async(struct audio_output *ao, static void ao_command_async(AudioOutput *ao,
enum audio_output_command cmd) enum audio_output_command cmd)
{ {
assert(ao->command == AO_COMMAND_NONE); assert(ao->command == AO_COMMAND_NONE);
@ -67,31 +67,31 @@ static void ao_command_async(struct audio_output *ao,
} }
/** /**
* Sends a command to the #audio_output object and waits for * Sends a command to the #AudioOutput object and waits for
* completion. * completion.
* *
* @param ao the #audio_output instance; must be locked * @param ao the #AudioOutput instance; must be locked
*/ */
static void static void
ao_command(struct audio_output *ao, enum audio_output_command cmd) ao_command(AudioOutput *ao, enum audio_output_command cmd)
{ {
ao_command_async(ao, cmd); ao_command_async(ao, cmd);
ao_command_wait(ao); ao_command_wait(ao);
} }
/** /**
* Lock the #audio_output object and execute the command * Lock the #AudioOutput object and execute the command
* synchronously. * synchronously.
*/ */
static void static void
ao_lock_command(struct audio_output *ao, enum audio_output_command cmd) ao_lock_command(AudioOutput *ao, enum audio_output_command cmd)
{ {
const ScopeLock protect(ao->mutex); const ScopeLock protect(ao->mutex);
ao_command(ao, cmd); ao_command(ao, cmd);
} }
void void
audio_output_set_replay_gain_mode(struct audio_output *ao, audio_output_set_replay_gain_mode(AudioOutput *ao,
ReplayGainMode mode) ReplayGainMode mode)
{ {
if (ao->replay_gain_filter != nullptr) if (ao->replay_gain_filter != nullptr)
@ -101,7 +101,7 @@ audio_output_set_replay_gain_mode(struct audio_output *ao,
} }
void void
audio_output_enable(struct audio_output *ao) audio_output_enable(AudioOutput *ao)
{ {
if (!ao->thread.IsDefined()) { if (!ao->thread.IsDefined()) {
if (ao->plugin->enable == nullptr) { if (ao->plugin->enable == nullptr) {
@ -119,7 +119,7 @@ audio_output_enable(struct audio_output *ao)
} }
void void
audio_output_disable(struct audio_output *ao) audio_output_disable(AudioOutput *ao)
{ {
if (!ao->thread.IsDefined()) { if (!ao->thread.IsDefined()) {
if (ao->plugin->disable == nullptr) if (ao->plugin->disable == nullptr)
@ -139,7 +139,7 @@ audio_output_disable(struct audio_output *ao)
* Object must be locked (and unlocked) by the caller. * Object must be locked (and unlocked) by the caller.
*/ */
static bool static bool
audio_output_open(struct audio_output *ao, audio_output_open(AudioOutput *ao,
const AudioFormat audio_format, const AudioFormat audio_format,
const MusicPipe &mp) const MusicPipe &mp)
{ {
@ -199,7 +199,7 @@ audio_output_open(struct audio_output *ao,
* the caller. * the caller.
*/ */
static void static void
audio_output_close_locked(struct audio_output *ao) audio_output_close_locked(AudioOutput *ao)
{ {
assert(ao != nullptr); assert(ao != nullptr);
assert(ao->allow_play); assert(ao->allow_play);
@ -216,7 +216,7 @@ audio_output_close_locked(struct audio_output *ao)
} }
bool bool
audio_output_update(struct audio_output *ao, audio_output_update(AudioOutput *ao,
const AudioFormat audio_format, const AudioFormat audio_format,
const MusicPipe &mp) const MusicPipe &mp)
{ {
@ -233,7 +233,7 @@ audio_output_update(struct audio_output *ao,
} }
void void
audio_output_play(struct audio_output *ao) audio_output_play(AudioOutput *ao)
{ {
const ScopeLock protect(ao->mutex); const ScopeLock protect(ao->mutex);
@ -246,7 +246,7 @@ audio_output_play(struct audio_output *ao)
} }
} }
void audio_output_pause(struct audio_output *ao) void audio_output_pause(AudioOutput *ao)
{ {
if (ao->mixer != nullptr && ao->plugin->pause == nullptr) if (ao->mixer != nullptr && ao->plugin->pause == nullptr)
/* the device has no pause mode: close the mixer, /* the device has no pause mode: close the mixer,
@ -262,7 +262,7 @@ void audio_output_pause(struct audio_output *ao)
} }
void void
audio_output_drain_async(struct audio_output *ao) audio_output_drain_async(AudioOutput *ao)
{ {
const ScopeLock protect(ao->mutex); const ScopeLock protect(ao->mutex);
@ -271,7 +271,7 @@ audio_output_drain_async(struct audio_output *ao)
ao_command_async(ao, AO_COMMAND_DRAIN); ao_command_async(ao, AO_COMMAND_DRAIN);
} }
void audio_output_cancel(struct audio_output *ao) void audio_output_cancel(AudioOutput *ao)
{ {
const ScopeLock protect(ao->mutex); const ScopeLock protect(ao->mutex);
@ -282,7 +282,7 @@ void audio_output_cancel(struct audio_output *ao)
} }
void void
audio_output_allow_play(struct audio_output *ao) audio_output_allow_play(AudioOutput *ao)
{ {
const ScopeLock protect(ao->mutex); const ScopeLock protect(ao->mutex);
@ -292,7 +292,7 @@ audio_output_allow_play(struct audio_output *ao)
} }
void void
audio_output_release(struct audio_output *ao) audio_output_release(AudioOutput *ao)
{ {
if (ao->always_on) if (ao->always_on)
audio_output_pause(ao); audio_output_pause(ao);
@ -300,7 +300,7 @@ audio_output_release(struct audio_output *ao)
audio_output_close(ao); audio_output_close(ao);
} }
void audio_output_close(struct audio_output *ao) void audio_output_close(AudioOutput *ao)
{ {
assert(ao != nullptr); assert(ao != nullptr);
assert(!ao->open || !ao->fail_timer.IsDefined()); assert(!ao->open || !ao->fail_timer.IsDefined());
@ -309,7 +309,7 @@ void audio_output_close(struct audio_output *ao)
audio_output_close_locked(ao); audio_output_close_locked(ao);
} }
void audio_output_finish(struct audio_output *ao) void audio_output_finish(AudioOutput *ao)
{ {
audio_output_close(ao); audio_output_close(ao);

View File

@ -24,26 +24,26 @@
#include <stddef.h> #include <stddef.h>
struct audio_output; struct AudioOutput;
struct AudioFormat; struct AudioFormat;
struct config_param; struct config_param;
class MusicPipe; class MusicPipe;
void void
audio_output_set_replay_gain_mode(audio_output *ao, audio_output_set_replay_gain_mode(AudioOutput *ao,
ReplayGainMode mode); ReplayGainMode mode);
/** /**
* Enables the device. * Enables the device.
*/ */
void void
audio_output_enable(audio_output *ao); audio_output_enable(AudioOutput *ao);
/** /**
* Disables the device. * Disables the device.
*/ */
void void
audio_output_disable(audio_output *ao); audio_output_disable(AudioOutput *ao);
/** /**
* Opens or closes the device, depending on the "enabled" flag. * Opens or closes the device, depending on the "enabled" flag.
@ -51,18 +51,18 @@ audio_output_disable(audio_output *ao);
* @return true if the device is open * @return true if the device is open
*/ */
bool bool
audio_output_update(audio_output *ao, audio_output_update(AudioOutput *ao,
AudioFormat audio_format, AudioFormat audio_format,
const MusicPipe &mp); const MusicPipe &mp);
void void
audio_output_play(audio_output *ao); audio_output_play(AudioOutput *ao);
void void
audio_output_pause(audio_output *ao); audio_output_pause(AudioOutput *ao);
void void
audio_output_drain_async(audio_output *ao); audio_output_drain_async(AudioOutput *ao);
/** /**
* Clear the "allow_play" flag and send the "CANCEL" command * Clear the "allow_play" flag and send the "CANCEL" command
@ -70,25 +70,25 @@ audio_output_drain_async(audio_output *ao);
* audio_output_allow_play(). * audio_output_allow_play().
*/ */
void void
audio_output_cancel(audio_output *ao); audio_output_cancel(AudioOutput *ao);
/** /**
* Set the "allow_play" and signal the thread. * Set the "allow_play" and signal the thread.
*/ */
void void
audio_output_allow_play(audio_output *ao); audio_output_allow_play(AudioOutput *ao);
void void
audio_output_close(audio_output *ao); audio_output_close(AudioOutput *ao);
/** /**
* Closes the audio output, but if the "always_on" flag is set, put it * Closes the audio output, but if the "always_on" flag is set, put it
* into pause mode instead. * into pause mode instead.
*/ */
void void
audio_output_release(audio_output *ao); audio_output_release(AudioOutput *ao);
void void
audio_output_finish(audio_output *ao); audio_output_finish(AudioOutput *ao);
#endif #endif

View File

@ -26,7 +26,7 @@
#include <assert.h> #include <assert.h>
void void
ao_base_finish(struct audio_output *ao) ao_base_finish(AudioOutput *ao)
{ {
assert(!ao->open); assert(!ao->open);
assert(!ao->fail_timer.IsDefined()); assert(!ao->fail_timer.IsDefined());
@ -41,7 +41,7 @@ ao_base_finish(struct audio_output *ao)
} }
void void
audio_output_free(struct audio_output *ao) audio_output_free(AudioOutput *ao)
{ {
assert(!ao->open); assert(!ao->open);
assert(!ao->fail_timer.IsDefined()); assert(!ao->fail_timer.IsDefined());

View File

@ -93,7 +93,7 @@ audio_output_mixer_type(const config_param &param)
} }
static Mixer * static Mixer *
audio_output_load_mixer(struct audio_output *ao, audio_output_load_mixer(AudioOutput *ao,
const config_param &param, const config_param &param,
const struct mixer_plugin *plugin, const struct mixer_plugin *plugin,
Filter &filter_chain, Filter &filter_chain,
@ -128,7 +128,7 @@ audio_output_load_mixer(struct audio_output *ao,
} }
bool bool
ao_base_init(struct audio_output *ao, ao_base_init(AudioOutput *ao,
const AudioOutputPlugin *plugin, const AudioOutputPlugin *plugin,
const config_param &param, Error &error) const config_param &param, Error &error)
{ {
@ -214,7 +214,7 @@ ao_base_init(struct audio_output *ao,
} }
static bool static bool
audio_output_setup(struct audio_output *ao, const config_param &param, audio_output_setup(AudioOutput *ao, const config_param &param,
Error &error) Error &error)
{ {
@ -279,7 +279,7 @@ audio_output_setup(struct audio_output *ao, const config_param &param,
return true; return true;
} }
struct audio_output * AudioOutput *
audio_output_new(const config_param &param, audio_output_new(const config_param &param,
PlayerControl &pc, PlayerControl &pc,
Error &error) Error &error)
@ -304,7 +304,7 @@ audio_output_new(const config_param &param,
} }
} else { } else {
LogWarning(output_domain, LogWarning(output_domain,
"No 'audio_output' defined in config file"); "No 'AudioOutput' defined in config file");
plugin = audio_output_detect(error); plugin = audio_output_detect(error);
if (plugin == nullptr) if (plugin == nullptr)
@ -315,7 +315,7 @@ audio_output_new(const config_param &param,
plugin->name); plugin->name);
} }
struct audio_output *ao = ao_plugin_init(plugin, param, error); AudioOutput *ao = ao_plugin_init(plugin, param, error);
if (ao == nullptr) if (ao == nullptr)
return nullptr; return nullptr;

View File

@ -60,7 +60,7 @@ enum audio_output_command {
AO_COMMAND_KILL AO_COMMAND_KILL
}; };
struct audio_output { struct AudioOutput {
/** /**
* The device's configured display name. * The device's configured display name.
*/ */
@ -272,31 +272,31 @@ struct audio_output {
extern struct notify audio_output_client_notify; extern struct notify audio_output_client_notify;
static inline bool static inline bool
audio_output_is_open(const struct audio_output *ao) audio_output_is_open(const AudioOutput *ao)
{ {
return ao->open; return ao->open;
} }
static inline bool static inline bool
audio_output_command_is_finished(const struct audio_output *ao) audio_output_command_is_finished(const AudioOutput *ao)
{ {
return ao->command == AO_COMMAND_NONE; return ao->command == AO_COMMAND_NONE;
} }
struct audio_output * AudioOutput *
audio_output_new(const config_param &param, audio_output_new(const config_param &param,
PlayerControl &pc, PlayerControl &pc,
Error &error); Error &error);
bool bool
ao_base_init(struct audio_output *ao, ao_base_init(AudioOutput *ao,
const AudioOutputPlugin *plugin, const AudioOutputPlugin *plugin,
const config_param &param, Error &error); const config_param &param, Error &error);
void void
ao_base_finish(struct audio_output *ao); ao_base_finish(AudioOutput *ao);
void void
audio_output_free(struct audio_output *ao); audio_output_free(AudioOutput *ao);
#endif #endif

View File

@ -21,7 +21,7 @@
#include "OutputPlugin.hxx" #include "OutputPlugin.hxx"
#include "OutputInternal.hxx" #include "OutputInternal.hxx"
struct audio_output * AudioOutput *
ao_plugin_init(const AudioOutputPlugin *plugin, ao_plugin_init(const AudioOutputPlugin *plugin,
const config_param &param, const config_param &param,
Error &error) Error &error)
@ -33,13 +33,13 @@ ao_plugin_init(const AudioOutputPlugin *plugin,
} }
void void
ao_plugin_finish(struct audio_output *ao) ao_plugin_finish(AudioOutput *ao)
{ {
ao->plugin->finish(ao); ao->plugin->finish(ao);
} }
bool bool
ao_plugin_enable(struct audio_output *ao, Error &error_r) ao_plugin_enable(AudioOutput *ao, Error &error_r)
{ {
return ao->plugin->enable != nullptr return ao->plugin->enable != nullptr
? ao->plugin->enable(ao, error_r) ? ao->plugin->enable(ao, error_r)
@ -47,27 +47,27 @@ ao_plugin_enable(struct audio_output *ao, Error &error_r)
} }
void void
ao_plugin_disable(struct audio_output *ao) ao_plugin_disable(AudioOutput *ao)
{ {
if (ao->plugin->disable != nullptr) if (ao->plugin->disable != nullptr)
ao->plugin->disable(ao); ao->plugin->disable(ao);
} }
bool bool
ao_plugin_open(struct audio_output *ao, AudioFormat &audio_format, ao_plugin_open(AudioOutput *ao, AudioFormat &audio_format,
Error &error) Error &error)
{ {
return ao->plugin->open(ao, audio_format, error); return ao->plugin->open(ao, audio_format, error);
} }
void void
ao_plugin_close(struct audio_output *ao) ao_plugin_close(AudioOutput *ao)
{ {
ao->plugin->close(ao); ao->plugin->close(ao);
} }
unsigned unsigned
ao_plugin_delay(struct audio_output *ao) ao_plugin_delay(AudioOutput *ao)
{ {
return ao->plugin->delay != nullptr return ao->plugin->delay != nullptr
? ao->plugin->delay(ao) ? ao->plugin->delay(ao)
@ -75,35 +75,35 @@ ao_plugin_delay(struct audio_output *ao)
} }
void void
ao_plugin_send_tag(struct audio_output *ao, const Tag *tag) ao_plugin_send_tag(AudioOutput *ao, const Tag *tag)
{ {
if (ao->plugin->send_tag != nullptr) if (ao->plugin->send_tag != nullptr)
ao->plugin->send_tag(ao, tag); ao->plugin->send_tag(ao, tag);
} }
size_t size_t
ao_plugin_play(struct audio_output *ao, const void *chunk, size_t size, ao_plugin_play(AudioOutput *ao, const void *chunk, size_t size,
Error &error) Error &error)
{ {
return ao->plugin->play(ao, chunk, size, error); return ao->plugin->play(ao, chunk, size, error);
} }
void void
ao_plugin_drain(struct audio_output *ao) ao_plugin_drain(AudioOutput *ao)
{ {
if (ao->plugin->drain != nullptr) if (ao->plugin->drain != nullptr)
ao->plugin->drain(ao); ao->plugin->drain(ao);
} }
void void
ao_plugin_cancel(struct audio_output *ao) ao_plugin_cancel(AudioOutput *ao)
{ {
if (ao->plugin->cancel != nullptr) if (ao->plugin->cancel != nullptr)
ao->plugin->cancel(ao); ao->plugin->cancel(ao);
} }
bool bool
ao_plugin_pause(struct audio_output *ao) ao_plugin_pause(AudioOutput *ao)
{ {
return ao->plugin->pause != nullptr && ao->plugin->pause(ao); return ao->plugin->pause != nullptr && ao->plugin->pause(ao);
} }

View File

@ -27,6 +27,7 @@
struct config_param; struct config_param;
struct AudioFormat; struct AudioFormat;
struct Tag; struct Tag;
struct AudioOutput;
class Error; class Error;
/** /**
@ -53,13 +54,13 @@ struct AudioOutputPlugin {
* @return nullptr on error, or an opaque pointer to the plugin's * @return nullptr on error, or an opaque pointer to the plugin's
* data * data
*/ */
struct audio_output *(*init)(const config_param &param, AudioOutput *(*init)(const config_param &param,
Error &error); Error &error);
/** /**
* Free resources allocated by this device. * Free resources allocated by this device.
*/ */
void (*finish)(struct audio_output *data); void (*finish)(AudioOutput *data);
/** /**
* Enable the device. This may allocate resources, preparing * Enable the device. This may allocate resources, preparing
@ -69,13 +70,13 @@ struct AudioOutputPlugin {
* *
* @return true on success, false on error * @return true on success, false on error
*/ */
bool (*enable)(struct audio_output *data, Error &error); bool (*enable)(AudioOutput *data, Error &error);
/** /**
* Disables the device. It is closed before this method is * Disables the device. It is closed before this method is
* called. * called.
*/ */
void (*disable)(struct audio_output *data); void (*disable)(AudioOutput *data);
/** /**
* Really open the device. * Really open the device.
@ -83,13 +84,13 @@ struct AudioOutputPlugin {
* @param audio_format the audio format in which data is going * @param audio_format the audio format in which data is going
* to be delivered; may be modified by the plugin * to be delivered; may be modified by the plugin
*/ */
bool (*open)(struct audio_output *data, AudioFormat &audio_format, bool (*open)(AudioOutput *data, AudioFormat &audio_format,
Error &error); Error &error);
/** /**
* Close the device. * Close the device.
*/ */
void (*close)(struct audio_output *data); void (*close)(AudioOutput *data);
/** /**
* Returns a positive number if the output thread shall delay * Returns a positive number if the output thread shall delay
@ -99,33 +100,33 @@ struct AudioOutputPlugin {
* *
* @return the number of milliseconds to wait * @return the number of milliseconds to wait
*/ */
unsigned (*delay)(struct audio_output *data); unsigned (*delay)(AudioOutput *data);
/** /**
* Display metadata for the next chunk. Optional method, * Display metadata for the next chunk. Optional method,
* because not all devices can display metadata. * because not all devices can display metadata.
*/ */
void (*send_tag)(struct audio_output *data, const Tag *tag); void (*send_tag)(AudioOutput *data, const Tag *tag);
/** /**
* Play a chunk of audio data. * Play a chunk of audio data.
* *
* @return the number of bytes played, or 0 on error * @return the number of bytes played, or 0 on error
*/ */
size_t (*play)(struct audio_output *data, size_t (*play)(AudioOutput *data,
const void *chunk, size_t size, const void *chunk, size_t size,
Error &error); Error &error);
/** /**
* Wait until the device has finished playing. * Wait until the device has finished playing.
*/ */
void (*drain)(struct audio_output *data); void (*drain)(AudioOutput *data);
/** /**
* Try to cancel data which may still be in the device's * Try to cancel data which may still be in the device's
* buffers. * buffers.
*/ */
void (*cancel)(struct audio_output *data); void (*cancel)(AudioOutput *data);
/** /**
* Pause the device. If supported, it may perform a special * Pause the device. If supported, it may perform a special
@ -138,7 +139,7 @@ struct AudioOutputPlugin {
* @return false on error (output will be closed then), true * @return false on error (output will be closed then), true
* for continue to pause * for continue to pause
*/ */
bool (*pause)(struct audio_output *data); bool (*pause)(AudioOutput *data);
/** /**
* The mixer plugin associated with this output plugin. This * The mixer plugin associated with this output plugin. This
@ -158,45 +159,45 @@ ao_plugin_test_default_device(const AudioOutputPlugin *plugin)
} }
gcc_malloc gcc_malloc
struct audio_output * AudioOutput *
ao_plugin_init(const AudioOutputPlugin *plugin, ao_plugin_init(const AudioOutputPlugin *plugin,
const config_param &param, const config_param &param,
Error &error); Error &error);
void void
ao_plugin_finish(struct audio_output *ao); ao_plugin_finish(AudioOutput *ao);
bool bool
ao_plugin_enable(struct audio_output *ao, Error &error); ao_plugin_enable(AudioOutput *ao, Error &error);
void void
ao_plugin_disable(struct audio_output *ao); ao_plugin_disable(AudioOutput *ao);
bool bool
ao_plugin_open(struct audio_output *ao, AudioFormat &audio_format, ao_plugin_open(AudioOutput *ao, AudioFormat &audio_format,
Error &error); Error &error);
void void
ao_plugin_close(struct audio_output *ao); ao_plugin_close(AudioOutput *ao);
gcc_pure gcc_pure
unsigned unsigned
ao_plugin_delay(struct audio_output *ao); ao_plugin_delay(AudioOutput *ao);
void void
ao_plugin_send_tag(struct audio_output *ao, const Tag *tag); ao_plugin_send_tag(AudioOutput *ao, const Tag *tag);
size_t size_t
ao_plugin_play(struct audio_output *ao, const void *chunk, size_t size, ao_plugin_play(AudioOutput *ao, const void *chunk, size_t size,
Error &error); Error &error);
void void
ao_plugin_drain(struct audio_output *ao); ao_plugin_drain(AudioOutput *ao);
void void
ao_plugin_cancel(struct audio_output *ao); ao_plugin_cancel(AudioOutput *ao);
bool bool
ao_plugin_pause(struct audio_output *ao); ao_plugin_pause(AudioOutput *ao);
#endif #endif

View File

@ -32,7 +32,7 @@ void
printAudioDevices(Client &client, const MultipleOutputs &outputs) printAudioDevices(Client &client, const MultipleOutputs &outputs)
{ {
for (unsigned i = 0, n = outputs.Size(); i != n; ++i) { for (unsigned i = 0, n = outputs.Size(); i != n; ++i) {
const audio_output &ao = outputs.Get(i); const AudioOutput &ao = outputs.Get(i);
client_printf(client, client_printf(client,
"outputid: %i\n" "outputid: %i\n"

View File

@ -41,7 +41,7 @@ void
audio_output_state_save(FILE *fp, const MultipleOutputs &outputs) audio_output_state_save(FILE *fp, const MultipleOutputs &outputs)
{ {
for (unsigned i = 0, n = outputs.Size(); i != n; ++i) { for (unsigned i = 0, n = outputs.Size(); i != n; ++i) {
const audio_output &ao = outputs.Get(i); const AudioOutput &ao = outputs.Get(i);
fprintf(fp, AUDIO_DEVICE_STATE "%d:%s\n", fprintf(fp, AUDIO_DEVICE_STATE "%d:%s\n",
ao.enabled, ao.name); ao.enabled, ao.name);
@ -69,7 +69,7 @@ audio_output_state_read(const char *line, MultipleOutputs &outputs)
return true; return true;
name = endptr + 1; name = endptr + 1;
audio_output *ao = outputs.FindByName(name); AudioOutput *ao = outputs.FindByName(name);
if (ao == NULL) { if (ao == NULL) {
FormatDebug(output_domain, FormatDebug(output_domain,
"Ignoring device state for '%s'", name); "Ignoring device state for '%s'", name);

View File

@ -40,7 +40,7 @@
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
static void ao_command_finished(struct audio_output *ao) static void ao_command_finished(AudioOutput *ao)
{ {
assert(ao->command != AO_COMMAND_NONE); assert(ao->command != AO_COMMAND_NONE);
ao->command = AO_COMMAND_NONE; ao->command = AO_COMMAND_NONE;
@ -51,7 +51,7 @@ static void ao_command_finished(struct audio_output *ao)
} }
static bool static bool
ao_enable(struct audio_output *ao) ao_enable(AudioOutput *ao)
{ {
Error error; Error error;
bool success; bool success;
@ -74,10 +74,10 @@ ao_enable(struct audio_output *ao)
} }
static void static void
ao_close(struct audio_output *ao, bool drain); ao_close(AudioOutput *ao, bool drain);
static void static void
ao_disable(struct audio_output *ao) ao_disable(AudioOutput *ao)
{ {
if (ao->open) if (ao->open)
ao_close(ao, false); ao_close(ao, false);
@ -92,7 +92,7 @@ ao_disable(struct audio_output *ao)
} }
static AudioFormat static AudioFormat
ao_filter_open(struct audio_output *ao, AudioFormat &format, ao_filter_open(AudioOutput *ao, AudioFormat &format,
Error &error_r) Error &error_r)
{ {
assert(format.IsValid()); assert(format.IsValid());
@ -121,7 +121,7 @@ ao_filter_open(struct audio_output *ao, AudioFormat &format,
} }
static void static void
ao_filter_close(struct audio_output *ao) ao_filter_close(AudioOutput *ao)
{ {
if (ao->replay_gain_filter != nullptr) if (ao->replay_gain_filter != nullptr)
ao->replay_gain_filter->Close(); ao->replay_gain_filter->Close();
@ -132,7 +132,7 @@ ao_filter_close(struct audio_output *ao)
} }
static void static void
ao_open(struct audio_output *ao) ao_open(AudioOutput *ao)
{ {
bool success; bool success;
Error error; Error error;
@ -207,7 +207,7 @@ ao_open(struct audio_output *ao)
} }
static void static void
ao_close(struct audio_output *ao, bool drain) ao_close(AudioOutput *ao, bool drain)
{ {
assert(ao->open); assert(ao->open);
@ -233,7 +233,7 @@ ao_close(struct audio_output *ao, bool drain)
} }
static void static void
ao_reopen_filter(struct audio_output *ao) ao_reopen_filter(AudioOutput *ao)
{ {
Error error; Error error;
@ -266,7 +266,7 @@ ao_reopen_filter(struct audio_output *ao)
} }
static void static void
ao_reopen(struct audio_output *ao) ao_reopen(AudioOutput *ao)
{ {
if (!ao->config_audio_format.IsFullyDefined()) { if (!ao->config_audio_format.IsFullyDefined()) {
if (ao->open) { if (ao->open) {
@ -297,7 +297,7 @@ ao_reopen(struct audio_output *ao)
* was issued * was issued
*/ */
static bool static bool
ao_wait(struct audio_output *ao) ao_wait(AudioOutput *ao)
{ {
while (true) { while (true) {
unsigned delay = ao_plugin_delay(ao); unsigned delay = ao_plugin_delay(ao);
@ -312,7 +312,7 @@ ao_wait(struct audio_output *ao)
} }
static const void * static const void *
ao_chunk_data(struct audio_output *ao, const struct music_chunk *chunk, ao_chunk_data(AudioOutput *ao, const struct music_chunk *chunk,
Filter *replay_gain_filter, Filter *replay_gain_filter,
unsigned *replay_gain_serial_p, unsigned *replay_gain_serial_p,
size_t *length_r) size_t *length_r)
@ -352,7 +352,7 @@ ao_chunk_data(struct audio_output *ao, const struct music_chunk *chunk,
} }
static const void * static const void *
ao_filter_chunk(struct audio_output *ao, const struct music_chunk *chunk, ao_filter_chunk(AudioOutput *ao, const struct music_chunk *chunk,
size_t *length_r) size_t *length_r)
{ {
size_t length; size_t length;
@ -422,7 +422,7 @@ ao_filter_chunk(struct audio_output *ao, const struct music_chunk *chunk,
} }
static bool static bool
ao_play_chunk(struct audio_output *ao, const struct music_chunk *chunk) ao_play_chunk(AudioOutput *ao, const struct music_chunk *chunk)
{ {
assert(ao != nullptr); assert(ao != nullptr);
assert(ao->filter != nullptr); assert(ao->filter != nullptr);
@ -485,7 +485,7 @@ ao_play_chunk(struct audio_output *ao, const struct music_chunk *chunk)
} }
static const struct music_chunk * static const struct music_chunk *
ao_next_chunk(struct audio_output *ao) ao_next_chunk(AudioOutput *ao)
{ {
return ao->chunk != nullptr return ao->chunk != nullptr
/* continue the previous play() call */ /* continue the previous play() call */
@ -503,7 +503,7 @@ ao_next_chunk(struct audio_output *ao)
* tail of the pipe was already reached * tail of the pipe was already reached
*/ */
static bool static bool
ao_play(struct audio_output *ao) ao_play(AudioOutput *ao)
{ {
bool success; bool success;
const struct music_chunk *chunk; const struct music_chunk *chunk;
@ -547,7 +547,7 @@ ao_play(struct audio_output *ao)
return true; return true;
} }
static void ao_pause(struct audio_output *ao) static void ao_pause(AudioOutput *ao)
{ {
bool ret; bool ret;
@ -578,7 +578,7 @@ static void ao_pause(struct audio_output *ao)
static void static void
audio_output_task(void *arg) audio_output_task(void *arg)
{ {
struct audio_output *ao = (struct audio_output *)arg; AudioOutput *ao = (AudioOutput *)arg;
FormatThreadName("output:%s", ao->name); FormatThreadName("output:%s", ao->name);
@ -680,7 +680,7 @@ audio_output_task(void *arg)
} }
} }
void audio_output_thread_start(struct audio_output *ao) void audio_output_thread_start(AudioOutput *ao)
{ {
assert(ao->command == AO_COMMAND_NONE); assert(ao->command == AO_COMMAND_NONE);

View File

@ -20,9 +20,9 @@
#ifndef MPD_OUTPUT_THREAD_HXX #ifndef MPD_OUTPUT_THREAD_HXX
#define MPD_OUTPUT_THREAD_HXX #define MPD_OUTPUT_THREAD_HXX
struct audio_output; struct AudioOutput;
void void
audio_output_thread_start(audio_output *ao); audio_output_thread_start(AudioOutput *ao);
#endif #endif

View File

@ -44,7 +44,7 @@ typedef snd_pcm_sframes_t alsa_writei_t(snd_pcm_t * pcm, const void *buffer,
snd_pcm_uframes_t size); snd_pcm_uframes_t size);
struct AlsaOutput { struct AlsaOutput {
struct audio_output base; AudioOutput base;
Manual<PcmExport> pcm_export; Manual<PcmExport> pcm_export;
@ -169,7 +169,7 @@ alsa_configure(AlsaOutput *ad, const config_param &param)
#endif #endif
} }
static struct audio_output * static AudioOutput *
alsa_init(const config_param &param, Error &error) alsa_init(const config_param &param, Error &error)
{ {
AlsaOutput *ad = new AlsaOutput(); AlsaOutput *ad = new AlsaOutput();
@ -185,7 +185,7 @@ alsa_init(const config_param &param, Error &error)
} }
static void static void
alsa_finish(struct audio_output *ao) alsa_finish(AudioOutput *ao)
{ {
AlsaOutput *ad = (AlsaOutput *)ao; AlsaOutput *ad = (AlsaOutput *)ao;
@ -197,7 +197,7 @@ alsa_finish(struct audio_output *ao)
} }
static bool static bool
alsa_output_enable(struct audio_output *ao, gcc_unused Error &error) alsa_output_enable(AudioOutput *ao, gcc_unused Error &error)
{ {
AlsaOutput *ad = (AlsaOutput *)ao; AlsaOutput *ad = (AlsaOutput *)ao;
@ -206,7 +206,7 @@ alsa_output_enable(struct audio_output *ao, gcc_unused Error &error)
} }
static void static void
alsa_output_disable(struct audio_output *ao) alsa_output_disable(AudioOutput *ao)
{ {
AlsaOutput *ad = (AlsaOutput *)ao; AlsaOutput *ad = (AlsaOutput *)ao;
@ -671,7 +671,7 @@ alsa_setup_or_dsd(AlsaOutput *ad, AudioFormat &audio_format,
} }
static bool static bool
alsa_open(struct audio_output *ao, AudioFormat &audio_format, Error &error) alsa_open(AudioOutput *ao, AudioFormat &audio_format, Error &error)
{ {
AlsaOutput *ad = (AlsaOutput *)ao; AlsaOutput *ad = (AlsaOutput *)ao;
@ -774,7 +774,7 @@ alsa_recover(AlsaOutput *ad, int err)
} }
static void static void
alsa_drain(struct audio_output *ao) alsa_drain(AudioOutput *ao)
{ {
AlsaOutput *ad = (AlsaOutput *)ao; AlsaOutput *ad = (AlsaOutput *)ao;
@ -795,7 +795,7 @@ alsa_drain(struct audio_output *ao)
} }
static void static void
alsa_cancel(struct audio_output *ao) alsa_cancel(AudioOutput *ao)
{ {
AlsaOutput *ad = (AlsaOutput *)ao; AlsaOutput *ad = (AlsaOutput *)ao;
@ -805,7 +805,7 @@ alsa_cancel(struct audio_output *ao)
} }
static void static void
alsa_close(struct audio_output *ao) alsa_close(AudioOutput *ao)
{ {
AlsaOutput *ad = (AlsaOutput *)ao; AlsaOutput *ad = (AlsaOutput *)ao;
@ -814,7 +814,7 @@ alsa_close(struct audio_output *ao)
} }
static size_t static size_t
alsa_play(struct audio_output *ao, const void *chunk, size_t size, alsa_play(AudioOutput *ao, const void *chunk, size_t size,
Error &error) Error &error)
{ {
AlsaOutput *ad = (AlsaOutput *)ao; AlsaOutput *ad = (AlsaOutput *)ao;

View File

@ -35,7 +35,7 @@ static ao_sample_format OUR_AO_FORMAT_INITIALIZER;
static unsigned ao_output_ref; static unsigned ao_output_ref;
struct AoOutput { struct AoOutput {
struct audio_output base; AudioOutput base;
size_t write_size; size_t write_size;
int driver; int driver;
@ -152,7 +152,7 @@ AoOutput::Configure(const config_param &param, Error &error)
return true; return true;
} }
static struct audio_output * static AudioOutput *
ao_output_init(const config_param &param, Error &error) ao_output_init(const config_param &param, Error &error)
{ {
AoOutput *ad = new AoOutput(); AoOutput *ad = new AoOutput();
@ -172,7 +172,7 @@ ao_output_init(const config_param &param, Error &error)
} }
static void static void
ao_output_finish(struct audio_output *ao) ao_output_finish(AudioOutput *ao)
{ {
AoOutput *ad = (AoOutput *)ao; AoOutput *ad = (AoOutput *)ao;
@ -187,7 +187,7 @@ ao_output_finish(struct audio_output *ao)
} }
static void static void
ao_output_close(struct audio_output *ao) ao_output_close(AudioOutput *ao)
{ {
AoOutput *ad = (AoOutput *)ao; AoOutput *ad = (AoOutput *)ao;
@ -195,7 +195,7 @@ ao_output_close(struct audio_output *ao)
} }
static bool static bool
ao_output_open(struct audio_output *ao, AudioFormat &audio_format, ao_output_open(AudioOutput *ao, AudioFormat &audio_format,
Error &error) Error &error)
{ {
ao_sample_format format = OUR_AO_FORMAT_INITIALIZER; ao_sample_format format = OUR_AO_FORMAT_INITIALIZER;
@ -251,7 +251,7 @@ static int ao_play_deconst(ao_device *device, const void *output_samples,
} }
static size_t static size_t
ao_output_play(struct audio_output *ao, const void *chunk, size_t size, ao_output_play(AudioOutput *ao, const void *chunk, size_t size,
Error &error) Error &error)
{ {
AoOutput *ad = (AoOutput *)ao; AoOutput *ad = (AoOutput *)ao;

View File

@ -36,7 +36,7 @@
#define FIFO_BUFFER_SIZE 65536 /* pipe capacity on Linux >= 2.6.11 */ #define FIFO_BUFFER_SIZE 65536 /* pipe capacity on Linux >= 2.6.11 */
struct FifoOutput { struct FifoOutput {
struct audio_output base; AudioOutput base;
AllocatedPath path; AllocatedPath path;
std::string path_utf8; std::string path_utf8;
@ -172,7 +172,7 @@ fifo_open(FifoOutput *fd, Error &error)
return fd->Open(error); return fd->Open(error);
} }
static struct audio_output * static AudioOutput *
fifo_output_init(const config_param &param, Error &error) fifo_output_init(const config_param &param, Error &error)
{ {
FifoOutput *fd = new FifoOutput(); FifoOutput *fd = new FifoOutput();
@ -204,7 +204,7 @@ fifo_output_init(const config_param &param, Error &error)
} }
static void static void
fifo_output_finish(struct audio_output *ao) fifo_output_finish(AudioOutput *ao)
{ {
FifoOutput *fd = (FifoOutput *)ao; FifoOutput *fd = (FifoOutput *)ao;
@ -214,7 +214,7 @@ fifo_output_finish(struct audio_output *ao)
} }
static bool static bool
fifo_output_open(struct audio_output *ao, AudioFormat &audio_format, fifo_output_open(AudioOutput *ao, AudioFormat &audio_format,
gcc_unused Error &error) gcc_unused Error &error)
{ {
FifoOutput *fd = (FifoOutput *)ao; FifoOutput *fd = (FifoOutput *)ao;
@ -225,7 +225,7 @@ fifo_output_open(struct audio_output *ao, AudioFormat &audio_format,
} }
static void static void
fifo_output_close(struct audio_output *ao) fifo_output_close(AudioOutput *ao)
{ {
FifoOutput *fd = (FifoOutput *)ao; FifoOutput *fd = (FifoOutput *)ao;
@ -233,7 +233,7 @@ fifo_output_close(struct audio_output *ao)
} }
static void static void
fifo_output_cancel(struct audio_output *ao) fifo_output_cancel(AudioOutput *ao)
{ {
FifoOutput *fd = (FifoOutput *)ao; FifoOutput *fd = (FifoOutput *)ao;
char buf[FIFO_BUFFER_SIZE]; char buf[FIFO_BUFFER_SIZE];
@ -252,7 +252,7 @@ fifo_output_cancel(struct audio_output *ao)
} }
static unsigned static unsigned
fifo_output_delay(struct audio_output *ao) fifo_output_delay(AudioOutput *ao)
{ {
FifoOutput *fd = (FifoOutput *)ao; FifoOutput *fd = (FifoOutput *)ao;
@ -262,7 +262,7 @@ fifo_output_delay(struct audio_output *ao)
} }
static size_t static size_t
fifo_output_play(struct audio_output *ao, const void *chunk, size_t size, fifo_output_play(AudioOutput *ao, const void *chunk, size_t size,
Error &error) Error &error)
{ {
FifoOutput *fd = (FifoOutput *)ao; FifoOutput *fd = (FifoOutput *)ao;

View File

@ -51,7 +51,7 @@ struct Encoder;
struct Tag; struct Tag;
class HttpdOutput final : ServerSocket, DeferredMonitor { class HttpdOutput final : ServerSocket, DeferredMonitor {
struct audio_output base; AudioOutput base;
/** /**
* True if the audio output is open and accepts client * True if the audio output is open and accepts client
@ -157,7 +157,7 @@ public:
#pragma GCC diagnostic ignored "-Winvalid-offsetof" #pragma GCC diagnostic ignored "-Winvalid-offsetof"
#endif #endif
static constexpr HttpdOutput *Cast(audio_output *ao) { static constexpr HttpdOutput *Cast(AudioOutput *ao) {
return ContainerCast(ao, HttpdOutput, base); return ContainerCast(ao, HttpdOutput, base);
} }
@ -175,7 +175,7 @@ public:
bool Configure(const config_param &param, Error &error); bool Configure(const config_param &param, Error &error);
audio_output *InitAndConfigure(const config_param &param, AudioOutput *InitAndConfigure(const config_param &param,
Error &error) { Error &error) {
if (!Init(param, error)) if (!Init(param, error))
return nullptr; return nullptr;

View File

@ -139,12 +139,12 @@ HttpdOutput::Init(const config_param &param, Error &error)
return ao_base_init(&base, &httpd_output_plugin, param, error); return ao_base_init(&base, &httpd_output_plugin, param, error);
} }
static struct audio_output * static AudioOutput *
httpd_output_init(const config_param &param, Error &error) httpd_output_init(const config_param &param, Error &error)
{ {
HttpdOutput *httpd = new HttpdOutput(io_thread_get()); HttpdOutput *httpd = new HttpdOutput(io_thread_get());
audio_output *result = httpd->InitAndConfigure(param, error); AudioOutput *result = httpd->InitAndConfigure(param, error);
if (result == nullptr) if (result == nullptr)
delete httpd; delete httpd;
@ -152,7 +152,7 @@ httpd_output_init(const config_param &param, Error &error)
} }
static void static void
httpd_output_finish(struct audio_output *ao) httpd_output_finish(AudioOutput *ao)
{ {
HttpdOutput *httpd = HttpdOutput::Cast(ao); HttpdOutput *httpd = HttpdOutput::Cast(ao);
@ -276,7 +276,7 @@ HttpdOutput::ReadPage()
} }
static bool static bool
httpd_output_enable(struct audio_output *ao, Error &error) httpd_output_enable(AudioOutput *ao, Error &error)
{ {
HttpdOutput *httpd = HttpdOutput::Cast(ao); HttpdOutput *httpd = HttpdOutput::Cast(ao);
@ -284,7 +284,7 @@ httpd_output_enable(struct audio_output *ao, Error &error)
} }
static void static void
httpd_output_disable(struct audio_output *ao) httpd_output_disable(AudioOutput *ao)
{ {
HttpdOutput *httpd = HttpdOutput::Cast(ao); HttpdOutput *httpd = HttpdOutput::Cast(ao);
@ -329,7 +329,7 @@ HttpdOutput::Open(AudioFormat &audio_format, Error &error)
} }
static bool static bool
httpd_output_open(struct audio_output *ao, AudioFormat &audio_format, httpd_output_open(AudioOutput *ao, AudioFormat &audio_format,
Error &error) Error &error)
{ {
HttpdOutput *httpd = HttpdOutput::Cast(ao); HttpdOutput *httpd = HttpdOutput::Cast(ao);
@ -358,7 +358,7 @@ HttpdOutput::Close()
} }
static void static void
httpd_output_close(struct audio_output *ao) httpd_output_close(AudioOutput *ao)
{ {
HttpdOutput *httpd = HttpdOutput::Cast(ao); HttpdOutput *httpd = HttpdOutput::Cast(ao);
@ -411,7 +411,7 @@ HttpdOutput::Delay() const
} }
static unsigned static unsigned
httpd_output_delay(struct audio_output *ao) httpd_output_delay(AudioOutput *ao)
{ {
HttpdOutput *httpd = HttpdOutput::Cast(ao); HttpdOutput *httpd = HttpdOutput::Cast(ao);
@ -476,7 +476,7 @@ HttpdOutput::Play(const void *chunk, size_t size, Error &error)
} }
static size_t static size_t
httpd_output_play(struct audio_output *ao, const void *chunk, size_t size, httpd_output_play(AudioOutput *ao, const void *chunk, size_t size,
Error &error) Error &error)
{ {
HttpdOutput *httpd = HttpdOutput::Cast(ao); HttpdOutput *httpd = HttpdOutput::Cast(ao);
@ -485,7 +485,7 @@ httpd_output_play(struct audio_output *ao, const void *chunk, size_t size,
} }
static bool static bool
httpd_output_pause(struct audio_output *ao) httpd_output_pause(AudioOutput *ao)
{ {
HttpdOutput *httpd = HttpdOutput::Cast(ao); HttpdOutput *httpd = HttpdOutput::Cast(ao);
@ -548,7 +548,7 @@ HttpdOutput::SendTag(const Tag *tag)
} }
static void static void
httpd_output_tag(struct audio_output *ao, const Tag *tag) httpd_output_tag(AudioOutput *ao, const Tag *tag)
{ {
HttpdOutput *httpd = HttpdOutput::Cast(ao); HttpdOutput *httpd = HttpdOutput::Cast(ao);
@ -573,7 +573,7 @@ HttpdOutput::CancelAllClients()
} }
static void static void
httpd_output_cancel(struct audio_output *ao) httpd_output_cancel(AudioOutput *ao)
{ {
HttpdOutput *httpd = HttpdOutput::Cast(ao); HttpdOutput *httpd = HttpdOutput::Cast(ao);

View File

@ -42,7 +42,7 @@ enum {
static const size_t jack_sample_size = sizeof(jack_default_audio_sample_t); static const size_t jack_sample_size = sizeof(jack_default_audio_sample_t);
struct JackOutput { struct JackOutput {
struct audio_output base; AudioOutput base;
/** /**
* libjack options passed to jack_client_open(). * libjack options passed to jack_client_open().
@ -310,7 +310,7 @@ parse_port_list(const char *source, char **dest, Error &error)
return n; return n;
} }
static struct audio_output * static AudioOutput *
mpd_jack_init(const config_param &param, Error &error) mpd_jack_init(const config_param &param, Error &error)
{ {
JackOutput *jd = new JackOutput(); JackOutput *jd = new JackOutput();
@ -389,7 +389,7 @@ mpd_jack_init(const config_param &param, Error &error)
} }
static void static void
mpd_jack_finish(struct audio_output *ao) mpd_jack_finish(AudioOutput *ao)
{ {
JackOutput *jd = (JackOutput *)ao; JackOutput *jd = (JackOutput *)ao;
@ -404,7 +404,7 @@ mpd_jack_finish(struct audio_output *ao)
} }
static bool static bool
mpd_jack_enable(struct audio_output *ao, Error &error) mpd_jack_enable(AudioOutput *ao, Error &error)
{ {
JackOutput *jd = (JackOutput *)ao; JackOutput *jd = (JackOutput *)ao;
@ -415,7 +415,7 @@ mpd_jack_enable(struct audio_output *ao, Error &error)
} }
static void static void
mpd_jack_disable(struct audio_output *ao) mpd_jack_disable(AudioOutput *ao)
{ {
JackOutput *jd = (JackOutput *)ao; JackOutput *jd = (JackOutput *)ao;
@ -579,7 +579,7 @@ mpd_jack_start(JackOutput *jd, Error &error)
} }
static bool static bool
mpd_jack_open(struct audio_output *ao, AudioFormat &audio_format, mpd_jack_open(AudioOutput *ao, AudioFormat &audio_format,
Error &error) Error &error)
{ {
JackOutput *jd = (JackOutput *)ao; JackOutput *jd = (JackOutput *)ao;
@ -604,7 +604,7 @@ mpd_jack_open(struct audio_output *ao, AudioFormat &audio_format,
} }
static void static void
mpd_jack_close(gcc_unused struct audio_output *ao) mpd_jack_close(gcc_unused AudioOutput *ao)
{ {
JackOutput *jd = (JackOutput *)ao; JackOutput *jd = (JackOutput *)ao;
@ -612,7 +612,7 @@ mpd_jack_close(gcc_unused struct audio_output *ao)
} }
static unsigned static unsigned
mpd_jack_delay(struct audio_output *ao) mpd_jack_delay(AudioOutput *ao)
{ {
JackOutput *jd = (JackOutput *)ao; JackOutput *jd = (JackOutput *)ao;
@ -689,7 +689,7 @@ mpd_jack_write_samples(JackOutput *jd, const void *src,
} }
static size_t static size_t
mpd_jack_play(struct audio_output *ao, const void *chunk, size_t size, mpd_jack_play(AudioOutput *ao, const void *chunk, size_t size,
Error &error) Error &error)
{ {
JackOutput *jd = (JackOutput *)ao; JackOutput *jd = (JackOutput *)ao;
@ -734,7 +734,7 @@ mpd_jack_play(struct audio_output *ao, const void *chunk, size_t size,
} }
static bool static bool
mpd_jack_pause(struct audio_output *ao) mpd_jack_pause(AudioOutput *ao)
{ {
JackOutput *jd = (JackOutput *)ao; JackOutput *jd = (JackOutput *)ao;

View File

@ -23,7 +23,7 @@
#include "Timer.hxx" #include "Timer.hxx"
struct NullOutput { struct NullOutput {
struct audio_output base; AudioOutput base;
bool sync; bool sync;
@ -39,7 +39,7 @@ struct NullOutput {
} }
}; };
static struct audio_output * static AudioOutput *
null_init(const config_param &param, Error &error) null_init(const config_param &param, Error &error)
{ {
NullOutput *nd = new NullOutput(); NullOutput *nd = new NullOutput();
@ -55,7 +55,7 @@ null_init(const config_param &param, Error &error)
} }
static void static void
null_finish(struct audio_output *ao) null_finish(AudioOutput *ao)
{ {
NullOutput *nd = (NullOutput *)ao; NullOutput *nd = (NullOutput *)ao;
@ -64,7 +64,7 @@ null_finish(struct audio_output *ao)
} }
static bool static bool
null_open(struct audio_output *ao, AudioFormat &audio_format, null_open(AudioOutput *ao, AudioFormat &audio_format,
gcc_unused Error &error) gcc_unused Error &error)
{ {
NullOutput *nd = (NullOutput *)ao; NullOutput *nd = (NullOutput *)ao;
@ -76,7 +76,7 @@ null_open(struct audio_output *ao, AudioFormat &audio_format,
} }
static void static void
null_close(struct audio_output *ao) null_close(AudioOutput *ao)
{ {
NullOutput *nd = (NullOutput *)ao; NullOutput *nd = (NullOutput *)ao;
@ -85,7 +85,7 @@ null_close(struct audio_output *ao)
} }
static unsigned static unsigned
null_delay(struct audio_output *ao) null_delay(AudioOutput *ao)
{ {
NullOutput *nd = (NullOutput *)ao; NullOutput *nd = (NullOutput *)ao;
@ -95,7 +95,7 @@ null_delay(struct audio_output *ao)
} }
static size_t static size_t
null_play(struct audio_output *ao, gcc_unused const void *chunk, size_t size, null_play(AudioOutput *ao, gcc_unused const void *chunk, size_t size,
gcc_unused Error &error) gcc_unused Error &error)
{ {
NullOutput *nd = (NullOutput *)ao; NullOutput *nd = (NullOutput *)ao;
@ -112,7 +112,7 @@ null_play(struct audio_output *ao, gcc_unused const void *chunk, size_t size,
} }
static void static void
null_cancel(struct audio_output *ao) null_cancel(AudioOutput *ao)
{ {
NullOutput *nd = (NullOutput *)ao; NullOutput *nd = (NullOutput *)ao;

View File

@ -33,7 +33,7 @@
#include <CoreServices/CoreServices.h> #include <CoreServices/CoreServices.h>
struct OSXOutput { struct OSXOutput {
struct audio_output base; AudioOutput base;
/* configuration settings */ /* configuration settings */
OSType component_subtype; OSType component_subtype;
@ -77,7 +77,7 @@ osx_output_configure(OSXOutput *oo, const config_param &param)
} }
} }
static struct audio_output * static AudioOutput *
osx_output_init(const config_param &param, Error &error) osx_output_init(const config_param &param, Error &error)
{ {
OSXOutput *oo = new OSXOutput(); OSXOutput *oo = new OSXOutput();
@ -92,7 +92,7 @@ osx_output_init(const config_param &param, Error &error)
} }
static void static void
osx_output_finish(struct audio_output *ao) osx_output_finish(AudioOutput *ao)
{ {
OSXOutput *oo = (OSXOutput *)ao; OSXOutput *oo = (OSXOutput *)ao;
@ -231,7 +231,7 @@ osx_render(void *vdata,
} }
static bool static bool
osx_output_enable(struct audio_output *ao, Error &error) osx_output_enable(AudioOutput *ao, Error &error)
{ {
OSXOutput *oo = (OSXOutput *)ao; OSXOutput *oo = (OSXOutput *)ao;
@ -282,7 +282,7 @@ osx_output_enable(struct audio_output *ao, Error &error)
} }
static void static void
osx_output_disable(struct audio_output *ao) osx_output_disable(AudioOutput *ao)
{ {
OSXOutput *oo = (OSXOutput *)ao; OSXOutput *oo = (OSXOutput *)ao;
@ -290,7 +290,7 @@ osx_output_disable(struct audio_output *ao)
} }
static void static void
osx_output_cancel(struct audio_output *ao) osx_output_cancel(AudioOutput *ao)
{ {
OSXOutput *od = (OSXOutput *)ao; OSXOutput *od = (OSXOutput *)ao;
@ -299,7 +299,7 @@ osx_output_cancel(struct audio_output *ao)
} }
static void static void
osx_output_close(struct audio_output *ao) osx_output_close(AudioOutput *ao)
{ {
OSXOutput *od = (OSXOutput *)ao; OSXOutput *od = (OSXOutput *)ao;
@ -310,7 +310,7 @@ osx_output_close(struct audio_output *ao)
} }
static bool static bool
osx_output_open(struct audio_output *ao, AudioFormat &audio_format, osx_output_open(AudioOutput *ao, AudioFormat &audio_format,
Error &error) Error &error)
{ {
OSXOutput *od = (OSXOutput *)ao; OSXOutput *od = (OSXOutput *)ao;
@ -383,7 +383,7 @@ osx_output_open(struct audio_output *ao, AudioFormat &audio_format,
} }
static size_t static size_t
osx_output_play(struct audio_output *ao, const void *chunk, size_t size, osx_output_play(AudioOutput *ao, const void *chunk, size_t size,
gcc_unused Error &error) gcc_unused Error &error)
{ {
OSXOutput *od = (OSXOutput *)ao; OSXOutput *od = (OSXOutput *)ao;

View File

@ -37,7 +37,7 @@
#define NUM_BUFFERS 16 #define NUM_BUFFERS 16
struct OpenALOutput { struct OpenALOutput {
struct audio_output base; AudioOutput base;
const char *device_name; const char *device_name;
ALCdevice *device; ALCdevice *device;
@ -133,7 +133,7 @@ openal_setup_context(OpenALOutput *od, Error &error)
return true; return true;
} }
static struct audio_output * static AudioOutput *
openal_init(const config_param &param, Error &error) openal_init(const config_param &param, Error &error)
{ {
const char *device_name = param.GetBlockValue("device"); const char *device_name = param.GetBlockValue("device");
@ -153,7 +153,7 @@ openal_init(const config_param &param, Error &error)
} }
static void static void
openal_finish(struct audio_output *ao) openal_finish(AudioOutput *ao)
{ {
OpenALOutput *od = (OpenALOutput *)ao; OpenALOutput *od = (OpenALOutput *)ao;
@ -162,7 +162,7 @@ openal_finish(struct audio_output *ao)
} }
static bool static bool
openal_open(struct audio_output *ao, AudioFormat &audio_format, openal_open(AudioOutput *ao, AudioFormat &audio_format,
Error &error) Error &error)
{ {
OpenALOutput *od = (OpenALOutput *)ao; OpenALOutput *od = (OpenALOutput *)ao;
@ -196,7 +196,7 @@ openal_open(struct audio_output *ao, AudioFormat &audio_format,
} }
static void static void
openal_close(struct audio_output *ao) openal_close(AudioOutput *ao)
{ {
OpenALOutput *od = (OpenALOutput *)ao; OpenALOutput *od = (OpenALOutput *)ao;
@ -208,7 +208,7 @@ openal_close(struct audio_output *ao)
} }
static unsigned static unsigned
openal_delay(struct audio_output *ao) openal_delay(AudioOutput *ao)
{ {
OpenALOutput *od = (OpenALOutput *)ao; OpenALOutput *od = (OpenALOutput *)ao;
@ -221,7 +221,7 @@ openal_delay(struct audio_output *ao)
} }
static size_t static size_t
openal_play(struct audio_output *ao, const void *chunk, size_t size, openal_play(AudioOutput *ao, const void *chunk, size_t size,
gcc_unused Error &error) gcc_unused Error &error)
{ {
OpenALOutput *od = (OpenALOutput *)ao; OpenALOutput *od = (OpenALOutput *)ao;
@ -253,7 +253,7 @@ openal_play(struct audio_output *ao, const void *chunk, size_t size,
} }
static void static void
openal_cancel(struct audio_output *ao) openal_cancel(AudioOutput *ao)
{ {
OpenALOutput *od = (OpenALOutput *)ao; OpenALOutput *od = (OpenALOutput *)ao;

View File

@ -57,7 +57,7 @@
#endif #endif
struct OssOutput { struct OssOutput {
struct audio_output base; AudioOutput base;
#ifdef AFMT_S24_PACKED #ifdef AFMT_S24_PACKED
Manual<PcmExport> pcm_export; Manual<PcmExport> pcm_export;
@ -149,7 +149,7 @@ oss_output_test_default_device(void)
return false; return false;
} }
static struct audio_output * static AudioOutput *
oss_open_default(Error &error) oss_open_default(Error &error)
{ {
int err[ARRAY_SIZE(default_devices)]; int err[ARRAY_SIZE(default_devices)];
@ -199,7 +199,7 @@ oss_open_default(Error &error)
return NULL; return NULL;
} }
static struct audio_output * static AudioOutput *
oss_output_init(const config_param &param, Error &error) oss_output_init(const config_param &param, Error &error)
{ {
const char *device = param.GetBlockValue("device"); const char *device = param.GetBlockValue("device");
@ -218,7 +218,7 @@ oss_output_init(const config_param &param, Error &error)
} }
static void static void
oss_output_finish(struct audio_output *ao) oss_output_finish(AudioOutput *ao)
{ {
OssOutput *od = (OssOutput *)ao; OssOutput *od = (OssOutput *)ao;
@ -229,7 +229,7 @@ oss_output_finish(struct audio_output *ao)
#ifdef AFMT_S24_PACKED #ifdef AFMT_S24_PACKED
static bool static bool
oss_output_enable(struct audio_output *ao, gcc_unused Error &error) oss_output_enable(AudioOutput *ao, gcc_unused Error &error)
{ {
OssOutput *od = (OssOutput *)ao; OssOutput *od = (OssOutput *)ao;
@ -238,7 +238,7 @@ oss_output_enable(struct audio_output *ao, gcc_unused Error &error)
} }
static void static void
oss_output_disable(struct audio_output *ao) oss_output_disable(AudioOutput *ao)
{ {
OssOutput *od = (OssOutput *)ao; OssOutput *od = (OssOutput *)ao;
@ -680,7 +680,7 @@ oss_reopen(OssOutput *od, Error &error)
} }
static bool static bool
oss_output_open(struct audio_output *ao, AudioFormat &audio_format, oss_output_open(AudioOutput *ao, AudioFormat &audio_format,
Error &error) Error &error)
{ {
OssOutput *od = (OssOutput *)ao; OssOutput *od = (OssOutput *)ao;
@ -702,7 +702,7 @@ oss_output_open(struct audio_output *ao, AudioFormat &audio_format,
} }
static void static void
oss_output_close(struct audio_output *ao) oss_output_close(AudioOutput *ao)
{ {
OssOutput *od = (OssOutput *)ao; OssOutput *od = (OssOutput *)ao;
@ -710,7 +710,7 @@ oss_output_close(struct audio_output *ao)
} }
static void static void
oss_output_cancel(struct audio_output *ao) oss_output_cancel(AudioOutput *ao)
{ {
OssOutput *od = (OssOutput *)ao; OssOutput *od = (OssOutput *)ao;
@ -721,7 +721,7 @@ oss_output_cancel(struct audio_output *ao)
} }
static size_t static size_t
oss_output_play(struct audio_output *ao, const void *chunk, size_t size, oss_output_play(AudioOutput *ao, const void *chunk, size_t size,
Error &error) Error &error)
{ {
OssOutput *od = (OssOutput *)ao; OssOutput *od = (OssOutput *)ao;

View File

@ -29,7 +29,7 @@
#include <stdio.h> #include <stdio.h>
struct PipeOutput { struct PipeOutput {
struct audio_output base; AudioOutput base;
std::string cmd; std::string cmd;
FILE *fh; FILE *fh;
@ -61,7 +61,7 @@ PipeOutput::Configure(const config_param &param, Error &error)
return true; return true;
} }
static struct audio_output * static AudioOutput *
pipe_output_init(const config_param &param, Error &error) pipe_output_init(const config_param &param, Error &error)
{ {
PipeOutput *pd = new PipeOutput(); PipeOutput *pd = new PipeOutput();
@ -81,7 +81,7 @@ pipe_output_init(const config_param &param, Error &error)
} }
static void static void
pipe_output_finish(struct audio_output *ao) pipe_output_finish(AudioOutput *ao)
{ {
PipeOutput *pd = (PipeOutput *)ao; PipeOutput *pd = (PipeOutput *)ao;
@ -90,7 +90,7 @@ pipe_output_finish(struct audio_output *ao)
} }
static bool static bool
pipe_output_open(struct audio_output *ao, pipe_output_open(AudioOutput *ao,
gcc_unused AudioFormat &audio_format, gcc_unused AudioFormat &audio_format,
Error &error) Error &error)
{ {
@ -107,7 +107,7 @@ pipe_output_open(struct audio_output *ao,
} }
static void static void
pipe_output_close(struct audio_output *ao) pipe_output_close(AudioOutput *ao)
{ {
PipeOutput *pd = (PipeOutput *)ao; PipeOutput *pd = (PipeOutput *)ao;
@ -115,7 +115,7 @@ pipe_output_close(struct audio_output *ao)
} }
static size_t static size_t
pipe_output_play(struct audio_output *ao, const void *chunk, size_t size, pipe_output_play(AudioOutput *ao, const void *chunk, size_t size,
Error &error) Error &error)
{ {
PipeOutput *pd = (PipeOutput *)ao; PipeOutput *pd = (PipeOutput *)ao;

View File

@ -42,7 +42,7 @@
#define MPD_PULSE_NAME "Music Player Daemon" #define MPD_PULSE_NAME "Music Player Daemon"
struct PulseOutput { struct PulseOutput {
struct audio_output base; AudioOutput base;
const char *name; const char *name;
const char *server; const char *server;
@ -323,7 +323,7 @@ pulse_output_setup_context(PulseOutput *po, Error &error)
return true; return true;
} }
static struct audio_output * static AudioOutput *
pulse_output_init(const config_param &param, Error &error) pulse_output_init(const config_param &param, Error &error)
{ {
PulseOutput *po; PulseOutput *po;
@ -349,7 +349,7 @@ pulse_output_init(const config_param &param, Error &error)
} }
static void static void
pulse_output_finish(struct audio_output *ao) pulse_output_finish(AudioOutput *ao)
{ {
PulseOutput *po = (PulseOutput *)ao; PulseOutput *po = (PulseOutput *)ao;
@ -358,7 +358,7 @@ pulse_output_finish(struct audio_output *ao)
} }
static bool static bool
pulse_output_enable(struct audio_output *ao, Error &error) pulse_output_enable(AudioOutput *ao, Error &error)
{ {
PulseOutput *po = (PulseOutput *)ao; PulseOutput *po = (PulseOutput *)ao;
@ -404,7 +404,7 @@ pulse_output_enable(struct audio_output *ao, Error &error)
} }
static void static void
pulse_output_disable(struct audio_output *ao) pulse_output_disable(AudioOutput *ao)
{ {
PulseOutput *po = (PulseOutput *)ao; PulseOutput *po = (PulseOutput *)ao;
@ -548,7 +548,7 @@ pulse_output_setup_stream(PulseOutput *po, const pa_sample_spec *ss,
} }
static bool static bool
pulse_output_open(struct audio_output *ao, AudioFormat &audio_format, pulse_output_open(AudioOutput *ao, AudioFormat &audio_format,
Error &error) Error &error)
{ {
PulseOutput *po = (PulseOutput *)ao; PulseOutput *po = (PulseOutput *)ao;
@ -616,7 +616,7 @@ pulse_output_open(struct audio_output *ao, AudioFormat &audio_format,
} }
static void static void
pulse_output_close(struct audio_output *ao) pulse_output_close(AudioOutput *ao)
{ {
PulseOutput *po = (PulseOutput *)ao; PulseOutput *po = (PulseOutput *)ao;
pa_operation *o; pa_operation *o;
@ -702,7 +702,7 @@ pulse_output_stream_pause(PulseOutput *po, bool pause,
} }
static unsigned static unsigned
pulse_output_delay(struct audio_output *ao) pulse_output_delay(AudioOutput *ao)
{ {
PulseOutput *po = (PulseOutput *)ao; PulseOutput *po = (PulseOutput *)ao;
unsigned result = 0; unsigned result = 0;
@ -720,7 +720,7 @@ pulse_output_delay(struct audio_output *ao)
} }
static size_t static size_t
pulse_output_play(struct audio_output *ao, const void *chunk, size_t size, pulse_output_play(AudioOutput *ao, const void *chunk, size_t size,
Error &error) Error &error)
{ {
PulseOutput *po = (PulseOutput *)ao; PulseOutput *po = (PulseOutput *)ao;
@ -785,7 +785,7 @@ pulse_output_play(struct audio_output *ao, const void *chunk, size_t size,
} }
static void static void
pulse_output_cancel(struct audio_output *ao) pulse_output_cancel(AudioOutput *ao)
{ {
PulseOutput *po = (PulseOutput *)ao; PulseOutput *po = (PulseOutput *)ao;
pa_operation *o; pa_operation *o;
@ -818,7 +818,7 @@ pulse_output_cancel(struct audio_output *ao)
} }
static bool static bool
pulse_output_pause(struct audio_output *ao) pulse_output_pause(AudioOutput *ao)
{ {
PulseOutput *po = (PulseOutput *)ao; PulseOutput *po = (PulseOutput *)ao;

View File

@ -35,7 +35,7 @@
#include <errno.h> #include <errno.h>
struct RecorderOutput { struct RecorderOutput {
struct audio_output base; AudioOutput base;
/** /**
* The configured encoder plugin. * The configured encoder plugin.
@ -107,7 +107,7 @@ RecorderOutput::Configure(const config_param &param, Error &error)
return true; return true;
} }
static audio_output * static AudioOutput *
recorder_output_init(const config_param &param, Error &error) recorder_output_init(const config_param &param, Error &error)
{ {
RecorderOutput *recorder = new RecorderOutput(); RecorderOutput *recorder = new RecorderOutput();
@ -127,7 +127,7 @@ recorder_output_init(const config_param &param, Error &error)
} }
static void static void
recorder_output_finish(struct audio_output *ao) recorder_output_finish(AudioOutput *ao)
{ {
RecorderOutput *recorder = (RecorderOutput *)ao; RecorderOutput *recorder = (RecorderOutput *)ao;
@ -181,7 +181,7 @@ RecorderOutput::EncoderToFile(Error &error)
} }
static bool static bool
recorder_output_open(struct audio_output *ao, recorder_output_open(AudioOutput *ao,
AudioFormat &audio_format, AudioFormat &audio_format,
Error &error) Error &error)
{ {
@ -216,7 +216,7 @@ recorder_output_open(struct audio_output *ao,
} }
static void static void
recorder_output_close(struct audio_output *ao) recorder_output_close(AudioOutput *ao)
{ {
RecorderOutput *recorder = (RecorderOutput *)ao; RecorderOutput *recorder = (RecorderOutput *)ao;
@ -233,7 +233,7 @@ recorder_output_close(struct audio_output *ao)
} }
static size_t static size_t
recorder_output_play(struct audio_output *ao, const void *chunk, size_t size, recorder_output_play(AudioOutput *ao, const void *chunk, size_t size,
Error &error) Error &error)
{ {
RecorderOutput *recorder = (RecorderOutput *)ao; RecorderOutput *recorder = (RecorderOutput *)ao;

View File

@ -36,7 +36,7 @@
#undef new #undef new
class RoarOutput { class RoarOutput {
struct audio_output base; AudioOutput base;
std::string host, name; std::string host, name;
@ -52,7 +52,7 @@ public:
RoarOutput() RoarOutput()
:err(ROAR_ERROR_NONE) {} :err(ROAR_ERROR_NONE) {}
operator audio_output *() { operator AudioOutput *() {
return &base; return &base;
} }
@ -136,7 +136,7 @@ RoarOutput::Configure(const config_param &param)
: ROAR_ROLE_MUSIC; : ROAR_ROLE_MUSIC;
} }
static struct audio_output * static AudioOutput *
roar_init(const config_param &param, Error &error) roar_init(const config_param &param, Error &error)
{ {
RoarOutput *self = new RoarOutput(); RoarOutput *self = new RoarOutput();
@ -151,7 +151,7 @@ roar_init(const config_param &param, Error &error)
} }
static void static void
roar_finish(struct audio_output *ao) roar_finish(AudioOutput *ao)
{ {
RoarOutput *self = (RoarOutput *)ao; RoarOutput *self = (RoarOutput *)ao;
@ -227,7 +227,7 @@ RoarOutput::Open(AudioFormat &audio_format, Error &error)
} }
static bool static bool
roar_open(struct audio_output *ao, AudioFormat &audio_format, Error &error) roar_open(AudioOutput *ao, AudioFormat &audio_format, Error &error)
{ {
RoarOutput *self = (RoarOutput *)ao; RoarOutput *self = (RoarOutput *)ao;
@ -248,7 +248,7 @@ RoarOutput::Close()
} }
static void static void
roar_close(struct audio_output *ao) roar_close(AudioOutput *ao)
{ {
RoarOutput *self = (RoarOutput *)ao; RoarOutput *self = (RoarOutput *)ao;
self->Close(); self->Close();
@ -283,7 +283,7 @@ RoarOutput::Cancel()
} }
static void static void
roar_cancel(struct audio_output *ao) roar_cancel(AudioOutput *ao)
{ {
RoarOutput *self = (RoarOutput *)ao; RoarOutput *self = (RoarOutput *)ao;
@ -308,7 +308,7 @@ RoarOutput::Play(const void *chunk, size_t size, Error &error)
} }
static size_t static size_t
roar_play(struct audio_output *ao, const void *chunk, size_t size, roar_play(AudioOutput *ao, const void *chunk, size_t size,
Error &error) Error &error)
{ {
RoarOutput *self = (RoarOutput *)ao; RoarOutput *self = (RoarOutput *)ao;
@ -403,7 +403,7 @@ RoarOutput::SendTag(const Tag &tag)
} }
static void static void
roar_send_tag(struct audio_output *ao, const Tag *meta) roar_send_tag(AudioOutput *ao, const Tag *meta)
{ {
RoarOutput *self = (RoarOutput *)ao; RoarOutput *self = (RoarOutput *)ao;
self->SendTag(*meta); self->SendTag(*meta);

View File

@ -39,7 +39,7 @@
static constexpr unsigned DEFAULT_CONN_TIMEOUT = 2; static constexpr unsigned DEFAULT_CONN_TIMEOUT = 2;
struct ShoutOutput final { struct ShoutOutput final {
struct audio_output base; AudioOutput base;
shout_t *shout_conn; shout_t *shout_conn;
shout_metadata_t *shout_meta; shout_metadata_t *shout_meta;
@ -275,7 +275,7 @@ ShoutOutput::Configure(const config_param &param, Error &error)
return true; return true;
} }
static struct audio_output * static AudioOutput *
my_shout_init_driver(const config_param &param, Error &error) my_shout_init_driver(const config_param &param, Error &error)
{ {
ShoutOutput *sd = new ShoutOutput(); ShoutOutput *sd = new ShoutOutput();
@ -363,7 +363,7 @@ static void close_shout_conn(ShoutOutput * sd)
} }
static void static void
my_shout_finish_driver(struct audio_output *ao) my_shout_finish_driver(AudioOutput *ao)
{ {
ShoutOutput *sd = (ShoutOutput *)ao; ShoutOutput *sd = (ShoutOutput *)ao;
@ -379,7 +379,7 @@ my_shout_finish_driver(struct audio_output *ao)
} }
static void static void
my_shout_drop_buffered_audio(struct audio_output *ao) my_shout_drop_buffered_audio(AudioOutput *ao)
{ {
gcc_unused gcc_unused
ShoutOutput *sd = (ShoutOutput *)ao; ShoutOutput *sd = (ShoutOutput *)ao;
@ -388,7 +388,7 @@ my_shout_drop_buffered_audio(struct audio_output *ao)
} }
static void static void
my_shout_close_device(struct audio_output *ao) my_shout_close_device(AudioOutput *ao)
{ {
ShoutOutput *sd = (ShoutOutput *)ao; ShoutOutput *sd = (ShoutOutput *)ao;
@ -414,7 +414,7 @@ shout_connect(ShoutOutput *sd, Error &error)
} }
static bool static bool
my_shout_open_device(struct audio_output *ao, AudioFormat &audio_format, my_shout_open_device(AudioOutput *ao, AudioFormat &audio_format,
Error &error) Error &error)
{ {
ShoutOutput *sd = (ShoutOutput *)ao; ShoutOutput *sd = (ShoutOutput *)ao;
@ -437,7 +437,7 @@ my_shout_open_device(struct audio_output *ao, AudioFormat &audio_format,
} }
static unsigned static unsigned
my_shout_delay(struct audio_output *ao) my_shout_delay(AudioOutput *ao)
{ {
ShoutOutput *sd = (ShoutOutput *)ao; ShoutOutput *sd = (ShoutOutput *)ao;
@ -449,7 +449,7 @@ my_shout_delay(struct audio_output *ao)
} }
static size_t static size_t
my_shout_play(struct audio_output *ao, const void *chunk, size_t size, my_shout_play(AudioOutput *ao, const void *chunk, size_t size,
Error &error) Error &error)
{ {
ShoutOutput *sd = (ShoutOutput *)ao; ShoutOutput *sd = (ShoutOutput *)ao;
@ -461,7 +461,7 @@ my_shout_play(struct audio_output *ao, const void *chunk, size_t size,
} }
static bool static bool
my_shout_pause(struct audio_output *ao) my_shout_pause(AudioOutput *ao)
{ {
static char silence[1020]; static char silence[1020];
@ -494,7 +494,7 @@ shout_tag_to_metadata(const Tag *tag, char *dest, size_t size)
snprintf(dest, size, "%s - %s", artist, title); snprintf(dest, size, "%s - %s", artist, title);
} }
static void my_shout_set_tag(struct audio_output *ao, static void my_shout_set_tag(AudioOutput *ao,
const Tag *tag) const Tag *tag)
{ {
ShoutOutput *sd = (ShoutOutput *)ao; ShoutOutput *sd = (ShoutOutput *)ao;

View File

@ -50,7 +50,7 @@ struct audio_info {
#endif #endif
struct SolarisOutput { struct SolarisOutput {
struct audio_output base; AudioOutput base;
/* configuration */ /* configuration */
const char *device; const char *device;
@ -76,7 +76,7 @@ solaris_output_test_default_device(void)
access("/dev/audio", W_OK) == 0; access("/dev/audio", W_OK) == 0;
} }
static struct audio_output * static AudioOutput *
solaris_output_init(const config_param &param, Error &error_r) solaris_output_init(const config_param &param, Error &error_r)
{ {
SolarisOutput *so = new SolarisOutput(); SolarisOutput *so = new SolarisOutput();
@ -91,7 +91,7 @@ solaris_output_init(const config_param &param, Error &error_r)
} }
static void static void
solaris_output_finish(struct audio_output *ao) solaris_output_finish(AudioOutput *ao)
{ {
SolarisOutput *so = (SolarisOutput *)ao; SolarisOutput *so = (SolarisOutput *)ao;
@ -100,7 +100,7 @@ solaris_output_finish(struct audio_output *ao)
} }
static bool static bool
solaris_output_open(struct audio_output *ao, AudioFormat &audio_format, solaris_output_open(AudioOutput *ao, AudioFormat &audio_format,
Error &error) Error &error)
{ {
SolarisOutput *so = (SolarisOutput *)ao; SolarisOutput *so = (SolarisOutput *)ao;
@ -151,7 +151,7 @@ solaris_output_open(struct audio_output *ao, AudioFormat &audio_format,
} }
static void static void
solaris_output_close(struct audio_output *ao) solaris_output_close(AudioOutput *ao)
{ {
SolarisOutput *so = (SolarisOutput *)ao; SolarisOutput *so = (SolarisOutput *)ao;
@ -159,7 +159,7 @@ solaris_output_close(struct audio_output *ao)
} }
static size_t static size_t
solaris_output_play(struct audio_output *ao, const void *chunk, size_t size, solaris_output_play(AudioOutput *ao, const void *chunk, size_t size,
Error &error) Error &error)
{ {
SolarisOutput *so = (SolarisOutput *)ao; SolarisOutput *so = (SolarisOutput *)ao;
@ -175,7 +175,7 @@ solaris_output_play(struct audio_output *ao, const void *chunk, size_t size,
} }
static void static void
solaris_output_cancel(struct audio_output *ao) solaris_output_cancel(AudioOutput *ao)
{ {
SolarisOutput *so = (SolarisOutput *)ao; SolarisOutput *so = (SolarisOutput *)ao;

View File

@ -38,7 +38,7 @@ struct WinmmBuffer {
}; };
struct WinmmOutput { struct WinmmOutput {
struct audio_output base; AudioOutput base;
UINT device_id; UINT device_id;
HWAVEOUT handle; HWAVEOUT handle;
@ -108,7 +108,7 @@ fail:
return false; return false;
} }
static struct audio_output * static AudioOutput *
winmm_output_init(const config_param &param, Error &error) winmm_output_init(const config_param &param, Error &error)
{ {
WinmmOutput *wo = new WinmmOutput(); WinmmOutput *wo = new WinmmOutput();
@ -128,7 +128,7 @@ winmm_output_init(const config_param &param, Error &error)
} }
static void static void
winmm_output_finish(struct audio_output *ao) winmm_output_finish(AudioOutput *ao)
{ {
WinmmOutput *wo = (WinmmOutput *)ao; WinmmOutput *wo = (WinmmOutput *)ao;
@ -137,7 +137,7 @@ winmm_output_finish(struct audio_output *ao)
} }
static bool static bool
winmm_output_open(struct audio_output *ao, AudioFormat &audio_format, winmm_output_open(AudioOutput *ao, AudioFormat &audio_format,
Error &error) Error &error)
{ {
WinmmOutput *wo = (WinmmOutput *)ao; WinmmOutput *wo = (WinmmOutput *)ao;
@ -194,7 +194,7 @@ winmm_output_open(struct audio_output *ao, AudioFormat &audio_format,
} }
static void static void
winmm_output_close(struct audio_output *ao) winmm_output_close(AudioOutput *ao)
{ {
WinmmOutput *wo = (WinmmOutput *)ao; WinmmOutput *wo = (WinmmOutput *)ao;
@ -263,7 +263,7 @@ winmm_drain_buffer(WinmmOutput *wo, WinmmBuffer *buffer,
} }
static size_t static size_t
winmm_output_play(struct audio_output *ao, const void *chunk, size_t size, Error &error) winmm_output_play(AudioOutput *ao, const void *chunk, size_t size, Error &error)
{ {
WinmmOutput *wo = (WinmmOutput *)ao; WinmmOutput *wo = (WinmmOutput *)ao;
@ -318,7 +318,7 @@ winmm_stop(WinmmOutput *wo)
} }
static void static void
winmm_output_drain(struct audio_output *ao) winmm_output_drain(AudioOutput *ao)
{ {
WinmmOutput *wo = (WinmmOutput *)ao; WinmmOutput *wo = (WinmmOutput *)ao;
@ -327,7 +327,7 @@ winmm_output_drain(struct audio_output *ao)
} }
static void static void
winmm_output_cancel(struct audio_output *ao) winmm_output_cancel(AudioOutput *ao)
{ {
WinmmOutput *wo = (WinmmOutput *)ao; WinmmOutput *wo = (WinmmOutput *)ao;

View File

@ -80,7 +80,7 @@ PlayerControl::PlayerControl(gcc_unused MultipleOutputs &_outputs,
:outputs(_outputs) {} :outputs(_outputs) {}
PlayerControl::~PlayerControl() {} PlayerControl::~PlayerControl() {}
static struct audio_output * static AudioOutput *
load_audio_output(const char *name) load_audio_output(const char *name)
{ {
const struct config_param *param; const struct config_param *param;
@ -95,7 +95,7 @@ load_audio_output(const char *name)
32, 4); 32, 4);
Error error; Error error;
struct audio_output *ao = AudioOutput *ao =
audio_output_new(*param, dummy_player_control, error); audio_output_new(*param, dummy_player_control, error);
if (ao == nullptr) if (ao == nullptr)
LogError(error); LogError(error);
@ -104,7 +104,7 @@ load_audio_output(const char *name)
} }
static bool static bool
run_output(struct audio_output *ao, AudioFormat audio_format) run_output(AudioOutput *ao, AudioFormat audio_format)
{ {
/* open the audio output */ /* open the audio output */
@ -197,7 +197,7 @@ int main(int argc, char **argv)
/* initialize the audio output */ /* initialize the audio output */
struct audio_output *ao = load_audio_output(argv[2]); AudioOutput *ao = load_audio_output(argv[2]);
if (ao == NULL) if (ao == NULL)
return 1; return 1;