codemirror-lang-liquidsoap 0.3.5 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (427) hide show
  1. package/dist/cli.js +8 -8
  2. package/dist/index.js +7 -7
  3. package/package.json +1 -1
  4. package/src/liquidsoap.grammar +10 -4
  5. package/src/parser.js +6 -6
  6. package/tests/liquidsoap/.codespellignore +1 -0
  7. package/tests/liquidsoap/.github/ISSUE_TEMPLATE/bug_report.yml +16 -0
  8. package/tests/liquidsoap/.github/docker/alpine.dockerfile +20 -0
  9. package/tests/liquidsoap/.github/docker/debian.dockerfile +55 -0
  10. package/tests/liquidsoap/.github/opam/{liquidsoap-core-windows.opam → liquidsoap-windows.opam} +8 -5
  11. package/tests/liquidsoap/.github/renovate.json +23 -0
  12. package/tests/liquidsoap/.github/scripts/add-local-opam-packages.sh +5 -3
  13. package/tests/liquidsoap/.github/scripts/build-apk.sh +10 -19
  14. package/tests/liquidsoap/.github/scripts/build-deb.sh +6 -15
  15. package/tests/liquidsoap/.github/scripts/build-details.sh +15 -4
  16. package/tests/liquidsoap/.github/scripts/build-posix.sh +11 -20
  17. package/tests/liquidsoap/.github/scripts/build-website.sh +1 -1
  18. package/tests/liquidsoap/.github/scripts/build-win32.sh +6 -2
  19. package/tests/liquidsoap/.github/scripts/push-docker.sh +13 -15
  20. package/tests/liquidsoap/.github/workflows/ci.yml +291 -185
  21. package/tests/liquidsoap/.ocamlformat +1 -1
  22. package/tests/liquidsoap/.pre-commit-config.yaml +2 -2
  23. package/tests/liquidsoap/CHANGES.md +112 -3
  24. package/tests/liquidsoap/README.md +10 -9
  25. package/tests/liquidsoap/ROADMAP.md +14 -8
  26. package/tests/liquidsoap/bin/liquidsoap-macos-instruments +7 -0
  27. package/tests/liquidsoap/doc/content/build.md +0 -1
  28. package/tests/liquidsoap/doc/content/faq.md +2 -4
  29. package/tests/liquidsoap/doc/content/icy_metadata.md +2 -2
  30. package/tests/liquidsoap/doc/content/install.md +13 -2
  31. package/tests/liquidsoap/doc/content/json.md +1 -1
  32. package/tests/liquidsoap/doc/content/language.md +4 -4
  33. package/tests/liquidsoap/doc/content/liq/beets-protocol.liq +1 -1
  34. package/tests/liquidsoap/doc/content/liq/crossfade.liq +1 -1
  35. package/tests/liquidsoap/doc/content/liq/harbor-simple.liq +1 -1
  36. package/tests/liquidsoap/doc/content/liq/radiopi.liq +10 -9
  37. package/tests/liquidsoap/doc/content/liq/request.dynamic.liq +1 -1
  38. package/tests/liquidsoap/doc/content/migrating.md +25 -3
  39. package/tests/liquidsoap/doc/content/playlist_parsers.md +46 -1
  40. package/tests/liquidsoap/doc/content/script_loading.md +3 -0
  41. package/tests/liquidsoap/doc/content/xml.md +160 -0
  42. package/tests/liquidsoap/doc/dune.inc +129 -0
  43. package/tests/liquidsoap/dune-project +29 -49
  44. package/tests/liquidsoap/liquidsoap +1 -1
  45. package/tests/liquidsoap/{liquidsoap-js.opam → opam/liquidsoap-js.opam} +3 -2
  46. package/tests/liquidsoap/{liquidsoap-lang.opam → opam/liquidsoap-lang.opam} +4 -3
  47. package/tests/liquidsoap/{liquidsoap-mode.opam → opam/liquidsoap-mode.opam} +3 -2
  48. package/tests/liquidsoap/{liquidsoap-core.opam → opam/liquidsoap.opam} +46 -17
  49. package/tests/liquidsoap/{prometheus-liquidsoap.opam → opam/prometheus-liquidsoap.opam} +2 -1
  50. package/tests/liquidsoap/{sdl-liquidsoap.opam → opam/sdl-liquidsoap.opam} +2 -1
  51. package/tests/liquidsoap/{tls-liquidsoap.opam → opam/tls-liquidsoap.opam} +2 -1
  52. package/tests/liquidsoap/src/bin/dune +1 -1
  53. package/tests/liquidsoap/src/config/xmlplaylist_option.disabled.ml +2 -0
  54. package/tests/liquidsoap/src/core/builtins/builtins_ffmpeg_decoder.ml +22 -22
  55. package/tests/liquidsoap/src/core/builtins/builtins_ffmpeg_encoder.ml +4 -4
  56. package/tests/liquidsoap/src/core/builtins/builtins_ffmpeg_filters.ml +37 -41
  57. package/tests/liquidsoap/src/core/builtins/builtins_files.ml +3 -1
  58. package/tests/liquidsoap/src/core/builtins/builtins_optionals.ml +0 -1
  59. package/tests/liquidsoap/src/core/builtins/builtins_process.ml +15 -7
  60. package/tests/liquidsoap/src/core/builtins/builtins_resolvers.ml +16 -0
  61. package/tests/liquidsoap/src/core/builtins/builtins_socket.ml +7 -5
  62. package/tests/liquidsoap/src/core/builtins/builtins_source.ml +3 -3
  63. package/tests/liquidsoap/src/core/builtins/builtins_srt.ml +84 -8
  64. package/tests/liquidsoap/src/core/builtins/builtins_string_extra.ml +13 -0
  65. package/tests/liquidsoap/src/core/builtins/builtins_sys.ml +6 -6
  66. package/tests/liquidsoap/src/core/builtins/builtins_thread.ml +2 -2
  67. package/tests/liquidsoap/src/core/builtins/builtins_time.ml +5 -3
  68. package/tests/liquidsoap/src/core/builtins/builtins_tls.ml +1 -1
  69. package/tests/liquidsoap/src/core/clock.ml +105 -38
  70. package/tests/liquidsoap/src/core/clock.mli +1 -0
  71. package/tests/liquidsoap/src/core/clock_base.ml +2 -2
  72. package/tests/liquidsoap/src/core/conversions/stereo.ml +6 -8
  73. package/tests/liquidsoap/src/core/converters/audio_converter.mli +5 -5
  74. package/tests/liquidsoap/src/core/converters/video_converter.ml +2 -2
  75. package/tests/liquidsoap/src/core/converters/video_converter.mli +3 -3
  76. package/tests/liquidsoap/src/core/decoder/decoder.ml +14 -17
  77. package/tests/liquidsoap/src/core/decoder/decoder.mli +11 -11
  78. package/tests/liquidsoap/src/core/decoder/decoder_utils.ml +12 -13
  79. package/tests/liquidsoap/src/core/decoder/decoder_utils.mli +2 -3
  80. package/tests/liquidsoap/src/core/decoder/external_decoder.ml +9 -13
  81. package/tests/liquidsoap/src/core/decoder/ffmpeg_decoder.ml +57 -53
  82. package/tests/liquidsoap/src/core/decoder/ffmpeg_raw_decoder.ml +28 -9
  83. package/tests/liquidsoap/src/core/decoder/flac_metadata_plug.ml +15 -2
  84. package/tests/liquidsoap/src/core/decoder/image_decoder.ml +33 -19
  85. package/tests/liquidsoap/src/core/decoder/liq_flac_decoder.ml +22 -23
  86. package/tests/liquidsoap/src/core/decoder/liq_ogg_decoder.ml +5 -5
  87. package/tests/liquidsoap/src/core/decoder/mad_decoder.ml +2 -2
  88. package/tests/liquidsoap/src/core/decoder/midi_decoder.ml +1 -2
  89. package/tests/liquidsoap/src/core/decoder/ogg_flac_duration.ml +3 -11
  90. package/tests/liquidsoap/src/core/decoder/ogg_metadata_plug.ml +15 -2
  91. package/tests/liquidsoap/src/core/decoder/raw_audio_decoder.ml +8 -7
  92. package/tests/liquidsoap/src/core/decoder/wav_aiff_decoder.ml +3 -3
  93. package/tests/liquidsoap/src/core/dune +2 -15
  94. package/tests/liquidsoap/src/core/encoder/encoder.ml +18 -23
  95. package/tests/liquidsoap/src/core/encoder/encoder.mli +12 -17
  96. package/tests/liquidsoap/src/core/encoder/encoders/ffmpeg_encoder.ml +13 -27
  97. package/tests/liquidsoap/src/core/encoder/encoders/ffmpeg_encoder_common.ml +1 -1
  98. package/tests/liquidsoap/src/core/encoder/encoders/flac_encoder.ml +3 -4
  99. package/tests/liquidsoap/src/core/encoder/encoders/ndi_encoder.ml +2 -1
  100. package/tests/liquidsoap/src/core/encoder/encoders/ogg_encoder.ml +1 -2
  101. package/tests/liquidsoap/src/core/encoder/lang/lang_external_encoder.ml +2 -2
  102. package/tests/liquidsoap/src/core/encoder/lang/lang_fdkaac.ml +1 -1
  103. package/tests/liquidsoap/src/core/encoder/lang/lang_ffmpeg.ml +46 -39
  104. package/tests/liquidsoap/src/core/encoder/lang/lang_flac.ml +1 -1
  105. package/tests/liquidsoap/src/core/encoder/lang/lang_shine.ml +2 -2
  106. package/tests/liquidsoap/src/core/encoder/lang/lang_vorbis.ml +1 -1
  107. package/tests/liquidsoap/src/core/encoder/lang/lang_wav.ml +1 -1
  108. package/tests/liquidsoap/src/core/file_watcher.inotify.ml +8 -13
  109. package/tests/liquidsoap/src/core/harbor/harbor.ml +22 -24
  110. package/tests/liquidsoap/src/core/io/ffmpeg_filter_io.ml +4 -3
  111. package/tests/liquidsoap/src/core/io/oss_io.ml +3 -4
  112. package/tests/liquidsoap/src/core/io/portaudio_io.ml +1 -1
  113. package/tests/liquidsoap/src/core/io/pulseaudio_io.ml +3 -4
  114. package/tests/liquidsoap/src/core/io/srt_io.ml +316 -120
  115. package/tests/liquidsoap/src/core/io/udp_io.ml +14 -12
  116. package/tests/liquidsoap/src/core/lang.mli +10 -12
  117. package/tests/liquidsoap/src/core/lang_source.ml +25 -39
  118. package/tests/liquidsoap/src/core/lang_string.ml +30 -0
  119. package/tests/liquidsoap/src/core/lang_string.mli +3 -0
  120. package/tests/liquidsoap/src/core/ogg_formats/ogg_flac_encoder.ml +6 -6
  121. package/tests/liquidsoap/src/core/ogg_formats/ogg_muxer.ml +17 -27
  122. package/tests/liquidsoap/src/core/ogg_formats/ogg_muxer.mli +44 -53
  123. package/tests/liquidsoap/src/core/ogg_formats/opus_encoder.ml +1 -1
  124. package/tests/liquidsoap/src/core/ogg_formats/vorbis_encoder.ml +1 -2
  125. package/tests/liquidsoap/src/core/operators/add.ml +2 -2
  126. package/tests/liquidsoap/src/core/operators/cross.ml +2 -2
  127. package/tests/liquidsoap/src/core/operators/delay.ml +23 -6
  128. package/tests/liquidsoap/src/core/operators/dtmf.ml +3 -2
  129. package/tests/liquidsoap/src/core/operators/dyn_op.ml +2 -2
  130. package/tests/liquidsoap/src/core/operators/fir_filter.ml +2 -1
  131. package/tests/liquidsoap/src/core/operators/iir_filter.ml +1 -1
  132. package/tests/liquidsoap/src/core/operators/insert_metadata.ml +1 -1
  133. package/tests/liquidsoap/src/core/operators/lilv_op.ml +1 -1
  134. package/tests/liquidsoap/src/core/operators/lufs.ml +136 -89
  135. package/tests/liquidsoap/src/core/operators/lufs_c.c +105 -0
  136. package/tests/liquidsoap/src/core/operators/map_metadata.ml +33 -9
  137. package/tests/liquidsoap/src/core/operators/max_duration.ml +3 -4
  138. package/tests/liquidsoap/src/core/operators/muxer.ml +2 -1
  139. package/tests/liquidsoap/src/core/operators/noblank.ml +6 -6
  140. package/tests/liquidsoap/src/core/operators/sequence.ml +5 -5
  141. package/tests/liquidsoap/src/core/operators/switch.ml +10 -11
  142. package/tests/liquidsoap/src/core/operators/time_warp.ml +14 -11
  143. package/tests/liquidsoap/src/core/operators/video_fade.ml +2 -3
  144. package/tests/liquidsoap/src/core/outputs/ao_out.ml +1 -1
  145. package/tests/liquidsoap/src/core/outputs/bjack_out.ml +1 -1
  146. package/tests/liquidsoap/src/core/outputs/graphics_out.ml +6 -2
  147. package/tests/liquidsoap/src/core/outputs/harbor_output.ml +12 -10
  148. package/tests/liquidsoap/src/core/outputs/hls_output.ml +19 -14
  149. package/tests/liquidsoap/src/core/outputs/icecast2.ml +85 -52
  150. package/tests/liquidsoap/src/core/outputs/ndi_out.ml +1 -1
  151. package/tests/liquidsoap/src/core/outputs/output.ml +8 -9
  152. package/tests/liquidsoap/src/core/outputs/output.mli +61 -61
  153. package/tests/liquidsoap/src/core/outputs/pipe_output.ml +8 -6
  154. package/tests/liquidsoap/src/core/outputs/sdl_out.ml +5 -2
  155. package/tests/liquidsoap/src/core/playlist_parser.ml +6 -7
  156. package/tests/liquidsoap/src/core/playlists/playlist_basic.ml +0 -180
  157. package/tests/liquidsoap/src/core/protocols/annotate.ml +3 -3
  158. package/tests/liquidsoap/src/core/request.ml +16 -17
  159. package/tests/liquidsoap/src/core/request.mli +27 -28
  160. package/tests/liquidsoap/src/core/shebang.ml +3 -2
  161. package/tests/liquidsoap/src/core/source.ml +104 -63
  162. package/tests/liquidsoap/src/core/source.mli +249 -247
  163. package/tests/liquidsoap/src/core/sources/generated.ml +2 -2
  164. package/tests/liquidsoap/src/core/sources/request_dynamic.ml +2 -2
  165. package/tests/liquidsoap/src/core/sources/synthesized.ml +2 -2
  166. package/tests/liquidsoap/src/core/stream/aFrame.mli +7 -9
  167. package/tests/liquidsoap/src/core/stream/content.mli +4 -13
  168. package/tests/liquidsoap/src/core/stream/content_base.ml +2 -19
  169. package/tests/liquidsoap/src/core/stream/content_video.ml +9 -10
  170. package/tests/liquidsoap/src/core/stream/ffmpeg_copy_content.ml +19 -15
  171. package/tests/liquidsoap/src/core/stream/ffmpeg_raw_content.ml +26 -9
  172. package/tests/liquidsoap/src/core/stream/frame.ml +4 -4
  173. package/tests/liquidsoap/src/core/stream/frame.mli +13 -15
  174. package/tests/liquidsoap/src/core/stream/frame_base.ml +1 -2
  175. package/tests/liquidsoap/src/core/stream/frame_settings.ml +14 -14
  176. package/tests/liquidsoap/src/core/stream/generator.mli +14 -17
  177. package/tests/liquidsoap/src/core/stream/mFrame.mli +2 -2
  178. package/tests/liquidsoap/src/core/tools/charset.ml +28 -18
  179. package/tests/liquidsoap/src/core/tools/charset_base.ml +5 -0
  180. package/tests/liquidsoap/src/core/tools/child_support.ml +2 -2
  181. package/tests/liquidsoap/src/core/tools/ffmpeg_avfilter_utils.ml +139 -0
  182. package/tests/liquidsoap/src/core/tools/ffmpeg_avfilter_utils.mli +22 -0
  183. package/tests/liquidsoap/src/core/tools/ffmpeg_utils.ml +2 -1
  184. package/tests/liquidsoap/src/core/tools/lifecycle.mli +4 -4
  185. package/tests/liquidsoap/src/core/tools/liq_http.ml +44 -19
  186. package/tests/liquidsoap/src/core/tools/liq_http.mli +1 -1
  187. package/tests/liquidsoap/src/core/tools/log.ml +3 -8
  188. package/tests/liquidsoap/src/core/tools/log.mli +1 -1
  189. package/tests/liquidsoap/src/core/tools/mutex_utils.ml +1 -1
  190. package/tests/liquidsoap/src/core/tools/pool.ml +2 -2
  191. package/tests/liquidsoap/src/core/tools/process_handler.mli +30 -27
  192. package/tests/liquidsoap/src/core/tools/producer_consumer.ml +10 -9
  193. package/tests/liquidsoap/src/{lang → core/tools}/queues.ml +58 -64
  194. package/tests/liquidsoap/src/{lang → core/tools}/queues.mli +10 -0
  195. package/tests/liquidsoap/src/core/tools/sdl_utils.ml +2 -0
  196. package/tests/liquidsoap/src/core/tools/server.mli +8 -8
  197. package/tests/liquidsoap/src/core/tools/sha1.ml +2 -1
  198. package/tests/liquidsoap/src/core/tools/start_stop.ml +2 -1
  199. package/tests/liquidsoap/src/core/tools/strings.mli +5 -4
  200. package/tests/liquidsoap/src/core/tools/tutils.ml +7 -7
  201. package/tests/liquidsoap/src/core/tools/tutils.mli +14 -18
  202. package/tests/liquidsoap/src/core/tools/unix_c.c +16 -5
  203. package/tests/liquidsoap/src/core/tools/utils.ml +83 -25
  204. package/tests/liquidsoap/src/core/tools/wav_aiff.ml +3 -3
  205. package/tests/liquidsoap/src/core/tools/wav_aiff.mli +7 -7
  206. package/tests/liquidsoap/src/core/types/format_type.ml +6 -6
  207. package/tests/liquidsoap/src/js/index.html +1 -154
  208. package/tests/liquidsoap/src/js/interactive_js.ml +7 -3
  209. package/tests/liquidsoap/src/js/stdlib_js.liq +6 -0
  210. package/tests/liquidsoap/src/lang/builtins_lang.ml +8 -0
  211. package/tests/liquidsoap/src/lang/builtins_null.ml +1 -1
  212. package/tests/liquidsoap/src/lang/builtins_string.ml +2 -11
  213. package/tests/liquidsoap/src/lang/builtins_xml.ml +204 -0
  214. package/tests/liquidsoap/src/lang/cache.ml +7 -2
  215. package/tests/liquidsoap/src/lang/dune +5 -2
  216. package/tests/liquidsoap/src/lang/flags.ml +2 -2
  217. package/tests/liquidsoap/src/lang/lang.mli +10 -12
  218. package/tests/liquidsoap/src/lang/lang_core.ml +24 -24
  219. package/tests/liquidsoap/src/lang/lang_eval.ml +1 -1
  220. package/tests/liquidsoap/src/lang/lang_string.ml +7 -13
  221. package/tests/liquidsoap/src/lang/lang_string.mli +0 -1
  222. package/tests/liquidsoap/src/lang/lexer.ml +3 -0
  223. package/tests/liquidsoap/src/lang/parser.mly +7 -4
  224. package/tests/liquidsoap/src/lang/parser_helper.ml +9 -77
  225. package/tests/liquidsoap/src/lang/parser_helper.mli +1 -1
  226. package/tests/liquidsoap/src/lang/pos.ml +4 -4
  227. package/tests/liquidsoap/src/lang/pos.mli +55 -0
  228. package/tests/liquidsoap/src/lang/preprocessor.ml +12 -5
  229. package/tests/liquidsoap/src/lang/repr.ml +6 -6
  230. package/tests/liquidsoap/src/lang/runtime.ml +55 -48
  231. package/tests/liquidsoap/src/lang/runtime.mli +8 -3
  232. package/tests/liquidsoap/src/lang/term/parsed_term.ml +33 -33
  233. package/tests/liquidsoap/src/lang/term/term_base.ml +14 -10
  234. package/tests/liquidsoap/src/lang/term/term_preprocessor.ml +28 -1
  235. package/tests/liquidsoap/src/lang/term/term_reducer.ml +244 -132
  236. package/tests/liquidsoap/src/lang/term/term_reducer.mli +10 -2
  237. package/tests/liquidsoap/src/lang/term/term_stdlib.ml +14 -13
  238. package/tests/liquidsoap/src/lang/term.mli +3 -1
  239. package/tests/liquidsoap/src/lang/typechecking.ml +16 -16
  240. package/tests/liquidsoap/src/lang/typechecking.mli +5 -1
  241. package/tests/liquidsoap/src/lang/types/type_base.ml +16 -17
  242. package/tests/liquidsoap/src/lang/typing.ml +13 -12
  243. package/tests/liquidsoap/src/lang/typing.mli +2 -1
  244. package/tests/liquidsoap/src/lang/value.ml +20 -14
  245. package/tests/liquidsoap/src/libs/audio.liq +53 -18
  246. package/tests/liquidsoap/src/libs/autocue.liq +8 -8
  247. package/tests/liquidsoap/src/libs/clock.liq +3 -3
  248. package/tests/liquidsoap/src/libs/dune +2 -2
  249. package/tests/liquidsoap/src/libs/extra/audio.liq +4 -4
  250. package/tests/liquidsoap/src/libs/extra/audioscrobbler.liq +487 -0
  251. package/tests/liquidsoap/src/libs/extra/deprecations.liq +11 -11
  252. package/tests/liquidsoap/src/libs/extra/externals.liq +9 -9
  253. package/tests/liquidsoap/src/libs/extra/fades.liq +2 -2
  254. package/tests/liquidsoap/src/libs/extra/file.liq +1 -1
  255. package/tests/liquidsoap/src/libs/extra/http.liq +4 -4
  256. package/tests/liquidsoap/src/libs/extra/interactive.liq +1 -1
  257. package/tests/liquidsoap/src/libs/extra/metadata.liq +3 -3
  258. package/tests/liquidsoap/src/libs/extra/native.liq +6 -6
  259. package/tests/liquidsoap/src/libs/extra/server.liq +2 -2
  260. package/tests/liquidsoap/src/libs/extra/source.liq +10 -10
  261. package/tests/liquidsoap/src/libs/extra/spinitron.liq +11 -11
  262. package/tests/liquidsoap/src/libs/extra/telnet.liq +51 -0
  263. package/tests/liquidsoap/src/libs/extra/video.liq +2 -2
  264. package/tests/liquidsoap/src/libs/fades.liq +70 -57
  265. package/tests/liquidsoap/src/libs/ffmpeg.liq +50 -33
  266. package/tests/liquidsoap/src/libs/file.liq +8 -8
  267. package/tests/liquidsoap/src/libs/hls.liq +5 -5
  268. package/tests/liquidsoap/src/libs/http.liq +64 -37
  269. package/tests/liquidsoap/src/libs/icecast.liq +1 -1
  270. package/tests/liquidsoap/src/libs/io.liq +6 -6
  271. package/tests/liquidsoap/src/libs/medialib.liq +46 -45
  272. package/tests/liquidsoap/src/libs/metadata.liq +4 -4
  273. package/tests/liquidsoap/src/libs/null.liq +3 -3
  274. package/tests/liquidsoap/src/libs/playlist.liq +547 -22
  275. package/tests/liquidsoap/src/libs/protocols.liq +14 -14
  276. package/tests/liquidsoap/src/libs/replaygain.liq +11 -11
  277. package/tests/liquidsoap/src/libs/request.liq +27 -29
  278. package/tests/liquidsoap/src/libs/runtime.liq +2 -0
  279. package/tests/liquidsoap/src/libs/source.liq +15 -15
  280. package/tests/liquidsoap/src/libs/sqlite.liq +1 -1
  281. package/tests/liquidsoap/src/libs/stdlib.liq +1 -1
  282. package/tests/liquidsoap/src/libs/string.liq +6 -6
  283. package/tests/liquidsoap/src/libs/switches.liq +3 -3
  284. package/tests/liquidsoap/src/libs/thread.liq +3 -9
  285. package/tests/liquidsoap/src/libs/tracks.liq +23 -9
  286. package/tests/liquidsoap/src/libs/video.liq +32 -32
  287. package/tests/liquidsoap/src/modules/dtools/README.md +58 -0
  288. package/tests/liquidsoap/src/modules/dtools/dtools.ml +19 -0
  289. package/tests/liquidsoap/src/modules/dtools/dtools.mli +284 -0
  290. package/tests/liquidsoap/src/modules/dtools/dtools_impl.ml +860 -0
  291. package/tests/liquidsoap/src/modules/dtools/dtools_syslog.impl.ml +45 -0
  292. package/tests/liquidsoap/src/modules/dtools/dtools_syslog.noop.ml +1 -0
  293. package/tests/liquidsoap/src/modules/dtools/dune +12 -0
  294. package/tests/liquidsoap/src/modules/duppy/.merlin +4 -0
  295. package/tests/liquidsoap/src/modules/duppy/README.md +47 -0
  296. package/tests/liquidsoap/src/modules/duppy/dune +7 -0
  297. package/tests/liquidsoap/src/modules/duppy/duppy.ml +1097 -0
  298. package/tests/liquidsoap/src/modules/duppy/duppy.mli +494 -0
  299. package/tests/liquidsoap/src/modules/duppy/duppy_stubs.c +176 -0
  300. package/tests/liquidsoap/src/modules/duppy/examples/dune +9 -0
  301. package/tests/liquidsoap/src/modules/duppy/examples/http.ml +560 -0
  302. package/tests/liquidsoap/src/modules/duppy/examples/index.html +1 -0
  303. package/tests/liquidsoap/src/modules/duppy/examples/telnet.ml +150 -0
  304. package/tests/liquidsoap/src/modules/xmlplaylist/dune +5 -0
  305. package/tests/liquidsoap/src/modules/xmlplaylist/xmlplaylist.ml +185 -0
  306. package/tests/liquidsoap/src/modules/xmlplaylist/xmlplaylist.mli +56 -0
  307. package/tests/liquidsoap/src/ndi/ndi.mli +2 -3
  308. package/tests/liquidsoap/src/runtime/build_config.ml +0 -1
  309. package/tests/liquidsoap/src/runtime/main.ml +4 -23
  310. package/tests/liquidsoap/src/stereotool/stereotool.mli +3 -3
  311. package/tests/liquidsoap/src/tooling/parsed_json.ml +6 -4
  312. package/tests/liquidsoap/tests/core/content_test.ml +2 -39
  313. package/tests/liquidsoap/tests/core/dune +13 -0
  314. package/tests/liquidsoap/tests/core/dune.inc +1 -1
  315. package/tests/liquidsoap/tests/core/gen_dune.ml +4 -1
  316. package/tests/liquidsoap/tests/core/json_test.ml +10 -0
  317. package/tests/liquidsoap/tests/core/more_types.ml +32 -28
  318. package/tests/liquidsoap/tests/core/output_encoded_test.ml +2 -0
  319. package/tests/liquidsoap/tests/core/string_test.ml +4 -0
  320. package/tests/liquidsoap/tests/core/types.ml +1 -1
  321. package/tests/liquidsoap/tests/harbor/http.liq +1 -1
  322. package/tests/liquidsoap/tests/harbor/http2.liq +1 -1
  323. package/tests/liquidsoap/tests/language/cue_test.liq +3993 -0
  324. package/tests/liquidsoap/tests/language/dune.inc +24 -0
  325. package/tests/liquidsoap/tests/language/error.liq +1 -1
  326. package/tests/liquidsoap/tests/language/json.liq +11 -11
  327. package/tests/liquidsoap/tests/language/list.liq +1 -1
  328. package/tests/liquidsoap/tests/language/metadata.liq +1 -1
  329. package/tests/liquidsoap/tests/language/null.liq +9 -9
  330. package/tests/liquidsoap/tests/language/record.liq +23 -23
  331. package/tests/liquidsoap/tests/language/replaygain.liq +8 -8
  332. package/tests/liquidsoap/tests/language/sqlite.liq +1 -1
  333. package/tests/liquidsoap/tests/language/string.liq +1 -1
  334. package/tests/liquidsoap/tests/language/type_errors.liq +2 -2
  335. package/tests/liquidsoap/tests/language/typing.liq +2 -2
  336. package/tests/liquidsoap/tests/language/various.liq +1 -0
  337. package/tests/liquidsoap/tests/language/xml_test.liq +132 -0
  338. package/tests/liquidsoap/tests/media/dune +74 -0
  339. package/tests/liquidsoap/tests/media/dune.inc +63 -0
  340. package/tests/liquidsoap/tests/media/ffmpeg_add_text.liq +42 -56
  341. package/tests/liquidsoap/tests/media/ffmpeg_copy_concat.liq +5 -2
  342. package/tests/liquidsoap/tests/media/ffmpeg_distributed_hls.liq +2 -4
  343. package/tests/liquidsoap/tests/media/ffmpeg_filter_changing_rate.liq +1 -1
  344. package/tests/liquidsoap/tests/media/ffmpeg_inline_encode_decode_audio.liq +1 -5
  345. package/tests/liquidsoap/tests/media/ffmpeg_inline_encode_decode_video.liq +1 -3
  346. package/tests/liquidsoap/tests/media/ffmpeg_raw_and_encode_decoder.liq +1 -3
  347. package/tests/liquidsoap/tests/media/ffmpeg_raw_hls.liq +2 -4
  348. package/tests/liquidsoap/tests/media/ffmpeg_raw_implicit_conversion.liq +63 -0
  349. package/tests/liquidsoap/tests/media/gen_dune.ml +1 -0
  350. package/tests/liquidsoap/tests/media/image_decoder_duration.liq +15 -0
  351. package/tests/liquidsoap/tests/media/lufs_integrated.liq +17 -0
  352. package/tests/liquidsoap/tests/regression/AC5109.liq +2 -2
  353. package/tests/liquidsoap/tests/regression/GH1129.liq +3 -3
  354. package/tests/liquidsoap/tests/regression/GH1279.liq +2 -2
  355. package/tests/liquidsoap/tests/regression/GH1327.liq +3 -3
  356. package/tests/liquidsoap/tests/regression/GH2585.liq +0 -2
  357. package/tests/liquidsoap/tests/regression/GH2756-2.liq +3 -3
  358. package/tests/liquidsoap/tests/regression/GH2756.liq +2 -2
  359. package/tests/liquidsoap/tests/regression/GH3134.liq +2 -2
  360. package/tests/liquidsoap/tests/regression/GH3303.liq +2 -2
  361. package/tests/liquidsoap/tests/regression/GH4163.liq +14 -3
  362. package/tests/liquidsoap/tests/regression/GH4281-2.liq +29 -0
  363. package/tests/liquidsoap/tests/regression/GH4281.liq +29 -0
  364. package/tests/liquidsoap/tests/regression/GH4395.liq +27 -0
  365. package/tests/liquidsoap/tests/regression/LS354-1.liq +1 -1
  366. package/tests/liquidsoap/tests/regression/LS354-2.liq +1 -1
  367. package/tests/liquidsoap/tests/regression/append-merge.liq +3 -1
  368. package/tests/liquidsoap/tests/regression/dune.inc +64 -0
  369. package/tests/liquidsoap/tests/regression/fallible_ogg.liq +9 -0
  370. package/tests/liquidsoap/tests/regression/init-error.liq +2 -0
  371. package/tests/liquidsoap/tests/regression/seek_track_map.liq +1 -1
  372. package/tests/liquidsoap/tests/regression/source_dynamic.liq +2 -2
  373. package/tests/liquidsoap/tests/run_test.ml +53 -60
  374. package/tests/liquidsoap/tests/streams/cross-override-end.liq +9 -2
  375. package/tests/liquidsoap/tests/streams/cross-override-start.liq +9 -2
  376. package/tests/liquidsoap/tests/streams/cross-override.liq +9 -2
  377. package/tests/liquidsoap/tests/streams/cross-persist-end-override.liq +9 -2
  378. package/tests/liquidsoap/tests/streams/cross-persist-override.liq +9 -2
  379. package/tests/liquidsoap/tests/streams/cross-persist-start-override.liq +9 -2
  380. package/tests/liquidsoap/tests/streams/cross.liq +8 -2
  381. package/tests/liquidsoap/tests/streams/crossfade-plot.liq +11 -8
  382. package/tests/liquidsoap/tests/streams/crossfade-plot.new.txt +148 -248
  383. package/tests/liquidsoap/tests/streams/crossfade-plot.old.txt +50 -150
  384. package/tests/liquidsoap/tests/streams/crossfade.liq +8 -2
  385. package/tests/liquidsoap/tests/streams/ctype2.liq +1 -1
  386. package/tests/liquidsoap/tests/streams/dune.inc +31 -0
  387. package/tests/liquidsoap/tests/streams/fades-overrides.liq +9 -2
  388. package/tests/liquidsoap/tests/streams/fades-persistent-override.liq +9 -2
  389. package/tests/liquidsoap/tests/streams/harbor_metadata_3.liq +1 -1
  390. package/tests/liquidsoap/tests/streams/hls_id3v2.liq +11 -7
  391. package/tests/liquidsoap/tests/streams/icecast_last_meta.liq +47 -0
  392. package/tests/liquidsoap/tests/streams/icecast_ssl.liq +3 -0
  393. package/tests/liquidsoap/tests/streams/icecast_ssl_tls.liq +3 -3
  394. package/tests/liquidsoap/tests/streams/icecast_tls.liq +1 -0
  395. package/tests/liquidsoap/tests/streams/icecast_tls_ssl.liq +5 -0
  396. package/tests/liquidsoap/tests/streams/no-cue-cut.liq +2 -2
  397. package/tests/liquidsoap/tests/streams/random.liq +2 -2
  398. package/tests/liquidsoap/tests/streams/replaygain.liq +10 -10
  399. package/tests/liquidsoap/tests/streams/rotate.liq +6 -1
  400. package/tests/liquidsoap/tests/streams/say.liq +2 -2
  401. package/tests/liquidsoap/tests/streams/srt_listen_callback.liq +1 -0
  402. package/tests/liquidsoap/tests/streams/srt_multiple_outputs.liq +1 -0
  403. package/tests/liquidsoap/tests/streams/srt_passphrase.liq +1 -0
  404. package/tests/liquidsoap/tests/streams/srt_raw_pcm.liq +1 -0
  405. package/tests/liquidsoap/tests/test.liq +4 -5
  406. package/tests/liquidsoap/.github/docker/Dockerfile.production +0 -37
  407. package/tests/liquidsoap/.github/docker/Dockerfile.production-alpine +0 -18
  408. package/tests/liquidsoap/.github/opam/packages/metadata/metadata.0.3.0/opam +0 -33
  409. package/tests/liquidsoap/.github/scripts/build-docker-alpine.sh +0 -31
  410. package/tests/liquidsoap/.github/scripts/build-docker.sh +0 -35
  411. package/tests/liquidsoap/liquidsoap-libs-extra.opam +0 -32
  412. package/tests/liquidsoap/liquidsoap-libs.opam +0 -31
  413. package/tests/liquidsoap/liquidsoap.opam +0 -63
  414. package/tests/liquidsoap/src/core/builtins/builtins_lastfm.ml +0 -110
  415. package/tests/liquidsoap/src/core/tools/liqfm.ml +0 -244
  416. package/tests/liquidsoap/src/libs/extra/lastfm.liq +0 -185
  417. /package/tests/liquidsoap/.github/docker/{Dockerfile.website → website.dockerfile} +0 -0
  418. /package/tests/liquidsoap/.github/opam/packages/ffmpeg-av-windows/{ffmpeg-av-windows.1.2.0 → ffmpeg-av-windows.1.2.5}/opam +0 -0
  419. /package/tests/liquidsoap/.github/opam/packages/ffmpeg-avcodec-windows/{ffmpeg-avcodec-windows.1.2.0 → ffmpeg-avcodec-windows.1.2.5}/opam +0 -0
  420. /package/tests/liquidsoap/.github/opam/packages/ffmpeg-avdevice-windows/{ffmpeg-avdevice-windows.1.2.0 → ffmpeg-avdevice-windows.1.2.5}/opam +0 -0
  421. /package/tests/liquidsoap/.github/opam/packages/ffmpeg-avfilter-windows/{ffmpeg-avfilter-windows.1.2.0 → ffmpeg-avfilter-windows.1.2.5}/opam +0 -0
  422. /package/tests/liquidsoap/.github/opam/packages/ffmpeg-avutil-windows/{ffmpeg-avutil-windows.1.2.0 → ffmpeg-avutil-windows.1.2.5}/opam +0 -0
  423. /package/tests/liquidsoap/.github/opam/packages/ffmpeg-swresample-windows/{ffmpeg-swresample-windows.1.2.0 → ffmpeg-swresample-windows.1.2.5}/opam +0 -0
  424. /package/tests/liquidsoap/.github/opam/packages/ffmpeg-swscale-windows/{ffmpeg-swscale-windows.1.2.0 → ffmpeg-swscale-windows.1.2.5}/opam +0 -0
  425. /package/tests/liquidsoap/.github/opam/packages/ffmpeg-windows/{ffmpeg-windows.1.2.0 → ffmpeg-windows.1.2.5}/opam +0 -0
  426. /package/tests/liquidsoap/{liquidsoap-mode.opam.template → opam/liquidsoap-mode.opam.template} +0 -0
  427. /package/tests/liquidsoap/{liquidsoap.opam.template → opam/liquidsoap.opam.template} +0 -0
@@ -8,9 +8,9 @@ let rec append_ref =
8
8
  | tm ->
9
9
  Term.make ?pos:tm.t.Type.pos
10
10
  (`Seq
11
- ( tm,
12
- Term.make ?pos:tm.t.Type.pos
13
- (`Cache_env (ref { var_name = 0; var_id = 0; env = [] })) ))
11
+ ( tm,
12
+ Term.make ?pos:tm.t.Type.pos
13
+ (`Cache_env (ref { var_name = 0; var_id = 0; env = [] })) ))
14
14
 
15
15
  let rec extract_ref =
16
16
  let open Runtime_term in
@@ -46,11 +46,12 @@ let rec prepend_parsed_stdlib =
46
46
  { tm with term = `Seq (t1, prepend_parsed_stdlib ~parsed_term t2) }
47
47
  | tm -> Parsed_term.make ~pos:tm.pos (`Seq (tm, parsed_term))
48
48
 
49
- (** To be cacheable, the standard library is parsed and converted to a term.
50
- We add [`Cache_env] to it and type-check it. This results in having the full
51
- standard library env stored in it. We can then cache this term and retrieve the full
52
- env using it. Next, we append the user script to the resulting term and typecheck
53
- the user script only using the standard library environment. *)
49
+ (** To be cacheable, the standard library is parsed and converted to a term. We
50
+ add [`Cache_env] to it and type-check it. This results in having the full
51
+ standard library env stored in it. We can then cache this term and retrieve
52
+ the full env using it. Next, we append the user script to the resulting term
53
+ and typecheck the user script only using the standard library environment.
54
+ *)
54
55
  let prepare ?libs ~cache ~error_on_no_stdlib ~deprecated parsed_term =
55
56
  let libs =
56
57
  match libs with
@@ -60,11 +61,11 @@ let prepare ?libs ~cache ~error_on_no_stdlib ~deprecated parsed_term =
60
61
  let script = List.fold_left (Printf.sprintf "%s\n%%include %S") "" libs in
61
62
  let lexbuf = Sedlexing.Utf8.from_string script in
62
63
  let parsed_stdlib, stdlib =
63
- Runtime.report
64
+ Runtime.report ~lexbuf:(Some lexbuf)
64
65
  ~default:(fun () -> raise Runtime.Error)
65
- (fun ~throw:_ () ->
66
+ (fun ~throw () ->
66
67
  let parsed_stdlib = Term_reducer.mk_expr Term_reducer.program lexbuf in
67
- (parsed_stdlib, Term_reducer.to_term parsed_stdlib))
68
+ (parsed_stdlib, Term_reducer.to_term ~throw parsed_stdlib))
68
69
  in
69
70
  let append () =
70
71
  let stdlib = append_ref stdlib in
@@ -76,9 +77,9 @@ let prepare ?libs ~cache ~error_on_no_stdlib ~deprecated parsed_term =
76
77
  Atomic.set Type_base.var_name_atom var_name;
77
78
  Atomic.set Type_base.var_id_atom var_id;
78
79
  let checked_term =
79
- Runtime.report
80
+ Runtime.report ~lexbuf:None
80
81
  ~default:(fun () -> raise Runtime.Error)
81
- (fun ~throw:_ () -> Term_reducer.to_term parsed_term)
82
+ (fun ~throw () -> Term_reducer.to_term ~throw parsed_term)
82
83
  in
83
84
  let full_term = prepend_stdlib ~term:checked_term stdlib in
84
85
  { Runtime.checked_term; full_term; env }
@@ -62,8 +62,10 @@ exception No_label of t * string * bool * t
62
62
  exception Duplicate_label of Pos.Option.t * string
63
63
  exception Missing_arguments of Pos.Option.t * (string * Type.t) list
64
64
  exception Unused_variable of (string * Pos.t)
65
+ exception Deprecated of (string * Pos.t)
65
66
 
66
- val check_unused : throw:(exn -> unit) -> lib:bool -> t -> unit
67
+ val check_unused :
68
+ throw:(bt:Printexc.raw_backtrace -> exn -> unit) -> lib:bool -> t -> unit
67
69
 
68
70
  module type Custom = sig
69
71
  type content
@@ -29,23 +29,22 @@ let debug = ref false
29
29
 
30
30
  (** {1 Type checking / inference} *)
31
31
 
32
- (** Can a function return type be generalized after being applied?
33
- Current implementation considers it safe to generalize when all
34
- universal types in the function return type are specified by a non-optional
35
- argument.
32
+ (** Can a function return type be generalized after being applied? Current
33
+ implementation considers it safe to generalize when all universal types in
34
+ the function return type are specified by a non-optional argument.
36
35
 
37
- For instance, this can be generalized:
36
+ For instance,
37
+ - this can be generalized:
38
38
  [def f() = fun (x) -> x end; fn = f() : fun ('a) -> 'a ]
39
- But this cannot:
40
- [s = single() : source('A) ]
41
- and this cannot either:
42
- [def f() = fun (x=null()) -> ref(x) end; fn = f() : (?'A?) -> ref('A) ]
39
+ - but this cannot: [s = single() : source('A) ]
40
+ - and this cannot either:
41
+ [def f() = fun (x=null) -> ref(x) end; fn = f() : (?'A?) -> ref('A) ]
43
42
 
44
43
  When all universal types in the return are specified by a non-optional
45
44
  argument, we are assured that anything that would be generalized is later
46
- specified when the required argument is passed. If this argument is still
47
- of a universal type, then the argument's universal type takes over the
48
- type that was generalized. *)
45
+ specified when the required argument is passed. If this argument is still of
46
+ a universal type, then the argument's universal type takes over the type
47
+ that was generalized. *)
49
48
 
50
49
  let function_app_value_restriction fn =
51
50
  let rec filter_app_vars l t =
@@ -70,8 +69,7 @@ let function_app_value_restriction fn =
70
69
  let pl =
71
70
  List.fold_left
72
71
  (fun pl -> function
73
- | true, _, _ -> pl
74
- | false, _, t -> filter_app_vars pl t)
72
+ | true, _, _ -> pl | false, _, t -> filter_app_vars pl t)
75
73
  [] p
76
74
  in
77
75
  List.filter (fun v -> not (List.memq v pl)) l
@@ -303,7 +301,9 @@ let rec check ?(print_toplevel = false) ~throw ~level ~(env : Typing.env) e =
303
301
  base_type >: b.t
304
302
  | `Seq (a, b) ->
305
303
  check ~env ~level a;
306
- if not (can_ignore a.t) then throw (Ignored a);
304
+ if not (can_ignore a.t) then (
305
+ let bt = Printexc.get_callstack 0 in
306
+ throw ~bt (Ignored a));
307
307
  check ~print_toplevel ~level ~env b;
308
308
  base_type >: b.t
309
309
  | `App (a, l) -> (
@@ -314,7 +314,7 @@ let rec check ?(print_toplevel = false) ~throw ~level ~(env : Typing.env) e =
314
314
  better error messages. Otherwise generate its type and unify -- in
315
315
  that case the optionality can't be guessed and mandatory is the
316
316
  default. *)
317
- match (Type.demeth a.t).Type.descr with
317
+ match (Type.demeth a.t).Type.descr with
318
318
  | Type.Arrow (ap, t) ->
319
319
  (* Find in l the first arg labeled lbl, return it together with the
320
320
  remaining of the list. *)
@@ -12,4 +12,8 @@ val type_of_pat :
12
12
  Term.pattern ->
13
13
  (string list * Type.t) list * Type.t
14
14
 
15
- val check : ?env:Typing.env -> throw:(exn -> unit) -> Term.t -> unit
15
+ val check :
16
+ ?env:Typing.env ->
17
+ throw:(bt:Printexc.raw_backtrace -> exn -> unit) ->
18
+ Term.t ->
19
+ unit
@@ -28,21 +28,21 @@ let debug_levels = ref false
28
28
 
29
29
  let debug_variance = ref false
30
30
 
31
- (* Type information comes attached to the AST from the parsing,
32
- * with appropriate sharing of the type variables. Then the type inference
33
- * performs in-place unification.
34
- *
35
- * In order to report precise type error messages, we put very dense
36
- * parsing location information in the type. Every layer of it can have
37
- * a location. Destructive unification introduces links in such a way
38
- * that the old location is still accessible.
39
- *
40
- * The level annotation represents the number of abstractions which surround
41
- * the type in the AST -- function arguments and let-in definitions.
42
- * It is used to safely generalize types.
43
- *
44
- * Finally, constraints can be attached to existential (unknown, '_a)
45
- * and universal ('a) type variables. *)
31
+ (** Type information comes attached to the AST from the parsing, with
32
+ appropriate sharing of the type variables. Then the type inference performs
33
+ in-place unification.
34
+
35
+ In order to report precise type error messages, we put very dense parsing
36
+ location information in the type. Every layer of it can have a location.
37
+ Destructive unification introduces links in such a way that the old location
38
+ is still accessible.
39
+
40
+ The level annotation represents the number of abstractions which surround
41
+ the type in the AST -- function arguments and let-in definitions. It is used
42
+ to safely generalize types.
43
+
44
+ Finally, constraints can be attached to existential (unknown, '_a) and
45
+ universal ('a) type variables. *)
46
46
 
47
47
  (** {2 Types} *)
48
48
 
@@ -71,8 +71,7 @@ module R = struct
71
71
  | `UVar of 'a var (* universal variable *)
72
72
  | `Ellipsis (* omitted sub-term *)
73
73
  | `Range_Ellipsis (* omitted sub-terms (in a list, e.g. list of args) *)
74
- | `Debug of
75
- string * 'a t * string
74
+ | `Debug of string * 'a t * string
76
75
  (* add annotations before / after, mostly used for debugging *) ]
77
76
 
78
77
  and 'a var = string * 'a Type_constraints.t
@@ -39,20 +39,19 @@ type env = (string * scheme) list
39
39
  (** {1 Type generalization and instantiation}
40
40
 
41
41
  We don't have type schemes per se, but we compute generalizable variables
42
- and keep track of them in the AST. This is simple and useful because in any
43
- case we need to distinguish two 'a variables bound at different
44
- places. Indeed, we might instantiate one in a term where the second is
45
- bound, and we don't want to merge the two when going under the binder.
42
+ and keep track of them in the AST. This is simple and useful because in any
43
+ case we need to distinguish two 'a variables bound at different places.
44
+ Indeed, we might instantiate one in a term where the second is bound, and we
45
+ don't want to merge the two when going under the binder.
46
46
 
47
47
  When generalizing we need to know what can be generalized in the outermost
48
48
  type but also in the inner types of the term forming a let-definition.
49
49
  Indeed those variables will have to be instantiated by fresh ones for every
50
50
  instance.
51
51
 
52
- If the value restriction applies, then we have some (fun (...) -> ...) and
52
+ If the value restriction applies, then we have some (fun (...) -> ...) and
53
53
  any type variable of higher level can be generalized, whether it's in the
54
- outermost type or not.
55
- *)
54
+ outermost type or not. *)
56
55
 
57
56
  (** Find all the free variables satisfying a predicate. *)
58
57
  let filter_vars f t =
@@ -84,8 +83,8 @@ let generalizable ~level t = filter_vars (fun v -> v.level > level) t
84
83
  let generalize ~level t : scheme = (generalizable ~level t, t)
85
84
 
86
85
  (** Instantiate a type scheme, given as a type together with a list of
87
- generalized variables. This erases position
88
- information, since they usually become irrelevant. *)
86
+ generalized variables. This erases position information, since they usually
87
+ become irrelevant. *)
89
88
  let instantiate ~level ((generalized, t) : scheme) =
90
89
  if generalized = [] then t
91
90
  else (
@@ -251,7 +250,8 @@ let () =
251
250
  (Repr.to_string b))
252
251
  | _ -> None)
253
252
 
254
- (** Ensure that a type satisfies a given constraint, i.e. morally that b <: c. *)
253
+ (** Ensure that a type satisfies a given constraint, i.e. morally that b <: c.
254
+ *)
255
255
  let rec satisfies_constraint b c =
256
256
  match (deref b).descr with
257
257
  | Var { contents = Free v } ->
@@ -280,7 +280,8 @@ and bind ?(variance = `Invariant) a b =
280
280
  let b = if b.pos = None then Type.make ?pos:a0.pos b.Type.descr else b in
281
281
  v.contents <- Link (variance, b)
282
282
 
283
- (** Ensure that the type for the method [l] in [a] is a subtype of the one for the same method in [b]. *)
283
+ (** Ensure that the type for the method [l] in [a] is a subtype of the one for
284
+ the same method in [b]. *)
284
285
  and unify_meth a b l =
285
286
  let {
286
287
  optional = optional1;
@@ -458,7 +459,7 @@ and ( <: ) a b =
458
459
  List.fold_left
459
460
  (* Start with [l2:=l12], [l1:=[]] and move each param [o,lbl]
460
461
  required by [l] from [l2] to [l1]. *)
461
- (fun (l1, l2) (o, lbl, t) ->
462
+ (fun (l1, l2) (o, lbl, t) ->
462
463
  (* Search for a param with label lbl. Returns the first
463
464
  matching parameter and the list without it. *)
464
465
  let rec get_param acc = function
@@ -54,7 +54,8 @@ val sup : pos:Pos.Option.t -> t -> t -> t
54
54
  (** Bind a variable *)
55
55
  val bind : ?variance:Type.variance -> t -> t -> unit
56
56
 
57
- (** Ensure that a type satisfies a given constraint, i.e. morally that b <: c. *)
57
+ (** Ensure that a type satisfies a given constraint, i.e. morally that b <: c.
58
+ *)
58
59
  val satisfies_constraint : t -> constr -> unit
59
60
 
60
61
  val do_occur_check : bool ref
@@ -26,8 +26,8 @@ open Term_hash
26
26
  module Custom = Term.Custom
27
27
  module Methods = Runtime_term.Methods
28
28
 
29
- (** We derive a hash of the environment to invalidate the cache
30
- when the builtin env change. We mostly keep name and methods. *)
29
+ (** We derive a hash of the environment to invalidate the cache when the builtin
30
+ env change. We mostly keep name and methods. *)
31
31
  type env = (string * t) list
32
32
 
33
33
  and dynamic_methods = {
@@ -130,7 +130,7 @@ let methods = function
130
130
  | Fun { methods }
131
131
  | FFI { methods } ->
132
132
  methods
133
- [@@inline always]
133
+ [@@inline always]
134
134
 
135
135
  let map_methods v fn =
136
136
  match v with
@@ -144,7 +144,7 @@ let map_methods v fn =
144
144
  | List ({ methods } as p) -> List { p with methods = fn methods }
145
145
  | Fun ({ methods } as p) -> Fun { p with methods = fn methods }
146
146
  | FFI ({ methods } as p) -> FFI { p with methods = fn methods }
147
- [@@inline always]
147
+ [@@inline always]
148
148
 
149
149
  let pos = function
150
150
  | Int { pos }
@@ -158,7 +158,7 @@ let pos = function
158
158
  | Fun { pos }
159
159
  | FFI { pos } ->
160
160
  pos
161
- [@@inline always]
161
+ [@@inline always]
162
162
 
163
163
  let set_pos v pos =
164
164
  match v with
@@ -172,7 +172,7 @@ let set_pos v pos =
172
172
  | List p -> List { p with pos }
173
173
  | Fun p -> Fun { p with pos }
174
174
  | FFI p -> FFI { p with pos }
175
- [@@inline always]
175
+ [@@inline always]
176
176
 
177
177
  let has_flag v flag =
178
178
  match v with
@@ -184,7 +184,7 @@ let has_flag v flag =
184
184
  | Fun { flags }
185
185
  | FFI { flags } ->
186
186
  Flags.has flags flag
187
- [@@inline always]
187
+ [@@inline always]
188
188
 
189
189
  let add_flag v flag =
190
190
  match v with
@@ -195,7 +195,7 @@ let add_flag v flag =
195
195
  | List p -> p.flags <- Flags.add p.flags flag
196
196
  | Fun p -> p.flags <- Flags.add p.flags flag
197
197
  | FFI p -> p.flags <- Flags.add p.flags flag
198
- [@@inline always]
198
+ [@@inline always]
199
199
 
200
200
  let unit = `Tuple []
201
201
  let is_unit = function Tuple { value = [] } -> true | _ -> false
@@ -215,13 +215,15 @@ let make ?pos ?(methods = Methods.empty) ?(flags = Flags.empty) : in_value -> t
215
215
  Fun { pos; methods; flags; fun_args; fun_env; fun_body }
216
216
  | `FFI { ffi_args; ffi_fn } -> FFI { pos; methods; flags; ffi_args; ffi_fn }
217
217
 
218
+ let string_of_int_value ~flags i =
219
+ if Flags.has flags Flags.octal_int then Printf.sprintf "0o%o" i
220
+ else if Flags.has flags Flags.hex_int then Printf.sprintf "0x%x" i
221
+ else string_of_int i
222
+
218
223
  let rec to_string v =
219
224
  let base_string v =
220
225
  match v with
221
- | Int { value = i; flags } ->
222
- if Flags.has flags Flags.octal_int then Printf.sprintf "0o%o" i
223
- else if Flags.has flags Flags.hex_int then Printf.sprintf "0x%x" i
224
- else string_of_int i
226
+ | Int { value = i; flags } -> string_of_int_value ~flags i
225
227
  | Float { value = f } -> Utils.string_of_float f
226
228
  | Bool { value = b } -> string_of_bool b
227
229
  | String { value = s } -> Lang_string.quote_string s
@@ -331,12 +333,16 @@ let compare a b =
331
333
  let a =
332
334
  make
333
335
  (`Tuple
334
- (List.map (fun (lbl, v) -> make (`Tuple [make (`String lbl); v])) a))
336
+ (List.map
337
+ (fun (lbl, v) -> make (`Tuple [make (`String lbl); v]))
338
+ a))
335
339
  in
336
340
  let b =
337
341
  make
338
342
  (`Tuple
339
- (List.map (fun (lbl, v) -> make (`Tuple [make (`String lbl); v])) b))
343
+ (List.map
344
+ (fun (lbl, v) -> make (`Tuple [make (`String lbl); v]))
345
+ b))
340
346
  in
341
347
  aux (a, b))
342
348
  else aux (a, b)
@@ -97,13 +97,14 @@ lufs_builtin = lufs
97
97
  # @param ~target Desired RMS (dB).
98
98
  # @param ~threshold Minimal RMS for activaing gain control (dB).
99
99
  # @param ~window Duration of the window used to compute the current RMS power (second).
100
+ # @param ~enabled Whether normalization is enabled or not.
100
101
  # @param ~debug How often to print debug messages, in seconds, useful to finetune the parameters. You should set `set("log.level", 5)` to see them.
101
102
  # @param s Source to normalize.
102
103
  # @method gain Current amplification coefficient (in linear scale).
103
104
  # @method target_gain Current target amplification coefficient (in linear scale).
104
105
  # @method rms Current rms (in linear scale).
105
106
  def replaces normalize(
106
- ~id=null(),
107
+ ~id=null,
107
108
  ~target=getter(-13.),
108
109
  ~up=getter(10.),
109
110
  ~down=getter(.1),
@@ -114,7 +115,8 @@ def replaces normalize(
114
115
  ~window=getter(.5),
115
116
  ~threshold=getter(-40.),
116
117
  ~track_sensitive=true,
117
- ~debug=null(),
118
+ ~enabled=getter(true),
119
+ ~debug=null,
118
120
  s
119
121
  ) =
120
122
  let (s, rms) =
@@ -134,23 +136,29 @@ def replaces normalize(
134
136
  gain_max = lin_of_dB(gain_max)
135
137
 
136
138
  def update() =
137
- target = lin_of_dB(getter.get(target))
138
- threshold = lin_of_dB(getter.get(threshold))
139
- rms = rms()
140
139
  if
141
- rms >= threshold
140
+ not (getter.get(enabled))
142
141
  then
142
+ v := 1.
143
+ else
144
+ target = lin_of_dB(getter.get(target))
145
+ threshold = lin_of_dB(getter.get(threshold))
146
+ rms = rms()
143
147
  if
144
- v() * rms <= target
148
+ rms >= threshold
145
149
  then
146
- up = 1. - exp(0. - frame / getter.get(up))
147
- v := v() + up * ((target / rms) - v())
148
- else
149
- down = 1. - exp(0. - frame / getter.get(down))
150
- v := v() + down * ((target / rms) - v())
150
+ if
151
+ v() * rms <= target
152
+ then
153
+ up = 1. - exp(0. - frame / getter.get(up))
154
+ v := v() + up * ((target / rms) - v())
155
+ else
156
+ down = 1. - exp(0. - frame / getter.get(down))
157
+ v := v() + down * ((target / rms) - v())
158
+ end
159
+
160
+ v := max(gain_min, min(gain_max, v()))
151
161
  end
152
-
153
- v := max(gain_min, min(gain_max, v()))
154
162
  end
155
163
  end
156
164
 
@@ -216,7 +224,7 @@ end
216
224
  # @param t Track to extract from
217
225
  def track.audio.stereo.left(~id=null("track.audio.stereo.left"), t) =
218
226
  track.audio.amplify(
219
- id=id, override=null(), 2., track.audio.mean(track.audio.stereo.pan(-1., t))
227
+ id=id, override=null, 2., track.audio.mean(track.audio.stereo.pan(-1., t))
220
228
  )
221
229
  end
222
230
 
@@ -233,7 +241,7 @@ end
233
241
  # @param s Track to extract from
234
242
  def track.audio.stereo.right(~id=null("track.audio.stereo.right"), t) =
235
243
  track.audio.amplify(
236
- id=id, override=null(), 2., track.audio.mean(track.audio.stereo.pan(1., t))
244
+ id=id, override=null, 2., track.audio.mean(track.audio.stereo.pan(1., t))
237
245
  )
238
246
  end
239
247
 
@@ -352,10 +360,37 @@ end
352
360
  # Defer the source's audio track by a given amount of time. Source will be
353
361
  # available when the given `delay` has been fully buffered. Use this operator
354
362
  # instead of `buffer` when buffering large amount of data as initial delay.
363
+ #
364
+ # This operator encodes and decodes the audio content. See `defer.pcm_s16` for
365
+ # a low-level operator using directly the `pcm_s16` format.
366
+ # @argsof track.audio.defer[!id]
367
+ # @param ~id Force the source's ID
368
+ def defer(~id=null("defer"), %argsof(track.audio.defer[!id]), s) =
369
+ let {audio = a} = source.tracks(s)
370
+ a = track.encode.audio.pcm_s16(a)
371
+ a = track.audio.defer(%argsof(track.audio.defer[!id]), a)
372
+ a = track.decode.audio.pcm_s16(a)
373
+
374
+ source(
375
+ id=id,
376
+ {audio=a, metadata=track.metadata(a), track_marks=track.track_marks(a)}
377
+ )
378
+ end
379
+
380
+ # Defer the source's audio track by a given amount of time. Source will be
381
+ # available when the given `delay` has been fully buffered. Use this operator
382
+ # instead of `buffer` when buffering large amount of data as initial delay.
383
+ #
384
+ # This operator uses a source already using `pcm_s16` audio data. It can
385
+ # be used to prevent unneeded data copy. Typically, decoders that know
386
+ # how to decode to `pcm_s16` (like `ffmpeg`) will decode directly
387
+ # into the format and encoders who support it (also `%ffmpeg`)
388
+ # will encoder directly from the `pcm_s16` data. Use `defer` if you
389
+ # prefer a more user-friendly operator.
355
390
  # @argsof track.audio.defer[!id]
356
391
  # @param ~id Force the source's ID
357
- def defer(
358
- ~id=null("defer"),
392
+ def defer.pcm_s16(
393
+ ~id=null("defer.pcm_s16"),
359
394
  %argsof(track.audio.defer[!id]),
360
395
  (s:source(audio=pcm_s16))
361
396
  ) =
@@ -263,7 +263,7 @@ def autocue.internal.implementation(
263
263
  label="autocue.internal.metadata",
264
264
  "Override metadata detected for #{filename}, disabling autocue!"
265
265
  )
266
- null()
266
+ null
267
267
  else
268
268
  log(
269
269
  level=4,
@@ -274,18 +274,18 @@ def autocue.internal.implementation(
274
274
  %ifdef request.duration.ffmpeg
275
275
  duration = request.duration.ffmpeg(resolve_metadata=false, filename)
276
276
  %else
277
- duration = null()
277
+ duration = null
278
278
  %endif
279
279
 
280
280
  if
281
- duration == null()
281
+ duration == null
282
282
  then
283
283
  log(
284
284
  level=2,
285
285
  label="autocue.internal",
286
286
  "Could not get request duration, internal autocue disabled!"
287
287
  )
288
- null()
288
+ null
289
289
  else
290
290
  duration = null.get(duration)
291
291
 
@@ -302,7 +302,7 @@ def autocue.internal.implementation(
302
302
  label="autocue.internal",
303
303
  "Autocue computation failed!"
304
304
  )
305
- null()
305
+ null
306
306
  else
307
307
  # Get the 2nd last frame which is the last with loudness data
308
308
  frame = list.nth(frames, list.length(frames) - 2)
@@ -981,7 +981,7 @@ def enable_autocue_metadata() =
981
981
  user_supplied_amplify =
982
982
  list.filter_map(
983
983
  fun (el) ->
984
- if list.mem(fst(el), all_amplify) then fst(el) else null() end,
984
+ if list.mem(fst(el), all_amplify) then fst(el) else null end,
985
985
  metadata
986
986
  )
987
987
 
@@ -1054,8 +1054,8 @@ def enable_autocue_metadata() =
1054
1054
  mime_types = settings.decoder.mime_types.ffmpeg()
1055
1055
  file_extensions = settings.decoder.file_extensions.ffmpeg()
1056
1056
  %else
1057
- mime_types = null()
1058
- file_extensions = null()
1057
+ mime_types = null
1058
+ file_extensions = null
1059
1059
  %endif
1060
1060
 
1061
1061
  decoder.metadata.add(
@@ -8,7 +8,7 @@
8
8
  # @param ~on_error Error callback executed when a streaming error occurs. \
9
9
  # When passed, all streaming errors are silenced. Intended \
10
10
  # mostly for debugging purposes.
11
- def clock.assign_new(~sync="auto", ~id=null(), ~on_error=null(), sources) =
12
- clock = clock.create(id=id, sync=sync, on_error=on_error)
13
- list.iter(fun (s) -> clock.unify(s.clock), sources)
11
+ def clock.assign_new(~sync="auto", ~id=null, ~on_error=null, sources) =
12
+ c = clock.create(id=id, sync=sync, on_error=on_error)
13
+ list.iter(fun (s) -> c.unify(s.clock), sources)
14
14
  end
@@ -2,7 +2,7 @@
2
2
  (section
3
3
  (site
4
4
  (liquidsoap-lang libs)))
5
- (package liquidsoap-libs)
5
+ (package liquidsoap)
6
6
  (files
7
7
  (glob_files *.liq)))
8
8
 
@@ -10,6 +10,6 @@
10
10
  (section
11
11
  (site
12
12
  (liquidsoap-lang libs)))
13
- (package liquidsoap-libs-extra)
13
+ (package liquidsoap)
14
14
  (files
15
15
  (glob_files extra/*.liq)))
@@ -57,7 +57,7 @@ end
57
57
  # @category Source / Audio processing
58
58
  # @flag extra
59
59
  def limit(
60
- ~id=null(),
60
+ ~id=null,
61
61
  ~attack=getter(50.),
62
62
  ~release=getter(200.),
63
63
  ~ratio=getter(20.),
@@ -87,7 +87,7 @@ let limiter = limit
87
87
  # @param ~low Lower frequency of the bandpass filter.
88
88
  # @param ~high Higher frequency of the bandpass filter.
89
89
  # @param ~q Q factor.
90
- def filter.iir.eq.low_high(~id=null(), ~low, ~high, ~q=1., s) =
90
+ def filter.iir.eq.low_high(~id=null, ~low, ~high, ~q=1., s) =
91
91
  s =
92
92
  if
93
93
  not (getter.is_constant(high) and getter.get(high) == infinity)
@@ -345,7 +345,7 @@ end
345
345
  # @category Source / Audio processing
346
346
  # @param ~id Force the value of the source ID.
347
347
  # @param ~register_server_commands Register corresponding server commands
348
- def mix(~id=null(), ~register_server_commands=true, sources) =
348
+ def mix(~id=null, ~register_server_commands=true, sources) =
349
349
  id = string.id.default(default="mixer", id)
350
350
  inputs =
351
351
  list.map(
@@ -585,7 +585,7 @@ end
585
585
  # @param ~playlist Playlist name
586
586
  # @param ~directory Directory to write to
587
587
  def output.file.dash(
588
- ~id=null(),
588
+ ~id=null,
589
589
  ~fallible=false,
590
590
  ~on_start={()},
591
591
  ~on_stop={()},