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
@@ -1,110 +0,0 @@
1
- (*****************************************************************************
2
-
3
- Liquidsoap, a programmable stream generator.
4
- Copyright 2003-2024 Savonet team
5
-
6
- This program is free software; you can redistribute it and/or modify
7
- it under the terms of the GNU General Public License as published by
8
- the Free Software Foundation; either version 2 of the License, or
9
- (at your option) any later version.
10
-
11
- This program is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- GNU General Public License for more details, fully stated in the COPYING
15
- file at the root of the liquidsoap distribution.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with this program; if not, write to the Free Software
19
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
-
21
- *****************************************************************************)
22
-
23
- let audioscrobbler = Lang.add_module "audioscrobbler"
24
- let log = Log.make ["lastfm"; "submit"]
25
-
26
- let () =
27
- let f name stype descr =
28
- let proto =
29
- [
30
- ("user", Lang.string_t, None, None);
31
- ("password", Lang.string_t, None, None);
32
- ( "host",
33
- Lang.string_t,
34
- Some (Lang.string !Liqfm.Audioscrobbler.base_host),
35
- Some "Host for audioscrobbling submissions." );
36
- ( "port",
37
- Lang.int_t,
38
- Some (Lang.int !Liqfm.Audioscrobbler.base_port),
39
- Some "Port for audioscrobbling submissions." );
40
- ( "length",
41
- Lang.bool_t,
42
- Some (Lang.bool false),
43
- Some
44
- "Try to submit length information. This operation can be CPU \
45
- intensive. Value forced to true when used with the \"user\" \
46
- source type." );
47
- ("", Lang.metadata_t, None, None);
48
- ]
49
- in
50
- let proto =
51
- if stype = Liqfm.Played then
52
- ( "source",
53
- Lang.string_t,
54
- Some (Lang.string "broadcast"),
55
- Some
56
- "Source for tracks. Should be one of: \"broadcast\", \"user\", \
57
- \"recommendation\" or \"unknown\". Since liquidsoap is intended \
58
- for radio broadcasting, this is the default. Sources other than \
59
- user don't need duration to be set." )
60
- :: proto
61
- else proto
62
- in
63
- let tasks = Hashtbl.create 1 in
64
- ignore
65
- (Lang.add_builtin ~base:audioscrobbler name
66
- ~category:`Interaction (* TODO better cat *) ~descr proto Lang.unit_t
67
- (fun p ->
68
- let user = Lang.to_string (List.assoc "user" p) in
69
- let password = Lang.to_string (List.assoc "password" p) in
70
- let metas = Lang.to_metadata (Lang.assoc "" 1 p) in
71
- let host = Lang.to_string (List.assoc "host" p) in
72
- let port = Lang.to_int (List.assoc "port" p) in
73
- let host = (host, port) in
74
- let mode =
75
- if stype = Liqfm.Played then (
76
- match Lang.to_string (List.assoc "source" p) with
77
- | "broadcast" -> Liqfm.Broadcast
78
- | "user" -> Liqfm.User
79
- | "recommendation" -> Liqfm.Recommendation
80
- | "unknown" -> Liqfm.Unknown
81
- | _ ->
82
- raise
83
- (Error.Invalid_value
84
- ( List.assoc "source" p,
85
- "unknown lastfm submission mode" )))
86
- else Liqfm.Unknown
87
- in
88
- let length = Lang.to_bool (List.assoc "length" p) in
89
- let length =
90
- if length = false && mode = Liqfm.User then (
91
- log#severe
92
- "length information is required for \"user\" sources, setting \
93
- to true.";
94
- true)
95
- else length
96
- in
97
- let task =
98
- try Hashtbl.find tasks host
99
- with Not_found ->
100
- let t = Liqfm.init host in
101
- Hashtbl.replace tasks host t;
102
- t
103
- in
104
- Liqfm.submit (user, password) task length mode stype [metas];
105
- Lang.unit))
106
- in
107
- f "submit" Liqfm.Played
108
- "Submit a played song using the audioscrobbler protocol.";
109
- f "nowplaying" Liqfm.NowPlaying
110
- "Submit a now playing song using the audioscrobbler protocol."
@@ -1,244 +0,0 @@
1
- (*****************************************************************************
2
-
3
- Liquidsoap, a programmable stream generator.
4
- Copyright 2003-2024 Savonet team
5
-
6
- This program is free software; you can redistribute it and/or modify
7
- it under the terms of the GNU General Public License as published by
8
- the Free Software Foundation; either version 2 of the License, or
9
- (at your option) any later version.
10
-
11
- This program is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- GNU General Public License for more details, fully stated in the COPYING
15
- file at the root of the liquidsoap distribution.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with this program; if not, write to the Free Software
19
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
-
21
- *****************************************************************************)
22
-
23
- (* A custom implementation of HTTP
24
- * requests. *)
25
- module Liq_http = struct
26
- type request = Get | Post of string
27
-
28
- exception Http of string
29
-
30
- let exc_of_exc = function
31
- | Http s -> Http s
32
- | e -> Http (Printexc.to_string e)
33
-
34
- (* This in unused for now.. *)
35
- let default_timeout = ref 50.
36
-
37
- let request ?timeout ?headers ?(port = 80) ~host ~url ~request () =
38
- try
39
- let timeout =
40
- match timeout with None -> !default_timeout | Some t -> t
41
- in
42
- let mk_read s =
43
- let buf = Buffer.create 10 in
44
- Buffer.add_string buf s;
45
- fun len ->
46
- let len = min (Buffer.length buf) len in
47
- let ret = Buffer.sub buf 0 len in
48
- Utils.buffer_drop buf len;
49
- ret
50
- in
51
- let request =
52
- match request with
53
- | Get -> `Get
54
- | Post s -> `Post (Some (Int64.of_int (String.length s)), mk_read s)
55
- in
56
- let url = Printf.sprintf "http://%s:%d%s" host port url in
57
- let data = Buffer.create 1024 in
58
- let x, code, y, _ =
59
- Liqcurl.http_request ?headers ~pos:[] ~follow_redirect:true
60
- ~on_body_data:(Buffer.add_string data)
61
- ~timeout:(Some (int_of_float (timeout *. 1000.)))
62
- ~url ~request ()
63
- in
64
- if code <> 200 then
65
- raise (Http (Printf.sprintf "Http request failed: %s %i %s" x code y));
66
- Buffer.contents data
67
- with e -> raise (exc_of_exc e)
68
- end
69
-
70
- module Audioscrobbler = Lastfm_generic.Audioscrobbler_generic (Liq_http)
71
-
72
- let error_translator = function
73
- | Audioscrobbler.Error x ->
74
- Some
75
- (Printf.sprintf "Audioscrobbler error: %s"
76
- (Audioscrobbler.string_of_error x))
77
- | _ -> None
78
-
79
- let () = Printexc.register_printer error_translator
80
-
81
- open Lastfm_generic
82
- open Audioscrobbler
83
-
84
- type source = User | Lastfm | Broadcast | Recommendation | Unknown
85
- type submission = NowPlaying | Played
86
-
87
- type task = {
88
- task : Duppy.Async.t;
89
- submit_m : Mutex.t;
90
- submissions :
91
- (string * string * source * submission * bool * Frame.metadata) Queue.t;
92
- }
93
-
94
- let log = Log.make ["audioscrobbler"]
95
-
96
- exception Duration
97
-
98
- let client = { client = "lsp"; version = "0.1" }
99
-
100
- let init host =
101
- (* The list of waiting submissions *)
102
- let submissions = Queue.create () in
103
- (* A mutex to manage thread concurrency *)
104
- let submit_m = Mutex.create () in
105
- let reason s = log#important "Lastfm Submission failed: %s" s in
106
- (* Define a new task *)
107
- let do_submit () =
108
- try
109
- (* This function checks that the submission is valid *)
110
- let song songs (user, password, (source : source), stype, length, m) =
111
- let login = { user; password } in
112
- let f x = try Frame.Metadata.find x m with Not_found -> "" in
113
- let artist, track = (f "artist", f "title") in
114
- let s =
115
- match stype with Played -> "submit" | NowPlaying -> "nowplaying"
116
- in
117
- let h, p = host in
118
- log#info "Submitting %s -- %s with mode: %s to %s:%i" artist track s h p;
119
- try
120
- let duration () =
121
- try
122
- match float_of_string_opt (Frame.Metadata.find "duration" m) with
123
- | Some d -> d
124
- | None -> raise Not_found
125
- with Not_found -> (
126
- let exception Bad_rid in
127
- try
128
- let rid =
129
- match int_of_string_opt (Frame.Metadata.find "rid" m) with
130
- | Some rid -> rid
131
- | None -> raise Bad_rid
132
- in
133
- let request = Request.from_id rid in
134
- match request with
135
- | Some s -> (
136
- match Request.get_filename s with
137
- | Some file -> (
138
- match
139
- Request.duration ~metadata:(Request.metadata s)
140
- file
141
- with
142
- | Some f -> f
143
- | None -> raise Not_found)
144
- | None -> raise Not_found)
145
- | None -> raise Not_found
146
- with
147
- | Not_found -> raise Duration
148
- | Bad_rid ->
149
- log#severe "Metadata 'rid' is not associated to an integer!";
150
- raise Duration)
151
- in
152
- let duration =
153
- if length then (
154
- try Some (duration ())
155
- with Duration -> if source = User then raise Duration else None)
156
- else if source <> User then None
157
- else raise Duration
158
- in
159
- let time = Unix.time () in
160
- let trackauth =
161
- (* Only when source is lasftm *)
162
- match source with
163
- | Lastfm -> Some (f "lastfm:trackauth")
164
- | _ -> None
165
- in
166
- let source =
167
- match source with
168
- | User -> Audioscrobbler.User
169
- | Lastfm -> Audioscrobbler.Lastfm
170
- | Broadcast -> Audioscrobbler.Broadcast
171
- | Recommendation -> Audioscrobbler.Recommendation
172
- | Unknown -> Audioscrobbler.Unknown
173
- in
174
- let song =
175
- {
176
- artist;
177
- track;
178
- time = Some time;
179
- source = Some source;
180
- rating = None;
181
- length = duration;
182
- album = Some (f "album");
183
- tracknumber = None;
184
- musicbrainzid = None;
185
- trackauth;
186
- }
187
- in
188
- check_song song Submit;
189
- (login, stype, song) :: songs
190
- with
191
- | Duration ->
192
- log#info "could not submit track %s -- %s, no duration available"
193
- artist track;
194
- songs
195
- | Error e ->
196
- log#info "could not submit track %s -- %s, %s" artist track
197
- (string_of_error e);
198
- songs
199
- | e ->
200
- log#info "could not submit track %s -- %s: unknown error %s"
201
- artist track (Printexc.to_string e);
202
- songs
203
- in
204
- Mutex.lock submit_m;
205
- let songs = Queue.fold song [] submissions in
206
- Queue.clear submissions;
207
- Mutex.unlock submit_m;
208
- let submit = Hashtbl.create 10 in
209
- let filter (c, t, m) =
210
- try
211
- let v = Hashtbl.find submit (c, t) in
212
- Hashtbl.replace submit (c, t) (m :: v)
213
- with Not_found -> Hashtbl.replace submit (c, t) [m]
214
- in
215
- List.iter filter songs;
216
- let f (login, (stype : submission)) songs =
217
- try
218
- match stype with
219
- | NowPlaying ->
220
- List.iter
221
- (fun song -> Audioscrobbler.do_np ~host client login song)
222
- songs
223
- | Played ->
224
- ignore (Audioscrobbler.do_submit ~host client login songs)
225
- with Audioscrobbler.Error e ->
226
- reason (Audioscrobbler.string_of_error e)
227
- in
228
- Hashtbl.iter f submit;
229
- -1.
230
- with e ->
231
- reason (Printexc.to_string e);
232
- -1.
233
- in
234
- let task = Duppy.Async.add ~priority:`Blocking Tutils.scheduler do_submit in
235
- { task; submit_m; submissions }
236
-
237
- let submit (user, password) task length source stype songs =
238
- let songs =
239
- List.map (fun x -> (user, password, source, stype, length, x)) songs
240
- in
241
- Mutex.lock task.submit_m;
242
- List.iter (fun x -> Queue.add x task.submissions) songs;
243
- Mutex.unlock task.submit_m;
244
- Duppy.Async.wake_up task.task
@@ -1,185 +0,0 @@
1
- %ifdef audioscrobbler.submit
2
- librefm = ()
3
- lastfm = ()
4
-
5
- # Submit metadata to libre.fm using the audioscrobbler protocol.
6
- # @category Interaction
7
- # @flag extra
8
- # @param ~source Source for tracks. Should be one of: "broadcast", "user", "recommendation" or "unknown". Since liquidsoap is intended for radio broadcasting, this is the default. Sources other than user don't need duration to be set.
9
- # @param ~length Try to submit length information. This operation can be CPU intensive. Value forced to true when used with the "user" source type.
10
- def librefm.submit(~user, ~password, ~source="broadcast", ~length=false, m) =
11
- audioscrobbler.submit(
12
- user=user,
13
- password=password,
14
- source=source,
15
- length=length,
16
- host="turtle.libre.fm",
17
- port=80,
18
- m
19
- )
20
- end
21
-
22
- # Submit metadata to lastfm.fm using the audioscrobbler protocol.
23
- # @category Interaction
24
- # @flag extra
25
- # @param ~source Source for tracks. Should be one of: "broadcast", "user", "recommendation" or "unknown". Since liquidsoap is intended for radio broadcasting, this is the default. Sources other than user don't need duration to be set.
26
- # @param ~length Try to submit length information. This operation can be CPU intensive. Value forced to true when used with the "user" source type.
27
- def lastfm.submit(~user, ~password, ~source="broadcast", ~length=false, m) =
28
- audioscrobbler.submit(
29
- user=user,
30
- password=password,
31
- source=source,
32
- length=length,
33
- host="post.audioscrobbler.com",
34
- port=80,
35
- m
36
- )
37
- end
38
-
39
- # Submit metadata to libre.fm using the audioscrobbler protocol (nowplaying mode).
40
- # @category Interaction
41
- # @flag extra
42
- # @param ~length Try to submit length information. This operation can be CPU intensive. Value forced to true when used with the "user" source type.
43
- def librefm.nowplaying(~user, ~password, ~length=false, m) =
44
- audioscrobbler.nowplaying(
45
- user=user,
46
- password=password,
47
- length=length,
48
- host="turtle.libre.fm",
49
- port=80,
50
- m
51
- )
52
- end
53
-
54
- # Submit metadata to lastfm.fm using the audioscrobbler protocol (nowplaying mode).
55
- # @category Interaction
56
- # @flag extra
57
- # @param ~length Try to submit length information. This operation can be CPU intensive. Value forced to true when used with the "user" source type.
58
- def lastfm.nowplaying(~user, ~password, ~length=false, m) =
59
- audioscrobbler.nowplaying(
60
- user=user,
61
- password=password,
62
- length=length,
63
- host="post.audioscrobbler.com",
64
- port=80,
65
- m
66
- )
67
- end
68
-
69
- let source_on_end = source.on_end
70
- let source_on_metadata = source.on_metadata
71
-
72
- # Submit songs using audioscrobbler, respecting the full protocol:
73
- # First signal song as now playing when starting, and
74
- # then submit song when it ends.
75
- # @category Interaction
76
- # @flag extra
77
- # @param ~source Source for tracks. Should be one of: "broadcast", "user", "recommendation" or "unknown". Since liquidsoap is intended for radio broadcasting, this is the default. Sources other than user don't need duration to be set.
78
- # @param ~length Try to submit length information. This operation can be CPU intensive. Value forced to true when used with the "user" source type.
79
- # @param ~delay Submit song when there is only this delay left, in seconds.
80
- # @param ~force If remaining time is null, the song will be assumed to be skipped or cut, and not submitted. Set to zero to disable this behaviour.
81
- def audioscrobbler.submit.full(
82
- ~user,
83
- ~password,
84
- ~host="post.audioscrobbler.com",
85
- ~port=80,
86
- ~source="broadcast",
87
- ~length=false,
88
- ~delay=10.,
89
- ~force=false,
90
- s
91
- ) =
92
- def f(m) =
93
- audioscrobbler.nowplaying(
94
- user=user, password=password, host=host, port=port, length=length, m
95
- )
96
- end
97
-
98
- s = source_on_metadata(s, f)
99
- f =
100
- fun (rem, m) ->
101
- # Avoid skipped songs
102
- if
103
- rem > 0. or force
104
- then
105
- audioscrobbler.submit(
106
- user=user,
107
- password=password,
108
- host=host,
109
- port=port,
110
- length=length,
111
- source=source,
112
- m
113
- )
114
- else
115
- log(
116
- label="audioscrobbler.submit.full",
117
- level=4,
118
- "Remaining time null: will not submit song (song skipped ?)"
119
- )
120
- end
121
- source_on_end(s, delay=delay, f)
122
- end
123
-
124
- # Submit songs to librefm using audioscrobbler, respecting the full protocol:
125
- # First signal song as now playing when starting, and
126
- # then submit song when it ends.
127
- # @category Interaction
128
- # @flag extra
129
- # @param ~source Source for tracks. Should be one of: "broadcast", "user", "recommendation" or "unknown". Since liquidsoap is intended for radio broadcasting, this is the default. Sources other than user don't need duration to be set.
130
- # @param ~length Try to submit length information. This operation can be CPU intensive. Value forced to true when used with the "user" source type.
131
- # @param ~delay Submit song when there is only this delay left, in seconds. If remaining time is less than this value, the song will be assumed to be skipped or cut, and not submitted. Set to zero to disable this behaviour.
132
- # @param ~force If remaining time is null, the song will be assumed to be skipped or cut, and not submitted. Set to zero to disable this behaviour.
133
- def librefm.submit.full(
134
- ~user,
135
- ~password,
136
- ~source="broadcast",
137
- ~length=false,
138
- ~delay=10.,
139
- ~force=false,
140
- s
141
- ) =
142
- audioscrobbler.submit.full(
143
- user=user,
144
- password=password,
145
- source=source,
146
- length=length,
147
- host="turtle.libre.fm",
148
- port=80,
149
- delay=delay,
150
- force=force,
151
- s
152
- )
153
- end
154
-
155
- # Submit songs to lastfm using audioscrobbler, respecting the full protocol:
156
- # First signal song as now playing when starting, and
157
- # then submit song when it ends.
158
- # @category Interaction
159
- # @flag extra
160
- # @param ~source Source for tracks. Should be one of: "broadcast", "user", "recommendation" or "unknown". Since liquidsoap is intended for radio broadcasting, this is the default. Sources other than user don't need duration to be set.
161
- # @param ~length Try to submit length information. This operation can be CPU intensive. Value forced to true when used with the "user" source type.
162
- # @param ~delay Submit song when there is only this delay left, in seconds. If remaining time is less than this value, the song will be assumed to be skipped or cut, and not submitted. Set to zero to disable this behaviour.
163
- # @param ~force If remaining time is null, the song will be assumed to be skipped or cut, and not submitted. Set to zero to disable this behaviour.
164
- def lastfm.submit.full(
165
- ~user,
166
- ~password,
167
- ~source="broadcast",
168
- ~length=false,
169
- ~delay=10.,
170
- ~force=false,
171
- s
172
- ) =
173
- audioscrobbler.submit.full(
174
- user=user,
175
- password=password,
176
- source=source,
177
- length=length,
178
- host="post.audioscrobbler.com",
179
- port=80,
180
- delay=delay,
181
- force=force,
182
- s
183
- )
184
- end
185
- %endif