seal 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (421) hide show
  1. data/.yardopts +1 -0
  2. data/LICENSE +13 -0
  3. data/README.md +265 -0
  4. data/ext/seal/extconf.rb +45 -0
  5. data/include/al/al.h +724 -0
  6. data/include/al/alc.h +277 -0
  7. data/include/al/efx-presets.h +402 -0
  8. data/include/al/efx.h +758 -0
  9. data/include/mpg123/mpg123.h +1034 -0
  10. data/include/ogg/config_types.h +25 -0
  11. data/include/ogg/ogg.h +210 -0
  12. data/include/ogg/os_types.h +147 -0
  13. data/include/seal.h +23 -0
  14. data/include/seal/buf.h +143 -0
  15. data/include/seal/core.h +95 -0
  16. data/include/seal/efs.h +112 -0
  17. data/include/seal/err.h +93 -0
  18. data/include/seal/fmt.h +58 -0
  19. data/include/seal/listener.h +103 -0
  20. data/include/seal/raw.h +86 -0
  21. data/include/seal/rvb.h +520 -0
  22. data/include/seal/src.h +413 -0
  23. data/include/seal/stream.h +81 -0
  24. data/include/vorbis/codec.h +243 -0
  25. data/include/vorbis/vorbisfile.h +206 -0
  26. data/mpg123/AUTHORS +150 -0
  27. data/mpg123/COPYING +773 -0
  28. data/mpg123/ChangeLog +3 -0
  29. data/mpg123/INSTALL +111 -0
  30. data/mpg123/Makefile.am +99 -0
  31. data/mpg123/Makefile.in +1043 -0
  32. data/mpg123/NEWS +1200 -0
  33. data/mpg123/NEWS.libmpg123 +133 -0
  34. data/mpg123/README +203 -0
  35. data/mpg123/TODO +38 -0
  36. data/mpg123/aclocal.m4 +1168 -0
  37. data/mpg123/build/config.guess +1530 -0
  38. data/mpg123/build/config.sub +1782 -0
  39. data/mpg123/build/depcomp +707 -0
  40. data/mpg123/build/install-sh +527 -0
  41. data/mpg123/build/ltmain.sh +9655 -0
  42. data/mpg123/build/missing +330 -0
  43. data/mpg123/configure +20267 -0
  44. data/mpg123/configure.ac +2178 -0
  45. data/mpg123/doc/ACCURACY +2 -0
  46. data/mpg123/doc/BENCHMARKING +110 -0
  47. data/mpg123/doc/BUGS +3 -0
  48. data/mpg123/doc/CONTACT +17 -0
  49. data/mpg123/doc/LICENSE +22 -0
  50. data/mpg123/doc/Makefile.am +32 -0
  51. data/mpg123/doc/Makefile.in +490 -0
  52. data/mpg123/doc/PATENTS +39 -0
  53. data/mpg123/doc/README.3DNOW +56 -0
  54. data/mpg123/doc/README.gain +171 -0
  55. data/mpg123/doc/README.remote +218 -0
  56. data/mpg123/doc/ROAD_TO_LGPL +270 -0
  57. data/mpg123/doc/THANKS +13 -0
  58. data/mpg123/doc/TODO +63 -0
  59. data/mpg123/doc/doxy_examples.c +21 -0
  60. data/mpg123/doc/doxygen.conf +41 -0
  61. data/mpg123/doc/doxyhead.xhtml +12 -0
  62. data/mpg123/doc/examples/dump_seekindex.c +41 -0
  63. data/mpg123/doc/examples/extract_frames.c +92 -0
  64. data/mpg123/doc/examples/feedseek.c +238 -0
  65. data/mpg123/doc/examples/id3dump.c +178 -0
  66. data/mpg123/doc/examples/mpg123_to_wav.c +118 -0
  67. data/mpg123/doc/examples/mpglib.c +92 -0
  68. data/mpg123/doc/examples/scan.c +47 -0
  69. data/mpg123/doc/libmpg123_speed.txt +84 -0
  70. data/mpg123/equalize.dat +37 -0
  71. data/mpg123/libmpg123.pc.in +11 -0
  72. data/mpg123/m4/addrconfig.m4 +34 -0
  73. data/mpg123/m4/libtool.m4 +7982 -0
  74. data/mpg123/m4/ltoptions.m4 +384 -0
  75. data/mpg123/m4/ltsugar.m4 +123 -0
  76. data/mpg123/m4/ltversion.m4 +23 -0
  77. data/mpg123/m4/lt~obsolete.m4 +98 -0
  78. data/mpg123/makedll.sh +19 -0
  79. data/mpg123/man1/mpg123.1 +512 -0
  80. data/mpg123/mpg123.spec +68 -0
  81. data/mpg123/mpg123.spec.in +68 -0
  82. data/mpg123/ports/MSVC++/2005/libmpg123/libmpg123.vcproj +741 -0
  83. data/mpg123/ports/MSVC++/2008/dump_seekindex/dump_seekindex.vcproj +194 -0
  84. data/mpg123/ports/MSVC++/2008/feedseek/feedseek.vcproj +195 -0
  85. data/mpg123/ports/MSVC++/2008/libmpg123/libmpg123.vcproj +1357 -0
  86. data/mpg123/ports/MSVC++/2008/mpg123.sln +44 -0
  87. data/mpg123/ports/MSVC++/2008/mpglib/mpglib.vcproj +191 -0
  88. data/mpg123/ports/MSVC++/2008/scan/scan.vcproj +195 -0
  89. data/mpg123/ports/MSVC++/2008clr/2008clr.sln +81 -0
  90. data/mpg123/ports/MSVC++/2008clr/examples/ReplaceReaderclr/Program.cs +435 -0
  91. data/mpg123/ports/MSVC++/2008clr/examples/ReplaceReaderclr/Properties/AssemblyInfo.cs +36 -0
  92. data/mpg123/ports/MSVC++/2008clr/examples/ReplaceReaderclr/ReplaceReaderclr.csproj +72 -0
  93. data/mpg123/ports/MSVC++/2008clr/examples/feedseekclr/Program.cs +331 -0
  94. data/mpg123/ports/MSVC++/2008clr/examples/feedseekclr/Properties/AssemblyInfo.cs +36 -0
  95. data/mpg123/ports/MSVC++/2008clr/examples/feedseekclr/feedseekclr.csproj +71 -0
  96. data/mpg123/ports/MSVC++/2008clr/examples/scanclr/Program.cs +79 -0
  97. data/mpg123/ports/MSVC++/2008clr/examples/scanclr/Properties/AssemblyInfo.cs +36 -0
  98. data/mpg123/ports/MSVC++/2008clr/examples/scanclr/scanclr.csproj +70 -0
  99. data/mpg123/ports/MSVC++/2008clr/mpg123clr/AssemblyInfo.cpp +76 -0
  100. data/mpg123/ports/MSVC++/2008clr/mpg123clr/ReadMe.txt +165 -0
  101. data/mpg123/ports/MSVC++/2008clr/mpg123clr/advanced.cpp +91 -0
  102. data/mpg123/ports/MSVC++/2008clr/mpg123clr/advanced.h +130 -0
  103. data/mpg123/ports/MSVC++/2008clr/mpg123clr/dllmain.cpp +19 -0
  104. data/mpg123/ports/MSVC++/2008clr/mpg123clr/enum.h +218 -0
  105. data/mpg123/ports/MSVC++/2008clr/mpg123clr/error.cpp +48 -0
  106. data/mpg123/ports/MSVC++/2008clr/mpg123clr/error.h +134 -0
  107. data/mpg123/ports/MSVC++/2008clr/mpg123clr/id3v1.cpp +92 -0
  108. data/mpg123/ports/MSVC++/2008clr/mpg123clr/id3v1.h +132 -0
  109. data/mpg123/ports/MSVC++/2008clr/mpg123clr/id3v2.cpp +138 -0
  110. data/mpg123/ports/MSVC++/2008clr/mpg123clr/id3v2.h +152 -0
  111. data/mpg123/ports/MSVC++/2008clr/mpg123clr/mpg123clr.cpp +896 -0
  112. data/mpg123/ports/MSVC++/2008clr/mpg123clr/mpg123clr.h +953 -0
  113. data/mpg123/ports/MSVC++/2008clr/mpg123clr/mpg123clr.rc +102 -0
  114. data/mpg123/ports/MSVC++/2008clr/mpg123clr/mpg123clr.vcproj +328 -0
  115. data/mpg123/ports/MSVC++/2008clr/mpg123clr/resource.h +14 -0
  116. data/mpg123/ports/MSVC++/2008clr/mpg123clr/stdafx.cpp +8 -0
  117. data/mpg123/ports/MSVC++/2008clr/mpg123clr/stdafx.h +38 -0
  118. data/mpg123/ports/MSVC++/2008clr/mpg123clr/string.cpp +166 -0
  119. data/mpg123/ports/MSVC++/2008clr/mpg123clr/string.h +265 -0
  120. data/mpg123/ports/MSVC++/2008clr/mpg123clr/targetver.h +24 -0
  121. data/mpg123/ports/MSVC++/2008clr/mpg123clr/text.cpp +67 -0
  122. data/mpg123/ports/MSVC++/2008clr/mpg123clr/text.h +111 -0
  123. data/mpg123/ports/MSVC++/2010/dump_seekindex/dump_seekindex.vcxproj +90 -0
  124. data/mpg123/ports/MSVC++/2010/dump_seekindex/dump_seekindex.vcxproj.filters +6 -0
  125. data/mpg123/ports/MSVC++/2010/feedseek/feedseek.vcxproj +95 -0
  126. data/mpg123/ports/MSVC++/2010/feedseek/feedseek.vcxproj.filters +6 -0
  127. data/mpg123/ports/MSVC++/2010/libmpg123/libmpg123.vcxproj +960 -0
  128. data/mpg123/ports/MSVC++/2010/libmpg123/libmpg123.vcxproj.user +3 -0
  129. data/mpg123/ports/MSVC++/2010/libmpg123/yasm.exe +0 -0
  130. data/mpg123/ports/MSVC++/2010/mpg123.sln +38 -0
  131. data/mpg123/ports/MSVC++/2010/scan/scan.vcxproj +93 -0
  132. data/mpg123/ports/MSVC++/2010/scan/scan.vcxproj.filters +6 -0
  133. data/mpg123/ports/MSVC++/CMP3Stream/INCLUDE/CORE/CORE_FileIn.H +15 -0
  134. data/mpg123/ports/MSVC++/CMP3Stream/INCLUDE/CORE/SourceFilter_MP3.H +139 -0
  135. data/mpg123/ports/MSVC++/CMP3Stream/INCLUDE/IIEP_Def.H +206 -0
  136. data/mpg123/ports/MSVC++/CMP3Stream/INCLUDE/IIEP_FileIn.H +167 -0
  137. data/mpg123/ports/MSVC++/CMP3Stream/README +4 -0
  138. data/mpg123/ports/MSVC++/CMP3Stream/SOURCE/CORE_FileIn.CPP +462 -0
  139. data/mpg123/ports/MSVC++/CMP3Stream/SOURCE/CORE_Log.CPP +122 -0
  140. data/mpg123/ports/MSVC++/CMP3Stream/SOURCE/CORE_Mutex.CPP +35 -0
  141. data/mpg123/ports/MSVC++/CMP3Stream/SOURCE/SourceFilter_MP3Stream.CPP +586 -0
  142. data/mpg123/ports/MSVC++/CMP3Stream/libMPG123/PLACE_LIBMPG123_SOURCES_HERE +0 -0
  143. data/mpg123/ports/MSVC++/CMP3Stream/libMPG123/libMPG123.vcproj +245 -0
  144. data/mpg123/ports/MSVC++/config.h +35 -0
  145. data/mpg123/ports/MSVC++/examples/feedseek.c +240 -0
  146. data/mpg123/ports/MSVC++/examples/scan.c +47 -0
  147. data/mpg123/ports/MSVC++/mpg123.h +46 -0
  148. data/mpg123/ports/MSVC++/msvc.c +59 -0
  149. data/mpg123/ports/README +26 -0
  150. data/mpg123/ports/Sony_PSP/Makefile.psp +38 -0
  151. data/mpg123/ports/Sony_PSP/README +11 -0
  152. data/mpg123/ports/Sony_PSP/config.h +368 -0
  153. data/mpg123/ports/Sony_PSP/readers.c.patch +2 -0
  154. data/mpg123/ports/Xcode/config.h +197 -0
  155. data/mpg123/ports/Xcode/mpg123.h +17 -0
  156. data/mpg123/ports/Xcode/mpg123.xcodeproj/project.pbxproj +670 -0
  157. data/mpg123/ports/mpg123_.pas +478 -0
  158. data/mpg123/scripts/benchmark-cpu.pl +56 -0
  159. data/mpg123/scripts/tag_lyrics.py +76 -0
  160. data/mpg123/src/Makefile.am +186 -0
  161. data/mpg123/src/Makefile.in +1097 -0
  162. data/mpg123/src/audio.c +725 -0
  163. data/mpg123/src/audio.h +106 -0
  164. data/mpg123/src/buffer.c +312 -0
  165. data/mpg123/src/buffer.h +45 -0
  166. data/mpg123/src/common.c +240 -0
  167. data/mpg123/src/common.h +29 -0
  168. data/mpg123/src/config.h.in +436 -0
  169. data/mpg123/src/control_generic.c +809 -0
  170. data/mpg123/src/equalizer.c +48 -0
  171. data/mpg123/src/genre.c +271 -0
  172. data/mpg123/src/genre.h +15 -0
  173. data/mpg123/src/getlopt.c +148 -0
  174. data/mpg123/src/getlopt.h +77 -0
  175. data/mpg123/src/httpget.c +700 -0
  176. data/mpg123/src/httpget.h +66 -0
  177. data/mpg123/src/legacy_module.c +74 -0
  178. data/mpg123/src/libmpg123/Makefile.am +141 -0
  179. data/mpg123/src/libmpg123/Makefile.in +919 -0
  180. data/mpg123/src/libmpg123/compat.c +138 -0
  181. data/mpg123/src/libmpg123/compat.h +178 -0
  182. data/mpg123/src/libmpg123/dct36_3dnow.S +505 -0
  183. data/mpg123/src/libmpg123/dct36_3dnowext.S +512 -0
  184. data/mpg123/src/libmpg123/dct64.c +174 -0
  185. data/mpg123/src/libmpg123/dct64_3dnow.S +712 -0
  186. data/mpg123/src/libmpg123/dct64_3dnowext.S +714 -0
  187. data/mpg123/src/libmpg123/dct64_altivec.c +315 -0
  188. data/mpg123/src/libmpg123/dct64_i386.c +336 -0
  189. data/mpg123/src/libmpg123/dct64_i486.c +342 -0
  190. data/mpg123/src/libmpg123/dct64_mmx.S +811 -0
  191. data/mpg123/src/libmpg123/dct64_neon.S +297 -0
  192. data/mpg123/src/libmpg123/dct64_neon_float.S +270 -0
  193. data/mpg123/src/libmpg123/dct64_sse.S +454 -0
  194. data/mpg123/src/libmpg123/dct64_sse_float.S +401 -0
  195. data/mpg123/src/libmpg123/dct64_x86_64.S +464 -0
  196. data/mpg123/src/libmpg123/dct64_x86_64_float.S +426 -0
  197. data/mpg123/src/libmpg123/debug.h +171 -0
  198. data/mpg123/src/libmpg123/decode.h +268 -0
  199. data/mpg123/src/libmpg123/dither.c +119 -0
  200. data/mpg123/src/libmpg123/dither.h +23 -0
  201. data/mpg123/src/libmpg123/equalizer.c +17 -0
  202. data/mpg123/src/libmpg123/equalizer_3dnow.S +70 -0
  203. data/mpg123/src/libmpg123/feature.c +106 -0
  204. data/mpg123/src/libmpg123/format.c +521 -0
  205. data/mpg123/src/libmpg123/frame.c +1046 -0
  206. data/mpg123/src/libmpg123/frame.h +410 -0
  207. data/mpg123/src/libmpg123/gapless.h +119 -0
  208. data/mpg123/src/libmpg123/getbits.h +100 -0
  209. data/mpg123/src/libmpg123/getcpuflags.S +91 -0
  210. data/mpg123/src/libmpg123/getcpuflags.h +47 -0
  211. data/mpg123/src/libmpg123/huffman.h +340 -0
  212. data/mpg123/src/libmpg123/icy.c +32 -0
  213. data/mpg123/src/libmpg123/icy.h +38 -0
  214. data/mpg123/src/libmpg123/icy2utf8.c +438 -0
  215. data/mpg123/src/libmpg123/icy2utf8.h +10 -0
  216. data/mpg123/src/libmpg123/id3.c +999 -0
  217. data/mpg123/src/libmpg123/id3.h +43 -0
  218. data/mpg123/src/libmpg123/index.c +134 -0
  219. data/mpg123/src/libmpg123/index.h +59 -0
  220. data/mpg123/src/libmpg123/intsym.h +256 -0
  221. data/mpg123/src/libmpg123/l12_integer_tables.h +278 -0
  222. data/mpg123/src/libmpg123/l2tables.h +164 -0
  223. data/mpg123/src/libmpg123/l3_integer_tables.h +1002 -0
  224. data/mpg123/src/libmpg123/layer1.c +155 -0
  225. data/mpg123/src/libmpg123/layer2.c +371 -0
  226. data/mpg123/src/libmpg123/layer3.c +2053 -0
  227. data/mpg123/src/libmpg123/lfs_alias.c +252 -0
  228. data/mpg123/src/libmpg123/lfs_wrap.c +751 -0
  229. data/mpg123/src/libmpg123/libmpg123.c +1607 -0
  230. data/mpg123/src/libmpg123/mangle.h +74 -0
  231. data/mpg123/src/libmpg123/mpeghead.h +87 -0
  232. data/mpg123/src/libmpg123/mpg123.h.in +1075 -0
  233. data/mpg123/src/libmpg123/mpg123lib_intern.h +338 -0
  234. data/mpg123/src/libmpg123/ntom.c +148 -0
  235. data/mpg123/src/libmpg123/optimize.c +964 -0
  236. data/mpg123/src/libmpg123/optimize.h +219 -0
  237. data/mpg123/src/libmpg123/parse.c +1179 -0
  238. data/mpg123/src/libmpg123/parse.h +25 -0
  239. data/mpg123/src/libmpg123/reader.h +137 -0
  240. data/mpg123/src/libmpg123/readers.c +1235 -0
  241. data/mpg123/src/libmpg123/sample.h +152 -0
  242. data/mpg123/src/libmpg123/stringbuf.c +163 -0
  243. data/mpg123/src/libmpg123/synth.c +816 -0
  244. data/mpg123/src/libmpg123/synth.h +196 -0
  245. data/mpg123/src/libmpg123/synth_3dnow.S +318 -0
  246. data/mpg123/src/libmpg123/synth_3dnowext.S +6 -0
  247. data/mpg123/src/libmpg123/synth_8bit.c +142 -0
  248. data/mpg123/src/libmpg123/synth_8bit.h +86 -0
  249. data/mpg123/src/libmpg123/synth_altivec.c +1057 -0
  250. data/mpg123/src/libmpg123/synth_arm.S +271 -0
  251. data/mpg123/src/libmpg123/synth_arm_accurate.S +287 -0
  252. data/mpg123/src/libmpg123/synth_i486.c +252 -0
  253. data/mpg123/src/libmpg123/synth_i586.S +336 -0
  254. data/mpg123/src/libmpg123/synth_i586_dither.S +375 -0
  255. data/mpg123/src/libmpg123/synth_mmx.S +125 -0
  256. data/mpg123/src/libmpg123/synth_mono.h +64 -0
  257. data/mpg123/src/libmpg123/synth_neon.S +123 -0
  258. data/mpg123/src/libmpg123/synth_neon_accurate.S +173 -0
  259. data/mpg123/src/libmpg123/synth_neon_float.S +149 -0
  260. data/mpg123/src/libmpg123/synth_neon_s32.S +168 -0
  261. data/mpg123/src/libmpg123/synth_ntom.h +213 -0
  262. data/mpg123/src/libmpg123/synth_real.c +404 -0
  263. data/mpg123/src/libmpg123/synth_s32.c +411 -0
  264. data/mpg123/src/libmpg123/synth_sse.S +6 -0
  265. data/mpg123/src/libmpg123/synth_sse3d.h +246 -0
  266. data/mpg123/src/libmpg123/synth_sse_accurate.S +294 -0
  267. data/mpg123/src/libmpg123/synth_sse_float.S +241 -0
  268. data/mpg123/src/libmpg123/synth_sse_s32.S +306 -0
  269. data/mpg123/src/libmpg123/synth_stereo_neon.S +175 -0
  270. data/mpg123/src/libmpg123/synth_stereo_neon_accurate.S +262 -0
  271. data/mpg123/src/libmpg123/synth_stereo_neon_float.S +220 -0
  272. data/mpg123/src/libmpg123/synth_stereo_neon_s32.S +247 -0
  273. data/mpg123/src/libmpg123/synth_stereo_sse_accurate.S +508 -0
  274. data/mpg123/src/libmpg123/synth_stereo_sse_float.S +416 -0
  275. data/mpg123/src/libmpg123/synth_stereo_sse_s32.S +540 -0
  276. data/mpg123/src/libmpg123/synth_stereo_x86_64.S +335 -0
  277. data/mpg123/src/libmpg123/synth_stereo_x86_64_accurate.S +454 -0
  278. data/mpg123/src/libmpg123/synth_stereo_x86_64_float.S +396 -0
  279. data/mpg123/src/libmpg123/synth_stereo_x86_64_s32.S +473 -0
  280. data/mpg123/src/libmpg123/synth_x86_64.S +244 -0
  281. data/mpg123/src/libmpg123/synth_x86_64_accurate.S +301 -0
  282. data/mpg123/src/libmpg123/synth_x86_64_float.S +259 -0
  283. data/mpg123/src/libmpg123/synth_x86_64_s32.S +312 -0
  284. data/mpg123/src/libmpg123/synths.h +52 -0
  285. data/mpg123/src/libmpg123/tabinit.c +294 -0
  286. data/mpg123/src/libmpg123/tabinit_mmx.S +210 -0
  287. data/mpg123/src/libmpg123/testcpu.c +35 -0
  288. data/mpg123/src/libmpg123/true.h +14 -0
  289. data/mpg123/src/local.c +63 -0
  290. data/mpg123/src/local.h +21 -0
  291. data/mpg123/src/metaprint.c +373 -0
  292. data/mpg123/src/metaprint.h +17 -0
  293. data/mpg123/src/module.c +306 -0
  294. data/mpg123/src/module.h +48 -0
  295. data/mpg123/src/mpg123.c +1405 -0
  296. data/mpg123/src/mpg123app.h +171 -0
  297. data/mpg123/src/output/Makefile.am +213 -0
  298. data/mpg123/src/output/Makefile.in +1238 -0
  299. data/mpg123/src/output/aix.c +300 -0
  300. data/mpg123/src/output/alib.c +209 -0
  301. data/mpg123/src/output/alsa.c +297 -0
  302. data/mpg123/src/output/arts.c +117 -0
  303. data/mpg123/src/output/coreaudio.c +370 -0
  304. data/mpg123/src/output/dummy.c +78 -0
  305. data/mpg123/src/output/esd.c +167 -0
  306. data/mpg123/src/output/hp.c +184 -0
  307. data/mpg123/src/output/jack.c +450 -0
  308. data/mpg123/src/output/mint.c +197 -0
  309. data/mpg123/src/output/nas.c +335 -0
  310. data/mpg123/src/output/openal.c +197 -0
  311. data/mpg123/src/output/os2.c +665 -0
  312. data/mpg123/src/output/oss.c +319 -0
  313. data/mpg123/src/output/portaudio.c +255 -0
  314. data/mpg123/src/output/pulse.c +164 -0
  315. data/mpg123/src/output/sdl.c +206 -0
  316. data/mpg123/src/output/sgi.c +213 -0
  317. data/mpg123/src/output/sndio.c +161 -0
  318. data/mpg123/src/output/sun.c +281 -0
  319. data/mpg123/src/output/win32.c +229 -0
  320. data/mpg123/src/playlist.c +596 -0
  321. data/mpg123/src/playlist.h +52 -0
  322. data/mpg123/src/resolver.c +319 -0
  323. data/mpg123/src/resolver.h +25 -0
  324. data/mpg123/src/sfifo.c +146 -0
  325. data/mpg123/src/sfifo.h +95 -0
  326. data/mpg123/src/streamdump.c +74 -0
  327. data/mpg123/src/streamdump.h +20 -0
  328. data/mpg123/src/term.c +479 -0
  329. data/mpg123/src/term.h +81 -0
  330. data/mpg123/src/tests/noise.c +52 -0
  331. data/mpg123/src/tests/plain_id3.c +109 -0
  332. data/mpg123/src/tests/seek_accuracy.c +261 -0
  333. data/mpg123/src/tests/seek_whence.c +56 -0
  334. data/mpg123/src/tests/testtext.h +34 -0
  335. data/mpg123/src/tests/text.c +80 -0
  336. data/mpg123/src/wav.c +464 -0
  337. data/mpg123/src/wavhead.h +68 -0
  338. data/mpg123/src/win32_net.c +599 -0
  339. data/mpg123/src/win32_support.c +191 -0
  340. data/mpg123/src/win32_support.h +152 -0
  341. data/mpg123/src/xfermem.c +321 -0
  342. data/mpg123/src/xfermem.h +74 -0
  343. data/mpg123/windows-builds.sh +137 -0
  344. data/msvc/lib/OpenAL32.lib +0 -0
  345. data/spec/fixtures/heal.ogg +0 -0
  346. data/spec/fixtures/tone_up.wav +0 -0
  347. data/spec/seal/buffer_spec.rb +37 -0
  348. data/spec/seal/core_spec.rb +29 -0
  349. data/spec/seal/effect_slot_spec.rb +38 -0
  350. data/spec/seal/listener_spec.rb +33 -0
  351. data/spec/seal/reverb_spec.rb +51 -0
  352. data/spec/seal/source_spec.rb +370 -0
  353. data/spec/seal/stream_spec.rb +38 -0
  354. data/spec/spec_helper.rb +45 -0
  355. data/spec/support/attribute_examples.rb +75 -0
  356. data/spec/support/audio_object_with_format.rb +27 -0
  357. data/spec/support/movable_object.rb +22 -0
  358. data/src/libogg/bitwise.c +857 -0
  359. data/src/libogg/framing.c +2093 -0
  360. data/src/libvorbis/backends.h +144 -0
  361. data/src/libvorbis/bitrate.c +253 -0
  362. data/src/libvorbis/bitrate.h +59 -0
  363. data/src/libvorbis/block.c +1046 -0
  364. data/src/libvorbis/codebook.c +484 -0
  365. data/src/libvorbis/codebook.h +119 -0
  366. data/src/libvorbis/codec_internal.h +167 -0
  367. data/src/libvorbis/envelope.c +375 -0
  368. data/src/libvorbis/envelope.h +80 -0
  369. data/src/libvorbis/floor0.c +221 -0
  370. data/src/libvorbis/floor1.c +1100 -0
  371. data/src/libvorbis/highlevel.h +58 -0
  372. data/src/libvorbis/info.c +668 -0
  373. data/src/libvorbis/lookup.c +94 -0
  374. data/src/libvorbis/lookup.h +32 -0
  375. data/src/libvorbis/lookup_data.h +192 -0
  376. data/src/libvorbis/lpc.c +160 -0
  377. data/src/libvorbis/lpc.h +29 -0
  378. data/src/libvorbis/lsp.c +456 -0
  379. data/src/libvorbis/lsp.h +28 -0
  380. data/src/libvorbis/mapping0.c +816 -0
  381. data/src/libvorbis/masking.h +785 -0
  382. data/src/libvorbis/mdct.c +563 -0
  383. data/src/libvorbis/mdct.h +71 -0
  384. data/src/libvorbis/misc.h +57 -0
  385. data/src/libvorbis/os.h +186 -0
  386. data/src/libvorbis/psy.c +1206 -0
  387. data/src/libvorbis/psy.h +154 -0
  388. data/src/libvorbis/registry.c +45 -0
  389. data/src/libvorbis/registry.h +32 -0
  390. data/src/libvorbis/res0.c +889 -0
  391. data/src/libvorbis/scales.h +90 -0
  392. data/src/libvorbis/sharedbook.c +579 -0
  393. data/src/libvorbis/smallft.c +1255 -0
  394. data/src/libvorbis/smallft.h +34 -0
  395. data/src/libvorbis/synthesis.c +184 -0
  396. data/src/libvorbis/vorbisfile.c +2337 -0
  397. data/src/libvorbis/window.c +2135 -0
  398. data/src/libvorbis/window.h +26 -0
  399. data/src/rubyext.c +2329 -0
  400. data/src/seal/buf.c +124 -0
  401. data/src/seal/core.c +283 -0
  402. data/src/seal/efs.c +74 -0
  403. data/src/seal/err.c +118 -0
  404. data/src/seal/fmt.c +86 -0
  405. data/src/seal/listener.c +111 -0
  406. data/src/seal/mpg.c +174 -0
  407. data/src/seal/mpg.h +24 -0
  408. data/src/seal/ov.c +180 -0
  409. data/src/seal/ov.h +22 -0
  410. data/src/seal/raw.c +59 -0
  411. data/src/seal/reader.c +102 -0
  412. data/src/seal/reader.h +59 -0
  413. data/src/seal/rvb.c +368 -0
  414. data/src/seal/src.c +654 -0
  415. data/src/seal/stream.c +109 -0
  416. data/src/seal/threading.c +66 -0
  417. data/src/seal/threading.h +20 -0
  418. data/src/seal/wav.c +297 -0
  419. data/src/seal/wav.h +23 -0
  420. data/src/win32api.rb +29 -0
  421. metadata +563 -0
@@ -0,0 +1,953 @@
1
+ /*
2
+ mpg123clr: MPEG Audio Decoder library Common Language Runtime version.
3
+
4
+ copyright 2009-2011 by Malcolm Boczek - free software under the terms of the LGPL 2.1
5
+ mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply.
6
+
7
+ All rights to this work freely assigned to the mpg123 project.
8
+ */
9
+ /*
10
+ libmpg123: MPEG Audio Decoder library
11
+
12
+ copyright 1995-2011 by the mpg123 project - free software under the terms of the LGPL 2.1
13
+ see COPYING and AUTHORS files in distribution or http://mpg123.org
14
+
15
+ */
16
+ /*
17
+ 1.8.1.0 04-Aug-09 Initial release.
18
+ 1.9.0.0 24-Sep-09 Function names harmonized with libmpg123 (mb)
19
+ 1.10.0.0 30-Nov-09 release match - added mpg123_feature (mb)
20
+ 1.12.0.0 14-Apr-10 release match - added framebyframe and "handle" ReplaceReaders (mb)
21
+ 1.13.0.0 13-Jan-11 release match - added encsize (mb)
22
+ */
23
+
24
+ #pragma once
25
+
26
+ #pragma warning(disable : 4635)
27
+ #include "mpg123.h"
28
+ #pragma warning(default : 4635)
29
+
30
+ #include "enum.h"
31
+ #include "error.h"
32
+ #include "id3v1.h"
33
+ #include "id3v2.h"
34
+ #include "advanced.h"
35
+
36
+ #include <io.h> // for posix proof of concept only
37
+
38
+ #include <string>
39
+ #include <iostream>
40
+ #include <stdarg.h>
41
+
42
+ #include <vcclr.h>
43
+ using namespace std;
44
+ using namespace System;
45
+ using namespace System::IO;
46
+ using namespace System::Runtime::InteropServices;
47
+
48
+ namespace mpg123clr
49
+ {
50
+
51
+
52
+ // Recommended usage when creating reference type on the managed heap (not using stack semantics
53
+ // for reference types...) [see (Microsoft) Destructors and Finalizers in Visual C++]
54
+ //
55
+ // C++/CLI
56
+ // A myA;
57
+ // // use myA here
58
+ //
59
+ // Equivalent user code:
60
+ //
61
+ // A ^ myA = gcnew A;
62
+ // try { /* use myA here */ } finally { delete myA; }
63
+ //
64
+ //
65
+ // C# (from wikipedia)
66
+ // using(A myA = new A()) { /* Use myA here */ }
67
+ // Compiler calls myA.Dispose(), in a "finally" of a "try/finally" block
68
+ //
69
+ // Equivalent user code:
70
+ //
71
+ // A myA = new myA();
72
+ // try { /* Use myA here */ } finally { myA.Dispose(); }
73
+ //
74
+ // Otherwise Finalizer will be nondeterministically called by GC
75
+
76
+
77
+ ///<summary>Wrapper for libmpg123.</summary>
78
+ public ref class mpg123
79
+ {
80
+
81
+ #pragma region Callback and Delegate
82
+
83
+ // Functional callbacks for low-level I/O ReplaceReader
84
+
85
+ public:
86
+ ///<summary>Seek Delegate.
87
+ ///<para>Callback seek function to provide low-level stream access to posix-like seek operations.
88
+ /// Requires user supplied static callback fuction of form off_t fn(int fd, off_t offset, int origin).</para>
89
+ ///<para>Returns callee supplied resulting offset from start of file or -1 for error.</para>
90
+ ///</summary>
91
+ ///<param name="fd">Contains file descriptor.</param>
92
+ ///<param name="offset">Contains required offset value.</param>
93
+ ///<param name="origin">Contains relative origin value (whence) applied to offset.</param>
94
+ ///<returns>Callee supplied resulting offset from start of file or -1 for error.</returns>
95
+ [UnmanagedFunctionPointer(CallingConvention::Cdecl)]
96
+ delegate off_t SeekDelegate(int fd, off_t offset, int origin);
97
+
98
+ [UnmanagedFunctionPointer(CallingConvention::Cdecl)]
99
+ delegate off_t SeekHandleDelegate(void* handle, off_t offset, int origin);
100
+
101
+ ///<summary>Read Delegate.
102
+ ///<para>Callback read function to provide low-level stream access to posix-like read operations.
103
+ /// Requires user supplied static callback fuction of form ssize_t fn(int fd, void* buffer, size_t size).</para>
104
+ ///<para>Returns callee supplied resulting actual number of bytes read or -1 for error.</para>
105
+ ///</summary>
106
+ ///<param name="fd">Contains file descriptor.</param>
107
+ ///<param name="offset">Contains address of buffer.</param>
108
+ ///<param name="origin">Contains size of buffer.</param>
109
+ ///<returns>Callee supplied resulting actual number of bytes read or -1 for error.</returns>
110
+ [UnmanagedFunctionPointer(CallingConvention::Cdecl)]
111
+ delegate ssize_t ReadDelegate(int fd, void* buffer, size_t size);
112
+
113
+ [UnmanagedFunctionPointer(CallingConvention::Cdecl)]
114
+ delegate ssize_t ReadHandleDelegate(void* handle, void* buffer, size_t size);
115
+
116
+ [UnmanagedFunctionPointer(CallingConvention::Cdecl)]
117
+ delegate void CleanupHandleDelegate(void* handle);
118
+
119
+ private:
120
+ // Delegate "keep alive" fields to prevent GC of delegate.
121
+ SeekDelegate^ seekDel;
122
+ ReadDelegate^ readDel;
123
+
124
+ SeekHandleDelegate^ seekHDel;
125
+ ReadHandleDelegate^ readHDel;
126
+ CleanupHandleDelegate^ cleanHDel;
127
+
128
+ GCHandle userObjectHandle;
129
+
130
+ // Temporary delegate store, replacereader action is defered until next stream 'open' action
131
+ SeekDelegate^ r_seekDel;
132
+ ReadDelegate^ r_readDel;
133
+
134
+ SeekHandleDelegate^ r_seekHDel;
135
+ ReadHandleDelegate^ r_readHDel;
136
+ CleanupHandleDelegate^ r_cleanHDel;
137
+
138
+ bool useHandleReplacement;
139
+ bool lastReplacementWasHandle;
140
+
141
+ #pragma endregion -Callback and Delegate
142
+
143
+
144
+ #pragma region Library and Handle Setup
145
+
146
+ // \defgroup mpg123_init mpg123 library and handle setup
147
+ //
148
+ // Functions to initialise and shutdown the mpg123 library and handles.
149
+ // The parameters of handles have workable defaults, you only have to tune them when you want to tune something;-)
150
+ // Tip: Use a RVA setting...
151
+ //
152
+
153
+ private:
154
+ mpg123_handle* mh;
155
+
156
+ internal:
157
+ mpg123(mpg123_handle* mh);
158
+
159
+ protected:
160
+ ///<summary>Finalizer.
161
+ ///<para>Cleanly handles mpg123_delete of internal (unmanaged) mpg123 handle.</para></summary>
162
+ /// Implementation of CLR Finalize().
163
+ !mpg123(void);
164
+
165
+ public:
166
+ ///<summary>Constructor.
167
+ ///<para>Only creates mpg123 object, you must call one of the New() methods to obtain a decoder library handle.</para>
168
+ ///<para>Recommended usage: using(mpg123 obj = new mpg123()){ use obj here }</para></summary>
169
+ mpg123(void);
170
+
171
+ ///<summary>Destructor. Used for final object deletion.
172
+ ///<para>Calls finalizer for clean disposal of internal (unmanaged) library handles.</para>
173
+ ///</summary>
174
+ /// Implementation of CLR Dispose().
175
+ /// ~Destructor and !Finalizer are the prescribed implementation of Dispose() and Finalize().
176
+ /// See Destructors and Finalizers in Visual C++
177
+ ~mpg123(void);
178
+
179
+ ///<summary>(mpg123_init) Function to initialise the mpg123 library.
180
+ ///<para>This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the library.</para>
181
+ ///<para>Returns MPG123_OK if successful, otherwise an error number.</para></summary>
182
+ ///<returns>Returns MPG123_OK if successful, otherwise an error number.</returns>
183
+ static mpg123clr::mpg::ErrorCode __clrcall mpg123_init(void);
184
+
185
+ ///<summary>(mpg123_exit) Function to close down the mpg123 library.
186
+ ///<para>This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the library.</para></summary>
187
+ static void __clrcall mpg123_exit(void);
188
+
189
+ ///<summary>(mpg123_new) Obtain am mpg123 handle with designated decoder.
190
+ ///<para>Returns MPG123_OK or applicable error code.</para>
191
+ ///</summary>
192
+ ///<param name="decoder">Name of the decoder to attach.</param>
193
+ ///<returns>MPG123_OK or applicable error code.</returns>
194
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_new(String ^ decoder);
195
+
196
+ ///<summary>Obtain an mpg123 handle with default decoder.
197
+ ///<para>Returns MPG123_OK or applicable error code.</para>
198
+ ///</summary>
199
+ ///<returns>MPG123_OK or applicable error code.</returns>
200
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_new(void);
201
+
202
+ ///<summary>Obtain am mpg123 handle with default decoder.
203
+ ///<para>Allows use of common parms object for multiple connections.</para>
204
+ ///<para>Returns MPG123_OK or applicable error code.</para>
205
+ ///</summary>
206
+ ///<param name="par">Supplied Advanced parameter object.</param>
207
+ ///<returns>MPG123_OK or applicable error code.</returns>
208
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_parnew(mpg123clr::advpars^ par);
209
+
210
+ ///<summary>Obtain am mpg123 handle with designated decoder.
211
+ ///<para>Allows use of common parms object for multiple connections.</para>
212
+ ///<para>Returns MPG123_OK or applicable error code.</para>
213
+ ///</summary>
214
+ ///<param name="par">Supplied Advanced parameter object.</param>
215
+ ///<param name="decoder">Name of the decoder to attach.</param>
216
+ ///<returns>MPG123_OK or applicable error code.</returns>
217
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_parnew(mpg123clr::advpars^ par, String^ decoder);
218
+
219
+ ///<summary>(mpg123_delete) Delete internal mpg123 handle.
220
+ ///<para>The framework will dispose of the object when it goes out of scope - you do not need to explicitly call Delete().
221
+ /// However it is available to allow reuse of this object with successive handles - using New()/Delete() pairs.</para>
222
+ ///</summary>
223
+ void __clrcall mpg123_delete(void);
224
+
225
+ public:
226
+
227
+ ///<summary>Set a specific parameter value.
228
+ ///<para>Returns MPG123_OK or applicable error code.</para>
229
+ ///</summary>
230
+ ///<param name="type">Define the parameter to be set. (parms enumeration)</param>
231
+ ///<param name="val">Integer value to apply.</param>
232
+ ///<param name="fval">Real value to apply.</param>
233
+ ///<returns>MPG123_OK or applicable error code.</returns>
234
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_param(mpg123clr::mpg::parms type, int val, double fval);
235
+
236
+ ///<summary>Get a specific parameter value.
237
+ ///<para>Returns MPG123_OK or applicable error code.</para>
238
+ ///</summary>
239
+ ///<param name="type">Define the parameter to get. (parms enumeration)</param>
240
+ ///<param name="val">Returned integer value.</param>
241
+ ///<param name="fval">Returned real value.</param>
242
+ ///<returns>MPG123_OK or applicable error code.</returns>
243
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_getparam(mpg123clr::mpg::parms type, [Out] int% val, [Out] double% fval);
244
+
245
+ ///<summary>Query libmpg123 feature.
246
+ ///<para>Returns 1 for success, 0 for unimplemented feature.</para>
247
+ ///</summary>
248
+ ///<param name="key">Define the feature to query. (feature_set enumeration)</param>
249
+ ///<returns>1 for success, 0 for unimplemented feature.</returns>
250
+ static int __clrcall mpg123_feature(mpg123clr::mpg::feature_set key);
251
+
252
+ #pragma endregion -Library and Handle Setup
253
+
254
+ #pragma region Internal Helpers
255
+
256
+ internal:
257
+ array<String^>^ StringArrayFromPtr(const char ** ptr);
258
+
259
+ #pragma endregion -Internal Helpers
260
+
261
+ #pragma region Error Handling
262
+
263
+ // \defgroup mpg123_error mpg123 error handling
264
+ //
265
+ // Functions to get text version of the error numbers and an enumeration
266
+ // of the error codes returned by libmpg123.
267
+ //
268
+ // Most functions operating on a mpg123_handle simply return MPG123_OK on success and MPG123_ERR on failure (setting the internal error variable of the handle to the specific error code).
269
+ // Decoding/seek functions may also return message codes MPG123_DONE, MPG123_NEW_FORMAT and MPG123_NEED_MORE (please read up on these on how to react!).
270
+ // The positive range of return values is used for "useful" values when appropriate.
271
+ //
272
+
273
+ public:
274
+
275
+ ///<summary>Get string describing what error has occured in the context of this object.
276
+ ///<para>When a function operating on an mpg123 handle returns MPG123_ERR, you should use this function to check the actual reason.</para>
277
+ ///<para>This function will catch mh == NULL and return the message for MPG123_BAD_HANDLE.</para>
278
+ ///<para>Returns text representation of last error (incl. None) encountered by this object.</para>
279
+ ///</summary>
280
+ ///<returns>Text representation of last error (incl. None) encountered by this object.</returns>
281
+ String^ __clrcall mpg123_strerror(void);
282
+
283
+ ///<summary>Get last error encountered in the context of this object.
284
+ ///<para>When a function operating on an mpg123 handle returns MPG123_ERR, you should use this function to check the actual reason.</para>
285
+ ///<para>This function will catch internal handle == NULL and return MPG123_BAD_HANDLE.</para>
286
+ ///<para>Returns ErrorCode for last encountered error.</para>
287
+ ///</summary>
288
+ ///<returns>The plain errcode intead of a string of last error (incl. None) encountered by this object.</returns>
289
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_errcode(void);
290
+
291
+ #pragma endregion -Error Handling
292
+
293
+ #pragma region Decoder Selection
294
+
295
+ // \defgroup mpg123_decoder mpg123 decoder selection
296
+ //
297
+ // Functions to list and select the available decoders.
298
+ // Perhaps the most prominent feature of mpg123: You have several (optimized) decoders to choose from (on x86 and PPC (MacOS) systems, that is).
299
+ //
300
+
301
+ public:
302
+
303
+ ///<summary>Obtain list of generally available decoder names (plain 8bit ASCII).
304
+ ///<para>Retuns a string array of generally available decoder names (plain 8bit ASCII).</para>
305
+ ///</summary>
306
+ ///<returns>A string array of generally available decoder names (plain 8bit ASCII).</returns>
307
+ array<String^>^ __clrcall mpg123_decoders(void);
308
+
309
+ ///<summary>Obtain list of the decoders supported by the CPU (plain 8bit ASCII).
310
+ ///<para>Returns a string array of the decoders supported by the CPU (plain 8bit ASCII).</para>
311
+ ///</summary>
312
+ ///<returns>A string array of the decoders supported by the CPU (plain 8bit ASCII).</returns>
313
+ array<String^>^ __clrcall mpg123_supported_decoders(void);
314
+
315
+ ///<summary>Select the decoder to use.
316
+ ///<para>Returns MPG123_OK or applicable error code.</para>
317
+ ///</summary>
318
+ ///<param name="name">Name of the required decoder. (should be in SupportedDecoders list)</param>
319
+ ///<returns>MPG123_OK or applicable error code.</returns>
320
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_decoder(String^ name);
321
+
322
+ ///<summary>Get the currently active decoder engine name.
323
+ ///<para>The active decoder engine can vary depening on output constraints, mostly non-resampling, integer output is accelerated via 3DNow and Co.
324
+ /// but for other modes a fallback engine kicks in.</para>
325
+ ///<para>Note that this can return a decoder that is ony active in the hidden and not available as decoder choice from the outside.</para>
326
+ ///<para>Returns the decoder name or String.Empty on error.</para>
327
+ ///</summary>
328
+ ///<returns>The decoder name or String.Empty on error.</returns>
329
+ String^ __clrcall mpg123_current_decoder(void);
330
+
331
+ #pragma endregion -Decoder Selection
332
+
333
+ #pragma region Output Audio Format
334
+
335
+ // \defgroup mpg123_output mpg123 output audio format
336
+ //
337
+ // Functions to get and select the format of the decoded audio.
338
+ //
339
+
340
+ public:
341
+
342
+ ///<summary>Get an array of supported standard sample rates.
343
+ ///<para>These are possible native sample rates of MPEG audio files.
344
+ /// You can still force mpg123 to resample to a different one, but by default you will only get audio in one of these samplings.</para>
345
+ ///<para>Returns array of sample rates.</para>
346
+ ///</summary>
347
+ ///<returns>An array of sample rates.</returns>
348
+ array<long>^ __clrcall mpg123_rates(void);
349
+
350
+ ///<summary>An array of supported audio encodings.
351
+ ///<para>An audio encoding is one of the fully qualified members of mpg.enc</para>
352
+ ///<para>Returns array of supported Encodings.</para>
353
+ ///</summary>
354
+ ///<returns>An array of supported Encodings.</returns>
355
+ array<mpg123clr::mpg::enc>^ __clrcall mpg123_encodings(void);
356
+
357
+ ///<summary>Get the size (in bytes) of one mono sample of the named encoding.
358
+ ///<para>Returns the positive size of encoding in bytes, 0 on invalid encoding.</para>
359
+ ///</summary>
360
+ ///<param name="encoding">The encoding value to analyze.</param>
361
+ ///<returns>The positive size of encoding in bytes, 0 on invalid encoding.</returns>
362
+ static int __clrcall mpg123_encsize(mpg123clr::mpg::enc encoding);
363
+
364
+ ///<summary>Configure mpg123 to accept no output format at all.
365
+ ///<para>Use to clear default parameters prior to applying specific settings.</para>
366
+ ///<para>Returns MPG123 error codes.</para>
367
+ ///</summary>
368
+ ///<returns>MPG123 error codes.</returns>
369
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_format_none(void);
370
+
371
+ ///<summary>Configure mpg123 to accept all formats including any custom formats - this is the default.
372
+ ///<para>Returns MPG123 error codes.</para>
373
+ ///</summary>
374
+ ///<returns>MPG123 error codes.</returns>
375
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_format_all(void);
376
+
377
+ ///<summary>Configure detailed output formats.
378
+ ///<para>Returns MPG123 error codes.</para>
379
+ ///</summary>
380
+ ///<param name="rate">Sample rate (Hertz)</param>
381
+ ///<param name="channels">Combination of channelcount.stereo and channelcount.mono</param>
382
+ ///<param name="encodings">Combination of accepted encodings for rate and channels e.g. enc.enc_signed16 | enc.enc_ulaw_8 (or 0 for none)</param>
383
+ ///<returns>MPG123 error codes.</returns>
384
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_format(int rate, mpg123clr::mpg::channelcount channels, mpg123clr::mpg::enc encodings);
385
+
386
+ ///<summary>Get available support for supplied rate and encoding.
387
+ ///<para>Returns 0 for no support (includes invalid parameters), or combination of channelcount.stereo and channelcount.mono.</para>
388
+ ///</summary>
389
+ ///<param name="rate">Sample rate (Hertz)</param>
390
+ ///<param name="encoding">Combination of accepted encodings for rate and channels e.g. enc.enc_signed16 | enc.enc_ulaw_8 (or 0 for none)</param>
391
+ ///<returns>Returns 0 for no support (includes invalid parameters), or combination of channelcount.stereo and channelcount.mono.</returns>
392
+ mpg123clr::mpg::channelcount __clrcall mpg123_format_support(int rate, mpg123clr::mpg::enc encoding);
393
+
394
+ ///<summary>Get current output format.
395
+ ///<para>Returns MPG123 error codes.</para>
396
+ ///</summary>
397
+ ///<param name="rate">Returns current sample rate (Hertz)</param>
398
+ ///<param name="channels">Returns combination of channelcount.stereo and channelcount.mono</param>
399
+ ///<param name="encoding">Returns combination of accepted encodings for rate and channels e.g. enc.enc_signed16 | enc.enc_ulaw_8 (or 0 for none)</param>
400
+ ///<returns>MPG123 error codes.</returns>
401
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_getformat([Out] int% rate, [Out] mpg123clr::mpg::channelcount% channels, [Out] mpg123clr::mpg::enc% encoding);
402
+
403
+ #pragma endregion -Output Audio Format
404
+
405
+ #pragma region File Input and Decoding
406
+
407
+ // \defgroup mpg123_input mpg123 file input and decoding
408
+ //
409
+ // Functions for input bitstream and decoding operations.
410
+ // Decoding/seek functions may also return message codes MPG123_DONE, MPG123_NEW_FORMAT and MPG123_NEED_MORE (please read up on these on how to react!).
411
+ //
412
+
413
+ public:
414
+
415
+ ///<summary>Open and prepare to decode the file specified by ANSI filename.
416
+ ///<para>This does not open HTTP urls; the mpg library contains no networking code.
417
+ /// If you want to decode internet streams, use Open(fd) or Open().</para>
418
+ ///
419
+ ///<para>Returns MPG123 error codes</para>
420
+ ///</summary>
421
+ ///<param name="path">ANSI file path. Accepts ANSI path characters. For Unicode paths use tOpen.
422
+ /// NOTE: can be used in Unicode environment as long as wide-char codepages are avoided.</param>
423
+ ///<returns>MPG123 error codes.</returns>
424
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_open(String^ path);
425
+
426
+ ///<summary>Use a previously obtained file descriptor as the bitstream input.
427
+ ///<para>NOTE: Close() will NOT close a file opened with this method.</para>
428
+ ///<para>Returns MPG123 error codes.</para>
429
+ ///</summary>
430
+ ///<param name="fd">File Descriptor of pre required file.</param>
431
+ ///<returns>MPG123 error codes.</returns>
432
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_open_fd(int fd);
433
+
434
+ ///<summary>Use an opaque handle as bitstream input.
435
+ ///<para>This works only with the replaced I/O from mpg123_replace_reader_handle()!</para>
436
+ ///<para>mpg123_close() will call the cleanup callback for your handle (if you gave one).</para>
437
+ ///<para>Returns MPG123 error codes.</para>
438
+ ///</summary>
439
+ ///<returns>MPG123 error codes.</returns>
440
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_open_handle(System::Object^ obj);
441
+
442
+ ///<summary>Open a new bitstream and prepare for direct feeding.
443
+ ///<para>This works together with Decode(); you are responsible for reading and feeding the input bitstream.</para>
444
+ ///<para>Returns MPG123 error codes.</para>
445
+ ///</summary>
446
+ ///<returns>MPG123 error codes.</returns>
447
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_open_feed(void);
448
+
449
+ ///<summary>Closes the source, if the library opened it.
450
+ ///<para>Returns MPG123 error codes.</para>
451
+ ///</summary>
452
+ ///<returns>MPG123 error codes.</returns>
453
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_close(void);
454
+
455
+ ///<summary>Open and prepare to decode the file specified by UNICODE (wide-character) filename.
456
+ ///<para>This does not open HTTP urls; the mpg library contains no networking code.
457
+ /// If you want to decode internet streams, use Open(fd) or Open().</para>
458
+ ///
459
+ ///<para>Returns MPG123 error codes</para>
460
+ ///</summary>
461
+ ///<param name="path">UNICODE wide-character file path. See also ANSI Open(path).</param>
462
+ ///<returns>MPG123 error codes.</returns>
463
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_topen(String^ path);
464
+
465
+ ///<summary>Closes the file opened with tOpen.
466
+ ///<para>Returns MPG123 error codes.</para>
467
+ ///</summary>
468
+ ///<returns>MPG123 error codes.</returns>
469
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_tclose(void);
470
+
471
+ ///<summary>Read from stream and decode.
472
+ ///<para>Equivalent to mpg123_read(,,,)</para>
473
+ ///<para>Returns MPG123 error codes. (watch out for MPG123_DONE and friends!)</para>
474
+ ///</summary>
475
+ ///<param name="buffer">Supplied buffer in which to return audio output data.</param>
476
+ ///<param name="count">Returns number of actual audio output bytes returned.</param>
477
+ ///<returns>MPG123 error codes. (watch out for MPG123_DONE and friends!)</returns>
478
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_read(array<unsigned char>^ buffer, [Out] size_t% count);
479
+
480
+ ///<summary>Read from stream and decode.
481
+ ///<para>Equivalent to mpg123_read(,,,) but modified to better support CLR Stream.Read</para>
482
+ ///<para>Returns MPG123 error codes. (watch out for MPG123_DONE and friends!)</para>
483
+ ///</summary>
484
+ ///<param name="buffer">Supplied buffer in which to return audio output data.</param>
485
+ ///<param name="offset">Offset in buffer at which to begin storing data.</param>
486
+ ///<param name="size">Maximum number of bytes to return.</param>
487
+ ///<param name="count">Returns number of actual audio output bytes returned.</param>
488
+ ///<returns>MPG123 error codes. (watch out for MPG123_DONE and friends!)</returns>
489
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_read(array<unsigned char>^ buffer, size_t offset, size_t size, [Out] size_t% count);
490
+
491
+ ///<summary>Feed data for a stream that has been opened with Open() - (mpg123_open_feed).
492
+ ///<para>Equivalent to mpg123_feed(...), it's give and take: You provide the bytestream, mpg123 gives you the decoded samples.</para>
493
+ ///<para>Returns MPG123 error codes.</para>
494
+ ///</summary>
495
+ ///<param name="inbuffer">Input buffer.</param>
496
+ ///<param name="size">Number of input bytes.</param>
497
+ ///<returns>MPG123 error codes.</returns>
498
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_feed(array<unsigned char>^ inbuffer, size_t size);
499
+
500
+ ///<summary>Decode MPEG Audio from inmemory to outmemory.
501
+ ///<para>This is very close to a drop-in replacement for old mpglib.</para>
502
+ ///<para>When you give zero-sized output buffer the input will be parsed until
503
+ /// decoded data is available. This enables you to get MPG123_NEW_FORMAT (and query it)
504
+ /// without taking decoded data.</para>
505
+ ///<para>Think of this function being the union of Read() and Feed() (which it actually is, sort of;-).
506
+ /// You can actually always decide if you want those specialized functions in separate steps or one call this one here.</para>
507
+ ///<para>Returns MPG123 error codes. (watch out especially for MPG123_NEED_MORE)</para>
508
+ ///</summary>
509
+ ///<param name="inbuffer">Input buffer.</param>
510
+ ///<param name="insize">Number of input bytes.</param>
511
+ ///<param name="outbuffer">Supplied buffer in which to return audio output data.</param>
512
+ ///<param name="outsize">Size in bytes of buffer.</param>
513
+ ///<param name="count">Returns number of actual audio output bytes returned.</param>
514
+ ///<returns>MPG123 error codes. (watch out especially for MPG123_NEED_MORE)</returns>
515
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_decode(array<unsigned char>^ inbuffer, size_t insize, array<unsigned char>^ outbuffer, size_t outsize, [Out] size_t% count);
516
+
517
+ ///<summary>Decode next MPEG frame to internal buffer or read a frame and return after setting a new format.
518
+ ///<para>Returns MPG123 error codes. (watch out for MPG123_NEW_FORMAT)</para>
519
+ ///</summary>
520
+ ///<param name="num">Returns current frame offset.</param>
521
+ ///<param name="audio">Returns pointer to internal buffer to read the decoded audio from. (Can be NULL for NEW_FORMAT)</param>
522
+ ///<param name="count">Returns number of actual audio output bytes ready in the buffer.</param>
523
+ ///<returns>MPG123 error codes. (watch out for MPG123_NEW_FORMAT)</returns>
524
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_decode_frame([Out] off_t% num, [Out] IntPtr% audio, [Out] size_t% count);
525
+
526
+ ///<summary>Decode current MPEG frame to internal buffer.
527
+ ///<para>Use with mpg123_framebyframe_next to progress through data.</para>
528
+ ///<para>Warning: This is experimental API that might change in future releases!
529
+ /// Please watch mpg123 development closely when using it.</para>
530
+ ///<para>Returns MPG123 error codes.</para>
531
+ ///</summary>
532
+ ///<param name="num">Returns current frame offset.</param>
533
+ ///<param name="audio">Returns pointer to internal buffer to read the decoded audio from. (Can be NULL for NEW_FORMAT)</param>
534
+ ///<param name="bytes">Returns number of actual audio output bytes ready in the buffer.</param>
535
+ ///<returns>MPG123 error codes.</returns>
536
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_framebyframe_decode([Out] off_t% num, [Out] IntPtr% audio, [Out] size_t% bytes);
537
+
538
+ ///<summary>Find, read and parse the next mp3 frame.
539
+ ///<para>Use with mpg123_framebyframe_decode to obtain frame data.</para>
540
+ ///<para>Warning: This is experimental API that might change in future releases!
541
+ /// Please watch mpg123 development closely when using it.</para>
542
+ ///<para>Returns MPG123 error codes. (watch out for MPG123_NEW_FORMAT)</para>
543
+ ///</summary>
544
+ ///<returns>MPG123 error codes. (watch out for MPG123_NEW_FORMAT)</returns>
545
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_framebyframe_next(void);
546
+
547
+ #pragma endregion -File Input and Decoding
548
+
549
+ #pragma region Position and Seeking
550
+
551
+ // \defgroup mpg123_seek mpg123 position and seeking
552
+ //
553
+ // Functions querying and manipulating position in the decoded audio bitstream.
554
+ // The position is measured in decoded audio samples, or MPEG frame offset for the specific functions.
555
+ // If gapless code is in effect, the positions are adjusted to compensate the skipped padding/delay - meaning, you should not care about that at all and just use the position defined for the samples you get out of the decoder;-)
556
+ // The general usage is modelled after stdlib's ftell() and fseek().
557
+ // Especially, the whence parameter for the seek functions has the same meaning as the one for fseek() and needs the same constants from stdlib.h:
558
+ // - SEEK_SET: set position to (or near to) specified offset
559
+ // - SEEK_CUR: change position by offset from now
560
+ // - SEEK_END: set position to offset from end
561
+ //
562
+ // Note that sample-accurate seek only works when gapless support has been enabled at compile time; seek is frame-accurate otherwise.
563
+ // Also, really sample-accurate seeking (meaning that you get the identical sample value after seeking compared to plain decoding up to the position) is only guaranteed when you do not mess with the position code by using MPG123_UPSPEED, MPG123_DOWNSPEED or MPG123_START_FRAME. The first two mainly should cause trouble with NtoM resampling, but in any case with these options in effect, you have to keep in mind that the sample offset is not the same as counting the samples you get from decoding since mpg123 counts the skipped samples, too (or the samples played twice only once)!
564
+ // Short: When you care about the sample position, don't mess with those parameters;-)
565
+ // Also, seeking is not guaranteed to work for all streams (underlying stream may not support it).
566
+ //
567
+
568
+ public:
569
+
570
+ ///<summary>Get the current position in samples. On the next read, you'd get that sample.
571
+ ///<para>Returns the current sample position.</para>
572
+ ///</summary>
573
+ ///<returns>The current sample position.</returns>
574
+ long long __clrcall mpg123_tell();
575
+
576
+ ///<summary>Get the frame number that the next read will give you data from.
577
+ ///<para>Returns the current frame number position.</para>
578
+ ///</summary>
579
+ ///<returns>The current frame number position.</returns>
580
+ long long __clrcall mpg123_tellframe();
581
+
582
+ ///<summary>Get the current byte offset in the input stream.
583
+ ///<para>Returns the current byte offset.</para>
584
+ ///</summary>
585
+ ///<returns>The current byte offset.</returns>
586
+ long long __clrcall mpg123_tell_stream();
587
+
588
+ ///<summary>Seek to a desired sample offset.
589
+ ///<para>Returns the resulting offset >= 0 or error/message code.</para>
590
+ ///</summary>
591
+ ///<param name="offset">The distance to move.</param>
592
+ ///<param name="origin">(whence) The relative location to move from.(SeekOrigin.Begin, SeekOrigin.Current, SeekOrigin.End)</param>
593
+ ///<returns>Returns the resulting offset >= 0 or error/message code.</returns>
594
+ long long __clrcall mpg123_seek(long long offset, SeekOrigin origin);
595
+
596
+ ///<summary>Seek to a desired sample offset in data feeding mode.
597
+ ///<para>This just prepares things to be right only if you ensure that the next chunk of input data will be from input_offset byte position.</para>
598
+ ///<para>Returns the resulting offset >= 0 or error/message code.</para>
599
+ ///</summary>
600
+ ///<param name="offset">The distance to move.</param>
601
+ ///<param name="origin">(whence) The relative location to move from.(SeekOrigin.Begin, SeekOrigin.Current, SeekOrigin.End)</param>
602
+ ///<param name="input_offset">Returns the position it expects to be at the next time data is fed to Decode().</param>
603
+ ///<returns>Returns the resulting offset >= 0 or error/message code.</returns>
604
+ long long __clrcall mpg123_feedseek(long long offset, SeekOrigin origin, [Out] long long% input_offset);
605
+
606
+ ///<summary>Seek to a desired MPEG frame index.
607
+ ///<para>Returns the resulting offset >= 0 or error/message code.</para>
608
+ ///</summary>
609
+ ///<param name="frameoffset">The numberof frames to move.</param>
610
+ ///<param name="origin">(whence) The relative location to move from.(SEEK_SET, SEEK_CUR or SEEK_END)</param>
611
+ ///<returns>Returns the resulting offset >= 0 or error/message code.</returns>
612
+ long long __clrcall mpg123_seek_frame(long long frameoffset, SeekOrigin origin);
613
+
614
+ ///<summary>Seek to an absolute MPEG frame offset corresponding to an offset in seconds.
615
+ ///<para>This assumes that the samples per frame do not change in the file/stream, which is a good assumption for any sane file/stream only.</para>
616
+ ///<para>Returns the resulting offset >= 0 or error/message code.</para>
617
+ ///</summary>
618
+ ///<param name="seconds">The absolute time offset required.</param>
619
+ ///<returns>Returns the resulting offset >= 0 or error/message code.</returns>
620
+ long long __clrcall mpg123_timeframe(double seconds);
621
+
622
+ ///<summary>Get a copy of the frame index table. Somewhat equivalent to mpg123_index(,,).
623
+ ///<para>The library requests not to modify table values. Since this is a copy, modification is meaningless - it has no effect on library routines.</para>
624
+ ///<para>NOTE: The returned index table value types are Int64 independant of library build.</para>
625
+ ///<para>Returns MPG123 error codes.</para>
626
+ ///</summary>
627
+ ///<param name="index">Returns array of source file position offsets (not output samples). Length of array is equivalent to mpg123_index "fill" parameter.</param>
628
+ ///<param name="step">Returns number of MPEG frames per index entry.</param>
629
+ ///<returns>MPG123 error codes.</returns>
630
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_index([Out] array<long long>^% index, [Out] long long% step);
631
+
632
+ ///<summary>Get a pointer to the frame index table. Equivalent to mpg123_index(,,).
633
+ ///<para>Do not modify table values unless you really know what you are doing!</para>
634
+ ///<para>NOTE: The returned index table value types may be Int32 or Int64 depending on library build.</para>
635
+ ///<para>Returns MPG123 error codes.</para>
636
+ ///</summary>
637
+ ///<param name="indexarr">Returns pointer to source file position offset index array (not output samples).</param>
638
+ ///<param name="step">Returns number of MPEG frames per index entry.</param>
639
+ ///<param name="fill">Returns number of recorded index offsets; size of the array.</param>
640
+ ///<returns>MPG123 error codes.</returns>
641
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_index([Out] IntPtr% indexarr, [Out] long long% step, [Out] size_t% fill);
642
+
643
+ ///<summary>Get information about current and remaining frames/seconds. Equivalent to mpg123_position(,,,,,,).
644
+ ///<para>WARNING: This function is there because of special usage by standalone mpg123 and may be removed in the final version of libmpg123!</para>
645
+ ///<para>You provide an offset (in frames) from now and a number of output bytes
646
+ /// served by libmpg123 but not yet played. You get the projected current frame
647
+ /// and seconds, as well as the remaining frames/seconds. This does _not_ care
648
+ /// about skipped samples due to gapless playback.</para>
649
+ ///<para>Returns MPG123 error codes.</para>
650
+ ///</summary>
651
+ ///<param name="frameoffset">Offset (in frames) from now.</param>
652
+ ///<param name="bufferedbytes">Number of output bytes served by library but not yet played.</param>
653
+ ///<param name="currentframe">Returns projected current frame.</param>
654
+ ///<param name="framesleft">Returns projected frames remaining.</param>
655
+ ///<param name="currentseconds">Returns projected current seconds.</param>
656
+ ///<param name="secondsleft">Returns projected seconds remaining.</param>
657
+ ///<returns>MPG123 error codes.</returns>
658
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_position(long long frameoffset, long long bufferedbytes,
659
+ [Out] long long% currentframe, [Out] long long% framesleft,
660
+ [Out] double% currentseconds, [Out] double% secondsleft);
661
+
662
+ #pragma endregion -Position and Seeking
663
+
664
+ #pragma region Volume and Equalizer
665
+
666
+ // \defgroup mpg123_voleq mpg123 volume and equalizer
667
+ //
668
+
669
+ public:
670
+
671
+ ///<summary>Set the 32 Band Audio Equalizer settings.
672
+ ///<para>Returns MPG123 error codes.</para>
673
+ ///</summary>
674
+ ///<param name="channel">Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for both. (enum mpg.channels)</param>
675
+ ///<param name ="band">The equaliser band to change (from 0 to 31)</param>
676
+ ///<param name="fval">The (linear) adjustment factor to be applied.</param>
677
+ ///<returns>MPG123 error codes.</returns>
678
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_eq(mpg123clr::mpg::channels channel, int band, double fval);
679
+
680
+ ///<summary>Get the 32 Band Audio Equalizer settings.
681
+ ///<para>Rreturns the (linear) adjustment factor.</para>
682
+ ///</summary>
683
+ ///<param name="channel">Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for (arithmetic mean of) both. (enum mpg.channels)</param>
684
+ ///<param name="band">The equaliser band to get (from 0 to 31)</param>
685
+ ///<return>The (linear) adjustment factor.</return>
686
+ double __clrcall mpg123_geteq(mpg123clr::mpg::channels channel, int band);
687
+
688
+ ///<summary>Reset the 32 Band Audio Equalizer settings to flat.
689
+ ///<para>Returns MPG123 error codes.</para>
690
+ ///</summary>
691
+ ///<returns>MPG123 error codes.</returns>
692
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_reset_eq();
693
+
694
+ ///<summary>Set the absolute output volume including the RVA setting.
695
+ ///<para>Returns MPG123 error codes.</para>
696
+ ///</summary>
697
+ ///<param name="volume">The (linear) adjustment factor to be applied, volume &lt; 0 just applies (a possibly changed) RVA setting.</param>
698
+ ///<returns>MPG123 error codes.</returns>
699
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_volume(double volume);
700
+
701
+ ///<summary>Adjust output volume including the RVA setting.
702
+ ///<para>Returns MPG123 error codes.</para>
703
+ ///</summary>
704
+ ///<param name="change">The (linear) adjustment factor to be applied.</param>
705
+ ///<returns>MPG123 error codes.</returns>
706
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_volume_change(double change);
707
+
708
+ ///<summary>Get the current volume setting, the actual value due to RVA, and the RVA adjustment itself.
709
+ ///<para>Returns MPG123 error codes.</para>
710
+ ///</summary>
711
+ ///<param name="basevol">Returns the current linear volume factor. (not percent)</param>
712
+ ///<param name="really">Returns the actual linear volume factor due to RVA. (not percent)</param>
713
+ ///<param name="rva_db">Returns the RVA adjustment in decibels.</param>
714
+ ///<returns>MPG123 error codes.</returns>
715
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_getvolume([Out] double% basevol, [Out] double% really, [Out] double% rva_db);
716
+
717
+ #pragma endregion -Volume and Equalizer
718
+
719
+ #pragma region Status and Information
720
+
721
+ // \defgroup mpg123_status mpg123 status and information
722
+ //
723
+ //
724
+ //
725
+
726
+ [StructLayout(LayoutKind::Sequential, CharSet=CharSet::Ansi, Pack=1)]
727
+ ref struct mpeg_frameinfo
728
+ {
729
+ mpg123clr::mpg::mpeg_version version; // The MPEG version (1.0/2.0/2.5).
730
+ int layer; // The MPEG Audio Layer (MP1/MP2/MP3).
731
+ long rate; // The sampling rate in Hz.
732
+ mpg123clr::mpg::mpeg_mode mode; // The audio mode (Mono, Stereo, Joint-stero, Dual Channel).
733
+ int mode_ext; // The mode extension bit flag.
734
+ int framesize; // The size of the frame (in bytes).
735
+ mpg123clr::mpg::mpeg_flags flags; // MPEG Audio flag bits.
736
+ int emphasis; // The emphasis type.
737
+ int bitrate; // Bitrate of the frame (kbps).
738
+ int abr_rate; // The target average bitrate.
739
+ mpg123clr::mpg::mpeg_vbr vbr; // The VBR mode.
740
+ };
741
+
742
+ ///<summary>Get the frame information about the MPEG audio bitstream.
743
+ ///<para>Returns MPG123 error codes.</para>
744
+ ///</summary>
745
+ ///<param name="finfo">Returns the frame information.</param>
746
+ ///<returns>MPG123 error codes.</returns>
747
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_info([Out]mpeg_frameinfo^% finfo);
748
+
749
+ ///<summary>Get the frame information about the MPEG audio bitstream.
750
+ ///<para>SafeInfo uses "safe" managed structures but is somewhat slower than Info().
751
+ /// Recommend using Info() unless it gives specific problems.</para>
752
+ ///<para>Returns MPG123 error codes.</para>
753
+ ///</summary>
754
+ ///<param name="finfo">Returns the frame information.</param>
755
+ ///<returns>MPG123 error codes.</returns>
756
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_safeinfo([Out]mpeg_frameinfo^% finfo);
757
+
758
+ ///<summary>Get the safe output buffer size for all cases (when you want to replace the internal buffer).
759
+ ///<para>Returns safe buffer size.</para>
760
+ ///</summary>
761
+ ///<returns>Safe buffer size.</returns>
762
+ static size_t __clrcall mpg123_safe_buffer(void);
763
+
764
+ ///<summary>Make a full parsing scan of each frame in the file.
765
+ ///<para>ID3 tags are found. An accurate length value is stored. Seek index will be filled.
766
+ /// A seek back to current position is performed.</para>
767
+ ///<para>This function refuses work when stream is not seekable.</para>
768
+ ///<para>Returns MPG123 error codes.</para>
769
+ ///</summary>
770
+ ///<returns>MPG123 error codes.</returns>
771
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_scan(void);
772
+
773
+ ///<summary>Return, if possible, the full (expected) length of current track in samples.
774
+ ///<para>Returns length (>= 0) or MPG123_ERR if there is no length guess possible. (Multiply by BlockAlign for byte-count)</para>
775
+ ///</summary>
776
+ ///<returns>Length (>= 0) or MPG123_ERR if there is no length guess possible. (Multiply by BlockAlign for byte-count)</returns>
777
+ long long __clrcall mpg123_length(void);
778
+
779
+ ///<summary>Override the value for file size in bytes.
780
+ ///<para>Useful for getting sensible track length values in feed mode or for HTTP streams.</para>
781
+ ///<para>Returns MPG123 error codes.</para>
782
+ ///</summary>
783
+ ///<param name="size">Size to set.</param>
784
+ ///<returns>MPG123 error codes.</returns>
785
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_set_filesize(long long size);
786
+
787
+ ///<summary>Time Per Frame (seconds).
788
+ ///<para>Returns time per frame in seconds ( &lt; 0 is error ).</para>
789
+ ///</summary>
790
+ ///<returns>Time per frame in seconds ( &lt; 0 is error ).</returns>
791
+ double __clrcall mpg123_tpf(void);
792
+
793
+ ///<summary>Get and reset the clip count.
794
+ ///<para>Returns the number of previously encountered clips.</para>
795
+ ///</summary>
796
+ ///<returns>The number of previously encountered clips.</returns>
797
+ long __clrcall mpg123_clip();
798
+
799
+ ///<summary>Get various current decoder/stream state information.
800
+ ///<para>Returns MPG123 error codes.</para>
801
+ ///</summary>
802
+ ///<param name="key">The key to identify the information to get (enum mpg.state).</param>
803
+ ///<param name="val">Returns integer values.</param>
804
+ ///<param name="fval">Returns real values.</param>
805
+ ///<returns>MPG123 error codes.</returns>
806
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_getstate(mpg123clr::mpg::state key, [Out] int% val, [Out] double% fval);
807
+
808
+ #pragma endregion -Status and Information
809
+
810
+ #pragma region Metadata Handling
811
+
812
+ // \defgroup mpg123_metadata mpg123 metadata handling
813
+ //
814
+ // Functions to retrieve the metadata from MPEG Audio files and streams.
815
+ // Also includes string handling functions.
816
+ //
817
+
818
+ // clr - much of the metadata has been relocated to class files for maintainability
819
+ // see string.h, text.h, id3v1.h and id3v2.h
820
+ //
821
+
822
+ ///<summary>Query if there is (new) meta info, be it ID3 or ICY (or something new in future).
823
+ ///<para>Returns a combination of flags. (enum id3.id3check)</para>
824
+ ///</summary>
825
+ ///<returns>Returns a combination of flags. (enum id3.id3check)</returns>
826
+ mpg123clr::id3::id3check __clrcall mpg123_meta_check(void); /* On error (no valid handle) just 0 is returned. */
827
+
828
+ ///<summary>Get ID3 data. Data structures may change on any (next) read/decode function call.
829
+ ///<para>v1 and/or v2 may be Empty if no corresponding data exists.</para>
830
+ ///<para>Returns MPG123_OK or MPG123_ERR.</para>
831
+ ///</summary>
832
+ ///<param name="v1">Returns mpg123id3v1 data structure containing ID3v1 data (usually from end of file).</param>
833
+ ///<param name="v2">Returns mpg123id3v2 data structure containing ID3v2 data (usually - but not restricted to - from beginning of file).</param>
834
+ ///<returns>Returns MPG123_OK or MPG123_ERR.</returns>
835
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_id3([Out]id3::mpg123id3v1^% v1, [Out]id3::mpg123id3v2^% v2);
836
+
837
+ ///<summary>Get ICY meta data. Data structure may change on any (next) read/decode function call.
838
+ ///<para>Icy_meta may be null if no corresponding data exists.</para>
839
+ ///<para>Returns MPG123_OK or MPG123_ERR.</para>
840
+ ///</summary>
841
+ ///<param name="icy_meta">Returns ICY meta data (windows-1252 encoded).</param>
842
+ ///<returns>Returns MPG123_OK or MPG123_ERR.</returns>
843
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_icy([Out]IntPtr% icy_meta); /* same for ICY meta string */
844
+
845
+ ///<summary>Decode from windows-1252 (the encoding ICY metainfo used) to UTF-8.
846
+ ///<para>Returns byte array of utf8 encoded data.</para>
847
+ ///</summary>
848
+ ///<param name="icy_text">ICY meta data in ICY encoding.</param>
849
+ ///<returns>Returns byte array of utf8 encoded data.</returns>
850
+ static array<unsigned char>^ __clrcall mpg123_icy2utf8(IntPtr icy_text);
851
+
852
+ #pragma endregion -Metadata Handling
853
+
854
+ #pragma region Advanced Parameter API
855
+
856
+ // \defgroup mpg123_advpar mpg123 advanced parameter API
857
+ //
858
+ // Direct access to a parameter set without full handle around it.
859
+ // Possible uses:
860
+ // - Influence behaviour of library _during_ initialization of handle (MPG123_VERBOSE).
861
+ // - Use one set of parameters for multiple handles.
862
+ //
863
+ // The functions for handling mpg123_pars (mpg123_par() and mpg123_fmt()
864
+ // family) directly return a fully qualified mpg123 error code, the ones
865
+ // operating on full handles normally MPG123_OK or MPG123_ERR, storing the
866
+ // specific error code itself inside the handle.
867
+ //
868
+
869
+ // see advanced.h
870
+
871
+ #pragma endregion -Advanced Parameter API
872
+
873
+ #pragma region Low Level I/O
874
+
875
+ // \defgroup mpg123_lowio mpg123 low level I/O
876
+ // You may want to do tricky stuff with I/O that does not work with mpg123's default file access or you want to make it decode into your own pocket...
877
+ //
878
+
879
+ ///<summary>Replace default internal buffer with user-supplied buffer.
880
+ ///<para>Instead of working on it's own private buffer, mpg123 will directly use the one you provide for storing decoded audio.</para>
881
+ ///<para>The data buffer should be pinned before calling this function.</para>
882
+ ///<para>Returns MPG123_OK or MPG123 error code.</para>
883
+ ///</summary>
884
+ ///<param name="data">Pointer to supplied buffer.</param>
885
+ ///<param name="size">Size of supplied buffer.</param>
886
+ ///<returns>MPG123_OK or MPG123_ERR code.</returns>
887
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_replace_buffer(IntPtr data, size_t size);
888
+
889
+ ///<summary>The max size of one frame's decoded output with current settings.
890
+ ///<para>Use that to determine an appropriate minimum buffer size for decoding one frame.</para>
891
+ ///<para>Returns size of required buffer.</para>
892
+ ///</summary>
893
+ ///<returns>Size of required buffer.</returns>
894
+ size_t __clrcall mpg123_outblock(void);
895
+
896
+ ///<summary>Replace low-level stream access functions; read and lseek as known in POSIX.
897
+ ///<para>You can use this to make any fancy file opening/closing yourself,
898
+ /// using mpg123_open_fd() to set the file descriptor for your read/lseek (doesn't need to be a 'real' file descriptor...).</para>
899
+ ///<para>Setting a function to NULL means that the default internal function is used (active from next Open call onward).</para>
900
+ /////////////////////////
901
+ ///<para>Always returns MPG123_OK.</para>
902
+ ///</summary>
903
+ ///<param name="r_read">Delegate for read function, null for default.</param>
904
+ ///<param name="r_lseek">Delegate for lseek function, null for default.</param>
905
+ ///<returns>Always MPG123_OK.</returns>
906
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_replace_reader(ReadDelegate^ r_read, SeekDelegate^ r_lseek);
907
+
908
+ ///////////////////////////////////////
909
+ mpg123clr::mpg::ErrorCode __clrcall mpg123_replace_reader_handle(ReadHandleDelegate^ rh_read, SeekHandleDelegate^ rh_lseek, CleanupHandleDelegate^ rh_clean);
910
+
911
+ private:
912
+
913
+ // Defered internal implementation of ReplaceReader - action is defered until next 'Open' operation.
914
+ void __clrcall _ReplaceReader(void);
915
+
916
+ public:
917
+
918
+ // These functions are not part of the mpg123clr wrapper but are included as proof of concept
919
+ // of how to implement callback functions.
920
+
921
+ ///<summary>Proof of concept posix-like lseek function.
922
+ ///<para>This routine should not normally be called from your callback routine, it is a sample function
923
+ /// showing how such a callback could be implemented.</para>
924
+ ///</summary>
925
+ ///<param name="fd">File descriptor.</param>
926
+ ///<param name="offset">Required position.</param>
927
+ ///<param name="origin">Whence.</param>
928
+ ///<returns>Resultant position.</returns>
929
+ static long PosixSeek(int fd, long offset, int origin)
930
+ {
931
+ long ret = _lseek(fd, offset, origin);
932
+ return ret;
933
+ }
934
+
935
+ ///<summary>Proof of concept posix-like read function.
936
+ ///<para>This routine should not normally be called from your callback routine, it is a sample function
937
+ /// showing how such a callback could be implemented.</para>
938
+ ///</summary>
939
+ ///<param name="fd">File descriptor.</param>
940
+ ///<param name="buf">Buffer address.</param>
941
+ ///<param name="count">Size of buffer.</param>
942
+ ///<returns>Actual bytes read.</returns>
943
+ static int PosixRead(int fd, void*buf, unsigned int count)
944
+ {
945
+ int ret = _read(fd, buf, count);
946
+ return ret;
947
+ }
948
+
949
+ #pragma endregion -Low Level I/O
950
+
951
+ };
952
+
953
+ }