output_control: no CamelCase

Renamed variables.
This commit is contained in:
Max Kellermann 2009-02-16 00:43:06 +01:00
parent ed591f19ef
commit 3a82283b19
2 changed files with 55 additions and 56 deletions

View File

@ -50,39 +50,39 @@ static void ao_command_async(struct audio_output *ao,
} }
bool bool
audio_output_open(struct audio_output *audioOutput, audio_output_open(struct audio_output *ao,
const struct audio_format *audioFormat) const struct audio_format *audio_format)
{ {
audioOutput->reopen_after = 0; ao->reopen_after = 0;
if (audioOutput->open && if (ao->open &&
audio_format_equals(audioFormat, &audioOutput->in_audio_format)) { audio_format_equals(audio_format, &ao->in_audio_format)) {
return true; return true;
} }
audioOutput->in_audio_format = *audioFormat; ao->in_audio_format = *audio_format;
if (audio_format_defined(&audioOutput->config_audio_format)) { if (audio_format_defined(&ao->config_audio_format)) {
/* copy config_audio_format to out_audio_format only if the /* copy config_audio_format to out_audio_format only if the
device is not yet open; if it is already open, device is not yet open; if it is already open,
plugin->open() may have modified out_audio_format, plugin->open() may have modified out_audio_format,
and the value is already ok */ and the value is already ok */
if (!audioOutput->open) if (!ao->open)
audioOutput->out_audio_format = ao->out_audio_format =
audioOutput->config_audio_format; ao->config_audio_format;
} else { } else {
audioOutput->out_audio_format = audioOutput->in_audio_format; ao->out_audio_format = ao->in_audio_format;
if (audioOutput->open) if (ao->open)
audio_output_close(audioOutput); audio_output_close(ao);
} }
if (audioOutput->thread == NULL) if (ao->thread == NULL)
audio_output_thread_start(audioOutput); audio_output_thread_start(ao);
if (!audioOutput->open) if (!ao->open)
ao_command(audioOutput, AO_COMMAND_OPEN); ao_command(ao, AO_COMMAND_OPEN);
return audioOutput->open; return ao->open;
} }
void void
@ -102,56 +102,56 @@ audio_output_signal(struct audio_output *ao)
notify_signal(&ao->notify); notify_signal(&ao->notify);
} }
void audio_output_play(struct audio_output *audioOutput, void
const char *playChunk, size_t size) audio_output_play(struct audio_output *ao, const char *chunk, size_t size)
{ {
assert(size > 0); assert(size > 0);
if (!audioOutput->open) if (!ao->open)
return; return;
audioOutput->args.play.data = playChunk; ao->args.play.data = chunk;
audioOutput->args.play.size = size; ao->args.play.size = size;
ao_command_async(audioOutput, AO_COMMAND_PLAY); ao_command_async(ao, AO_COMMAND_PLAY);
} }
void audio_output_pause(struct audio_output *audioOutput) void audio_output_pause(struct audio_output *ao)
{ {
ao_command_async(audioOutput, AO_COMMAND_PAUSE); ao_command_async(ao, AO_COMMAND_PAUSE);
} }
void audio_output_cancel(struct audio_output *audioOutput) void audio_output_cancel(struct audio_output *ao)
{ {
ao_command_async(audioOutput, AO_COMMAND_CANCEL); ao_command_async(ao, AO_COMMAND_CANCEL);
} }
void audio_output_close(struct audio_output *audioOutput) void audio_output_close(struct audio_output *ao)
{ {
if (audioOutput->open) if (ao->open)
ao_command(audioOutput, AO_COMMAND_CLOSE); ao_command(ao, AO_COMMAND_CLOSE);
} }
void audio_output_finish(struct audio_output *audioOutput) void audio_output_finish(struct audio_output *ao)
{ {
audio_output_close(audioOutput); audio_output_close(ao);
if (audioOutput->thread != NULL) { if (ao->thread != NULL) {
ao_command(audioOutput, AO_COMMAND_KILL); ao_command(ao, AO_COMMAND_KILL);
g_thread_join(audioOutput->thread); g_thread_join(ao->thread);
} }
if (audioOutput->plugin->finish) if (ao->plugin->finish)
audioOutput->plugin->finish(audioOutput->data); ao->plugin->finish(ao->data);
notify_deinit(&audioOutput->notify); notify_deinit(&ao->notify);
} }
void audio_output_send_tag(struct audio_output *audioOutput, void
const struct tag *tag) audio_output_send_tag(struct audio_output *ao, const struct tag *tag)
{ {
if (audioOutput->plugin->send_tag == NULL) if (ao->plugin->send_tag == NULL)
return; return;
audioOutput->args.tag = tag; ao->args.tag = tag;
ao_command_async(audioOutput, AO_COMMAND_SEND_TAG); ao_command_async(ao, AO_COMMAND_SEND_TAG);
} }

View File

@ -23,17 +23,16 @@
#include <stdbool.h> #include <stdbool.h>
struct audio_output; struct audio_output;
struct audio_output_plugin;
struct audio_format; struct audio_format;
struct tag; struct tag;
struct config_param; struct config_param;
int int
audio_output_init(struct audio_output *, const struct config_param *param); audio_output_init(struct audio_output *ao, const struct config_param *param);
bool bool
audio_output_open(struct audio_output *audioOutput, audio_output_open(struct audio_output *ao,
const struct audio_format *audioFormat); const struct audio_format *audio_format);
/** /**
* Opens or closes the device, depending on the "enabled" flag. * Opens or closes the device, depending on the "enabled" flag.
@ -50,15 +49,15 @@ audio_output_update(struct audio_output *ao,
void void
audio_output_signal(struct audio_output *ao); audio_output_signal(struct audio_output *ao);
void audio_output_play(struct audio_output *audioOutput, void
const char *playChunk, size_t size); audio_output_play(struct audio_output *ao, const char *chunk, size_t size);
void audio_output_pause(struct audio_output *audioOutput); void audio_output_pause(struct audio_output *ao);
void audio_output_cancel(struct audio_output *audioOutput); void audio_output_cancel(struct audio_output *ao);
void audio_output_close(struct audio_output *audioOutput); void audio_output_close(struct audio_output *ao);
void audio_output_finish(struct audio_output *audioOutput); void audio_output_finish(struct audio_output *ao);
void audio_output_send_tag(struct audio_output *audioOutput, void
const struct tag *tag); audio_output_send_tag(struct audio_output *ao, const struct tag *tag);
#endif #endif