From d0ca43932625771467cf462981ea244a47da251b Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Fri, 14 Mar 2008 00:11:12 +0100 Subject: [PATCH] Implement para_afh: The stand-alone audio file handler. --- Makefile.in | 6 +++++- NEWS | 3 +++ configure.ac | 18 ++++++++++++++++-- error.h | 12 +++++++++--- 4 files changed, 33 insertions(+), 6 deletions(-) diff --git a/Makefile.in b/Makefile.in index 7ee2132b..3d3e5f71 100644 --- a/Makefile.in +++ b/Makefile.in @@ -53,7 +53,7 @@ CPPFLAGS += @ncurses_cppflags@ CPPFLAGS += @arch_cppflags@ BINARIES = para_server para_client para_audioc para_recv \ - para_filter para_write para_fsck @extra_binaries@ + para_filter para_write para_fsck para_afh @extra_binaries@ man_binaries := $(BINARIES) man_pages := $(patsubst %, man/man1/%.1, $(man_binaries)) man_pages_in := $(patsubst %, web/%.man.in.html, $(man_binaries)) @@ -116,6 +116,7 @@ grab_client.cmdline.h grab_client.cmdline.c: grab_client.ggo case $< in client.ggo) O="--unamed-opts=command";; \ audioc.ggo) O="--unamed-opts=command";; \ fsck.ggo) O="--unamed-opts=table";; \ + afh.ggo) O="--unamed-opts=audio_file";; \ esac; \ if test $< != fsck.ggo; then O="$$O --conf-parser "; fi; \ gengetopt $$O \ @@ -214,6 +215,9 @@ para_fsck: @fsck_objs@ para_write: @write_objs@ $(CC) $(LDFLAGS) -o $@ @write_objs@ @write_ldflags@ +para_afh: @afh_objs@ + $(CC) $(LDFLAGS) -o $@ @afh_objs@ @afh_ldflags@ + clean: rm -f *.o $(BINARIES) rm -rf man diff --git a/NEWS b/NEWS index 668d8dab..4cc2d68d 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,9 @@ NEWS 0.3.2 (to be announced) "probabilistic parity" ---------------------------------------------- + - new ls option: -lc (list chunk table) + - new executable: para_afh, the stand-alone audio file handler tool + --------------------------------------- 0.3.1 (2008-02-23) "liquid interaction" --------------------------------------- diff --git a/configure.ac b/configure.ac index 64ef3f90..c435e371 100644 --- a/configure.ac +++ b/configure.ac @@ -79,12 +79,12 @@ AC_CHECK_FUNCS([atexit dup2 memchr memmove memset \ [AC_MSG_ERROR([function not found, cannot live without it])]) all_errlist_objs="server mp3_afh afh_common vss command net string signal time -daemon stat crypt http_send close_on_fork ipc acl +daemon stat crypt http_send close_on_fork ipc acl afh dccp_send fd user_list chunk_queue afs osl aft mood score attribute blob ringbuffer playlist sha1 rbtree sched audiod grab_client filter_chain wav compress http_recv dccp_recv recv_common write_common file_write audiod_command client_common recv stdout filter stdin audioc write client fsck exec send_common" -all_executables="server recv filter audioc write client fsck" +all_executables="server recv filter audioc write client fsck afh" recv_cmdline_objs="recv.cmdline http_recv.cmdline dccp_recv.cmdline" recv_errlist_objs="http_recv recv_common recv time string net dccp_recv @@ -113,6 +113,10 @@ audiod_errlist_objs="audiod signal string daemon stat net audiod_ldflags="" audiod_audio_formats="" +afh_cmdline_objs="afh.cmdline" +afh_errlist_objs="afh string fd mp3_afh afh_common time" +afh_ldflags="" + server_cmdline_objs="server.cmdline server_command_list afs_command_list" server_errlist_objs="server afh_common mp3_afh vss command net string signal time daemon stat crypt http_send close_on_fork @@ -315,6 +319,7 @@ if test "$have_ogg" = "yes"; then server_ldflags="$server_ldflags $oggvorbis_libs -logg -lvorbis -lvorbisfile" filter_ldflags="$filter_ldflags $oggvorbis_libs -lvorbis -lvorbisfile" audiod_ldflags="$audiod_ldflags $oggvorbis_libs -lvorbis -lvorbisfile" + afh_ldflags="$afh_ldflags $oggvorbis_libs -lvorbis -lvorbisfile" filter_cmdline_objs="$filter_cmdline_objs oggdec_filter.cmdline" audiod_cmdline_objs="$audiod_cmdline_objs oggdec_filter.cmdline" @@ -322,6 +327,7 @@ if test "$have_ogg" = "yes"; then server_errlist_objs="$server_errlist_objs ogg_afh" filter_errlist_objs="$filter_errlist_objs oggdec" audiod_errlist_objs="$audiod_errlist_objs oggdec" + afh_errlist_objs="$afh_errlist_objs ogg_afh" audiod_audio_formats="ogg" server_audio_formats="$server_audio_formats ogg" @@ -357,12 +363,14 @@ if test "$have_faad" = "yes"; then AC_DEFINE(HAVE_FAAD, 1, define to 1 if you want to build the aacdec filter) all_errlist_objs="$all_errlist_objs aac_common aacdec aac_afh" filter_errlist_objs="$filter_errlist_objs aacdec aac_common" + afh_errlist_objs="$afh_errlist_objs aac_common aac_afh" filter_filters="$filter_filters aacdec" audiod_errlist_objs="$audiod_errlist_objs aacdec aac_common" server_errlist_objs="$server_errlist_objs aac_afh aac_common" server_ldflags="$server_ldflags $faad_libs -lfaad" filter_ldflags="$filter_ldflags $faad_libs -lfaad" audiod_ldflags="$audiod_ldflags $faad_libs -lfaad" + afh_ldflags="$afh_ldflags $faad_libs -lfaad" audiod_audio_formats="$audiod_audio_formats aac" server_audio_formats="$server_audio_formats aac" filters="$filters aacdec" @@ -621,6 +629,7 @@ write_objs="$write_cmdline_objs $write_errlist_objs" client_objs="$client_cmdline_objs $client_errlist_objs" fsck_objs="$fsck_cmdline_objs $fsck_errlist_objs" audioc_objs="$audioc_cmdline_objs $audioc_errlist_objs" +afh_objs="$afh_cmdline_objs $afh_errlist_objs" AC_SUBST(recv_objs, add_dot_o($recv_objs)) AC_SUBST(recv_ldflags, $recv_ldflags) @@ -642,6 +651,11 @@ AC_SUBST(server_ldflags, $server_ldflags) AC_DEFINE_UNQUOTED(INIT_SERVER_ERRLISTS, objlist_to_errlist($server_errlist_objs), errors used by para_server) +AC_SUBST(afh_objs, add_dot_o($afh_objs)) +AC_SUBST(afh_ldflags, $afh_ldflags) +AC_DEFINE_UNQUOTED(INIT_AFH_ERRLISTS, + objlist_to_errlist($afh_errlist_objs), errors used by para_afh) + AC_SUBST(write_objs, add_dot_o($write_objs)) AC_SUBST(write_ldflags, $write_ldflags) AC_DEFINE_UNQUOTED(INIT_WRITE_ERRLISTS, diff --git a/error.h b/error.h index 55bd3ba6..994ec1ba 100644 --- a/error.h +++ b/error.h @@ -24,13 +24,21 @@ DEFINE_ERRLIST_OBJECT_ENUM; #define RINGBUFFER_ERRORS #define SCORE_ERRORS #define SHA1_ERRORS -#define AFH_COMMON_ERRORS #define RBTREE_ERRORS #define RECV_ERRORS #define SEND_COMMON_ERRORS extern const char **para_errlist[]; +#define AFH_ERRORS \ + PARA_ERROR(AFH_SYNTAX, "afh syntax error"), \ + + +#define AFH_COMMON_ERRORS \ + PARA_ERROR(BAD_AUDIO_FILE_SUFFIX, "unknown suffix"), \ + PARA_ERROR(AUDIO_FORMAT, "audio format not recognized"), \ + + #define ACL_ERRORS \ PARA_ERROR(ACL_PERM, "access denied by acl"), \ @@ -302,8 +310,6 @@ extern const char **para_errlist[]; #define VSS_ERRORS \ - PARA_ERROR(BAD_AUDIO_FILE_SUFFIX, "unknown suffix"), \ - PARA_ERROR(AUDIO_FORMAT, "audio format not recognized"), \ PARA_ERROR(CHUNK, "unable to get chunk"), \ PARA_ERROR(NOFD, "did not receive open fd from afs"), \ -- 2.39.2