From a5937a0eca5ada5cb2332dbce676b327aa9e37ee Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 20 Aug 2006 18:52:34 +0200 Subject: [PATCH] rename xxx_writer.c to xxx_write.c Just to be consistent.. --- README | 6 +++--- alsa_writer.c => alsa_write.c | 15 ++++++++------- configure.ac | 12 ++++++------ error.h | 12 ++++++------ file_writer.c => file_write.c | 36 +++++++++++++++++------------------ osx_writer.c => osx_write.c | 30 ++++++++++++++--------------- 6 files changed, 56 insertions(+), 55 deletions(-) rename alsa_writer.c => alsa_write.c (94%) rename file_writer.c => file_write.c (74%) rename osx_writer.c => osx_write.c (91%) diff --git a/README b/README index a1e8adc1..02d647a9 100644 --- a/README +++ b/README @@ -69,9 +69,9 @@ read(2)/write(2)/select(2) etc. functions. para_write (obligatory) ---------------------- -A modular audio stream writer. It supports a simple file writer output -plugin and an optional wav/raw player for alsa. Debian package: -libasound2-dev +A modular audio stream writer. It supports a simple file writer output plugin +and optional wav/raw players for alsa (linux-only, Debian package: +libasound2-dev) and Mac OS. --------------------------------------- para_audiod (optional, but recommended) diff --git a/alsa_writer.c b/alsa_write.c similarity index 94% rename from alsa_writer.c rename to alsa_write.c index 7d7d36bf..c104a5d5 100644 --- a/alsa_writer.c +++ b/alsa_write.c @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ -/** \file alsa_writer.c paraslash's alsa output plugin */ +/** \file alsa_write.c paraslash's alsa output plugin */ /* * Based in parts on aplay.c from the alsa-utils-1.0.8 package, @@ -40,7 +40,7 @@ #define FORMAT SND_PCM_FORMAT_S16_LE /** data specific to the alsa writer */ -struct private_alsa_data { +struct private_alsa_write_data { /** the alsa handle */ snd_pcm_t *handle; /** determined and set by alsa_open() */ @@ -67,7 +67,8 @@ static int alsa_open(struct writer_node *w) int err; snd_pcm_info_t *info; snd_pcm_uframes_t period_size; - struct private_alsa_data *pad = para_calloc(sizeof(struct private_alsa_data)); + struct private_alsa_write_data *pad = para_calloc(sizeof(struct + private_alsa_write_data)); struct alsa_write_args_info *conf = w->conf; struct writer_node_group *wng = w->wng; @@ -149,7 +150,7 @@ static int alsa_open(struct writer_node *w) static int alsa_write_pre_select(struct sched *s, struct writer_node *wn) { - struct private_alsa_data *pad = wn->private_data; + struct private_alsa_write_data *pad = wn->private_data; struct writer_node_group *wng = wn->wng; struct timeval diff; @@ -169,7 +170,7 @@ static int alsa_write_pre_select(struct sched *s, struct writer_node *wn) static int alsa_write_post_select(__a_unused struct sched *s, struct writer_node *wn) { - struct private_alsa_data *pad = wn->private_data; + struct private_alsa__write_data *pad = wn->private_data; struct writer_node_group *wng = wn->wng; size_t frames = (*wng->loaded - wn->written) / pad->bytes_per_frame; snd_pcm_sframes_t ret; @@ -203,7 +204,7 @@ static int alsa_write_post_select(__a_unused struct sched *s, static void alsa_close(struct writer_node *wn) { - struct private_alsa_data *pad = wn->private_data; + struct private_alsa_write_data *pad = wn->private_data; PARA_INFO_LOG("closing writer node %p\n", wn); snd_pcm_drain(pad->handle); snd_pcm_close(pad->handle); @@ -227,7 +228,7 @@ err_out: } /** the init function of the alsa writer */ -void alsa_writer_init(struct writer *w) +void alsa_write_init(struct writer *w) { w->open = alsa_open; w->close = alsa_close; diff --git a/configure.ac b/configure.ac index 721c5c0c..a83d39eb 100644 --- a/configure.ac +++ b/configure.ac @@ -71,7 +71,7 @@ audiod_cmdline_objs="audiod.cmdline grab_client.cmdline compress_filter.cmdline http_recv.cmdline dccp_recv.cmdline file_write.cmdline client.cmdline" audiod_errlist_objs="audiod signal string daemon stat net time grab_client filter_chain wav compress http_recv dccp dccp_recv - recv_common fd sched write_common file_writer audiod_command crypt + recv_common fd sched write_common file_write audiod_command crypt client_common" audiod_ldflags="" @@ -82,7 +82,7 @@ server_errlist_objs="server mp3_afh afs command net string signal random_selecto server_ldflags="" write_cmdline_objs="write.cmdline file_write.cmdline" -write_errlist_objs="write write_common file_writer time fd string sched stdin" +write_errlist_objs="write write_common file_write time fd string sched stdin" write_ldflags="" write_writers="file" @@ -169,11 +169,11 @@ if test ${have_core_audio} = yes; then f3="-framework AudioUnit" f4="-framework CoreServices" f="$f1 $f2 $f3 $f4" - audiod_errlist_objs="$audiod_errlist_objs osx_writer" + audiod_errlist_objs="$audiod_errlist_objs osx_write" audiod_cmdline_objs="$audiod_cmdline_objs osx_write.cmdline" audiod_ldflags="$audiod_ldflags $f" - write_errlist_objs="$write_errlist_objs osx_writer" + write_errlist_objs="$write_errlist_objs osx_write" write_cmdline_objs="$write_cmdline_objs osx_write.cmdline" write_ldflags="$write_ldflags $f" write_writers="$write_writers osx" @@ -448,9 +448,9 @@ AC_DEFINE_UNQUOTED(WRITER_ENUM, $enum NUM_SUPPORTED_WRITERS, enum of supported writers) names="$(for i in $write_writers; do printf \"$i\",' ' ; done)" AC_DEFINE_UNQUOTED(WRITER_NAMES, $names, supported writer names) -inits="$(for i in $write_writers; do printf 'extern void '$i'_writer_init(struct writer *); '; done)" +inits="$(for i in $write_writers; do printf 'extern void '$i'_write_init(struct writer *); '; done)" AC_DEFINE_UNQUOTED(DECLARE_WRITER_INITS, $inits, init functions of the supported writers) -array="$(for i in $write_writers; do printf '{.init = '$i'_writer_init},'; done)" +array="$(for i in $write_writers; do printf '{.init = '$i'_write_init},'; done)" AC_DEFINE_UNQUOTED(WRITER_ARRAY, $array, array of supported writers) gui_cmdline_objs="gui.cmdline" diff --git a/error.h b/error.h index cbfb4083..e1af56a2 100644 --- a/error.h +++ b/error.h @@ -72,8 +72,8 @@ enum para_subsystem { SS_WRITE, SS_WRITE_COMMON, SS_ALSA_WRITER, - SS_FILE_WRITER, - SS_OSX_WRITER, + SS_FILE_WRITE, + SS_OSX_WRITE, NUM_SS }; @@ -94,7 +94,7 @@ enum para_subsystem { extern const char **para_errlist[]; /** \endcond */ -#define OSX_WRITER_ERRORS \ +#define OSX_WRITE_ERRORS \ PARA_ERROR(STREAM_FORMAT, "could not set stream format"), \ PARA_ERROR(ADD_CALLBACK, "can not add callback"), \ PARA_ERROR(READ_STDIN, "failed to read from stdin"), \ @@ -428,7 +428,7 @@ extern const char **para_errlist[]; PARA_ERROR(STOP_THRESHOLD, "snd_pcm_sw_params_set_stop_threshold() failed"), \ -#define FILE_WRITER_ERRORS \ +#define FILE_WRITE_ERRORS \ PARA_ERROR(FW_WRITE, "file writer write error"), \ PARA_ERROR(FW_OPEN, "file writer: can not open output file"), \ PARA_ERROR(FW_NO_FILE, "task started without open file"), \ @@ -565,8 +565,8 @@ SS_ENUM(FD); SS_ENUM(WRITE); SS_ENUM(WRITE_COMMON); SS_ENUM(ALSA_WRITER); -SS_ENUM(FILE_WRITER); -SS_ENUM(OSX_WRITER); +SS_ENUM(FILE_WRITE); +SS_ENUM(OSX_WRITE); SS_ENUM(RINGBUFFER); SS_ENUM(CLIENT); SS_ENUM(CLIENT_COMMON); diff --git a/file_writer.c b/file_write.c similarity index 74% rename from file_writer.c rename to file_write.c index e90647d2..2163b7a9 100644 --- a/file_writer.c +++ b/file_write.c @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ -/** \file file_writer.c simple output plugin for testing purposes */ +/** \file file_write.c simple output plugin for testing purposes */ #include "para.h" #include "list.h" @@ -28,17 +28,17 @@ #include "error.h" /** data specific to the file writer */ -struct private_file_writer_data { +struct private_file_write_data { /** the file descriptor of the output file */ int fd; /** non-zero if \a fd was added to the write fd set */ int check_fd; }; -static int file_writer_open(struct writer_node *wn) +static int file_write_open(struct writer_node *wn) { - struct private_file_writer_data *pfwd = para_calloc( - sizeof(struct private_file_writer_data)); + struct private_file_write_data *pfwd = para_calloc( + sizeof(struct private_file_write_data)); struct file_write_args_info *conf = wn->conf; char *filename; if (conf->filename_given) @@ -59,9 +59,9 @@ static int file_writer_open(struct writer_node *wn) return -E_FW_OPEN; } -static int file_writer_pre_select(struct sched *s, struct writer_node *wn) +static int file_write_pre_select(struct sched *s, struct writer_node *wn) { - struct private_file_writer_data *pfwd = wn->private_data; + struct private_file_write_data *pfwd = wn->private_data; struct writer_node_group *wng = wn->wng; pfwd->check_fd = 0; @@ -74,9 +74,9 @@ static int file_writer_pre_select(struct sched *s, struct writer_node *wn) return 1; } -static int file_writer_post_select(struct sched *s, struct writer_node *wn) +static int file_write_post_select(struct sched *s, struct writer_node *wn) { - struct private_file_writer_data *pfwd = wn->private_data; + struct private_file_write_data *pfwd = wn->private_data; struct writer_node_group *wng = wn->wng; int ret; @@ -95,14 +95,14 @@ static int file_writer_post_select(struct sched *s, struct writer_node *wn) return 1; } -static void file_writer_close(struct writer_node *wn) +static void file_write_close(struct writer_node *wn) { - struct private_file_writer_data *pfwd = wn->private_data; + struct private_file_write_data *pfwd = wn->private_data; close(pfwd->fd); free(pfwd); } -__malloc void *file_writer_parse_config(char *options) +__malloc void *file_write_parse_config(char *options) { PARA_INFO_LOG("options: %s\n", options); struct file_write_args_info *conf @@ -116,12 +116,12 @@ __malloc void *file_writer_parse_config(char *options) } /** the init function of the file writer */ -void file_writer_init(struct writer *w) +void file_write_init(struct writer *w) { - w->open = file_writer_open; - w->pre_select = file_writer_pre_select; - w->post_select = file_writer_post_select; - w->parse_config = file_writer_parse_config; - w->close = file_writer_close; + w->open = file_write_open; + w->pre_select = file_write_pre_select; + w->post_select = file_write_post_select; + w->parse_config = file_write_parse_config; + w->close = file_write_close; w->shutdown = NULL; /* nothing to do */ } diff --git a/osx_writer.c b/osx_write.c similarity index 91% rename from osx_writer.c rename to osx_write.c index fab60859..7e825f71 100644 --- a/osx_writer.c +++ b/osx_write.c @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ -/** \file osx_writer.c paraslash's output plugin for MacOs */ +/** \file osx_write.c paraslash's output plugin for MacOs */ /* * based on mosx-mpg123, by Guillaume Outters and Steven A. Kortze @@ -46,7 +46,7 @@ struct osx_buffer { }; typedef struct osx_buffer osx_buffer; -struct private_osx_writer_data { +struct private_osx_write_data { long size; short *ptr; AudioUnit output; @@ -67,7 +67,7 @@ struct private_osx_writer_data { */ #define NUMBER_BUFFERS 2 -static void destroy_buffers(struct private_osx_writer_data *powd) +static void destroy_buffers(struct private_osx_write_data *powd) { osx_buffer *ptr; osx_buffer *ptr2; @@ -81,7 +81,7 @@ static void destroy_buffers(struct private_osx_writer_data *powd) } } -static void init_buffers(struct private_osx_writer_data *powd) +static void init_buffers(struct private_osx_write_data *powd) { int i; @@ -138,7 +138,7 @@ static OSStatus osx_callback(void * inClientData, long m, n; float *dest; int i; - struct private_osx_writer_data *powd = inClientData; + struct private_osx_write_data *powd = inClientData; // PARA_INFO_LOG("%p\n", powd); for (i = 0; i < outOutputData->mNumberBuffers; ++i) { @@ -172,10 +172,10 @@ static OSStatus osx_callback(void * inClientData, return 0; } -static int osx_writer_open(struct writer_node *wn) +static int osx_write_open(struct writer_node *wn) { - struct private_osx_writer_data *powd = para_calloc( - sizeof(struct private_osx_writer_data)); + struct private_osx_write_data *powd = para_calloc( + sizeof(struct private_osx_write_data)); ComponentDescription desc; Component comp; AURenderCallbackStruct inputCallback = {osx_callback, powd}; @@ -269,9 +269,9 @@ err_out: } -static void osx_writer_close(struct writer_node *wn) +static void osx_write_close(struct writer_node *wn) { - struct private_osx_writer_data *powd = wn->private_data; + struct private_osx_write_data *powd = wn->private_data; PARA_INFO_LOG("closing writer node %p\n", wn); AudioOutputUnitStop(powd->output); @@ -284,7 +284,7 @@ static void osx_writer_close(struct writer_node *wn) static int need_new_buffer(struct writer_node *wn) { struct writer_node_group *wng = wn->wng; - struct private_osx_writer_data *powd = wn->private_data; + struct private_osx_write_data *powd = wn->private_data; if (*wng->loaded < sizeof(short)) return 0; @@ -296,7 +296,7 @@ static int need_new_buffer(struct writer_node *wn) static int osx_write_post_select(__a_unused struct sched *s, struct writer_node *wn) { - struct private_osx_writer_data *powd = wn->private_data; + struct private_osx_write_data *powd = wn->private_data; struct writer_node_group *wng = wn->wng; short *data = (short*)wng->buf; @@ -320,10 +320,10 @@ static int osx_write_pre_select(struct sched *s, __a_unused struct writer_node * return 1; } -void osx_writer_init(struct writer *w) +void osx_write_init(struct writer *w) { - w->open = osx_writer_open; - w->close = osx_writer_close; + w->open = osx_write_open; + w->close = osx_write_close; w->pre_select = osx_write_pre_select; w->post_select = osx_write_post_select; w->parse_config = osx_write_parse_config; -- 2.39.5