From 55c66b16e18d486c35f1e5d5f82a9f2735787968 Mon Sep 17 00:00:00 2001 From: Chris Double Date: Fri, 25 Sep 2009 13:23:53 +1200 Subject: [PATCH] Fix ogg.vorbis vocab --- extra/ogg/vorbis/authors.txt | 1 + extra/ogg/vorbis/summary.txt | 1 + extra/ogg/vorbis/tags.txt | 1 + extra/ogg/vorbis/vorbis.factor | 151 +++++++++++++++++++++++++++++++++ 4 files changed, 154 insertions(+) create mode 100644 extra/ogg/vorbis/authors.txt create mode 100644 extra/ogg/vorbis/summary.txt create mode 100644 extra/ogg/vorbis/tags.txt create mode 100644 extra/ogg/vorbis/vorbis.factor diff --git a/extra/ogg/vorbis/authors.txt b/extra/ogg/vorbis/authors.txt new file mode 100644 index 0000000000..44b06f94bc --- /dev/null +++ b/extra/ogg/vorbis/authors.txt @@ -0,0 +1 @@ +Chris Double diff --git a/extra/ogg/vorbis/summary.txt b/extra/ogg/vorbis/summary.txt new file mode 100644 index 0000000000..1a8118ffe2 --- /dev/null +++ b/extra/ogg/vorbis/summary.txt @@ -0,0 +1 @@ +Ogg Vorbis audio library binding diff --git a/extra/ogg/vorbis/tags.txt b/extra/ogg/vorbis/tags.txt new file mode 100644 index 0000000000..d5cc28426a --- /dev/null +++ b/extra/ogg/vorbis/tags.txt @@ -0,0 +1 @@ +audio diff --git a/extra/ogg/vorbis/vorbis.factor b/extra/ogg/vorbis/vorbis.factor new file mode 100644 index 0000000000..e11f309c91 --- /dev/null +++ b/extra/ogg/vorbis/vorbis.factor @@ -0,0 +1,151 @@ +! Copyright (C) 2007 Chris Double. +! See http://factorcode.org/license.txt for BSD license. +! +USING: + alien + alien.c-types + alien.libraries + alien.syntax + classes.struct + combinators + kernel + ogg + system +; +IN: ogg.vorbis + +<< +"vorbis" { + { [ os winnt? ] [ "vorbis.dll" ] } + { [ os macosx? ] [ "libvorbis.0.dylib" ] } + { [ os unix? ] [ "libvorbis.so" ] } +} cond "cdecl" add-library +>> + +LIBRARY: vorbis + +STRUCT: vorbis_info + { version int } + { channels int } + { rate long } + { bitrate_upper long } + { bitrate_nominal long } + { bitrate_lower long } + { bitrate_window long } + { codec_setup void* } + ; + +STRUCT: vorbis_dsp_state + { analysisp int } + { vi vorbis_info* } + { pcm float** } + { pcmret float** } + { pcm_storage int } + { pcm_current int } + { pcm_returned int } + { preextrapolate int } + { eofflag int } + { lW long } + { W long } + { nW long } + { centerW long } + { granulepos longlong } + { sequence longlong } + { glue_bits longlong } + { time_bits longlong } + { floor_bits longlong } + { res_bits longlong } + { backend_state void* } + ; + +STRUCT: alloc_chain + { ptr void* } + { next void* } + ; + +STRUCT: vorbis_block + { pcm float** } + { opb oggpack_buffer } + { lW long } + { W long } + { nW long } + { pcmend int } + { mode int } + { eofflag int } + { granulepos longlong } + { sequence longlong } + { vd vorbis_dsp_state* } + { localstore void* } + { localtop long } + { localalloc long } + { totaluse long } + { reap alloc_chain* } + { glue_bits long } + { time_bits long } + { floor_bits long } + { res_bits long } + { internal void* } + ; + +STRUCT: vorbis_comment + { usercomments char** } + { comment_lengths int* } + { comments int } + { vendor char* } + ; + +FUNCTION: void vorbis_info_init ( vorbis_info* vi ) ; +FUNCTION: void vorbis_info_clear ( vorbis_info* vi ) ; +FUNCTION: int vorbis_info_blocksize ( vorbis_info* vi, int zo ) ; +FUNCTION: void vorbis_comment_init ( vorbis_comment* vc ) ; +FUNCTION: void vorbis_comment_add ( vorbis_comment* vc, char* comment ) ; +FUNCTION: void vorbis_comment_add_tag ( vorbis_comment* vc, char* tag, char* contents ) ; +FUNCTION: char* vorbis_comment_query ( vorbis_comment* vc, char* tag, int count ) ; +FUNCTION: int vorbis_comment_query_count ( vorbis_comment* vc, char* tag ) ; +FUNCTION: void vorbis_comment_clear ( vorbis_comment* vc ) ; +FUNCTION: int vorbis_block_init ( vorbis_dsp_state* v, vorbis_block* vb ) ; +FUNCTION: int vorbis_block_clear ( vorbis_block* vb ) ; +FUNCTION: void vorbis_dsp_clear ( vorbis_dsp_state* v ) ; +FUNCTION: double vorbis_granule_time ( vorbis_dsp_state* v, longlong granulepos ) ; +FUNCTION: int vorbis_analysis_init ( vorbis_dsp_state* v, vorbis_info* vi ) ; +FUNCTION: int vorbis_commentheader_out ( vorbis_comment* vc, ogg_packet* op ) ; +FUNCTION: int vorbis_analysis_headerout ( vorbis_dsp_state* v, + vorbis_comment* vc, + ogg_packet* op, + ogg_packet* op_comm, + ogg_packet* op_code ) ; +FUNCTION: float** vorbis_analysis_buffer ( vorbis_dsp_state* v, int vals ) ; +FUNCTION: int vorbis_analysis_wrote ( vorbis_dsp_state* v, int vals ) ; +FUNCTION: int vorbis_analysis_blockout ( vorbis_dsp_state* v, vorbis_block* vb ) ; +FUNCTION: int vorbis_analysis ( vorbis_block* vb, ogg_packet* op ) ; +FUNCTION: int vorbis_bitrate_addblock ( vorbis_block* vb ) ; +FUNCTION: int vorbis_bitrate_flushpacket ( vorbis_dsp_state* vd, + ogg_packet* op ) ; +FUNCTION: int vorbis_synthesis_headerin ( vorbis_info* vi, vorbis_comment* vc, + ogg_packet* op ) ; +FUNCTION: int vorbis_synthesis_init ( vorbis_dsp_state* v, vorbis_info* vi ) ; +FUNCTION: int vorbis_synthesis_restart ( vorbis_dsp_state* v ) ; +FUNCTION: int vorbis_synthesis ( vorbis_block* vb, ogg_packet* op ) ; +FUNCTION: int vorbis_synthesis_trackonly ( vorbis_block* vb, ogg_packet* op ) ; +FUNCTION: int vorbis_synthesis_blockin ( vorbis_dsp_state* v, vorbis_block* vb ) ; +FUNCTION: int vorbis_synthesis_pcmout ( vorbis_dsp_state* v, float*** pcm ) ; +FUNCTION: int vorbis_synthesis_lapout ( vorbis_dsp_state* v, float*** pcm ) ; +FUNCTION: int vorbis_synthesis_read ( vorbis_dsp_state* v, int samples ) ; +FUNCTION: long vorbis_packet_blocksize ( vorbis_info* vi, ogg_packet* op ) ; +FUNCTION: int vorbis_synthesis_halfrate ( vorbis_info* v, int flag ) ; +FUNCTION: int vorbis_synthesis_halfrate_p ( vorbis_info* v ) ; + +: OV_FALSE ( -- number ) -1 ; inline +: OV_EOF ( -- number ) -2 ; inline +: OV_HOLE ( -- number ) -3 ; inline +: OV_EREAD ( -- number ) -128 ; inline +: OV_EFAULT ( -- number ) -129 ; inline +: OV_EIMPL ( -- number ) -130 ; inline +: OV_EINVAL ( -- number ) -131 ; inline +: OV_ENOTVORBIS ( -- number ) -132 ; inline +: OV_EBADHEADER ( -- number ) -133 ; inline +: OV_EVERSION ( -- number ) -134 ; inline +: OV_ENOTAUDIO ( -- number ) -135 ; inline +: OV_EBADPACKET ( -- number ) -136 ; inline +: OV_EBADLINK ( -- number ) -137 ; inline +: OV_ENOSEEK ( -- number ) -138 ; inline