From f75bfa2700b00393432a5e656bb776ffc0427df5 Mon Sep 17 00:00:00 2001 From: Justin Espedal Date: Wed, 30 Sep 2020 23:08:08 +0900 Subject: [PATCH] Hashlink vorbis bindings --- .../media/codecs/vorbis/VorbisBindings.cpp | 377 ++++++++++++++++++ .../_internal/backend/native/NativeCFFI.hx | 91 +++-- 2 files changed, 422 insertions(+), 46 deletions(-) diff --git a/project/src/media/codecs/vorbis/VorbisBindings.cpp b/project/src/media/codecs/vorbis/VorbisBindings.cpp index c1edc628e..4e15db5b2 100644 --- a/project/src/media/codecs/vorbis/VorbisBindings.cpp +++ b/project/src/media/codecs/vorbis/VorbisBindings.cpp @@ -20,6 +20,9 @@ namespace lime { static value infoValue; static value int64Value; static value readValue; + static vdynamic *hl_infoValue; + static vdynamic *hl_int64Value; + static vdynamic *hl_readValue; static bool init = false; @@ -58,6 +61,36 @@ namespace lime { } + inline void _hl_initializeVorbis () { + + if (!init) { + + id_bitrateUpper = hl_hash_utf8 ("bitrateUpper"); + id_bitrateNominal = hl_hash_utf8 ("bitrateNominal"); + id_bitrateLower = hl_hash_utf8 ("bitrateLower"); + id_bitstream = hl_hash_utf8 ("bitstream"); + id_channels = hl_hash_utf8 ("channels"); + id_high = hl_hash_utf8 ("high"); + id_low = hl_hash_utf8 ("low"); + id_rate = hl_hash_utf8 ("rate"); + id_returnValue = hl_hash_utf8 ("returnValue"); + id_version = hl_hash_utf8 ("version"); + + hl_infoValue = (vdynamic*)hl_alloc_dynobj(); + hl_int64Value = (vdynamic*)hl_alloc_dynobj(); + hl_readValue = (vdynamic*)hl_alloc_dynobj(); + + hl_add_root(&hl_infoValue); + hl_add_root(&hl_int64Value); + hl_add_root(&hl_readValue); + + init = true; + + } + + } + + value allocInt64 (ogg_int64_t val) { ogg_int32_t low = val; @@ -73,7 +106,23 @@ namespace lime { } + vdynamic* hl_allocInt64 (ogg_int64_t val) { + + ogg_int32_t low = val; + ogg_int32_t high = (val >> 32); + + _hl_initializeVorbis (); + + hl_dyn_seti (hl_int64Value, id_low, &hlt_i32, low); + hl_dyn_seti (hl_int64Value, id_high, &hlt_i32, high); + + return hl_int64Value; + + } + + void lime_vorbis_file_clear (value vorbisFile); + HL_PRIM void hl_lime_vorbis_file_clear (HL_CFFIPointer* vorbisFile); void gc_vorbis_file (value vorbisFile) { @@ -82,6 +131,12 @@ namespace lime { } + void hl_gc_vorbis_file (HL_CFFIPointer* vorbisFile) { + + hl_lime_vorbis_file_clear (vorbisFile); + + } + int lime_vorbis_file_bitrate (value vorbisFile, int bitstream) { @@ -91,6 +146,14 @@ namespace lime { } + HL_PRIM int hl_lime_vorbis_file_bitrate (HL_CFFIPointer* vorbisFile, int bitstream) { + + OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)vorbisFile->ptr; + return ov_bitrate (file, bitstream); + + } + + int lime_vorbis_file_bitrate_instant (value vorbisFile) { OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)val_data (vorbisFile); @@ -99,6 +162,14 @@ namespace lime { } + HL_PRIM int hl_lime_vorbis_file_bitrate_instant (HL_CFFIPointer* vorbisFile) { + + OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)vorbisFile->ptr; + return ov_bitrate_instant (file); + + } + + void lime_vorbis_file_clear (value vorbisFile) { if (!val_is_null (vorbisFile)) { @@ -112,6 +183,19 @@ namespace lime { } + HL_PRIM void hl_lime_vorbis_file_clear (HL_CFFIPointer* vorbisFile) { + + if (vorbisFile) { + + OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)vorbisFile->ptr; + vorbisFile->finalizer = 0; + ov_clear (file); + + } + + } + + value lime_vorbis_file_comment (value vorbisFile, int bitstream) { return alloc_null (); @@ -119,6 +203,13 @@ namespace lime { } + HL_PRIM vdynamic* hl_lime_vorbis_file_comment (HL_CFFIPointer* vorbisFile, int bitstream) { + + return NULL; + + } + + value lime_vorbis_file_crosslap (value vorbisFile, value otherVorbisFile) { OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)val_data (vorbisFile); @@ -128,6 +219,15 @@ namespace lime { } + HL_PRIM int hl_lime_vorbis_file_crosslap (HL_CFFIPointer* vorbisFile, HL_CFFIPointer* otherVorbisFile) { + + OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)vorbisFile->ptr; + OggVorbis_File* otherFile = (OggVorbis_File*)(uintptr_t)otherVorbisFile->ptr; + return ov_crosslap (file, otherFile); + + } + + value lime_vorbis_file_info (value vorbisFile, int bitstream) { OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)val_data (vorbisFile); @@ -153,6 +253,31 @@ namespace lime { } + HL_PRIM vdynamic* hl_lime_vorbis_file_info (HL_CFFIPointer* vorbisFile, int bitstream) { + + OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)vorbisFile->ptr; + vorbis_info *info = ov_info (file, bitstream); + + if (info) { + + _hl_initializeVorbis (); + + hl_dyn_seti (hl_infoValue, id_version, &hlt_i32, info->version); + hl_dyn_seti (hl_infoValue, id_channels, &hlt_i32, info->channels); + hl_dyn_seti (hl_infoValue, id_rate, &hlt_i32, info->rate); + hl_dyn_seti (hl_infoValue, id_bitrateUpper, &hlt_i32, info->bitrate_upper); + hl_dyn_seti (hl_infoValue, id_bitrateNominal, &hlt_i32, info->bitrate_nominal); + hl_dyn_seti (hl_infoValue, id_bitrateLower, &hlt_i32, info->bitrate_lower); + + return hl_infoValue; + + } + + return NULL; + + } + + value lime_vorbis_file_from_bytes (value data) { Bytes bytes; @@ -171,6 +296,21 @@ namespace lime { } + HL_PRIM HL_CFFIPointer* hl_lime_vorbis_file_from_bytes (Bytes* data) { + + OggVorbis_File* vorbisFile = VorbisFile::FromBytes (data); + + if (vorbisFile) { + + return HLCFFIPointer ((void*)(uintptr_t)vorbisFile, (hl_finalizer)hl_gc_vorbis_file); + + } + + return NULL; + + } + + value lime_vorbis_file_from_file (HxString path) { OggVorbis_File* vorbisFile = VorbisFile::FromFile (path.c_str ()); @@ -186,6 +326,21 @@ namespace lime { } + HL_PRIM HL_CFFIPointer* hl_lime_vorbis_file_from_file (hl_vstring* path) { + + OggVorbis_File* vorbisFile = VorbisFile::FromFile (path ? hl_to_utf8 (path->bytes) : NULL); + + if (vorbisFile) { + + return HLCFFIPointer ((void*)(uintptr_t)vorbisFile, (hl_finalizer)hl_gc_vorbis_file); + + } + + return NULL; + + } + + int lime_vorbis_file_pcm_seek (value vorbisFile, value posLow, value posHigh) { OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)val_data (vorbisFile); @@ -195,6 +350,15 @@ namespace lime { } + HL_PRIM int hl_lime_vorbis_file_pcm_seek (HL_CFFIPointer* vorbisFile, int posLow, int posHigh) { + + OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)vorbisFile->ptr; + ogg_int64_t pos = ((ogg_int64_t)posHigh << 32) | (ogg_int64_t)posLow; + return ov_pcm_seek (file, pos); + + } + + int lime_vorbis_file_pcm_seek_lap (value vorbisFile, value posLow, value posHigh) { OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)val_data (vorbisFile); @@ -204,6 +368,15 @@ namespace lime { } + HL_PRIM int hl_lime_vorbis_file_pcm_seek_lap (HL_CFFIPointer* vorbisFile, int posLow, int posHigh) { + + OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)vorbisFile->ptr; + ogg_int64_t pos = ((ogg_int64_t)posHigh << 32) | (ogg_int64_t)posLow; + return ov_pcm_seek_lap (file, pos); + + } + + int lime_vorbis_file_pcm_seek_page (value vorbisFile, value posLow, value posHigh) { OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)val_data (vorbisFile); @@ -213,6 +386,15 @@ namespace lime { } + HL_PRIM int hl_lime_vorbis_file_pcm_seek_page (HL_CFFIPointer* vorbisFile, int posLow, int posHigh) { + + OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)vorbisFile->ptr; + ogg_int64_t pos = ((ogg_int64_t)posHigh << 32) | (ogg_int64_t)posLow; + return ov_pcm_seek_page (file, pos); + + } + + int lime_vorbis_file_pcm_seek_page_lap (value vorbisFile, value posLow, value posHigh) { OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)val_data (vorbisFile); @@ -222,6 +404,15 @@ namespace lime { } + HL_PRIM int hl_lime_vorbis_file_pcm_seek_page_lap (HL_CFFIPointer* vorbisFile, int posLow, int posHigh) { + + OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)vorbisFile->ptr; + ogg_int64_t pos = ((ogg_int64_t)posHigh << 32) | (ogg_int64_t)posLow; + return ov_pcm_seek_page_lap (file, pos); + + } + + value lime_vorbis_file_pcm_tell (value vorbisFile) { OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)val_data (vorbisFile); @@ -230,6 +421,14 @@ namespace lime { } + HL_PRIM vdynamic* hl_lime_vorbis_file_pcm_tell (HL_CFFIPointer* vorbisFile) { + + OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)vorbisFile->ptr; + return hl_allocInt64 (ov_pcm_tell (file)); + + } + + value lime_vorbis_file_pcm_total (value vorbisFile, int bitstream) { OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)val_data (vorbisFile); @@ -238,6 +437,14 @@ namespace lime { } + HL_PRIM vdynamic* hl_lime_vorbis_file_pcm_total (HL_CFFIPointer* vorbisFile, int bitstream) { + + OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)vorbisFile->ptr; + return hl_allocInt64 (ov_pcm_total (file, bitstream)); + + } + + int lime_vorbis_file_raw_seek (value vorbisFile, value posLow, value posHigh) { OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)val_data (vorbisFile); @@ -247,6 +454,15 @@ namespace lime { } + HL_PRIM int hl_lime_vorbis_file_raw_seek (HL_CFFIPointer* vorbisFile, int posLow, int posHigh) { + + OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)vorbisFile->ptr; + ogg_int64_t pos = ((ogg_int64_t)posHigh << 32) | (ogg_int64_t)posLow; + return ov_raw_seek (file, pos); + + } + + int lime_vorbis_file_raw_seek_lap (value vorbisFile, value posLow, value posHigh) { OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)val_data (vorbisFile); @@ -256,6 +472,15 @@ namespace lime { } + HL_PRIM int hl_lime_vorbis_file_raw_seek_lap (HL_CFFIPointer* vorbisFile, int posLow, int posHigh) { + + OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)vorbisFile->ptr; + ogg_int64_t pos = ((ogg_int64_t)posHigh << 32) | (ogg_int64_t)posLow; + return ov_raw_seek_lap (file, pos); + + } + + value lime_vorbis_file_raw_tell (value vorbisFile) { OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)val_data (vorbisFile); @@ -264,6 +489,14 @@ namespace lime { } + HL_PRIM vdynamic* hl_lime_vorbis_file_raw_tell (HL_CFFIPointer* vorbisFile) { + + OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)vorbisFile->ptr; + return hl_allocInt64 (ov_raw_tell (file)); + + } + + value lime_vorbis_file_raw_total (value vorbisFile, int bitstream) { OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)val_data (vorbisFile); @@ -272,6 +505,14 @@ namespace lime { } + HL_PRIM vdynamic* hl_lime_vorbis_file_raw_total (HL_CFFIPointer* vorbisFile, int bitstream) { + + OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)vorbisFile->ptr; + return hl_allocInt64 (ov_raw_total (file, bitstream)); + + } + + value lime_vorbis_file_read (value vorbisFile, value buffer, int position, int length, bool bigendianp, int word, bool sgned) { if (val_is_null (buffer)) { @@ -298,6 +539,29 @@ namespace lime { } + HL_PRIM vdynamic* hl_lime_vorbis_file_read (HL_CFFIPointer* vorbisFile, Bytes* buffer, int position, int length, bool bigendianp, int word, bool sgned) { + + if (!buffer) { + + return NULL; + + } + + int bitstream; + + OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)vorbisFile->ptr; + long result = ov_read (file, (char*)buffer->b + position, length, bigendianp, word, sgned, &bitstream); + + _hl_initializeVorbis (); + + hl_dyn_seti (hl_readValue, id_bitstream, &hlt_i32, bitstream); + hl_dyn_seti (hl_readValue, id_returnValue, &hlt_i32, result); + + return hl_readValue; + + } + + value lime_vorbis_file_read_float (value vorbisFile, value pcmChannels, int samples) { //Bytes bytes; @@ -318,6 +582,13 @@ namespace lime { } + HL_PRIM vdynamic* hl_lime_vorbis_file_read_float (HL_CFFIPointer* vorbisFile, Bytes* pcmChannels, int samples) { + + return NULL; + + } + + bool lime_vorbis_file_seekable (value vorbisFile) { OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)val_data (vorbisFile); @@ -326,6 +597,14 @@ namespace lime { } + HL_PRIM bool hl_lime_vorbis_file_seekable (HL_CFFIPointer* vorbisFile) { + + OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)vorbisFile->ptr; + return ov_seekable (file); + + } + + int lime_vorbis_file_serial_number (value vorbisFile, int bitstream) { OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)val_data (vorbisFile); @@ -334,6 +613,14 @@ namespace lime { } + HL_PRIM int hl_lime_vorbis_file_serial_number (HL_CFFIPointer* vorbisFile, int bitstream) { + + OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)vorbisFile->ptr; + return ov_serialnumber (file, bitstream); + + } + + int lime_vorbis_file_streams (value vorbisFile) { OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)val_data (vorbisFile); @@ -342,6 +629,14 @@ namespace lime { } + HL_PRIM int hl_lime_vorbis_file_streams (HL_CFFIPointer* vorbisFile) { + + OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)vorbisFile->ptr; + return ov_streams (file); + + } + + int lime_vorbis_file_time_seek (value vorbisFile, double s) { OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)val_data (vorbisFile); @@ -350,6 +645,14 @@ namespace lime { } + HL_PRIM int hl_lime_vorbis_file_time_seek (HL_CFFIPointer* vorbisFile, double s) { + + OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)vorbisFile->ptr; + return ov_time_seek (file, s); + + } + + int lime_vorbis_file_time_seek_lap (value vorbisFile, double s) { OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)val_data (vorbisFile); @@ -358,6 +661,14 @@ namespace lime { } + HL_PRIM int hl_lime_vorbis_file_time_seek_lap (HL_CFFIPointer* vorbisFile, double s) { + + OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)vorbisFile->ptr; + return ov_time_seek_lap (file, s); + + } + + int lime_vorbis_file_time_seek_page (value vorbisFile, double s) { OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)val_data (vorbisFile); @@ -366,6 +677,14 @@ namespace lime { } + HL_PRIM int hl_lime_vorbis_file_time_seek_page (HL_CFFIPointer* vorbisFile, double s) { + + OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)vorbisFile->ptr; + return ov_time_seek_page (file, s); + + } + + int lime_vorbis_file_time_seek_page_lap (value vorbisFile, double s) { OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)val_data (vorbisFile); @@ -374,6 +693,14 @@ namespace lime { } + HL_PRIM int hl_lime_vorbis_file_time_seek_page_lap (HL_CFFIPointer* vorbisFile, double s) { + + OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)vorbisFile->ptr; + return ov_time_seek_page_lap (file, s); + + } + + double lime_vorbis_file_time_tell (value vorbisFile) { OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)val_data (vorbisFile); @@ -382,6 +709,14 @@ namespace lime { } + HL_PRIM double hl_lime_vorbis_file_time_tell (HL_CFFIPointer* vorbisFile) { + + OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)vorbisFile->ptr; + return ov_time_tell (file); + + } + + double lime_vorbis_file_time_total (value vorbisFile, int bitstream) { OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)val_data (vorbisFile); @@ -390,6 +725,14 @@ namespace lime { } + HL_PRIM double hl_lime_vorbis_file_time_total (HL_CFFIPointer* vorbisFile, int bitstream) { + + OggVorbis_File* file = (OggVorbis_File*)(uintptr_t)vorbisFile->ptr; + return ov_time_total (file, bitstream); + + } + + DEFINE_PRIME2 (lime_vorbis_file_bitrate); DEFINE_PRIME1 (lime_vorbis_file_bitrate_instant); DEFINE_PRIME1v (lime_vorbis_file_clear); @@ -421,6 +764,40 @@ namespace lime { DEFINE_PRIME2 (lime_vorbis_file_time_total); + #define _TBYTES _OBJ (_I32 _BYTES) + #define _TCFFIPOINTER _DYN + + DEFINE_HL_PRIM (_I32, lime_vorbis_file_bitrate, _TCFFIPOINTER _I32); + DEFINE_HL_PRIM (_I32, lime_vorbis_file_bitrate_instant, _TCFFIPOINTER); + DEFINE_HL_PRIM (_VOID, lime_vorbis_file_clear, _TCFFIPOINTER); + DEFINE_HL_PRIM (_DYN, lime_vorbis_file_comment, _TCFFIPOINTER _I32); + DEFINE_HL_PRIM (_I32, lime_vorbis_file_crosslap, _TCFFIPOINTER _TCFFIPOINTER); + DEFINE_HL_PRIM (_DYN, lime_vorbis_file_info, _TCFFIPOINTER _I32); + DEFINE_HL_PRIM (_TCFFIPOINTER, lime_vorbis_file_from_bytes, _TBYTES); + DEFINE_HL_PRIM (_TCFFIPOINTER, lime_vorbis_file_from_file, _STRING); + DEFINE_HL_PRIM (_I32, lime_vorbis_file_pcm_seek, _TCFFIPOINTER _I32 _I32); + DEFINE_HL_PRIM (_I32, lime_vorbis_file_pcm_seek_lap, _TCFFIPOINTER _I32 _I32); + DEFINE_HL_PRIM (_I32, lime_vorbis_file_pcm_seek_page, _TCFFIPOINTER _I32 _I32); + DEFINE_HL_PRIM (_I32, lime_vorbis_file_pcm_seek_page_lap, _TCFFIPOINTER _I32 _I32); + DEFINE_HL_PRIM (_DYN, lime_vorbis_file_pcm_tell, _TCFFIPOINTER); + DEFINE_HL_PRIM (_DYN, lime_vorbis_file_pcm_total, _TCFFIPOINTER _I32); + DEFINE_HL_PRIM (_I32, lime_vorbis_file_raw_seek, _TCFFIPOINTER _I32 _I32); + DEFINE_HL_PRIM (_I32, lime_vorbis_file_raw_seek_lap, _TCFFIPOINTER _I32 _I32); + DEFINE_HL_PRIM (_DYN, lime_vorbis_file_raw_tell, _TCFFIPOINTER); + DEFINE_HL_PRIM (_DYN, lime_vorbis_file_raw_total, _TCFFIPOINTER _I32); + DEFINE_HL_PRIM (_DYN, lime_vorbis_file_read, _TCFFIPOINTER _TBYTES _I32 _I32 _BOOL _I32 _BOOL); + DEFINE_HL_PRIM (_DYN, lime_vorbis_file_read_float, _TCFFIPOINTER _TBYTES _I32); + DEFINE_HL_PRIM (_BOOL, lime_vorbis_file_seekable, _TCFFIPOINTER); + DEFINE_HL_PRIM (_I32, lime_vorbis_file_serial_number, _TCFFIPOINTER _I32); + DEFINE_HL_PRIM (_I32, lime_vorbis_file_streams, _TCFFIPOINTER); + DEFINE_HL_PRIM (_I32, lime_vorbis_file_time_seek, _TCFFIPOINTER _F64); + DEFINE_HL_PRIM (_I32, lime_vorbis_file_time_seek_lap, _TCFFIPOINTER _F64); + DEFINE_HL_PRIM (_I32, lime_vorbis_file_time_seek_page, _TCFFIPOINTER _F64); + DEFINE_HL_PRIM (_I32, lime_vorbis_file_time_seek_page_lap, _TCFFIPOINTER _F64); + DEFINE_HL_PRIM (_F64, lime_vorbis_file_time_tell, _TCFFIPOINTER); + DEFINE_HL_PRIM (_F64, lime_vorbis_file_time_total, _TCFFIPOINTER _I32); + + } diff --git a/src/lime/_internal/backend/native/NativeCFFI.hx b/src/lime/_internal/backend/native/NativeCFFI.hx index 3b3c04131..28ecefe54 100644 --- a/src/lime/_internal/backend/native/NativeCFFI.hx +++ b/src/lime/_internal/backend/native/NativeCFFI.hx @@ -6737,145 +6737,144 @@ class NativeCFFI #end #if hl - // TODO - private static function lime_vorbis_file_bitrate(vorbisFile:Dynamic, bitstream:Int):Int + @:hlNative("lime", "lime_vorbis_file_bitrate") private static function lime_vorbis_file_bitrate(vorbisFile:CFFIPointer, bitstream:Int):Int { return 0; } - private static function lime_vorbis_file_bitrate_instant(vorbisFile:Dynamic):Int + @:hlNative("lime", "lime_vorbis_file_bitrate_instant") private static function lime_vorbis_file_bitrate_instant(vorbisFile:CFFIPointer):Int { return 0; } - private static function lime_vorbis_file_clear(vorbisFile:Dynamic):Void {} + @:hlNative("lime", "lime_vorbis_file_clear") private static function lime_vorbis_file_clear(vorbisFile:CFFIPointer):Void {} - private static function lime_vorbis_file_comment(vorbisFile:Dynamic, bitstream:Int):Dynamic + @:hlNative("lime", "lime_vorbis_file_comment") private static function lime_vorbis_file_comment(vorbisFile:CFFIPointer, bitstream:Int):Dynamic { return null; } - private static function lime_vorbis_file_crosslap(vorbisFile:Dynamic, otherVorbisFile:Dynamic):Dynamic - { - return null; - } - - private static function lime_vorbis_file_from_bytes(bytes:Dynamic):Dynamic - { - return null; - } - - private static function lime_vorbis_file_from_file(path:String):Dynamic - { - return null; - } - - private static function lime_vorbis_file_info(vorbisFile:Dynamic, bitstream:Int):Dynamic - { - return null; - } - - private static function lime_vorbis_file_pcm_seek(vorbisFile:Dynamic, posLow:Dynamic, posHigh:Dynamic):Int + @:hlNative("lime", "lime_vorbis_file_crosslap") private static function lime_vorbis_file_crosslap(vorbisFile:CFFIPointer, otherVorbisFile:CFFIPointer):Int { return 0; } - private static function lime_vorbis_file_pcm_seek_lap(vorbisFile:Dynamic, posLow:Dynamic, posHigh:Dynamic):Int + @:hlNative("lime", "lime_vorbis_file_from_bytes") private static function lime_vorbis_file_from_bytes(bytes:Bytes):CFFIPointer + { + return null; + } + + @:hlNative("lime", "lime_vorbis_file_from_file") private static function lime_vorbis_file_from_file(path:String):CFFIPointer + { + return null; + } + + @:hlNative("lime", "lime_vorbis_file_info") private static function lime_vorbis_file_info(vorbisFile:CFFIPointer, bitstream:Int):Dynamic + { + return null; + } + + @:hlNative("lime", "lime_vorbis_file_pcm_seek") private static function lime_vorbis_file_pcm_seek(vorbisFile:CFFIPointer, posLow:Int, posHigh:Int):Int { return 0; } - private static function lime_vorbis_file_pcm_seek_page(vorbisFile:Dynamic, posLow:Dynamic, posHigh:Dynamic):Int + @:hlNative("lime", "lime_vorbis_file_pcm_seek_lap") private static function lime_vorbis_file_pcm_seek_lap(vorbisFile:CFFIPointer, posLow:Int, posHigh:Int):Int { return 0; } - private static function lime_vorbis_file_pcm_seek_page_lap(vorbisFile:Dynamic, posLow:Dynamic, posHigh:Dynamic):Int + @:hlNative("lime", "lime_vorbis_file_pcm_seek_page") private static function lime_vorbis_file_pcm_seek_page(vorbisFile:CFFIPointer, posLow:Int, posHigh:Int):Int { return 0; } - private static function lime_vorbis_file_raw_seek(vorbisFile:Dynamic, posLow:Dynamic, posHigh:Dynamic):Int + @:hlNative("lime", "lime_vorbis_file_pcm_seek_page_lap") private static function lime_vorbis_file_pcm_seek_page_lap(vorbisFile:CFFIPointer, posLow:Int, posHigh:Int):Int { return 0; } - private static function lime_vorbis_file_raw_seek_lap(vorbisFile:Dynamic, posLow:Dynamic, posHigh:Dynamic):Int + @:hlNative("lime", "lime_vorbis_file_raw_seek") private static function lime_vorbis_file_raw_seek(vorbisFile:CFFIPointer, posLow:Int, posHigh:Int):Int { return 0; } - private static function lime_vorbis_file_pcm_tell(vorbisFile:Dynamic):Dynamic + @:hlNative("lime", "lime_vorbis_file_raw_seek_lap") private static function lime_vorbis_file_raw_seek_lap(vorbisFile:CFFIPointer, posLow:Int, posHigh:Int):Int + { + return 0; + } + + @:hlNative("lime", "lime_vorbis_file_pcm_tell") private static function lime_vorbis_file_pcm_tell(vorbisFile:CFFIPointer):Dynamic { return null; } - private static function lime_vorbis_file_pcm_total(vorbisFile:Dynamic, bitstream:Int):Dynamic + @:hlNative("lime", "lime_vorbis_file_pcm_total") private static function lime_vorbis_file_pcm_total(vorbisFile:CFFIPointer, bitstream:Int):Dynamic { return null; } - private static function lime_vorbis_file_raw_tell(vorbisFile:Dynamic):Dynamic + @:hlNative("lime", "lime_vorbis_file_raw_tell") private static function lime_vorbis_file_raw_tell(vorbisFile:CFFIPointer):Dynamic { return null; } - private static function lime_vorbis_file_raw_total(vorbisFile:Dynamic, bitstream:Int):Dynamic + @:hlNative("lime", "lime_vorbis_file_raw_total") private static function lime_vorbis_file_raw_total(vorbisFile:CFFIPointer, bitstream:Int):Dynamic { return null; } - private static function lime_vorbis_file_read(vorbisFile:Dynamic, buffer:Dynamic, position:Int, length:Int, bigendianp:Bool, word:Int, signed:Bool):Dynamic + @:hlNative("lime", "lime_vorbis_file_read") private static function lime_vorbis_file_read(vorbisFile:CFFIPointer, buffer:Bytes, position:Int, length:Int, bigendianp:Bool, word:Int, signed:Bool):Dynamic { return null; } - private static function lime_vorbis_file_read_float(vorbisFile:Dynamic, pcmChannels:Dynamic, samples:Int):Dynamic + @:hlNative("lime", "lime_vorbis_file_read_float") private static function lime_vorbis_file_read_float(vorbisFile:CFFIPointer, pcmChannels:Bytes, samples:Int):Dynamic { return null; } - private static function lime_vorbis_file_seekable(vorbisFile:Dynamic):Bool + @:hlNative("lime", "lime_vorbis_file_seekable") private static function lime_vorbis_file_seekable(vorbisFile:CFFIPointer):Bool { return false; } - private static function lime_vorbis_file_serial_number(vorbisFile:Dynamic, bitstream:Int):Int + @:hlNative("lime", "lime_vorbis_file_serial_number") private static function lime_vorbis_file_serial_number(vorbisFile:CFFIPointer, bitstream:Int):Int { return 0; } - private static function lime_vorbis_file_streams(vorbisFile:Dynamic):Int + @:hlNative("lime", "lime_vorbis_file_streams") private static function lime_vorbis_file_streams(vorbisFile:CFFIPointer):Int { return 0; } - private static function lime_vorbis_file_time_seek(vorbisFile:Dynamic, s:Float):Int + @:hlNative("lime", "lime_vorbis_file_time_seek") private static function lime_vorbis_file_time_seek(vorbisFile:CFFIPointer, s:Float):Int { return 0; } - private static function lime_vorbis_file_time_seek_lap(vorbisFile:Dynamic, s:Float):Int + @:hlNative("lime", "lime_vorbis_file_time_seek_lap") private static function lime_vorbis_file_time_seek_lap(vorbisFile:CFFIPointer, s:Float):Int { return 0; } - private static function lime_vorbis_file_time_seek_page(vorbisFile:Dynamic, s:Float):Int + @:hlNative("lime", "lime_vorbis_file_time_seek_page") private static function lime_vorbis_file_time_seek_page(vorbisFile:CFFIPointer, s:Float):Int { return 0; } - private static function lime_vorbis_file_time_seek_page_lap(vorbisFile:Dynamic, s:Float):Int + @:hlNative("lime", "lime_vorbis_file_time_seek_page_lap") private static function lime_vorbis_file_time_seek_page_lap(vorbisFile:CFFIPointer, s:Float):Int { return 0; } - private static function lime_vorbis_file_time_tell(vorbisFile:Dynamic):Float + @:hlNative("lime", "lime_vorbis_file_time_tell") private static function lime_vorbis_file_time_tell(vorbisFile:CFFIPointer):Float { return 0; } - private static function lime_vorbis_file_time_total(vorbisFile:Dynamic, bitstream:Int):Float + @:hlNative("lime", "lime_vorbis_file_time_total") private static function lime_vorbis_file_time_total(vorbisFile:CFFIPointer, bitstream:Int):Float { return 0; }