codemirror-lang-liquidsoap 0.2.9 → 0.3.1
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.
- package/dist/cli.js +2 -2
- package/dist/index.js +2 -2
- package/package.json +4 -3
- package/src/cli.ts +0 -0
- package/src/liquidsoap.grammar +1 -1
- package/src/parser.js +1 -1
- package/tests/liquidsoap/.github/alpine/APKBUILD-minimal.in +1 -1
- package/tests/liquidsoap/.github/alpine/APKBUILD.in +1 -1
- package/tests/liquidsoap/.github/alpine/liquidsoap.pre-install +0 -0
- package/tests/liquidsoap/.github/debian/rules +1 -1
- package/tests/liquidsoap/.github/debian/rules-minimal +1 -1
- package/tests/liquidsoap/.github/opam/liquidsoap-core-windows.opam +4 -3
- package/tests/liquidsoap/.github/opam/packages/ffmpeg-av-windows/ffmpeg-av-windows.1.2.0/opam +38 -0
- package/tests/liquidsoap/.github/opam/packages/ffmpeg-avcodec-windows/ffmpeg-avcodec-windows.1.2.0/opam +37 -0
- package/tests/liquidsoap/.github/opam/packages/ffmpeg-avdevice-windows/ffmpeg-avdevice-windows.1.2.0/opam +37 -0
- package/tests/liquidsoap/.github/opam/packages/ffmpeg-avfilter-windows/ffmpeg-avfilter-windows.1.2.0/opam +37 -0
- package/tests/liquidsoap/.github/opam/packages/ffmpeg-avutil-windows/ffmpeg-avutil-windows.1.2.0/opam +37 -0
- package/tests/liquidsoap/.github/opam/packages/ffmpeg-swresample-windows/ffmpeg-swresample-windows.1.2.0/opam +38 -0
- package/tests/liquidsoap/.github/opam/packages/ffmpeg-swscale-windows/ffmpeg-swscale-windows.1.2.0/opam +37 -0
- package/tests/liquidsoap/.github/opam/packages/ffmpeg-windows/ffmpeg-windows.1.2.0/opam +35 -0
- package/tests/liquidsoap/.github/scripts/add-local-opam-packages.sh +0 -0
- package/tests/liquidsoap/.github/scripts/build-apk.sh +0 -0
- package/tests/liquidsoap/.github/scripts/build-deb.sh +0 -0
- package/tests/liquidsoap/.github/scripts/build-details.sh +1 -1
- package/tests/liquidsoap/.github/scripts/build-doc.sh +0 -0
- package/tests/liquidsoap/.github/scripts/build-docker-alpine.sh +0 -0
- package/tests/liquidsoap/.github/scripts/build-docker.sh +0 -0
- package/tests/liquidsoap/.github/scripts/build-posix.sh +16 -13
- package/tests/liquidsoap/.github/scripts/build-website.sh +0 -0
- package/tests/liquidsoap/.github/scripts/build-win32.sh +0 -0
- package/tests/liquidsoap/.github/scripts/checkout-deps.sh +0 -0
- package/tests/liquidsoap/.github/scripts/export-metrics.sh +0 -0
- package/tests/liquidsoap/.github/scripts/push-docker.sh +0 -0
- package/tests/liquidsoap/.github/scripts/stats-posix.sh +0 -0
- package/tests/liquidsoap/.github/scripts/test-posix.sh +0 -0
- package/tests/liquidsoap/.github/workflows/ci.yml +10 -1
- package/tests/liquidsoap/.pre-commit-config.yaml +1 -1
- package/tests/liquidsoap/CHANGES.md +101 -1
- package/tests/liquidsoap/README.md +1 -1
- package/tests/liquidsoap/ROADMAP.md +28 -26
- package/tests/liquidsoap/doc/content/cookbook.md +46 -3
- package/tests/liquidsoap/doc/content/database.md +126 -0
- package/tests/liquidsoap/doc/content/documentation.md +1 -0
- package/tests/liquidsoap/doc/content/encoding_formats.md +6 -7
- package/tests/liquidsoap/doc/content/ffmpeg_encoder.md +20 -0
- package/tests/liquidsoap/doc/content/hls_output.md +27 -2
- package/tests/liquidsoap/doc/content/index.md +1 -1
- package/tests/liquidsoap/doc/content/liq/basic-radio.liq +14 -6
- package/tests/liquidsoap/doc/content/liq/check +0 -0
- package/tests/liquidsoap/doc/content/liq/liquidsoap +0 -0
- package/tests/liquidsoap/doc/content/liq/medialib.sqlite.liq +4 -0
- package/tests/liquidsoap/doc/content/liq/on2-if2.liq +5 -2
- package/tests/liquidsoap/doc/content/liq/on2-initial.liq +10 -5
- package/tests/liquidsoap/doc/content/liq/on2-replaygain.liq +13 -4
- package/tests/liquidsoap/doc/content/liq/on2-volume.liq +4 -2
- package/tests/liquidsoap/doc/content/liq/playlists.liq +2 -1
- package/tests/liquidsoap/doc/content/liq/radiopi.liq +2 -6
- package/tests/liquidsoap/doc/content/liq/source-cue.liq +26 -0
- package/tests/liquidsoap/doc/content/liq/space_overhead.liq +0 -0
- package/tests/liquidsoap/doc/content/liq/split-cue.liq +7 -8
- package/tests/liquidsoap/doc/content/liq/sqlite.liq +120 -0
- package/tests/liquidsoap/doc/content/liq/video-in-video.liq +2 -0
- package/tests/liquidsoap/doc/content/migrating.md +12 -0
- package/tests/liquidsoap/doc/content/on2_part2.md +1 -1
- package/tests/liquidsoap/doc/content/playlist_parsers.md +2 -10
- package/tests/liquidsoap/doc/content/seek.md +1 -20
- package/tests/liquidsoap/doc/dune.inc +655 -0
- package/tests/liquidsoap/dune-project +8 -5
- package/tests/liquidsoap/liquidsoap +0 -0
- package/tests/liquidsoap/liquidsoap-core.opam +6 -4
- package/tests/liquidsoap/src/core/builtins/builtins_ffmpeg_bitstream_filters.ml +100 -128
- package/tests/liquidsoap/src/core/builtins/builtins_ffmpeg_decoder.ml +10 -11
- package/tests/liquidsoap/src/core/builtins/builtins_ffmpeg_encoder.ml +14 -15
- package/tests/liquidsoap/src/core/builtins/builtins_ffmpeg_filters.ml +33 -3
- package/tests/liquidsoap/src/core/builtins/builtins_files.ml +64 -12
- package/tests/liquidsoap/src/core/builtins/builtins_optionals.ml +0 -1
- package/tests/liquidsoap/src/core/builtins/builtins_prometheus.ml +4 -4
- package/tests/liquidsoap/src/core/builtins/builtins_request.ml +16 -1
- package/tests/liquidsoap/src/core/builtins/builtins_resolvers.ml +1 -1
- package/tests/liquidsoap/src/core/builtins/builtins_settings.ml +12 -2
- package/tests/liquidsoap/src/core/builtins/builtins_socket.ml +17 -4
- package/tests/liquidsoap/src/core/builtins/builtins_source.ml +17 -7
- package/tests/liquidsoap/src/core/builtins/builtins_sqlite.ml +362 -0
- package/tests/liquidsoap/src/core/builtins/builtins_ssl.ml +18 -9
- package/tests/liquidsoap/src/core/builtins/builtins_tls.ml +38 -27
- package/tests/liquidsoap/src/core/clock.ml +1 -1
- package/tests/liquidsoap/src/core/clock.mli +1 -1
- package/tests/liquidsoap/src/core/conversions/conversion.ml +4 -38
- package/tests/liquidsoap/src/core/conversions/mean.ml +12 -14
- package/tests/liquidsoap/src/core/conversions/stereo.ml +4 -4
- package/tests/liquidsoap/src/core/conversions/swap.ml +8 -23
- package/tests/liquidsoap/src/core/decoder/aac_decoder.ml +3 -3
- package/tests/liquidsoap/src/core/decoder/decoder.ml +134 -129
- package/tests/liquidsoap/src/core/decoder/decoder.mli +11 -4
- package/tests/liquidsoap/src/core/decoder/decoder_utils.ml +8 -9
- package/tests/liquidsoap/src/core/decoder/decoder_utils.mli +2 -2
- package/tests/liquidsoap/src/core/decoder/external_decoder.ml +7 -5
- package/tests/liquidsoap/src/core/decoder/ffmpeg_copy_decoder.ml +1 -1
- package/tests/liquidsoap/src/core/decoder/ffmpeg_decoder.ml +138 -60
- package/tests/liquidsoap/src/core/decoder/ffmpeg_decoder_common.ml +10 -0
- package/tests/liquidsoap/src/core/decoder/ffmpeg_internal_decoder.ml +1 -2
- package/tests/liquidsoap/src/core/decoder/ffmpeg_raw_decoder.ml +1 -1
- package/tests/liquidsoap/src/core/decoder/flac_metadata_plug.ml +3 -3
- package/tests/liquidsoap/src/core/decoder/gstreamer_decoder.ml +1 -2
- package/tests/liquidsoap/src/core/decoder/id3_plug.ml +3 -3
- package/tests/liquidsoap/src/core/decoder/image/sdlimage_decoder.ml +3 -3
- package/tests/liquidsoap/src/core/decoder/image_decoder.ml +25 -23
- package/tests/liquidsoap/src/core/decoder/image_plug.ml +3 -3
- package/tests/liquidsoap/src/core/decoder/liq_flac_decoder.ml +10 -11
- package/tests/liquidsoap/src/core/decoder/liq_ogg_decoder.ml +5 -5
- package/tests/liquidsoap/src/core/decoder/mad_decoder.ml +6 -7
- package/tests/liquidsoap/src/core/decoder/midi_decoder.ml +10 -10
- package/tests/liquidsoap/src/core/decoder/ogg_metadata_plug.ml +3 -3
- package/tests/liquidsoap/src/core/decoder/srt_decoder.ml +23 -15
- package/tests/liquidsoap/src/core/decoder/taglib_plug.ml +3 -3
- package/tests/liquidsoap/src/core/decoder/text/video_text_sdl.ml +12 -7
- package/tests/liquidsoap/src/core/decoder/video_plug.ml +3 -3
- package/tests/liquidsoap/src/core/dune +19 -22
- package/tests/liquidsoap/src/core/encoder/encoder.ml +1 -1
- package/tests/liquidsoap/src/core/encoder/encoder.mli +1 -1
- package/tests/liquidsoap/src/core/encoder/encoder_formats.ml +6 -0
- package/tests/liquidsoap/src/core/encoder/encoder_utils.ml +66 -0
- package/tests/liquidsoap/src/core/encoder/encoders/avi_encoder.ml +38 -39
- package/tests/liquidsoap/src/core/encoder/encoders/fdkaac_encoder.ml +1 -1
- package/tests/liquidsoap/src/core/encoder/encoders/ffmpeg_copy_encoder.ml +26 -24
- package/tests/liquidsoap/src/core/encoder/encoders/ffmpeg_encoder.ml +24 -6
- package/tests/liquidsoap/src/core/encoder/encoders/ffmpeg_encoder_common.ml +52 -45
- package/tests/liquidsoap/src/core/encoder/encoders/ffmpeg_internal_encoder.ml +55 -34
- package/tests/liquidsoap/src/core/encoder/encoders/gstreamer_encoder.ml +27 -22
- package/tests/liquidsoap/src/core/encoder/encoders/lame_encoder.ml +5 -4
- package/tests/liquidsoap/src/core/encoder/encoders/ogg_encoder.ml +14 -7
- package/tests/liquidsoap/src/core/encoder/encoders/shine_encoder.ml +4 -5
- package/tests/liquidsoap/src/core/encoder/formats/ffmpeg_format.ml +9 -0
- package/tests/liquidsoap/src/core/encoder/lang/lang_ffmpeg.ml +13 -10
- package/tests/liquidsoap/src/core/encoder/lang_encoder.ml +1 -1
- package/tests/liquidsoap/src/core/harbor/harbor.ml +7 -2
- package/tests/liquidsoap/src/core/harbor/harbor_base.ml +7 -3
- package/tests/liquidsoap/src/core/io/alsa_io.ml +8 -5
- package/tests/liquidsoap/src/core/io/ffmpeg_filter_io.ml +9 -14
- package/tests/liquidsoap/src/core/io/ffmpeg_io.ml +23 -24
- package/tests/liquidsoap/src/core/io/gstreamer_io.ml +24 -20
- package/tests/liquidsoap/src/core/io/oss_io.ml +7 -5
- package/tests/liquidsoap/src/core/io/portaudio_io.ml +7 -5
- package/tests/liquidsoap/src/core/io/pulseaudio_io.ml +8 -7
- package/tests/liquidsoap/src/core/io/srt_io.ml +115 -114
- package/tests/liquidsoap/src/core/io/udp_io.ml +6 -3
- package/tests/liquidsoap/src/core/lang.mli +3 -0
- package/tests/liquidsoap/src/core/lang_source.ml +23 -9
- package/tests/liquidsoap/src/core/ogg_formats/opus_encoder.ml +1 -1
- package/tests/liquidsoap/src/core/operators/accelerate.ml +10 -23
- package/tests/liquidsoap/src/core/operators/add.ml +131 -122
- package/tests/liquidsoap/src/core/operators/amplify.ml +36 -27
- package/tests/liquidsoap/src/core/operators/available.ml +20 -8
- package/tests/liquidsoap/src/core/operators/biquad_filter.ml +8 -8
- package/tests/liquidsoap/src/core/operators/chord.ml +7 -9
- package/tests/liquidsoap/src/core/operators/clip.ml +7 -7
- package/tests/liquidsoap/src/core/operators/comb.ml +7 -8
- package/tests/liquidsoap/src/core/operators/compand.ml +9 -9
- package/tests/liquidsoap/src/core/operators/compress.ml +15 -10
- package/tests/liquidsoap/src/core/operators/compress_exp.ml +8 -9
- package/tests/liquidsoap/src/core/operators/cross.ml +180 -247
- package/tests/liquidsoap/src/core/operators/defer.ml +8 -18
- package/tests/liquidsoap/src/core/operators/delay.ml +10 -18
- package/tests/liquidsoap/src/core/operators/delay_line.ml +9 -8
- package/tests/liquidsoap/src/core/operators/dtmf.ml +18 -16
- package/tests/liquidsoap/src/core/operators/dyn_op.ml +66 -63
- package/tests/liquidsoap/src/core/operators/echo.ml +8 -7
- package/tests/liquidsoap/src/core/operators/filter.ml +8 -8
- package/tests/liquidsoap/src/core/operators/filter_rc.ml +11 -10
- package/tests/liquidsoap/src/core/operators/fir_filter.ml +8 -7
- package/tests/liquidsoap/src/core/operators/flanger.ml +9 -8
- package/tests/liquidsoap/src/core/operators/frei0r_op.ml +113 -91
- package/tests/liquidsoap/src/core/operators/gate.ml +9 -8
- package/tests/liquidsoap/src/core/operators/iir_filter.ml +7 -7
- package/tests/liquidsoap/src/core/operators/insert_metadata.ml +29 -54
- package/tests/liquidsoap/src/core/operators/ladspa_op.ml +38 -36
- package/tests/liquidsoap/src/core/operators/lilv_op.ml +44 -44
- package/tests/liquidsoap/src/core/operators/lufs.ml +8 -8
- package/tests/liquidsoap/src/core/operators/map_metadata.ml +23 -20
- package/tests/liquidsoap/src/core/operators/map_op.ml +6 -7
- package/tests/liquidsoap/src/core/operators/max_duration.ml +21 -20
- package/tests/liquidsoap/src/core/operators/midi_routing.ml +13 -9
- package/tests/liquidsoap/src/core/operators/ms_stereo.ml +13 -15
- package/tests/liquidsoap/src/core/operators/muxer.ml +30 -101
- package/tests/liquidsoap/src/core/operators/noblank.ml +26 -48
- package/tests/liquidsoap/src/core/operators/normalize.ml +13 -9
- package/tests/liquidsoap/src/core/operators/on_end.ml +25 -12
- package/tests/liquidsoap/src/core/operators/on_frame.ml +9 -9
- package/tests/liquidsoap/src/core/operators/on_metadata.ml +9 -10
- package/tests/liquidsoap/src/core/operators/on_offset.ml +20 -13
- package/tests/liquidsoap/src/core/operators/on_track.ml +7 -10
- package/tests/liquidsoap/src/core/operators/pan.ml +7 -8
- package/tests/liquidsoap/src/core/operators/pipe.ml +14 -17
- package/tests/liquidsoap/src/core/operators/pitch.ml +7 -5
- package/tests/liquidsoap/src/core/operators/replaygain_op.ml +6 -6
- package/tests/liquidsoap/src/core/operators/resample.ml +7 -6
- package/tests/liquidsoap/src/core/operators/rms_smooth.ml +8 -8
- package/tests/liquidsoap/src/core/operators/sequence.ml +48 -58
- package/tests/liquidsoap/src/core/operators/soundtouch_op.ml +12 -12
- package/tests/liquidsoap/src/core/operators/st_bpm.ml +8 -7
- package/tests/liquidsoap/src/core/operators/stereotool_op.ml +5 -7
- package/tests/liquidsoap/src/core/operators/still_frame.ml +13 -10
- package/tests/liquidsoap/src/core/operators/switch.ml +128 -168
- package/tests/liquidsoap/src/core/operators/time_warp.ml +44 -103
- package/tests/liquidsoap/src/core/operators/track/merge_metadata.ml +31 -48
- package/tests/liquidsoap/src/core/operators/track_map.ml +6 -32
- package/tests/liquidsoap/src/core/operators/video_effects.ml +48 -13
- package/tests/liquidsoap/src/core/operators/video_fade.ml +69 -57
- package/tests/liquidsoap/src/core/operators/window_op.ml +8 -8
- package/tests/liquidsoap/src/core/outputs/graphics_out.ml +11 -8
- package/tests/liquidsoap/src/core/outputs/harbor_output.ml +3 -3
- package/tests/liquidsoap/src/core/outputs/hls_output.ml +203 -116
- package/tests/liquidsoap/src/core/outputs/icecast2.ml +31 -5
- package/tests/liquidsoap/src/core/outputs/output.ml +27 -31
- package/tests/liquidsoap/src/core/outputs/output.mli +4 -5
- package/tests/liquidsoap/src/core/outputs/pipe_output.ml +19 -8
- package/tests/liquidsoap/src/core/outputs/sdl_out.ml +12 -9
- package/tests/liquidsoap/src/core/playlist_parser.ml +2 -6
- package/tests/liquidsoap/src/core/request.ml +84 -36
- package/tests/liquidsoap/src/core/request.mli +11 -8
- package/tests/liquidsoap/src/core/source.ml +343 -181
- package/tests/liquidsoap/src/core/source.mli +147 -33
- package/tests/liquidsoap/src/core/sources/alsa_in.ml +4 -6
- package/tests/liquidsoap/src/core/sources/audio_gen.ml +23 -22
- package/tests/liquidsoap/src/core/sources/bjack_in.ml +7 -5
- package/tests/liquidsoap/src/core/sources/blank.ml +55 -36
- package/tests/liquidsoap/src/core/sources/debug_sources.ml +2 -2
- package/tests/liquidsoap/src/core/sources/external_input_video.ml +2 -3
- package/tests/liquidsoap/src/core/sources/generated.ml +25 -47
- package/tests/liquidsoap/src/core/sources/harbor_input.ml +7 -9
- package/tests/liquidsoap/src/core/sources/latest_metadata.ml +1 -2
- package/tests/liquidsoap/src/core/sources/noise.ml +38 -27
- package/tests/liquidsoap/src/core/sources/request_dynamic.ml +181 -198
- package/tests/liquidsoap/src/core/sources/synthesized.ml +36 -23
- package/tests/liquidsoap/src/core/sources/video_board.ml +8 -10
- package/tests/liquidsoap/src/core/sources/video_testsrc.ml +9 -11
- package/tests/liquidsoap/src/core/sources/video_text.ml +8 -11
- package/tests/liquidsoap/src/core/stream/aFrame.ml +0 -32
- package/tests/liquidsoap/src/core/stream/aFrame.mli +2 -46
- package/tests/liquidsoap/src/core/stream/content.ml +96 -11
- package/tests/liquidsoap/src/core/stream/content.mli +32 -22
- package/tests/liquidsoap/src/core/stream/content_audio.ml +8 -4
- package/tests/liquidsoap/src/core/stream/content_base.ml +24 -35
- package/tests/liquidsoap/src/core/stream/content_midi.ml +0 -1
- package/tests/liquidsoap/src/core/stream/content_pcm_base.ml +0 -1
- package/tests/liquidsoap/src/core/stream/content_timed.ml +15 -1
- package/tests/liquidsoap/src/core/stream/content_video.ml +91 -30
- package/tests/liquidsoap/src/core/stream/ffmpeg_content_base.ml +0 -49
- package/tests/liquidsoap/src/core/stream/ffmpeg_copy_content.ml +2 -1
- package/tests/liquidsoap/src/core/stream/ffmpeg_raw_content.ml +2 -1
- package/tests/liquidsoap/src/core/stream/frame.ml +67 -118
- package/tests/liquidsoap/src/core/stream/frame.mli +49 -43
- package/tests/liquidsoap/src/core/stream/frame_base.ml +20 -32
- package/tests/liquidsoap/src/core/stream/frame_settings.ml +13 -36
- package/tests/liquidsoap/src/core/stream/generator.ml +47 -140
- package/tests/liquidsoap/src/core/stream/generator.mli +6 -13
- package/tests/liquidsoap/src/core/stream/mFrame.ml +0 -12
- package/tests/liquidsoap/src/core/stream/mFrame.mli +0 -19
- package/tests/liquidsoap/src/core/stream/metadata_base.ml +75 -0
- package/tests/liquidsoap/src/core/stream/vFrame.ml +0 -16
- package/tests/liquidsoap/src/core/stream/vFrame.mli +1 -35
- package/tests/liquidsoap/src/core/synth/dssi_op.ml +19 -20
- package/tests/liquidsoap/src/core/synth/keyboard.ml +6 -10
- package/tests/liquidsoap/src/core/synth/keyboard_sdl.ml +5 -11
- package/tests/liquidsoap/src/core/synth/synth_op.ml +11 -10
- package/tests/liquidsoap/src/core/tools/http.ml +40 -6
- package/tests/liquidsoap/src/core/tools/http.mli +21 -3
- package/tests/liquidsoap/src/core/tools/liq_posix_time.ml +3 -1
- package/tests/liquidsoap/src/core/tools/producer_consumer.ml +7 -18
- package/tests/liquidsoap/src/core/tools/server.ml +1 -1
- package/tests/liquidsoap/src/core/tools/server_builtins.ml +1 -1
- package/tests/liquidsoap/src/core/tools/start_stop.ml +2 -6
- package/tests/liquidsoap/src/core/tools/tutils.ml +1 -1
- package/tests/liquidsoap/src/core/track.ml +1 -2
- package/tests/liquidsoap/src/core/visualization/midimeter.ml +7 -5
- package/tests/liquidsoap/src/core/visualization/video_volume.ml +55 -68
- package/tests/liquidsoap/src/core/visualization/vis_volume.ml +1 -1
- package/tests/liquidsoap/src/js/index.html +4 -4
- package/tests/liquidsoap/src/{core/builtins/builtins_magic.ml → lang/active_value.ml} +16 -12
- package/tests/liquidsoap/src/lang/active_value.mli +33 -0
- package/tests/liquidsoap/src/lang/builtins_math.ml +7 -6
- package/tests/liquidsoap/src/lang/dune +1 -0
- package/tests/liquidsoap/src/lang/environment.ml +3 -1
- package/tests/liquidsoap/src/lang/evaluation.ml +13 -2
- package/tests/liquidsoap/src/lang/lang.mli +3 -0
- package/tests/liquidsoap/src/lang/lang_core.ml +13 -6
- package/tests/liquidsoap/src/lang/lexer.ml +2 -0
- package/tests/liquidsoap/src/lang/methods.ml +1 -0
- package/tests/liquidsoap/src/lang/methods.mli +1 -0
- package/tests/liquidsoap/src/lang/modules.ml +1 -0
- package/tests/liquidsoap/src/lang/parser_helper.ml +10 -1
- package/tests/liquidsoap/src/lang/parser_helper.mli +8 -1
- package/tests/liquidsoap/src/lang/term/parsed_term.ml +2 -0
- package/tests/liquidsoap/src/lang/term/runtime_term.ml +6 -1
- package/tests/liquidsoap/src/lang/term/term_base.ml +128 -74
- package/tests/liquidsoap/src/lang/term/term_reducer.ml +69 -3
- package/tests/liquidsoap/src/lang/term.ml +0 -47
- package/tests/liquidsoap/src/lang/type.ml +17 -1
- package/tests/liquidsoap/src/lang/type.mli +1 -0
- package/tests/liquidsoap/src/lang/types/type_base.ml +1 -1
- package/tests/liquidsoap/src/lang/utils.ml +1 -0
- package/tests/liquidsoap/src/lang/value.ml +16 -2
- package/tests/liquidsoap/src/libs/error.liq +16 -0
- package/tests/liquidsoap/src/libs/extra/deprecations.liq +18 -0
- package/tests/liquidsoap/src/libs/extra/metadata.liq +101 -0
- package/tests/liquidsoap/src/libs/extra/openai.liq +152 -0
- package/tests/liquidsoap/src/libs/extra/server.liq +39 -25
- package/tests/liquidsoap/src/libs/extra/source.liq +188 -0
- package/tests/liquidsoap/src/libs/fades.liq +92 -46
- package/tests/liquidsoap/src/libs/file.liq +71 -5
- package/tests/liquidsoap/src/libs/medialib.liq +384 -2
- package/tests/liquidsoap/src/libs/metadata.liq +1 -9
- package/tests/liquidsoap/src/libs/playlist.liq +224 -141
- package/tests/liquidsoap/src/libs/request.liq +112 -84
- package/tests/liquidsoap/src/libs/server.liq +12 -0
- package/tests/liquidsoap/src/libs/source.liq +24 -3
- package/tests/liquidsoap/src/libs/sqlite.liq +164 -0
- package/tests/liquidsoap/src/libs/stdlib.liq +4 -0
- package/tests/liquidsoap/src/libs/string.liq +35 -1
- package/tests/liquidsoap/src/libs/utils.liq +8 -0
- package/tests/liquidsoap/src/libs/video.liq +2 -1
- package/tests/liquidsoap/src/runtime/build_config.ml +1 -1
- package/tests/liquidsoap/src/runtime/main.ml +1 -1
- package/tests/liquidsoap/src/tooling/parsed_json.ml +4 -0
- package/tests/liquidsoap/tests/core/content_test.ml +32 -20
- package/tests/liquidsoap/tests/core/decoder_test.ml +4 -4
- package/tests/liquidsoap/tests/core/ffmpeg_quality.ml +2 -0
- package/tests/liquidsoap/tests/core/frame_test.ml +0 -35
- package/tests/liquidsoap/tests/core/generator_test.ml +4 -4
- package/tests/liquidsoap/tests/core/more_types.ml +2 -0
- package/tests/liquidsoap/tests/core/output_encoded_test.ml +7 -5
- package/tests/liquidsoap/tests/core/output_test.ml +6 -11
- package/tests/liquidsoap/tests/core/stream_decoder_test.ml +3 -4
- package/tests/liquidsoap/tests/failures/ctype.liq +0 -0
- package/tests/liquidsoap/tests/failures/error.liq +0 -0
- package/tests/liquidsoap/tests/failures/record-invalid-member1.liq +0 -0
- package/tests/liquidsoap/tests/failures/record-invalid-member2.liq +0 -0
- package/tests/liquidsoap/tests/failures/ref.liq +0 -0
- package/tests/liquidsoap/tests/fixme/GH1170.liq +0 -0
- package/tests/liquidsoap/tests/fixme/cross2.liq +0 -0
- package/tests/liquidsoap/tests/fixme/cross3.liq +0 -0
- package/tests/liquidsoap/tests/fixme/sequence-1.liq +0 -0
- package/tests/liquidsoap/tests/language/bool.liq +1 -12
- package/tests/liquidsoap/tests/language/dune.inc +12 -0
- package/tests/liquidsoap/tests/language/file.liq +7 -2
- package/tests/liquidsoap/tests/language/functions.liq +2 -13
- package/tests/liquidsoap/tests/language/interactive.liq +5 -16
- package/tests/liquidsoap/tests/language/list.liq +73 -78
- package/tests/liquidsoap/tests/language/loop.liq +6 -18
- package/tests/liquidsoap/tests/language/mem_usage.liq +0 -1
- package/tests/liquidsoap/tests/language/metadata.liq +9 -13
- package/tests/liquidsoap/tests/language/null.liq +8 -12
- package/tests/liquidsoap/tests/language/number.liq +10 -0
- package/tests/liquidsoap/tests/language/pp.liq +8 -20
- package/tests/liquidsoap/tests/language/predicate.liq +6 -18
- package/tests/liquidsoap/tests/language/ref.liq +3 -15
- package/tests/liquidsoap/tests/language/regexp.liq +14 -25
- package/tests/liquidsoap/tests/language/sqlite.liq +96 -0
- package/tests/liquidsoap/tests/language/stdlib.liq +7 -20
- package/tests/liquidsoap/tests/language/string.liq +7 -0
- package/tests/liquidsoap/tests/media/dune.inc +39 -0
- package/tests/liquidsoap/tests/media/encoder_audio_only.liq.in +1 -1
- package/tests/liquidsoap/tests/media/encoder_audio_video.liq.in +1 -1
- package/tests/liquidsoap/tests/media/encoder_multitrack.liq.in +1 -1
- package/tests/liquidsoap/tests/media/encoder_video_only.liq.in +1 -1
- package/tests/liquidsoap/tests/media/ffmpeg_bitstream_filter.liq +94 -0
- package/tests/liquidsoap/tests/media/ffmpeg_complex_filter.liq +1 -1
- package/tests/liquidsoap/tests/media/ffmpeg_filter.liq +3 -9
- package/tests/liquidsoap/tests/media/ffmpeg_raw_hls.liq +15 -12
- package/tests/liquidsoap/tests/media/ffmpeg_transparency_filter.liq +3 -9
- package/tests/liquidsoap/tests/media/gen_dune.ml +1 -0
- package/tests/liquidsoap/tests/media/mk_encoder_test.sh +0 -0
- package/tests/liquidsoap/tests/media/mk_stream_test.sh +0 -0
- package/tests/liquidsoap/tests/media/multitrack.liq +21 -1
- package/tests/liquidsoap/tests/media/stream_audio.liq.in +0 -0
- package/tests/liquidsoap/tests/media/stream_video.liq.in +0 -0
- package/tests/liquidsoap/tests/performance/erathostenes.liq +0 -0
- package/tests/liquidsoap/tests/performance/memory.liq +0 -0
- package/tests/liquidsoap/tests/performance/small-record.liq +0 -0
- package/tests/liquidsoap/tests/regression/GH1327.liq +8 -0
- package/tests/liquidsoap/tests/regression/GH3316.liq +2 -0
- package/tests/liquidsoap/tests/regression/GH3645.liq +16 -0
- package/tests/liquidsoap/tests/regression/GH3675.liq +37 -0
- package/tests/liquidsoap/tests/regression/LS354-2.liq +11 -3
- package/tests/liquidsoap/tests/regression/dune.inc +45 -14
- package/tests/liquidsoap/tests/regression/track_sensitive.liq +17 -0
- package/tests/liquidsoap/tests/regression/unified-pcm-types.aac +0 -0
- package/tests/liquidsoap/tests/regression/unified-pcm-types.liq +3 -0
- package/tests/liquidsoap/tests/run_test.ml +7 -3
- package/tests/liquidsoap/tests/streams/195.liq +4 -1
- package/tests/liquidsoap/tests/streams/cross-override.liq +12 -4
- package/tests/liquidsoap/tests/streams/cross-persist-override.liq +12 -4
- package/tests/liquidsoap/tests/streams/cross.liq +1 -1
- package/tests/liquidsoap/tests/streams/crossfade.liq +11 -24
- package/tests/liquidsoap/tests/streams/cue-cut.liq +16 -0
- package/tests/liquidsoap/tests/streams/dtmf.liq +3 -0
- package/tests/liquidsoap/tests/streams/dtmf_pcm_s16.liq +4 -0
- package/tests/liquidsoap/tests/streams/dune.inc +145 -0
- package/tests/liquidsoap/tests/streams/fades-persistent-override.liq +7 -2
- package/tests/liquidsoap/tests/streams/hls_discontinuity.liq +68 -0
- package/tests/liquidsoap/tests/streams/hls_id3v2.liq +76 -4
- package/tests/liquidsoap/tests/streams/hls_large_frame.liq +31 -0
- package/tests/liquidsoap/tests/streams/merge_metadata.liq +2 -4
- package/tests/liquidsoap/tests/streams/no-cue-cut.liq +22 -0
- package/tests/liquidsoap/tests/streams/random.liq +4 -4
- package/tests/liquidsoap/tests/streams/rotate.liq +44 -21
- package/tests/liquidsoap/tests/streams/sharing.liq +5 -0
- package/tests/liquidsoap/tests/streams/source-cue.liq +134 -0
- package/tests/liquidsoap/tests/streams/srt_raw_pcm.liq +5 -0
- package/tests/liquidsoap/tests/test.liq +1 -2
- package/tests/run.sh +0 -0
- package/tests/liquidsoap/.github/opam/packages/duppy/duppy.0.9.3/opam +0 -37
- package/tests/liquidsoap/.github/opam/packages/ssl/ssl.0.7.0/opam +0 -40
- package/tests/liquidsoap/src/core/liqmagic.disabled.ml +0 -2
- package/tests/liquidsoap/src/core/liqmagic.enabled.ml +0 -3
- package/tests/liquidsoap/src/core/liqmagic.mli +0 -4
- package/tests/liquidsoap/src/core/operators/cuepoint.ml +0 -216
- package/tests/liquidsoap/tests/regression/GH3121.liq +0 -16
|
@@ -39,7 +39,7 @@ class compress ~attack ~release ~threshold ~ratio ~knee ~track_sensitive
|
|
|
39
39
|
method remaining = source#remaining
|
|
40
40
|
method seek_source = source#seek_source
|
|
41
41
|
method self_sync = source#self_sync
|
|
42
|
-
method private
|
|
42
|
+
method private can_generate_frame = source#is_ready
|
|
43
43
|
method abort_track = source#abort_track
|
|
44
44
|
|
|
45
45
|
(* Current gain in dB. *)
|
|
@@ -65,13 +65,10 @@ class compress ~attack ~release ~threshold ~ratio ~knee ~track_sensitive
|
|
|
65
65
|
gain <- 0.;
|
|
66
66
|
ms <- 0.
|
|
67
67
|
|
|
68
|
-
method private
|
|
69
|
-
let
|
|
70
|
-
|
|
71
|
-
let
|
|
72
|
-
let partial = AFrame.is_partial buf in
|
|
73
|
-
let buf = Content.Audio.get_data (Frame.get buf field) in
|
|
74
|
-
let chans = self#audio_channels in
|
|
68
|
+
method private compress frame =
|
|
69
|
+
let pos = AFrame.position frame in
|
|
70
|
+
let buf = Content.Audio.get_data (Frame.get frame field) in
|
|
71
|
+
let chans = Array.length buf in
|
|
75
72
|
let samplerate = float (Lazy.force Frame.audio_rate) in
|
|
76
73
|
let threshold = threshold () in
|
|
77
74
|
let knee = knee () in
|
|
@@ -88,7 +85,7 @@ class compress ~attack ~release ~threshold ~ratio ~knee ~track_sensitive
|
|
|
88
85
|
let window_coef = 1. -. exp (-1. /. (window *. samplerate)) in
|
|
89
86
|
let wet = wet () in
|
|
90
87
|
self#prepare lookahead;
|
|
91
|
-
for i =
|
|
88
|
+
for i = 0 to pos - 1 do
|
|
92
89
|
(* Apply pre_gain. *)
|
|
93
90
|
if pre_gain <> 0. then
|
|
94
91
|
for c = 0 to chans - 1 do
|
|
@@ -163,7 +160,15 @@ class compress ~attack ~release ~threshold ~ratio ~knee ~track_sensitive
|
|
|
163
160
|
buf.(c).(i) <- buf.(c).(i) *. (1. -. wet +. (wet *. gain))
|
|
164
161
|
done
|
|
165
162
|
done;
|
|
166
|
-
|
|
163
|
+
Frame.set_data frame field Content.Audio.lift_data buf
|
|
164
|
+
|
|
165
|
+
method private generate_frame =
|
|
166
|
+
match self#split_frame (source#get_mutable_frame field) with
|
|
167
|
+
| frame, None -> self#compress frame
|
|
168
|
+
| frame, Some new_track ->
|
|
169
|
+
let frame = self#compress frame in
|
|
170
|
+
if track_sensitive then self#reset;
|
|
171
|
+
Frame.append frame (self#compress new_track)
|
|
167
172
|
end
|
|
168
173
|
|
|
169
174
|
let audio_compress =
|
|
@@ -23,27 +23,26 @@
|
|
|
23
23
|
open Source
|
|
24
24
|
|
|
25
25
|
class compress ~field (source : source) mu =
|
|
26
|
-
object
|
|
26
|
+
object (self)
|
|
27
27
|
inherit operator ~name:"compress" [source]
|
|
28
28
|
method stype = source#stype
|
|
29
29
|
method remaining = source#remaining
|
|
30
|
-
method private
|
|
30
|
+
method private can_generate_frame = source#is_ready
|
|
31
31
|
method abort_track = source#abort_track
|
|
32
32
|
method seek_source = source#seek_source
|
|
33
33
|
method self_sync = source#self_sync
|
|
34
34
|
|
|
35
|
-
method private
|
|
36
|
-
let
|
|
37
|
-
|
|
38
|
-
let b = Content.Audio.get_data (Frame.get buf field) in
|
|
39
|
-
for c = 0 to Array.length b - 1 do
|
|
35
|
+
method private generate_frame =
|
|
36
|
+
let b = Content.Audio.get_data (source#get_mutable_content field) in
|
|
37
|
+
for c = 0 to self#audio_channels - 1 do
|
|
40
38
|
let b_c = b.(c) in
|
|
41
|
-
for i =
|
|
39
|
+
for i = 0 to source#frame_audio_position - 1 do
|
|
42
40
|
let x = b_c.(i) in
|
|
43
41
|
let sign = if x < 0. then -1. else 1. in
|
|
44
42
|
b_c.(i) <- sign *. (1. -. ((1. -. Utils.abs_float x) ** mu))
|
|
45
43
|
done
|
|
46
|
-
done
|
|
44
|
+
done;
|
|
45
|
+
source#set_frame_data field Content.Audio.lift_data b
|
|
47
46
|
end
|
|
48
47
|
|
|
49
48
|
let _ =
|
|
@@ -23,18 +23,39 @@
|
|
|
23
23
|
open Mm
|
|
24
24
|
open Source
|
|
25
25
|
|
|
26
|
+
class consumer buffer =
|
|
27
|
+
object (self)
|
|
28
|
+
inherit Source.source ~name:"buffer" ()
|
|
29
|
+
method stype = `Fallible
|
|
30
|
+
method private can_generate_frame = 0 < Generator.length buffer
|
|
31
|
+
|
|
32
|
+
method private generate_frame =
|
|
33
|
+
Generator.slice buffer (Lazy.force Frame.size)
|
|
34
|
+
|
|
35
|
+
method abort_track = Generator.clear buffer
|
|
36
|
+
method self_sync = (`Static, false)
|
|
37
|
+
method seek_source = (self :> Source.source)
|
|
38
|
+
method remaining = Generator.length buffer
|
|
39
|
+
end
|
|
40
|
+
|
|
26
41
|
let finalise_child_clock child_clock source =
|
|
27
42
|
Clock.forget source#clock child_clock
|
|
28
43
|
|
|
29
|
-
(** [rms_width]
|
|
30
|
-
* [cross_length] is in ticks (like #remaining estimations).
|
|
31
|
-
* We are assuming a fixed audio kind -- at least for now. *)
|
|
44
|
+
(** [rms_width] is in samples.
|
|
45
|
+
* [cross_length] is in ticks (like #remaining estimations) and must be at least one frame. *)
|
|
32
46
|
class cross val_source ~duration_getter ~override_duration ~persist_override
|
|
33
|
-
~rms_width
|
|
47
|
+
~rms_width transition =
|
|
34
48
|
let s = Lang.to_source val_source in
|
|
35
49
|
let original_duration_getter = duration_getter in
|
|
36
50
|
object (self)
|
|
37
51
|
inherit source ~name:"cross" () as super
|
|
52
|
+
|
|
53
|
+
inherit
|
|
54
|
+
generate_from_multiple_sources
|
|
55
|
+
~merge:(fun () -> false)
|
|
56
|
+
~track_sensitive:(fun () -> false)
|
|
57
|
+
()
|
|
58
|
+
|
|
38
59
|
inherit! Child_support.base ~check_self_sync:true [val_source]
|
|
39
60
|
initializer Typing.(s#frame_type <: self#frame_type)
|
|
40
61
|
method stype = `Fallible
|
|
@@ -43,7 +64,7 @@ class cross val_source ~duration_getter ~override_duration ~persist_override
|
|
|
43
64
|
* sources but we do not have a static way of knowing it at the moment.
|
|
44
65
|
* Going with the same choice as above for now. *)
|
|
45
66
|
method self_sync = s#self_sync
|
|
46
|
-
val mutable cross_length =
|
|
67
|
+
val mutable cross_length = Lazy.force Frame.size
|
|
47
68
|
val mutable duration_getter = original_duration_getter
|
|
48
69
|
method cross_duration = duration_getter ()
|
|
49
70
|
|
|
@@ -57,7 +78,11 @@ class cross val_source ~duration_getter ~override_duration ~persist_override
|
|
|
57
78
|
"Cannot set crossfade duration to negative value %f!"
|
|
58
79
|
new_cross_length
|
|
59
80
|
else (
|
|
60
|
-
|
|
81
|
+
let main_new_cross_length =
|
|
82
|
+
max (Lazy.force Frame.size) main_new_cross_length
|
|
83
|
+
in
|
|
84
|
+
self#log#info "Setting crossfade duration to %.2fs"
|
|
85
|
+
(Frame.seconds_of_main main_new_cross_length);
|
|
61
86
|
cross_length <- main_new_cross_length)
|
|
62
87
|
|
|
63
88
|
initializer self#set_cross_length
|
|
@@ -80,19 +105,6 @@ class cross val_source ~duration_getter ~override_duration ~persist_override
|
|
|
80
105
|
val mutable rmsi_after = 0
|
|
81
106
|
val mutable after_metadata = None
|
|
82
107
|
|
|
83
|
-
(* An audio frame for intermediate computations. It is used to buffer the
|
|
84
|
-
end and beginnings of tracks. Its past metadata should mimic that of the
|
|
85
|
-
main stream in order to avoid metadata duplication. *)
|
|
86
|
-
val mutable buf_frame = None
|
|
87
|
-
|
|
88
|
-
method private buf_frame =
|
|
89
|
-
match buf_frame with
|
|
90
|
-
| Some frame -> frame
|
|
91
|
-
| None ->
|
|
92
|
-
let f = Frame.create self#content_type in
|
|
93
|
-
buf_frame <- Some f;
|
|
94
|
-
f
|
|
95
|
-
|
|
96
108
|
method private reset_analysis =
|
|
97
109
|
gen_before <- Generator.create self#content_type;
|
|
98
110
|
gen_after <- Generator.create self#content_type;
|
|
@@ -110,199 +122,137 @@ class cross val_source ~duration_getter ~override_duration ~persist_override
|
|
|
110
122
|
* track limits. *)
|
|
111
123
|
val source = s
|
|
112
124
|
|
|
113
|
-
|
|
114
|
-
val mutable transition_source = None
|
|
115
|
-
val mutable pending_after = Generator.create Frame.Fields.empty
|
|
116
|
-
|
|
117
|
-
method private prepare_transition_source s =
|
|
125
|
+
method private prepare_source s =
|
|
118
126
|
let s = (s :> source) in
|
|
119
127
|
s#get_ready [(self :> source)];
|
|
120
128
|
Clock.unify ~pos:self#pos source#clock s#clock;
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
method cleanup_transition_source =
|
|
124
|
-
match transition_source with
|
|
125
|
-
| None -> ()
|
|
126
|
-
| Some s ->
|
|
127
|
-
s#leave (self :> source);
|
|
128
|
-
transition_source <- None
|
|
129
|
+
self#set_cross_length
|
|
129
130
|
|
|
130
131
|
method! private wake_up a =
|
|
131
132
|
self#reset_analysis;
|
|
132
133
|
super#wake_up a;
|
|
133
134
|
source#get_ready [(self :> source)];
|
|
134
|
-
source#get_ready [(self :> source)];
|
|
135
135
|
Lang.iter_sources (fun s -> s#get_ready [(self :> source)]) transition
|
|
136
136
|
|
|
137
|
+
val mutable status
|
|
138
|
+
: [ `Idle | `Before of Source.source | `After of Source.source ] =
|
|
139
|
+
`Idle
|
|
140
|
+
|
|
141
|
+
method private leave_status =
|
|
142
|
+
match status with
|
|
143
|
+
| `Idle -> ()
|
|
144
|
+
| `Before s | `After s -> s#leave (self :> source)
|
|
145
|
+
|
|
137
146
|
method! private sleep =
|
|
138
147
|
source#leave (self :> source);
|
|
139
148
|
s#leave (self :> source);
|
|
140
149
|
Lang.iter_sources (fun s -> s#leave (self :> source)) transition;
|
|
141
|
-
self#
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
150
|
+
self#leave_status
|
|
151
|
+
|
|
152
|
+
method private child_get ~is_first source =
|
|
153
|
+
let frame = ref self#empty_frame in
|
|
154
|
+
self#child_on_output (fun () ->
|
|
155
|
+
frame :=
|
|
156
|
+
source#get_partial_frame (fun f ->
|
|
157
|
+
match self#split_frame f with
|
|
158
|
+
| buf, Some _ when Frame.position buf = 0 && is_first -> f
|
|
159
|
+
| buf, _ -> buf));
|
|
160
|
+
!frame
|
|
161
|
+
|
|
162
|
+
method private append mode buf_frame =
|
|
163
|
+
let l = Frame.get_all_metadata buf_frame in
|
|
164
|
+
List.iter
|
|
165
|
+
(fun (_, m) ->
|
|
166
|
+
match Frame.Metadata.find_opt override_duration m with
|
|
167
|
+
| None -> ()
|
|
168
|
+
| Some v -> (
|
|
169
|
+
try
|
|
170
|
+
self#log#info "Overriding crossfade duration from metadata %s"
|
|
171
|
+
override_duration;
|
|
172
|
+
let l = float_of_string v in
|
|
173
|
+
duration_getter <- (fun () -> l)
|
|
174
|
+
with _ -> ()))
|
|
175
|
+
l;
|
|
176
|
+
(match (List.rev l, mode) with
|
|
153
177
|
| (_, m) :: _, `Before -> before_metadata <- Some m
|
|
154
178
|
| (_, m) :: _, `After -> after_metadata <- Some m
|
|
155
|
-
| _ -> ()
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
duration_getter <- (fun () -> l)
|
|
172
|
-
with _ -> ())))
|
|
173
|
-
(Frame.get_all_metadata frame);
|
|
174
|
-
self#set_cross_length
|
|
175
|
-
|
|
176
|
-
method private get_frame frame =
|
|
179
|
+
| _ -> ());
|
|
180
|
+
match mode with
|
|
181
|
+
| `Before -> Generator.append gen_before buf_frame
|
|
182
|
+
| `After -> Generator.append gen_after buf_frame
|
|
183
|
+
|
|
184
|
+
method private prepare_before =
|
|
185
|
+
self#log#info "Buffering end of track...";
|
|
186
|
+
let before = new consumer gen_before in
|
|
187
|
+
Typing.(before#frame_type <: self#frame_type);
|
|
188
|
+
self#prepare_source before;
|
|
189
|
+
self#leave_status;
|
|
190
|
+
status <- `Before (before :> Source.source);
|
|
191
|
+
self#buffer_before ~is_first:true ();
|
|
192
|
+
before
|
|
193
|
+
|
|
194
|
+
method private get_source ~reselect () =
|
|
177
195
|
match status with
|
|
178
|
-
| `Idle ->
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
self#child_get (Option.get transition_source) frame;
|
|
216
|
-
|
|
217
|
-
if Generator.length pending_after = 0 && Frame.is_partial frame then (
|
|
218
|
-
status <- `Idle;
|
|
219
|
-
self#cleanup_transition_source;
|
|
220
|
-
|
|
221
|
-
(* If underlying source if ready, try to continue filling up the frame
|
|
222
|
-
* using it. Each call to [get_frame] must add exactly one break so
|
|
223
|
-
* call it again and then remove the intermediate break that was just
|
|
224
|
-
* added. *)
|
|
225
|
-
if source#is_ready ~frame () then (
|
|
226
|
-
self#get_frame frame;
|
|
227
|
-
Frame.set_breaks frame
|
|
228
|
-
(match List.rev (Frame.breaks frame) with
|
|
229
|
-
| b :: _ :: l -> List.rev (b :: l)
|
|
230
|
-
| _ -> assert false)))
|
|
231
|
-
| `After ->
|
|
232
|
-
(* Here, transition source went down so we switch back to main source.
|
|
233
|
-
Our [is_ready] check ensures that we only get here when the main source
|
|
234
|
-
is ready. *)
|
|
235
|
-
status <- `Idle;
|
|
236
|
-
self#cleanup_transition_source;
|
|
237
|
-
self#get_frame frame
|
|
238
|
-
|
|
239
|
-
(* [bufferize n] stores at most [n+d] samples from [s] in [gen_before],
|
|
240
|
-
* where [d=AFrame.size-1]. *)
|
|
241
|
-
method private buffering n =
|
|
242
|
-
let buf_frame = self#buf_frame in
|
|
243
|
-
if not (Frame.is_partial buf_frame) then Frame.clear buf_frame;
|
|
244
|
-
let start = AFrame.position buf_frame in
|
|
245
|
-
let stop =
|
|
246
|
-
self#child_get source buf_frame;
|
|
247
|
-
AFrame.position buf_frame
|
|
248
|
-
in
|
|
249
|
-
self#save_last_metadata `Before buf_frame;
|
|
250
|
-
self#update_cross_length buf_frame start;
|
|
251
|
-
Generator.feed
|
|
252
|
-
~offset:(Frame.main_of_audio start)
|
|
253
|
-
~length:(Frame.main_of_audio (stop - start))
|
|
254
|
-
gen_before buf_frame;
|
|
255
|
-
|
|
256
|
-
(* Analyze them *)
|
|
257
|
-
let pcm = AFrame.pcm buf_frame in
|
|
258
|
-
let len = stop - start in
|
|
259
|
-
let squares = Audio.squares pcm start len in
|
|
260
|
-
rms_before <- rms_before -. mem_before.(mem_i) +. squares;
|
|
261
|
-
mem_before.(mem_i) <- squares;
|
|
262
|
-
mem_i <- (mem_i + len) mod rms_width;
|
|
263
|
-
rmsi_before <- min rms_width (rmsi_before + len);
|
|
264
|
-
|
|
265
|
-
(* Should we buffer more or are we done ? *)
|
|
266
|
-
if AFrame.is_partial buf_frame then (
|
|
267
|
-
Generator.add_track_mark gen_before;
|
|
268
|
-
status <- `Limit)
|
|
269
|
-
else if n > 0 then self#buffering (n - stop + start)
|
|
196
|
+
| `Idle when source#is_ready -> Some self#prepare_before
|
|
197
|
+
| `Idle -> None
|
|
198
|
+
| `Before _ -> (
|
|
199
|
+
self#buffer_before ~is_first:false ();
|
|
200
|
+
match status with
|
|
201
|
+
| `Idle -> assert false
|
|
202
|
+
| `Before before_source -> Some before_source
|
|
203
|
+
| `After after_source -> Some after_source)
|
|
204
|
+
| `After after_source
|
|
205
|
+
when self#can_reselect
|
|
206
|
+
~reselect:
|
|
207
|
+
(match reselect with
|
|
208
|
+
| `After_position _ -> reselect
|
|
209
|
+
| _ -> `Ok)
|
|
210
|
+
after_source ->
|
|
211
|
+
Some after_source
|
|
212
|
+
| `After _ -> Some self#prepare_before
|
|
213
|
+
|
|
214
|
+
method private buffer_before ~is_first () =
|
|
215
|
+
if Generator.length gen_before < cross_length && source#is_ready then (
|
|
216
|
+
let buf_frame = self#child_get ~is_first source in
|
|
217
|
+
self#append `Before buf_frame;
|
|
218
|
+
(* Analyze them *)
|
|
219
|
+
let pcm = AFrame.pcm buf_frame in
|
|
220
|
+
let len = Audio.length pcm in
|
|
221
|
+
let squares = Audio.squares pcm 0 len in
|
|
222
|
+
rms_before <- rms_before -. mem_before.(mem_i) +. squares;
|
|
223
|
+
mem_before.(mem_i) <- squares;
|
|
224
|
+
mem_i <- (mem_i + len) mod rms_width;
|
|
225
|
+
rmsi_before <- min rms_width (rmsi_before + len);
|
|
226
|
+
|
|
227
|
+
(* Should we buffer more or are we done ? *)
|
|
228
|
+
if Frame.is_partial buf_frame then (
|
|
229
|
+
if not persist_override then
|
|
230
|
+
duration_getter <- original_duration_getter;
|
|
231
|
+
self#analyze_after)
|
|
232
|
+
else self#buffer_before ~is_first:false ())
|
|
270
233
|
|
|
271
234
|
(* Analyze the beginning of a new track. *)
|
|
272
235
|
method private analyze_after =
|
|
273
|
-
let
|
|
274
|
-
let before_len = Generator.length gen_before in
|
|
275
|
-
let rec f () =
|
|
276
|
-
let start = AFrame.position buf_frame in
|
|
277
|
-
let stop =
|
|
278
|
-
self#child_get source buf_frame;
|
|
279
|
-
AFrame.position buf_frame
|
|
280
|
-
in
|
|
281
|
-
Generator.feed
|
|
282
|
-
~offset:(Frame.main_of_audio start)
|
|
283
|
-
~length:(Frame.main_of_audio (stop - start))
|
|
284
|
-
gen_after buf_frame;
|
|
285
|
-
let after_len = Generator.length gen_after in
|
|
286
|
-
if after_len <= rms_width then (
|
|
287
|
-
let pcm = AFrame.pcm buf_frame in
|
|
288
|
-
let len = stop - start in
|
|
289
|
-
let squares = Audio.squares pcm start len in
|
|
290
|
-
rms_after <- rms_after +. squares;
|
|
291
|
-
rmsi_after <- rmsi_after + len);
|
|
292
|
-
self#save_last_metadata `After buf_frame;
|
|
293
|
-
self#update_cross_length buf_frame start;
|
|
236
|
+
let rec f ~is_first () =
|
|
294
237
|
if
|
|
295
|
-
|
|
296
|
-
&&
|
|
297
|
-
then
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
if
|
|
238
|
+
Generator.length gen_after < Generator.length gen_before
|
|
239
|
+
&& source#is_ready
|
|
240
|
+
then (
|
|
241
|
+
let buf_frame = self#child_get ~is_first source in
|
|
242
|
+
self#append `After buf_frame;
|
|
243
|
+
if Generator.length gen_after <= rms_width then (
|
|
244
|
+
let pcm = AFrame.pcm buf_frame in
|
|
245
|
+
let len = Audio.length pcm in
|
|
246
|
+
let squares = Audio.squares pcm 0 len in
|
|
247
|
+
rms_after <- rms_after +. squares;
|
|
248
|
+
rmsi_after <- rmsi_after + len);
|
|
249
|
+
if Frame.is_partial buf_frame then () else f ~is_first:false ())
|
|
301
250
|
in
|
|
302
|
-
f ()
|
|
251
|
+
f ~is_first:true ();
|
|
252
|
+
self#create_after
|
|
303
253
|
|
|
304
254
|
(* Sum up analysis and build the transition *)
|
|
305
|
-
method private
|
|
255
|
+
method private create_after =
|
|
306
256
|
let db_after =
|
|
307
257
|
Audio.dB_of_lin
|
|
308
258
|
(sqrt (rms_after /. float rmsi_after /. float self#audio_channels))
|
|
@@ -311,7 +261,7 @@ class cross val_source ~duration_getter ~override_duration ~persist_override
|
|
|
311
261
|
Audio.dB_of_lin
|
|
312
262
|
(sqrt (rms_before /. float rmsi_before /. float self#audio_channels))
|
|
313
263
|
in
|
|
314
|
-
let
|
|
264
|
+
let after =
|
|
315
265
|
Clock.collect_after (fun () ->
|
|
316
266
|
let metadata = function
|
|
317
267
|
| None -> Frame.Metadata.empty
|
|
@@ -319,17 +269,13 @@ class cross val_source ~duration_getter ~override_duration ~persist_override
|
|
|
319
269
|
in
|
|
320
270
|
let before_metadata = metadata before_metadata in
|
|
321
271
|
let after_metadata = metadata after_metadata in
|
|
322
|
-
let before =
|
|
323
|
-
new Insert_metadata.replay
|
|
324
|
-
before_metadata
|
|
325
|
-
(new Generated.consumer gen_before)
|
|
326
|
-
in
|
|
272
|
+
let before = new consumer gen_before in
|
|
327
273
|
Typing.(before#frame_type <: self#frame_type);
|
|
328
|
-
let
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
in
|
|
274
|
+
let before = new Insert_metadata.replay before_metadata before in
|
|
275
|
+
Typing.(before#frame_type <: self#frame_type);
|
|
276
|
+
let after = new consumer gen_after in
|
|
277
|
+
Typing.(after#frame_type <: self#frame_type);
|
|
278
|
+
let after = new Insert_metadata.replay after_metadata after in
|
|
333
279
|
Typing.(after#frame_type <: self#frame_type);
|
|
334
280
|
let () =
|
|
335
281
|
before#set_id (self#id ^ "_before");
|
|
@@ -343,6 +289,12 @@ class cross val_source ~duration_getter ~override_duration ~persist_override
|
|
|
343
289
|
[
|
|
344
290
|
("source", Lang.source a);
|
|
345
291
|
("db_level", Lang.float db_before);
|
|
292
|
+
( "expected_duration",
|
|
293
|
+
Lang.float (Frame.seconds_of_main cross_length) );
|
|
294
|
+
( "buffered",
|
|
295
|
+
Lang.float
|
|
296
|
+
(Frame.seconds_of_main
|
|
297
|
+
(Generator.length gen_before)) );
|
|
346
298
|
("metadata", Lang.metadata before_metadata);
|
|
347
299
|
] );
|
|
348
300
|
( "",
|
|
@@ -350,6 +302,12 @@ class cross val_source ~duration_getter ~override_duration ~persist_override
|
|
|
350
302
|
[
|
|
351
303
|
("source", Lang.source b);
|
|
352
304
|
("db_level", Lang.float db_after);
|
|
305
|
+
( "expected_duration",
|
|
306
|
+
Lang.float (Frame.seconds_of_main cross_length) );
|
|
307
|
+
( "buffered",
|
|
308
|
+
Lang.float
|
|
309
|
+
(Frame.seconds_of_main (Generator.length gen_after))
|
|
310
|
+
);
|
|
353
311
|
("metadata", Lang.metadata after_metadata);
|
|
354
312
|
] );
|
|
355
313
|
]
|
|
@@ -361,46 +319,38 @@ class cross val_source ~duration_getter ~override_duration ~persist_override
|
|
|
361
319
|
db_before db_after
|
|
362
320
|
(Frame.seconds_of_main (Generator.length gen_before))
|
|
363
321
|
(Frame.seconds_of_main (Generator.length gen_after));
|
|
364
|
-
|
|
365
|
-
then f before after
|
|
366
|
-
else (
|
|
367
|
-
self#log#important "Not enough data for crossing.";
|
|
368
|
-
(new Sequence.sequence [before; after] :> source))
|
|
322
|
+
f before after
|
|
369
323
|
in
|
|
370
324
|
Clock.unify ~pos:self#pos compound#clock s#clock;
|
|
371
325
|
Typing.(compound#frame_type <: self#frame_type);
|
|
372
326
|
compound)
|
|
373
327
|
in
|
|
374
|
-
self#
|
|
375
|
-
self#
|
|
376
|
-
|
|
377
|
-
status <- `After
|
|
378
|
-
self#reset_analysis
|
|
328
|
+
self#prepare_source after;
|
|
329
|
+
self#reset_analysis;
|
|
330
|
+
self#leave_status;
|
|
331
|
+
status <- `After after
|
|
379
332
|
|
|
380
333
|
method remaining =
|
|
381
334
|
match status with
|
|
382
|
-
| `
|
|
383
|
-
| `
|
|
384
|
-
|
|
335
|
+
| `Idle -> source#remaining
|
|
336
|
+
| `Before s -> (
|
|
337
|
+
match (s#remaining, source#remaining) with
|
|
338
|
+
| -1, _ | _, -1 -> -1
|
|
339
|
+
| r, r' -> r + r')
|
|
340
|
+
| `After s -> s#remaining
|
|
385
341
|
|
|
386
342
|
method seek_source =
|
|
387
343
|
match status with
|
|
388
|
-
| `
|
|
389
|
-
| `After ->
|
|
390
|
-
| _ -> (self :> Source.source)
|
|
391
|
-
|
|
392
|
-
method private _is_ready ?frame () =
|
|
393
|
-
match status with
|
|
394
|
-
| `Idle | `Before -> source#is_ready ?frame ()
|
|
395
|
-
| `Limit -> true
|
|
396
|
-
| `After ->
|
|
397
|
-
(Option.get transition_source)#is_ready ?frame ()
|
|
398
|
-
|| source#is_ready ?frame ()
|
|
344
|
+
| `Idle -> source#seek_source
|
|
345
|
+
| `Before s | `After s -> s#seek_source
|
|
399
346
|
|
|
400
347
|
method abort_track =
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
348
|
+
match status with
|
|
349
|
+
| `Idle -> source#abort_track
|
|
350
|
+
| `Before s | `After s ->
|
|
351
|
+
source#abort_track;
|
|
352
|
+
status <- `After s;
|
|
353
|
+
ignore self#prepare_before
|
|
404
354
|
end
|
|
405
355
|
|
|
406
356
|
let _ =
|
|
@@ -413,6 +363,8 @@ let _ =
|
|
|
413
363
|
[
|
|
414
364
|
("source", ([], Lang.source_t frame_t), "Source");
|
|
415
365
|
("db_level", ([], Lang.float_t), "dB level of the source.");
|
|
366
|
+
("expected_duration", ([], Lang.float_t), "Expected buffered duration.");
|
|
367
|
+
("buffered", ([], Lang.float_t), "Buffered duration.");
|
|
416
368
|
("metadata", ([], Lang.metadata_t), "Metadata of the source.");
|
|
417
369
|
]
|
|
418
370
|
in
|
|
@@ -434,26 +386,10 @@ let _ =
|
|
|
434
386
|
Lang.bool_t,
|
|
435
387
|
Some (Lang.bool false),
|
|
436
388
|
Some "Keep duration override on track change." );
|
|
437
|
-
( "minimum",
|
|
438
|
-
Lang.float_t,
|
|
439
|
-
Some (Lang.float (-1.)),
|
|
440
|
-
Some
|
|
441
|
-
"Minimum duration (in sec.) for a cross: If the track ends without \
|
|
442
|
-
any warning (e.g. in case of skip) there may not be enough data for \
|
|
443
|
-
a decent composition. Set to 0. to avoid having transitions after \
|
|
444
|
-
skips, or more to avoid transitions on short tracks. With a \
|
|
445
|
-
negative default, transitions always occur." );
|
|
446
389
|
( "width",
|
|
447
390
|
Lang.float_t,
|
|
448
391
|
Some (Lang.float 2.),
|
|
449
392
|
Some "Width of the power computation window." );
|
|
450
|
-
( "conservative",
|
|
451
|
-
Lang.bool_t,
|
|
452
|
-
Some (Lang.bool true),
|
|
453
|
-
Some
|
|
454
|
-
"Do not trust remaining time estimations, always buffering data in \
|
|
455
|
-
advance. This avoids being tricked by skips, either manual or \
|
|
456
|
-
caused by blank.skip()." );
|
|
457
393
|
( "",
|
|
458
394
|
Lang.fun_t
|
|
459
395
|
[(false, "", transition_arg); (false, "", transition_arg)]
|
|
@@ -485,13 +421,10 @@ let _ =
|
|
|
485
421
|
Lang.to_string (List.assoc "override_duration" p)
|
|
486
422
|
in
|
|
487
423
|
let persist_override = Lang.to_bool (List.assoc "persist_override" p) in
|
|
488
|
-
let minimum = Lang.to_float (List.assoc "minimum" p) in
|
|
489
|
-
let minimum_length = Frame.audio_of_seconds minimum in
|
|
490
424
|
let rms_width = Lang.to_float (List.assoc "width" p) in
|
|
491
425
|
let rms_width = Frame.audio_of_seconds rms_width in
|
|
492
426
|
let transition = Lang.assoc "" 1 p in
|
|
493
|
-
let conservative = Lang.to_bool (List.assoc "conservative" p) in
|
|
494
427
|
let source = Lang.assoc "" 2 p in
|
|
495
428
|
new cross
|
|
496
|
-
source transition ~
|
|
497
|
-
~
|
|
429
|
+
source transition ~duration_getter ~rms_width ~override_duration
|
|
430
|
+
~persist_override)
|