seal 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.yardopts +1 -0
- data/LICENSE +13 -0
- data/README.md +265 -0
- data/ext/seal/extconf.rb +45 -0
- data/include/al/al.h +724 -0
- data/include/al/alc.h +277 -0
- data/include/al/efx-presets.h +402 -0
- data/include/al/efx.h +758 -0
- data/include/mpg123/mpg123.h +1034 -0
- data/include/ogg/config_types.h +25 -0
- data/include/ogg/ogg.h +210 -0
- data/include/ogg/os_types.h +147 -0
- data/include/seal.h +23 -0
- data/include/seal/buf.h +143 -0
- data/include/seal/core.h +95 -0
- data/include/seal/efs.h +112 -0
- data/include/seal/err.h +93 -0
- data/include/seal/fmt.h +58 -0
- data/include/seal/listener.h +103 -0
- data/include/seal/raw.h +86 -0
- data/include/seal/rvb.h +520 -0
- data/include/seal/src.h +413 -0
- data/include/seal/stream.h +81 -0
- data/include/vorbis/codec.h +243 -0
- data/include/vorbis/vorbisfile.h +206 -0
- data/mpg123/AUTHORS +150 -0
- data/mpg123/COPYING +773 -0
- data/mpg123/ChangeLog +3 -0
- data/mpg123/INSTALL +111 -0
- data/mpg123/Makefile.am +99 -0
- data/mpg123/Makefile.in +1043 -0
- data/mpg123/NEWS +1200 -0
- data/mpg123/NEWS.libmpg123 +133 -0
- data/mpg123/README +203 -0
- data/mpg123/TODO +38 -0
- data/mpg123/aclocal.m4 +1168 -0
- data/mpg123/build/config.guess +1530 -0
- data/mpg123/build/config.sub +1782 -0
- data/mpg123/build/depcomp +707 -0
- data/mpg123/build/install-sh +527 -0
- data/mpg123/build/ltmain.sh +9655 -0
- data/mpg123/build/missing +330 -0
- data/mpg123/configure +20267 -0
- data/mpg123/configure.ac +2178 -0
- data/mpg123/doc/ACCURACY +2 -0
- data/mpg123/doc/BENCHMARKING +110 -0
- data/mpg123/doc/BUGS +3 -0
- data/mpg123/doc/CONTACT +17 -0
- data/mpg123/doc/LICENSE +22 -0
- data/mpg123/doc/Makefile.am +32 -0
- data/mpg123/doc/Makefile.in +490 -0
- data/mpg123/doc/PATENTS +39 -0
- data/mpg123/doc/README.3DNOW +56 -0
- data/mpg123/doc/README.gain +171 -0
- data/mpg123/doc/README.remote +218 -0
- data/mpg123/doc/ROAD_TO_LGPL +270 -0
- data/mpg123/doc/THANKS +13 -0
- data/mpg123/doc/TODO +63 -0
- data/mpg123/doc/doxy_examples.c +21 -0
- data/mpg123/doc/doxygen.conf +41 -0
- data/mpg123/doc/doxyhead.xhtml +12 -0
- data/mpg123/doc/examples/dump_seekindex.c +41 -0
- data/mpg123/doc/examples/extract_frames.c +92 -0
- data/mpg123/doc/examples/feedseek.c +238 -0
- data/mpg123/doc/examples/id3dump.c +178 -0
- data/mpg123/doc/examples/mpg123_to_wav.c +118 -0
- data/mpg123/doc/examples/mpglib.c +92 -0
- data/mpg123/doc/examples/scan.c +47 -0
- data/mpg123/doc/libmpg123_speed.txt +84 -0
- data/mpg123/equalize.dat +37 -0
- data/mpg123/libmpg123.pc.in +11 -0
- data/mpg123/m4/addrconfig.m4 +34 -0
- data/mpg123/m4/libtool.m4 +7982 -0
- data/mpg123/m4/ltoptions.m4 +384 -0
- data/mpg123/m4/ltsugar.m4 +123 -0
- data/mpg123/m4/ltversion.m4 +23 -0
- data/mpg123/m4/lt~obsolete.m4 +98 -0
- data/mpg123/makedll.sh +19 -0
- data/mpg123/man1/mpg123.1 +512 -0
- data/mpg123/mpg123.spec +68 -0
- data/mpg123/mpg123.spec.in +68 -0
- data/mpg123/ports/MSVC++/2005/libmpg123/libmpg123.vcproj +741 -0
- data/mpg123/ports/MSVC++/2008/dump_seekindex/dump_seekindex.vcproj +194 -0
- data/mpg123/ports/MSVC++/2008/feedseek/feedseek.vcproj +195 -0
- data/mpg123/ports/MSVC++/2008/libmpg123/libmpg123.vcproj +1357 -0
- data/mpg123/ports/MSVC++/2008/mpg123.sln +44 -0
- data/mpg123/ports/MSVC++/2008/mpglib/mpglib.vcproj +191 -0
- data/mpg123/ports/MSVC++/2008/scan/scan.vcproj +195 -0
- data/mpg123/ports/MSVC++/2008clr/2008clr.sln +81 -0
- data/mpg123/ports/MSVC++/2008clr/examples/ReplaceReaderclr/Program.cs +435 -0
- data/mpg123/ports/MSVC++/2008clr/examples/ReplaceReaderclr/Properties/AssemblyInfo.cs +36 -0
- data/mpg123/ports/MSVC++/2008clr/examples/ReplaceReaderclr/ReplaceReaderclr.csproj +72 -0
- data/mpg123/ports/MSVC++/2008clr/examples/feedseekclr/Program.cs +331 -0
- data/mpg123/ports/MSVC++/2008clr/examples/feedseekclr/Properties/AssemblyInfo.cs +36 -0
- data/mpg123/ports/MSVC++/2008clr/examples/feedseekclr/feedseekclr.csproj +71 -0
- data/mpg123/ports/MSVC++/2008clr/examples/scanclr/Program.cs +79 -0
- data/mpg123/ports/MSVC++/2008clr/examples/scanclr/Properties/AssemblyInfo.cs +36 -0
- data/mpg123/ports/MSVC++/2008clr/examples/scanclr/scanclr.csproj +70 -0
- data/mpg123/ports/MSVC++/2008clr/mpg123clr/AssemblyInfo.cpp +76 -0
- data/mpg123/ports/MSVC++/2008clr/mpg123clr/ReadMe.txt +165 -0
- data/mpg123/ports/MSVC++/2008clr/mpg123clr/advanced.cpp +91 -0
- data/mpg123/ports/MSVC++/2008clr/mpg123clr/advanced.h +130 -0
- data/mpg123/ports/MSVC++/2008clr/mpg123clr/dllmain.cpp +19 -0
- data/mpg123/ports/MSVC++/2008clr/mpg123clr/enum.h +218 -0
- data/mpg123/ports/MSVC++/2008clr/mpg123clr/error.cpp +48 -0
- data/mpg123/ports/MSVC++/2008clr/mpg123clr/error.h +134 -0
- data/mpg123/ports/MSVC++/2008clr/mpg123clr/id3v1.cpp +92 -0
- data/mpg123/ports/MSVC++/2008clr/mpg123clr/id3v1.h +132 -0
- data/mpg123/ports/MSVC++/2008clr/mpg123clr/id3v2.cpp +138 -0
- data/mpg123/ports/MSVC++/2008clr/mpg123clr/id3v2.h +152 -0
- data/mpg123/ports/MSVC++/2008clr/mpg123clr/mpg123clr.cpp +896 -0
- data/mpg123/ports/MSVC++/2008clr/mpg123clr/mpg123clr.h +953 -0
- data/mpg123/ports/MSVC++/2008clr/mpg123clr/mpg123clr.rc +102 -0
- data/mpg123/ports/MSVC++/2008clr/mpg123clr/mpg123clr.vcproj +328 -0
- data/mpg123/ports/MSVC++/2008clr/mpg123clr/resource.h +14 -0
- data/mpg123/ports/MSVC++/2008clr/mpg123clr/stdafx.cpp +8 -0
- data/mpg123/ports/MSVC++/2008clr/mpg123clr/stdafx.h +38 -0
- data/mpg123/ports/MSVC++/2008clr/mpg123clr/string.cpp +166 -0
- data/mpg123/ports/MSVC++/2008clr/mpg123clr/string.h +265 -0
- data/mpg123/ports/MSVC++/2008clr/mpg123clr/targetver.h +24 -0
- data/mpg123/ports/MSVC++/2008clr/mpg123clr/text.cpp +67 -0
- data/mpg123/ports/MSVC++/2008clr/mpg123clr/text.h +111 -0
- data/mpg123/ports/MSVC++/2010/dump_seekindex/dump_seekindex.vcxproj +90 -0
- data/mpg123/ports/MSVC++/2010/dump_seekindex/dump_seekindex.vcxproj.filters +6 -0
- data/mpg123/ports/MSVC++/2010/feedseek/feedseek.vcxproj +95 -0
- data/mpg123/ports/MSVC++/2010/feedseek/feedseek.vcxproj.filters +6 -0
- data/mpg123/ports/MSVC++/2010/libmpg123/libmpg123.vcxproj +960 -0
- data/mpg123/ports/MSVC++/2010/libmpg123/libmpg123.vcxproj.user +3 -0
- data/mpg123/ports/MSVC++/2010/libmpg123/yasm.exe +0 -0
- data/mpg123/ports/MSVC++/2010/mpg123.sln +38 -0
- data/mpg123/ports/MSVC++/2010/scan/scan.vcxproj +93 -0
- data/mpg123/ports/MSVC++/2010/scan/scan.vcxproj.filters +6 -0
- data/mpg123/ports/MSVC++/CMP3Stream/INCLUDE/CORE/CORE_FileIn.H +15 -0
- data/mpg123/ports/MSVC++/CMP3Stream/INCLUDE/CORE/SourceFilter_MP3.H +139 -0
- data/mpg123/ports/MSVC++/CMP3Stream/INCLUDE/IIEP_Def.H +206 -0
- data/mpg123/ports/MSVC++/CMP3Stream/INCLUDE/IIEP_FileIn.H +167 -0
- data/mpg123/ports/MSVC++/CMP3Stream/README +4 -0
- data/mpg123/ports/MSVC++/CMP3Stream/SOURCE/CORE_FileIn.CPP +462 -0
- data/mpg123/ports/MSVC++/CMP3Stream/SOURCE/CORE_Log.CPP +122 -0
- data/mpg123/ports/MSVC++/CMP3Stream/SOURCE/CORE_Mutex.CPP +35 -0
- data/mpg123/ports/MSVC++/CMP3Stream/SOURCE/SourceFilter_MP3Stream.CPP +586 -0
- data/mpg123/ports/MSVC++/CMP3Stream/libMPG123/PLACE_LIBMPG123_SOURCES_HERE +0 -0
- data/mpg123/ports/MSVC++/CMP3Stream/libMPG123/libMPG123.vcproj +245 -0
- data/mpg123/ports/MSVC++/config.h +35 -0
- data/mpg123/ports/MSVC++/examples/feedseek.c +240 -0
- data/mpg123/ports/MSVC++/examples/scan.c +47 -0
- data/mpg123/ports/MSVC++/mpg123.h +46 -0
- data/mpg123/ports/MSVC++/msvc.c +59 -0
- data/mpg123/ports/README +26 -0
- data/mpg123/ports/Sony_PSP/Makefile.psp +38 -0
- data/mpg123/ports/Sony_PSP/README +11 -0
- data/mpg123/ports/Sony_PSP/config.h +368 -0
- data/mpg123/ports/Sony_PSP/readers.c.patch +2 -0
- data/mpg123/ports/Xcode/config.h +197 -0
- data/mpg123/ports/Xcode/mpg123.h +17 -0
- data/mpg123/ports/Xcode/mpg123.xcodeproj/project.pbxproj +670 -0
- data/mpg123/ports/mpg123_.pas +478 -0
- data/mpg123/scripts/benchmark-cpu.pl +56 -0
- data/mpg123/scripts/tag_lyrics.py +76 -0
- data/mpg123/src/Makefile.am +186 -0
- data/mpg123/src/Makefile.in +1097 -0
- data/mpg123/src/audio.c +725 -0
- data/mpg123/src/audio.h +106 -0
- data/mpg123/src/buffer.c +312 -0
- data/mpg123/src/buffer.h +45 -0
- data/mpg123/src/common.c +240 -0
- data/mpg123/src/common.h +29 -0
- data/mpg123/src/config.h.in +436 -0
- data/mpg123/src/control_generic.c +809 -0
- data/mpg123/src/equalizer.c +48 -0
- data/mpg123/src/genre.c +271 -0
- data/mpg123/src/genre.h +15 -0
- data/mpg123/src/getlopt.c +148 -0
- data/mpg123/src/getlopt.h +77 -0
- data/mpg123/src/httpget.c +700 -0
- data/mpg123/src/httpget.h +66 -0
- data/mpg123/src/legacy_module.c +74 -0
- data/mpg123/src/libmpg123/Makefile.am +141 -0
- data/mpg123/src/libmpg123/Makefile.in +919 -0
- data/mpg123/src/libmpg123/compat.c +138 -0
- data/mpg123/src/libmpg123/compat.h +178 -0
- data/mpg123/src/libmpg123/dct36_3dnow.S +505 -0
- data/mpg123/src/libmpg123/dct36_3dnowext.S +512 -0
- data/mpg123/src/libmpg123/dct64.c +174 -0
- data/mpg123/src/libmpg123/dct64_3dnow.S +712 -0
- data/mpg123/src/libmpg123/dct64_3dnowext.S +714 -0
- data/mpg123/src/libmpg123/dct64_altivec.c +315 -0
- data/mpg123/src/libmpg123/dct64_i386.c +336 -0
- data/mpg123/src/libmpg123/dct64_i486.c +342 -0
- data/mpg123/src/libmpg123/dct64_mmx.S +811 -0
- data/mpg123/src/libmpg123/dct64_neon.S +297 -0
- data/mpg123/src/libmpg123/dct64_neon_float.S +270 -0
- data/mpg123/src/libmpg123/dct64_sse.S +454 -0
- data/mpg123/src/libmpg123/dct64_sse_float.S +401 -0
- data/mpg123/src/libmpg123/dct64_x86_64.S +464 -0
- data/mpg123/src/libmpg123/dct64_x86_64_float.S +426 -0
- data/mpg123/src/libmpg123/debug.h +171 -0
- data/mpg123/src/libmpg123/decode.h +268 -0
- data/mpg123/src/libmpg123/dither.c +119 -0
- data/mpg123/src/libmpg123/dither.h +23 -0
- data/mpg123/src/libmpg123/equalizer.c +17 -0
- data/mpg123/src/libmpg123/equalizer_3dnow.S +70 -0
- data/mpg123/src/libmpg123/feature.c +106 -0
- data/mpg123/src/libmpg123/format.c +521 -0
- data/mpg123/src/libmpg123/frame.c +1046 -0
- data/mpg123/src/libmpg123/frame.h +410 -0
- data/mpg123/src/libmpg123/gapless.h +119 -0
- data/mpg123/src/libmpg123/getbits.h +100 -0
- data/mpg123/src/libmpg123/getcpuflags.S +91 -0
- data/mpg123/src/libmpg123/getcpuflags.h +47 -0
- data/mpg123/src/libmpg123/huffman.h +340 -0
- data/mpg123/src/libmpg123/icy.c +32 -0
- data/mpg123/src/libmpg123/icy.h +38 -0
- data/mpg123/src/libmpg123/icy2utf8.c +438 -0
- data/mpg123/src/libmpg123/icy2utf8.h +10 -0
- data/mpg123/src/libmpg123/id3.c +999 -0
- data/mpg123/src/libmpg123/id3.h +43 -0
- data/mpg123/src/libmpg123/index.c +134 -0
- data/mpg123/src/libmpg123/index.h +59 -0
- data/mpg123/src/libmpg123/intsym.h +256 -0
- data/mpg123/src/libmpg123/l12_integer_tables.h +278 -0
- data/mpg123/src/libmpg123/l2tables.h +164 -0
- data/mpg123/src/libmpg123/l3_integer_tables.h +1002 -0
- data/mpg123/src/libmpg123/layer1.c +155 -0
- data/mpg123/src/libmpg123/layer2.c +371 -0
- data/mpg123/src/libmpg123/layer3.c +2053 -0
- data/mpg123/src/libmpg123/lfs_alias.c +252 -0
- data/mpg123/src/libmpg123/lfs_wrap.c +751 -0
- data/mpg123/src/libmpg123/libmpg123.c +1607 -0
- data/mpg123/src/libmpg123/mangle.h +74 -0
- data/mpg123/src/libmpg123/mpeghead.h +87 -0
- data/mpg123/src/libmpg123/mpg123.h.in +1075 -0
- data/mpg123/src/libmpg123/mpg123lib_intern.h +338 -0
- data/mpg123/src/libmpg123/ntom.c +148 -0
- data/mpg123/src/libmpg123/optimize.c +964 -0
- data/mpg123/src/libmpg123/optimize.h +219 -0
- data/mpg123/src/libmpg123/parse.c +1179 -0
- data/mpg123/src/libmpg123/parse.h +25 -0
- data/mpg123/src/libmpg123/reader.h +137 -0
- data/mpg123/src/libmpg123/readers.c +1235 -0
- data/mpg123/src/libmpg123/sample.h +152 -0
- data/mpg123/src/libmpg123/stringbuf.c +163 -0
- data/mpg123/src/libmpg123/synth.c +816 -0
- data/mpg123/src/libmpg123/synth.h +196 -0
- data/mpg123/src/libmpg123/synth_3dnow.S +318 -0
- data/mpg123/src/libmpg123/synth_3dnowext.S +6 -0
- data/mpg123/src/libmpg123/synth_8bit.c +142 -0
- data/mpg123/src/libmpg123/synth_8bit.h +86 -0
- data/mpg123/src/libmpg123/synth_altivec.c +1057 -0
- data/mpg123/src/libmpg123/synth_arm.S +271 -0
- data/mpg123/src/libmpg123/synth_arm_accurate.S +287 -0
- data/mpg123/src/libmpg123/synth_i486.c +252 -0
- data/mpg123/src/libmpg123/synth_i586.S +336 -0
- data/mpg123/src/libmpg123/synth_i586_dither.S +375 -0
- data/mpg123/src/libmpg123/synth_mmx.S +125 -0
- data/mpg123/src/libmpg123/synth_mono.h +64 -0
- data/mpg123/src/libmpg123/synth_neon.S +123 -0
- data/mpg123/src/libmpg123/synth_neon_accurate.S +173 -0
- data/mpg123/src/libmpg123/synth_neon_float.S +149 -0
- data/mpg123/src/libmpg123/synth_neon_s32.S +168 -0
- data/mpg123/src/libmpg123/synth_ntom.h +213 -0
- data/mpg123/src/libmpg123/synth_real.c +404 -0
- data/mpg123/src/libmpg123/synth_s32.c +411 -0
- data/mpg123/src/libmpg123/synth_sse.S +6 -0
- data/mpg123/src/libmpg123/synth_sse3d.h +246 -0
- data/mpg123/src/libmpg123/synth_sse_accurate.S +294 -0
- data/mpg123/src/libmpg123/synth_sse_float.S +241 -0
- data/mpg123/src/libmpg123/synth_sse_s32.S +306 -0
- data/mpg123/src/libmpg123/synth_stereo_neon.S +175 -0
- data/mpg123/src/libmpg123/synth_stereo_neon_accurate.S +262 -0
- data/mpg123/src/libmpg123/synth_stereo_neon_float.S +220 -0
- data/mpg123/src/libmpg123/synth_stereo_neon_s32.S +247 -0
- data/mpg123/src/libmpg123/synth_stereo_sse_accurate.S +508 -0
- data/mpg123/src/libmpg123/synth_stereo_sse_float.S +416 -0
- data/mpg123/src/libmpg123/synth_stereo_sse_s32.S +540 -0
- data/mpg123/src/libmpg123/synth_stereo_x86_64.S +335 -0
- data/mpg123/src/libmpg123/synth_stereo_x86_64_accurate.S +454 -0
- data/mpg123/src/libmpg123/synth_stereo_x86_64_float.S +396 -0
- data/mpg123/src/libmpg123/synth_stereo_x86_64_s32.S +473 -0
- data/mpg123/src/libmpg123/synth_x86_64.S +244 -0
- data/mpg123/src/libmpg123/synth_x86_64_accurate.S +301 -0
- data/mpg123/src/libmpg123/synth_x86_64_float.S +259 -0
- data/mpg123/src/libmpg123/synth_x86_64_s32.S +312 -0
- data/mpg123/src/libmpg123/synths.h +52 -0
- data/mpg123/src/libmpg123/tabinit.c +294 -0
- data/mpg123/src/libmpg123/tabinit_mmx.S +210 -0
- data/mpg123/src/libmpg123/testcpu.c +35 -0
- data/mpg123/src/libmpg123/true.h +14 -0
- data/mpg123/src/local.c +63 -0
- data/mpg123/src/local.h +21 -0
- data/mpg123/src/metaprint.c +373 -0
- data/mpg123/src/metaprint.h +17 -0
- data/mpg123/src/module.c +306 -0
- data/mpg123/src/module.h +48 -0
- data/mpg123/src/mpg123.c +1405 -0
- data/mpg123/src/mpg123app.h +171 -0
- data/mpg123/src/output/Makefile.am +213 -0
- data/mpg123/src/output/Makefile.in +1238 -0
- data/mpg123/src/output/aix.c +300 -0
- data/mpg123/src/output/alib.c +209 -0
- data/mpg123/src/output/alsa.c +297 -0
- data/mpg123/src/output/arts.c +117 -0
- data/mpg123/src/output/coreaudio.c +370 -0
- data/mpg123/src/output/dummy.c +78 -0
- data/mpg123/src/output/esd.c +167 -0
- data/mpg123/src/output/hp.c +184 -0
- data/mpg123/src/output/jack.c +450 -0
- data/mpg123/src/output/mint.c +197 -0
- data/mpg123/src/output/nas.c +335 -0
- data/mpg123/src/output/openal.c +197 -0
- data/mpg123/src/output/os2.c +665 -0
- data/mpg123/src/output/oss.c +319 -0
- data/mpg123/src/output/portaudio.c +255 -0
- data/mpg123/src/output/pulse.c +164 -0
- data/mpg123/src/output/sdl.c +206 -0
- data/mpg123/src/output/sgi.c +213 -0
- data/mpg123/src/output/sndio.c +161 -0
- data/mpg123/src/output/sun.c +281 -0
- data/mpg123/src/output/win32.c +229 -0
- data/mpg123/src/playlist.c +596 -0
- data/mpg123/src/playlist.h +52 -0
- data/mpg123/src/resolver.c +319 -0
- data/mpg123/src/resolver.h +25 -0
- data/mpg123/src/sfifo.c +146 -0
- data/mpg123/src/sfifo.h +95 -0
- data/mpg123/src/streamdump.c +74 -0
- data/mpg123/src/streamdump.h +20 -0
- data/mpg123/src/term.c +479 -0
- data/mpg123/src/term.h +81 -0
- data/mpg123/src/tests/noise.c +52 -0
- data/mpg123/src/tests/plain_id3.c +109 -0
- data/mpg123/src/tests/seek_accuracy.c +261 -0
- data/mpg123/src/tests/seek_whence.c +56 -0
- data/mpg123/src/tests/testtext.h +34 -0
- data/mpg123/src/tests/text.c +80 -0
- data/mpg123/src/wav.c +464 -0
- data/mpg123/src/wavhead.h +68 -0
- data/mpg123/src/win32_net.c +599 -0
- data/mpg123/src/win32_support.c +191 -0
- data/mpg123/src/win32_support.h +152 -0
- data/mpg123/src/xfermem.c +321 -0
- data/mpg123/src/xfermem.h +74 -0
- data/mpg123/windows-builds.sh +137 -0
- data/msvc/lib/OpenAL32.lib +0 -0
- data/spec/fixtures/heal.ogg +0 -0
- data/spec/fixtures/tone_up.wav +0 -0
- data/spec/seal/buffer_spec.rb +37 -0
- data/spec/seal/core_spec.rb +29 -0
- data/spec/seal/effect_slot_spec.rb +38 -0
- data/spec/seal/listener_spec.rb +33 -0
- data/spec/seal/reverb_spec.rb +51 -0
- data/spec/seal/source_spec.rb +370 -0
- data/spec/seal/stream_spec.rb +38 -0
- data/spec/spec_helper.rb +45 -0
- data/spec/support/attribute_examples.rb +75 -0
- data/spec/support/audio_object_with_format.rb +27 -0
- data/spec/support/movable_object.rb +22 -0
- data/src/libogg/bitwise.c +857 -0
- data/src/libogg/framing.c +2093 -0
- data/src/libvorbis/backends.h +144 -0
- data/src/libvorbis/bitrate.c +253 -0
- data/src/libvorbis/bitrate.h +59 -0
- data/src/libvorbis/block.c +1046 -0
- data/src/libvorbis/codebook.c +484 -0
- data/src/libvorbis/codebook.h +119 -0
- data/src/libvorbis/codec_internal.h +167 -0
- data/src/libvorbis/envelope.c +375 -0
- data/src/libvorbis/envelope.h +80 -0
- data/src/libvorbis/floor0.c +221 -0
- data/src/libvorbis/floor1.c +1100 -0
- data/src/libvorbis/highlevel.h +58 -0
- data/src/libvorbis/info.c +668 -0
- data/src/libvorbis/lookup.c +94 -0
- data/src/libvorbis/lookup.h +32 -0
- data/src/libvorbis/lookup_data.h +192 -0
- data/src/libvorbis/lpc.c +160 -0
- data/src/libvorbis/lpc.h +29 -0
- data/src/libvorbis/lsp.c +456 -0
- data/src/libvorbis/lsp.h +28 -0
- data/src/libvorbis/mapping0.c +816 -0
- data/src/libvorbis/masking.h +785 -0
- data/src/libvorbis/mdct.c +563 -0
- data/src/libvorbis/mdct.h +71 -0
- data/src/libvorbis/misc.h +57 -0
- data/src/libvorbis/os.h +186 -0
- data/src/libvorbis/psy.c +1206 -0
- data/src/libvorbis/psy.h +154 -0
- data/src/libvorbis/registry.c +45 -0
- data/src/libvorbis/registry.h +32 -0
- data/src/libvorbis/res0.c +889 -0
- data/src/libvorbis/scales.h +90 -0
- data/src/libvorbis/sharedbook.c +579 -0
- data/src/libvorbis/smallft.c +1255 -0
- data/src/libvorbis/smallft.h +34 -0
- data/src/libvorbis/synthesis.c +184 -0
- data/src/libvorbis/vorbisfile.c +2337 -0
- data/src/libvorbis/window.c +2135 -0
- data/src/libvorbis/window.h +26 -0
- data/src/rubyext.c +2329 -0
- data/src/seal/buf.c +124 -0
- data/src/seal/core.c +283 -0
- data/src/seal/efs.c +74 -0
- data/src/seal/err.c +118 -0
- data/src/seal/fmt.c +86 -0
- data/src/seal/listener.c +111 -0
- data/src/seal/mpg.c +174 -0
- data/src/seal/mpg.h +24 -0
- data/src/seal/ov.c +180 -0
- data/src/seal/ov.h +22 -0
- data/src/seal/raw.c +59 -0
- data/src/seal/reader.c +102 -0
- data/src/seal/reader.h +59 -0
- data/src/seal/rvb.c +368 -0
- data/src/seal/src.c +654 -0
- data/src/seal/stream.c +109 -0
- data/src/seal/threading.c +66 -0
- data/src/seal/threading.h +20 -0
- data/src/seal/wav.c +297 -0
- data/src/seal/wav.h +23 -0
- data/src/win32api.rb +29 -0
- metadata +563 -0
@@ -0,0 +1,32 @@
|
|
1
|
+
/*
|
2
|
+
icy: Puny code to pretend for a serious ICY data structure.
|
3
|
+
|
4
|
+
copyright 2007 by the mpg123 project - free software under the terms of the LGPL 2.1
|
5
|
+
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
6
|
+
initially written by Thomas Orgis
|
7
|
+
*/
|
8
|
+
|
9
|
+
#include "icy.h"
|
10
|
+
|
11
|
+
void init_icy(struct icy_meta *icy)
|
12
|
+
{
|
13
|
+
icy->data = NULL;
|
14
|
+
}
|
15
|
+
|
16
|
+
void clear_icy(struct icy_meta *icy)
|
17
|
+
{
|
18
|
+
if(icy->data != NULL) free(icy->data);
|
19
|
+
init_icy(icy);
|
20
|
+
}
|
21
|
+
|
22
|
+
void reset_icy(struct icy_meta *icy)
|
23
|
+
{
|
24
|
+
clear_icy(icy);
|
25
|
+
init_icy(icy);
|
26
|
+
}
|
27
|
+
/*void set_icy(struct icy_meta *icy, char* new_data)
|
28
|
+
{
|
29
|
+
if(icy->data) free(icy->data);
|
30
|
+
icy->data = new_data;
|
31
|
+
icy->changed = 1;
|
32
|
+
}*/
|
@@ -0,0 +1,38 @@
|
|
1
|
+
/*
|
2
|
+
icy: support for SHOUTcast ICY meta info, an attempt to keep it organized
|
3
|
+
|
4
|
+
copyright 2006-7 by the mpg123 project - free software under the terms of the LGPL 2.1
|
5
|
+
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
6
|
+
initially written by Thomas Orgis and modelled after patch by Honza
|
7
|
+
*/
|
8
|
+
#ifndef MPG123_ICY_H
|
9
|
+
#define MPG123_ICY_H
|
10
|
+
|
11
|
+
#ifndef NO_ICY
|
12
|
+
|
13
|
+
#include "compat.h"
|
14
|
+
#include "mpg123.h"
|
15
|
+
|
16
|
+
struct icy_meta
|
17
|
+
{
|
18
|
+
char* data;
|
19
|
+
off_t interval;
|
20
|
+
off_t next;
|
21
|
+
};
|
22
|
+
|
23
|
+
void init_icy(struct icy_meta *);
|
24
|
+
void clear_icy(struct icy_meta *);
|
25
|
+
void reset_icy(struct icy_meta *);
|
26
|
+
|
27
|
+
#else
|
28
|
+
|
29
|
+
#undef init_icy
|
30
|
+
#define init_icy(a)
|
31
|
+
#undef clear_icy
|
32
|
+
#define clear_icy(a)
|
33
|
+
#undef reset_icy
|
34
|
+
#define reset_icy(a)
|
35
|
+
|
36
|
+
#endif /* NO_ICY */
|
37
|
+
|
38
|
+
#endif
|
@@ -0,0 +1,438 @@
|
|
1
|
+
/* mpg123 note: This is BSD-licensed code that is no problem for mpg123 usage under LGPL.
|
2
|
+
It's Free, understood? ;-) */
|
3
|
+
|
4
|
+
/* Another note: This code is basically written by Thorsten Glaser,
|
5
|
+
Thomas Orgis did just some rearrangements and comments. */
|
6
|
+
|
7
|
+
/*-
|
8
|
+
* Copyright (c) 2008
|
9
|
+
* Thorsten Glaser <tg@mirbsd.org>
|
10
|
+
*
|
11
|
+
* Provided that these terms and disclaimer and all copyright notices
|
12
|
+
* are retained or reproduced in an accompanying document, permission
|
13
|
+
* is granted to deal in this work without restriction, including un-
|
14
|
+
* limited rights to use, publicly perform, distribute, sell, modify,
|
15
|
+
* merge, give away, or sublicence.
|
16
|
+
*
|
17
|
+
* This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to
|
18
|
+
* the utmost extent permitted by applicable law, neither express nor
|
19
|
+
* implied; without malicious intent or gross negligence. In no event
|
20
|
+
* may a licensor, author or contributor be held liable for indirect,
|
21
|
+
* direct, other damage, loss, or other issues arising in any way out
|
22
|
+
* of dealing in the work, even if advised of the possibility of such
|
23
|
+
* damage or existence of a defect, except proven that it results out
|
24
|
+
* of said person's immediate fault when using the work as intended.
|
25
|
+
*-
|
26
|
+
* Convert from ICY encoding (windows-1252 codepage) to UTF-8
|
27
|
+
*/
|
28
|
+
|
29
|
+
/* Includes string and stdlib headers... */
|
30
|
+
#include "compat.h"
|
31
|
+
|
32
|
+
/* ThOr: too lazy for this type check; also we use char/short all around anyway.
|
33
|
+
Of cource, it would be the proper way to use _these_ kind of types all around. */
|
34
|
+
#define uint8_t unsigned char
|
35
|
+
#define uint16_t unsigned short
|
36
|
+
|
37
|
+
static const uint8_t cp1252_utf8[] = {
|
38
|
+
/* 0x00 @ 0 */ 0x00,
|
39
|
+
/* 0x01 @ 1 */ 0x01,
|
40
|
+
/* 0x02 @ 2 */ 0x02,
|
41
|
+
/* 0x03 @ 3 */ 0x03,
|
42
|
+
/* 0x04 @ 4 */ 0x04,
|
43
|
+
/* 0x05 @ 5 */ 0x05,
|
44
|
+
/* 0x06 @ 6 */ 0x06,
|
45
|
+
/* 0x07 @ 7 */ 0x07,
|
46
|
+
/* 0x08 @ 8 */ 0x08,
|
47
|
+
/* 0x09 @ 9 */ 0x09,
|
48
|
+
/* 0x0A @ 10 */ 0x0A,
|
49
|
+
/* 0x0B @ 11 */ 0x0B,
|
50
|
+
/* 0x0C @ 12 */ 0x0C,
|
51
|
+
/* 0x0D @ 13 */ 0x0D,
|
52
|
+
/* 0x0E @ 14 */ 0x0E,
|
53
|
+
/* 0x0F @ 15 */ 0x0F,
|
54
|
+
/* 0x10 @ 16 */ 0x10,
|
55
|
+
/* 0x11 @ 17 */ 0x11,
|
56
|
+
/* 0x12 @ 18 */ 0x12,
|
57
|
+
/* 0x13 @ 19 */ 0x13,
|
58
|
+
/* 0x14 @ 20 */ 0x14,
|
59
|
+
/* 0x15 @ 21 */ 0x15,
|
60
|
+
/* 0x16 @ 22 */ 0x16,
|
61
|
+
/* 0x17 @ 23 */ 0x17,
|
62
|
+
/* 0x18 @ 24 */ 0x18,
|
63
|
+
/* 0x19 @ 25 */ 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x3D,
|
100
|
+
/* 0x3E @ 62 */ 0x3E,
|
101
|
+
/* 0x3F @ 63 */ 0x3F,
|
102
|
+
/* 0x40 @ 64 */ 0x40,
|
103
|
+
/* 0x41 @ 65 */ 0x41,
|
104
|
+
/* 0x42 @ 66 */ 0x42,
|
105
|
+
/* 0x43 @ 67 */ 0x43,
|
106
|
+
/* 0x44 @ 68 */ 0x44,
|
107
|
+
/* 0x45 @ 69 */ 0x45,
|
108
|
+
/* 0x46 @ 70 */ 0x46,
|
109
|
+
/* 0x47 @ 71 */ 0x47,
|
110
|
+
/* 0x48 @ 72 */ 0x48,
|
111
|
+
/* 0x49 @ 73 */ 0x49,
|
112
|
+
/* 0x4A @ 74 */ 0x4A,
|
113
|
+
/* 0x4B @ 75 */ 0x4B,
|
114
|
+
/* 0x4C @ 76 */ 0x4C,
|
115
|
+
/* 0x4D @ 77 */ 0x4D,
|
116
|
+
/* 0x4E @ 78 */ 0x4E,
|
117
|
+
/* 0x4F @ 79 */ 0x4F,
|
118
|
+
/* 0x50 @ 80 */ 0x50,
|
119
|
+
/* 0x51 @ 81 */ 0x51,
|
120
|
+
/* 0x52 @ 82 */ 0x52,
|
121
|
+
/* 0x53 @ 83 */ 0x53,
|
122
|
+
/* 0x54 @ 84 */ 0x54,
|
123
|
+
/* 0x55 @ 85 */ 0x55,
|
124
|
+
/* 0x56 @ 86 */ 0x56,
|
125
|
+
/* 0x57 @ 87 */ 0x57,
|
126
|
+
/* 0x58 @ 88 */ 0x58,
|
127
|
+
/* 0x59 @ 89 */ 0x59,
|
128
|
+
/* 0x5A @ 90 */ 0x5A,
|
129
|
+
/* 0x5B @ 91 */ 0x5B,
|
130
|
+
/* 0x5C @ 92 */ 0x5C,
|
131
|
+
/* 0x5D @ 93 */ 0x5D,
|
132
|
+
/* 0x5E @ 94 */ 0x5E,
|
133
|
+
/* 0x5F @ 95 */ 0x5F,
|
134
|
+
/* 0x60 @ 96 */ 0x60,
|
135
|
+
/* 0x61 @ 97 */ 0x61,
|
136
|
+
/* 0x62 @ 98 */ 0x62,
|
137
|
+
/* 0x63 @ 99 */ 0x63,
|
138
|
+
/* 0x64 @ 100 */ 0x64,
|
139
|
+
/* 0x65 @ 101 */ 0x65,
|
140
|
+
/* 0x66 @ 102 */ 0x66,
|
141
|
+
/* 0x67 @ 103 */ 0x67,
|
142
|
+
/* 0x68 @ 104 */ 0x68,
|
143
|
+
/* 0x69 @ 105 */ 0x69,
|
144
|
+
/* 0x6A @ 106 */ 0x6A,
|
145
|
+
/* 0x6B @ 107 */ 0x6B,
|
146
|
+
/* 0x6C @ 108 */ 0x6C,
|
147
|
+
/* 0x6D @ 109 */ 0x6D,
|
148
|
+
/* 0x6E @ 110 */ 0x6E,
|
149
|
+
/* 0x6F @ 111 */ 0x6F,
|
150
|
+
/* 0x70 @ 112 */ 0x70,
|
151
|
+
/* 0x71 @ 113 */ 0x71,
|
152
|
+
/* 0x72 @ 114 */ 0x72,
|
153
|
+
/* 0x73 @ 115 */ 0x73,
|
154
|
+
/* 0x74 @ 116 */ 0x74,
|
155
|
+
/* 0x75 @ 117 */ 0x75,
|
156
|
+
/* 0x76 @ 118 */ 0x76,
|
157
|
+
/* 0x77 @ 119 */ 0x77,
|
158
|
+
/* 0x78 @ 120 */ 0x78,
|
159
|
+
/* 0x79 @ 121 */ 0x79,
|
160
|
+
/* 0x7A @ 122 */ 0x7A,
|
161
|
+
/* 0x7B @ 123 */ 0x7B,
|
162
|
+
/* 0x7C @ 124 */ 0x7C,
|
163
|
+
/* 0x7D @ 125 */ 0x7D,
|
164
|
+
/* 0x7E @ 126 */ 0x7E,
|
165
|
+
/* 0x7F @ 127 */ 0x7F,
|
166
|
+
/* 0x80 @ 128 */ 0xE2, 0x82, 0xAC,
|
167
|
+
/* 0x81 @ 131 */ 0xEF, 0xBF, 0xBD,
|
168
|
+
/* 0x82 @ 134 */ 0xE2, 0x80, 0x9A,
|
169
|
+
/* 0x83 @ 137 */ 0xC6, 0x92,
|
170
|
+
/* 0x84 @ 139 */ 0xE2, 0x80, 0x9E,
|
171
|
+
/* 0x85 @ 142 */ 0xE2, 0x80, 0xA6,
|
172
|
+
/* 0x86 @ 145 */ 0xE2, 0x80, 0xA0,
|
173
|
+
/* 0x87 @ 148 */ 0xE2, 0x80, 0xA1,
|
174
|
+
/* 0x88 @ 151 */ 0xCB, 0x86,
|
175
|
+
/* 0x89 @ 153 */ 0xE2, 0x80, 0xB0,
|
176
|
+
/* 0x8A @ 156 */ 0xC5, 0xA0,
|
177
|
+
/* 0x8B @ 158 */ 0xE2, 0x80, 0xB9,
|
178
|
+
/* 0x8C @ 161 */ 0xC5, 0x92,
|
179
|
+
/* 0x8D @ 163 */ 0xEF, 0xBF, 0xBD,
|
180
|
+
/* 0x8E @ 166 */ 0xC5, 0xBD,
|
181
|
+
/* 0x8F @ 168 */ 0xEF, 0xBF, 0xBD,
|
182
|
+
/* 0x90 @ 171 */ 0xEF, 0xBF, 0xBD,
|
183
|
+
/* 0x91 @ 174 */ 0xE2, 0x80, 0x98,
|
184
|
+
/* 0x92 @ 177 */ 0xE2, 0x80, 0x99,
|
185
|
+
/* 0x93 @ 180 */ 0xE2, 0x80, 0x9C,
|
186
|
+
/* 0x94 @ 183 */ 0xE2, 0x80, 0x9D,
|
187
|
+
/* 0x95 @ 186 */ 0xE2, 0x80, 0xA2,
|
188
|
+
/* 0x96 @ 189 */ 0xE2, 0x80, 0x93,
|
189
|
+
/* 0x97 @ 192 */ 0xE2, 0x80, 0x94,
|
190
|
+
/* 0x98 @ 195 */ 0xCB, 0x9C,
|
191
|
+
/* 0x99 @ 197 */ 0xE2, 0x84, 0xA2,
|
192
|
+
/* 0x9A @ 200 */ 0xC5, 0xA1,
|
193
|
+
/* 0x9B @ 202 */ 0xE2, 0x80, 0xBA,
|
194
|
+
/* 0x9C @ 205 */ 0xC5, 0x93,
|
195
|
+
/* 0x9D @ 207 */ 0xEF, 0xBF, 0xBD,
|
196
|
+
/* 0x9E @ 210 */ 0xC5, 0xBE,
|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C2, 0xBB,
|
226
|
+
/* 0xBC @ 270 */ 0xC2, 0xBC,
|
227
|
+
/* 0xBD @ 272 */ 0xC2, 0xBD,
|
228
|
+
/* 0xBE @ 274 */ 0xC2, 0xBE,
|
229
|
+
/* 0xBF @ 276 */ 0xC2, 0xBF,
|
230
|
+
/* 0xC0 @ 278 */ 0xC3, 0x80,
|
231
|
+
/* 0xC1 @ 280 */ 0xC3, 0x81,
|
232
|
+
/* 0xC2 @ 282 */ 0xC3, 0x82,
|
233
|
+
/* 0xC3 @ 284 */ 0xC3, 0x83,
|
234
|
+
/* 0xC4 @ 286 */ 0xC3, 0x84,
|
235
|
+
/* 0xC5 @ 288 */ 0xC3, 0x85,
|
236
|
+
/* 0xC6 @ 290 */ 0xC3, 0x86,
|
237
|
+
/* 0xC7 @ 292 */ 0xC3, 0x87,
|
238
|
+
/* 0xC8 @ 294 */ 0xC3, 0x88,
|
239
|
+
/* 0xC9 @ 296 */ 0xC3, 0x89,
|
240
|
+
/* 0xCA @ 298 */ 0xC3, 0x8A,
|
241
|
+
/* 0xCB @ 300 */ 0xC3, 0x8B,
|
242
|
+
/* 0xCC @ 302 */ 0xC3, 0x8C,
|
243
|
+
/* 0xCD @ 304 */ 0xC3, 0x8D,
|
244
|
+
/* 0xCE @ 306 */ 0xC3, 0x8E,
|
245
|
+
/* 0xCF @ 308 */ 0xC3, 0x8F,
|
246
|
+
/* 0xD0 @ 310 */ 0xC3, 0x90,
|
247
|
+
/* 0xD1 @ 312 */ 0xC3, 0x91,
|
248
|
+
/* 0xD2 @ 314 */ 0xC3, 0x92,
|
249
|
+
/* 0xD3 @ 316 */ 0xC3, 0x93,
|
250
|
+
/* 0xD4 @ 318 */ 0xC3, 0x94,
|
251
|
+
/* 0xD5 @ 320 */ 0xC3, 0x95,
|
252
|
+
/* 0xD6 @ 322 */ 0xC3, 0x96,
|
253
|
+
/* 0xD7 @ 324 */ 0xC3, 0x97,
|
254
|
+
/* 0xD8 @ 326 */ 0xC3, 0x98,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 0xB5,
|
284
|
+
/* 0xF6 @ 386 */ 0xC3, 0xB6,
|
285
|
+
/* 0xF7 @ 388 */ 0xC3, 0xB7,
|
286
|
+
/* 0xF8 @ 390 */ 0xC3, 0xB8,
|
287
|
+
/* 0xF9 @ 392 */ 0xC3, 0xB9,
|
288
|
+
/* 0xFA @ 394 */ 0xC3, 0xBA,
|
289
|
+
/* 0xFB @ 396 */ 0xC3, 0xBB,
|
290
|
+
/* 0xFC @ 398 */ 0xC3, 0xBC,
|
291
|
+
/* 0xFD @ 400 */ 0xC3, 0xBD,
|
292
|
+
/* 0xFE @ 402 */ 0xC3, 0xBE,
|
293
|
+
/* 0xFF @ 404 */ 0xC3, 0xBF,
|
294
|
+
};
|
295
|
+
|
296
|
+
static const uint16_t tblofs[257] = {
|
297
|
+
/* 0x00 */ 0, 1, 2, 3, 4, 5, 6, 7,
|
298
|
+
/* 0x08 */ 8, 9, 10, 11, 12, 13, 14, 15,
|
299
|
+
/* 0x10 */ 16, 17, 18, 19, 20, 21, 22, 23,
|
300
|
+
/* 0x18 */ 24, 25, 26, 27, 28, 29, 30, 31,
|
301
|
+
/* 0x20 */ 32, 33, 34, 35, 36, 37, 38, 39,
|
302
|
+
/* 0x28 */ 40, 41, 42, 43, 44, 45, 46, 47,
|
303
|
+
/* 0x30 */ 48, 49, 50, 51, 52, 53, 54, 55,
|
304
|
+
/* 0x38 */ 56, 57, 58, 59, 60, 61, 62, 63,
|
305
|
+
/* 0x40 */ 64, 65, 66, 67, 68, 69, 70, 71,
|
306
|
+
/* 0x48 */ 72, 73, 74, 75, 76, 77, 78, 79,
|
307
|
+
/* 0x50 */ 80, 81, 82, 83, 84, 85, 86, 87,
|
308
|
+
/* 0x58 */ 88, 89, 90, 91, 92, 93, 94, 95,
|
309
|
+
/* 0x60 */ 96, 97, 98, 99, 100, 101, 102, 103,
|
310
|
+
/* 0x68 */ 104, 105, 106, 107, 108, 109, 110, 111,
|
311
|
+
/* 0x70 */ 112, 113, 114, 115, 116, 117, 118, 119,
|
312
|
+
/* 0x78 */ 120, 121, 122, 123, 124, 125, 126, 127,
|
313
|
+
/* 0x80 */ 128, 131, 134, 137, 139, 142, 145, 148,
|
314
|
+
/* 0x88 */ 151, 153, 156, 158, 161, 163, 166, 168,
|
315
|
+
/* 0x90 */ 171, 174, 177, 180, 183, 186, 189, 192,
|
316
|
+
/* 0x98 */ 195, 197, 200, 202, 205, 207, 210, 212,
|
317
|
+
/* 0xA0 */ 214, 216, 218, 220, 222, 224, 226, 228,
|
318
|
+
/* 0xA8 */ 230, 232, 234, 236, 238, 240, 242, 244,
|
319
|
+
/* 0xB0 */ 246, 248, 250, 252, 254, 256, 258, 260,
|
320
|
+
/* 0xB8 */ 262, 264, 266, 268, 270, 272, 274, 276,
|
321
|
+
/* 0xC0 */ 278, 280, 282, 284, 286, 288, 290, 292,
|
322
|
+
/* 0xC8 */ 294, 296, 298, 300, 302, 304, 306, 308,
|
323
|
+
/* 0xD0 */ 310, 312, 314, 316, 318, 320, 322, 324,
|
324
|
+
/* 0xD8 */ 326, 328, 330, 332, 334, 336, 338, 340,
|
325
|
+
/* 0xE0 */ 342, 344, 346, 348, 350, 352, 354, 356,
|
326
|
+
/* 0xE8 */ 358, 360, 362, 364, 366, 368, 370, 372,
|
327
|
+
/* 0xF0 */ 374, 376, 378, 380, 382, 384, 386, 388,
|
328
|
+
/* 0xF8 */ 390, 392, 394, 396, 398, 400, 402, 404,
|
329
|
+
/* sizeof (cp1252_utf8) */ 406
|
330
|
+
};
|
331
|
+
|
332
|
+
/* Check if a string qualifies as UTF-8. */
|
333
|
+
static int
|
334
|
+
is_utf8(const char* src)
|
335
|
+
{
|
336
|
+
uint8_t ch;
|
337
|
+
size_t i;
|
338
|
+
const uint8_t* s = (const uint8_t*) src;
|
339
|
+
|
340
|
+
/* We make a loop over every character, until we find a null one.
|
341
|
+
Remember: The string is supposed to end with a NUL, so ahead checks are safe. */
|
342
|
+
while ((ch = *s++)) {
|
343
|
+
/* Ye olde 7bit ASCII chars 'rr fine for anything */
|
344
|
+
if(ch < 0x80) continue;
|
345
|
+
|
346
|
+
/* Now, we watch out for non-UTF conform sequences. */
|
347
|
+
else if ((ch < 0xC2) || (ch > 0xFD))
|
348
|
+
return 0;
|
349
|
+
/* check for some misformed sequences */
|
350
|
+
if (((ch == 0xC2) && (s[0] < 0xA0)) ||
|
351
|
+
((ch == 0xEF) && (s[0] == 0xBF) && (s[1] > 0xBD)))
|
352
|
+
/* XXX add more for outside the BMP */
|
353
|
+
return 0;
|
354
|
+
|
355
|
+
/* Check the continuation bytes. */
|
356
|
+
if (ch < 0xE0) i = 1;
|
357
|
+
else if (ch < 0xF0) i = 2;
|
358
|
+
else if (ch < 0xF8) i = 3;
|
359
|
+
else if (ch < 0xFC) i = 4;
|
360
|
+
else
|
361
|
+
i = 5;
|
362
|
+
|
363
|
+
while (i--)
|
364
|
+
if ((*s++ & 0xC0) != 0x80)
|
365
|
+
return 0;
|
366
|
+
}
|
367
|
+
|
368
|
+
/* If no check failed, the string indeed looks like valid UTF-8. */
|
369
|
+
return 1;
|
370
|
+
}
|
371
|
+
|
372
|
+
/* The main conversion routine.
|
373
|
+
ICY in CP-1252 (or UTF-8 alreay) to UTF-8 encoded string.
|
374
|
+
If force is applied, it will always encode to UTF-8, without checking. */
|
375
|
+
char *
|
376
|
+
icy2utf8(const char *src, int force)
|
377
|
+
{
|
378
|
+
const uint8_t *s = (const uint8_t *)src;
|
379
|
+
size_t srclen, dstlen, i, k;
|
380
|
+
uint8_t ch, *d;
|
381
|
+
char *dst;
|
382
|
+
|
383
|
+
/* Some funny streams from Apple/iTunes give ICY info in UTF-8 already.
|
384
|
+
So, be prepared and don't try to re-encode such. Unless forced. */
|
385
|
+
if(!force && is_utf8(src)) return (strdup(src));
|
386
|
+
|
387
|
+
srclen = strlen(src) + 1;
|
388
|
+
/* allocate conservatively */
|
389
|
+
if ((d = malloc(srclen * 3)) == NULL)
|
390
|
+
return (NULL);
|
391
|
+
|
392
|
+
i = 0;
|
393
|
+
dstlen = 0;
|
394
|
+
while (i < srclen) {
|
395
|
+
ch = s[i++];
|
396
|
+
k = tblofs[ch];
|
397
|
+
while (k < tblofs[ch + 1])
|
398
|
+
d[dstlen++] = cp1252_utf8[k++];
|
399
|
+
}
|
400
|
+
|
401
|
+
/* dstlen includes trailing NUL since srclen also does */
|
402
|
+
if ((dst = realloc(d, dstlen)) == NULL) {
|
403
|
+
free(d);
|
404
|
+
return (NULL);
|
405
|
+
}
|
406
|
+
return (dst);
|
407
|
+
}
|
408
|
+
|
409
|
+
/* This stuff is for testing only. */
|
410
|
+
#ifdef TEST
|
411
|
+
static const char intext[] = "\225 Gr\374\337e kosten 0,55 \200\205";
|
412
|
+
|
413
|
+
#include <stdio.h>
|
414
|
+
|
415
|
+
int
|
416
|
+
main(void)
|
417
|
+
{
|
418
|
+
char *t, *t2;
|
419
|
+
|
420
|
+
if ((t = icy2utf8(intext, 0)) == NULL) {
|
421
|
+
fprintf(stderr, "out of memory\n");
|
422
|
+
return (1);
|
423
|
+
}
|
424
|
+
|
425
|
+
/* make sure it won't be converted twice */
|
426
|
+
if ((t2 = icy2utf8(t), 0) == NULL) {
|
427
|
+
fprintf(stderr, "out of memory\n");
|
428
|
+
return (1);
|
429
|
+
}
|
430
|
+
|
431
|
+
printf("Result is:\t\343\200\214%s\343\200\215\n"
|
432
|
+
"\t\t\343\200\214%s\343\200\215\n", t, t2);
|
433
|
+
|
434
|
+
free(t);
|
435
|
+
free(t2);
|
436
|
+
return (0);
|
437
|
+
}
|
438
|
+
#endif
|