Skip to content

Commit

Permalink
More absolute splitting.
Browse files Browse the repository at this point in the history
  • Loading branch information
smimram committed Nov 16, 2023
1 parent 7ade00b commit 6d8abaf
Show file tree
Hide file tree
Showing 15 changed files with 30 additions and 12 deletions.
2 changes: 1 addition & 1 deletion doc/content/blank.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ more about liquidsoap's notion of [source](sources.html).
Finally, if you need to do some custom action when there's too much blank, we
have `blank.detect`:

```{.liquidsoap include="blank-detect.liq" from=1 to=-1}
```{.liquidsoap include="blank-detect.liq" from="BEGIN" to="END"}
```
2 changes: 1 addition & 1 deletion doc/content/ffmpeg_filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ supported in liquidsoap.

In order to do so, you have to use a slightly different API:

```{.liquidsoap include="ffmpeg-filter-dynamic-volume.liq" to=-1}
```{.liquidsoap include="ffmpeg-filter-dynamic-volume.liq" to="END"}
```

Expand Down
2 changes: 2 additions & 0 deletions doc/content/liq/blank-detect.liq
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
s = playlist("my-playlist")
# BEGIN
def handler() =
process.run(
"/path/to/your/script to do whatever you want"
)
end
s = blank.detect(handler, s)
# END
output.dummy(fallible=true, s)
1 change: 1 addition & 0 deletions doc/content/liq/ffmpeg-filter-dynamic-volume.liq
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ end
s = playlist("my_playlist")

let (s, set_volume) = dynamic_volume(s)
# END
output.dummy(fallible=true, s)
ignore(set_volume)
1 change: 1 addition & 0 deletions doc/content/liq/multitrack-add-video-track.liq
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ s =
track_marks=track_marks
}
)
# END
output.dummy(fallible=true, s)
1 change: 1 addition & 0 deletions doc/content/liq/multitrack-add-video-track2.liq
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ image = single("/path/to/image.png")

# Mux the audio tracks with the image
s = source(source.tracks(s).{video=source.tracks(image).video})
# END
output.dummy(fallible=true, s)
5 changes: 4 additions & 1 deletion doc/content/liq/multitrack-default-video-track.liq
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ video = source.tracks(s).video ?? source.tracks(image).video

# Return a source that always has video:
s = source(source.tracks(s).{video=video})
output.dummy(fallible=true, s)output.dummy(image)

# END
output.dummy(fallible=true, s)
output.dummy(image)
5 changes: 5 additions & 0 deletions doc/content/liq/prometheus-callback.liq
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# A0
is_playing_metric = prometheus.gauge(labels=["source"], help="Whether source is playing.", "liquidsoap_is_playing")
# A1
# B0
playlist = playlist(id="playlist", "my-playlist")
set_playlist_is_playing = is_playing_metric(label_values=["radio"])
# B1
# C0
def check_if_ready(set_is_ready, s) =
def callback() =
if source.is_ready(s) then set_is_ready(1.) else set_is_ready(0.) end
Expand Down
1 change: 1 addition & 0 deletions doc/content/liq/replaygain-metadata.liq
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ enable_replaygain_metadata()

s = playlist("~/playlist")
s = amplify(1., override="replaygain_track_gain", s)
# END
output.dummy(fallible=true, s)
2 changes: 2 additions & 0 deletions doc/content/liq/replaygain-playlist.liq
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
enable_replaygain_metadata()

s = replaygain(playlist("~/playlist"))

# END
output.dummy(fallible=true, s)
2 changes: 2 additions & 0 deletions doc/content/liq/video-weather.liq
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ img = single("weather.jpg")
cam = input.v4l2()
cam = video.alpha.of_color(color=0x0000ff, precision=0.2, cam)
s = add([img, cam])

# END
output.dummy(fallible=true, s)
6 changes: 3 additions & 3 deletions doc/content/multitrack.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,22 +125,22 @@ Tracks can be muxed using the `source` operator. The operator takes a record of

Here's how to add a video track to a source

```{.liquidsoap include="multitrack-add-video-track.liq" to=-1}
```{.liquidsoap include="multitrack-add-video-track.liq" to="END"}
```

The above example was purposely written in a longer form to make it more explicit. However, if you wish to just add/replace a track, you
can also overload the existing tracks from the first source as follows:

```{.liquidsoap include="multitrack-add-video-track2.liq" to=-1}
```{.liquidsoap include="multitrack-add-video-track2.liq" to="END"}
```

### Add a default video track

You can also check if a source has a certain track and do something accordingly:

```{.liquidsoap include="multitrack-default-video-track.liq" to=-1}
```{.liquidsoap include="multitrack-default-video-track.liq" to="END"}
```

Expand Down
6 changes: 3 additions & 3 deletions doc/content/prometheus.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ This type can be a little confusing. Here's how it works:

1. First, one has to create a metric factory of a given type. For instance:

```{.liquidsoap include="prometheus-callback.liq" from=0 to=0}
```{.liquidsoap include="prometheus-callback.liq" from="A0" to="A1"}
```

2. Then, the metric factory can be used to instantiate speific metrics by passing the label's values:

```{.liquidsoap include="prometheus-callback.liq" from=1 to=2}
```{.liquidsoap include="prometheus-callback.liq" from="B0" to="B1"}
```

Expand All @@ -55,7 +55,7 @@ The returned function is a setter for this metric, i.e.

Finally, the programmer can now use that callback to set the metric as desired. For instance here:

```{.liquidsoap include="prometheus-callback.liq" from=3}
```{.liquidsoap include="prometheus-callback.liq" from="C0"}
```

Expand Down
4 changes: 2 additions & 2 deletions doc/content/replay_gain.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ done using the `override` parameter.

For replay gain implementation, the `amplify` operator would typically be added immediately on top of the basic tracks source, before transitions or other audio processing operators. Typically:

```{.liquidsoap include="replaygain-metadata.liq" to=-1}
```{.liquidsoap include="replaygain-metadata.liq" to="END"}
```

For convenience, we added the `replaygain` operator which performs the
amplification on the right metadata so that this can further be simplified to

```{.liquidsoap include="replaygain-playlist.liq" to=-1}
```{.liquidsoap include="replaygain-playlist.liq" to="END"}
```
2 changes: 1 addition & 1 deletion doc/content/video.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ You can say that a specific color should be transparent using
screen (whose RGB color should be around 0x0000ff) and replace the blue screen
by an image of the weather using

```{.liquidsoap include="video-weather.liq" to=-1}
```{.liquidsoap include="video-weather.liq" to="END"}
```

Expand Down

0 comments on commit 6d8abaf

Please sign in to comment.