File: crossfade-plot.liq

package info (click to toggle)
liquidsoap 2.4.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,844 kB
  • sloc: ml: 74,136; javascript: 27,320; ansic: 505; sh: 139; xml: 114; lisp: 96; makefile: 26
file content (59 lines) | stat: -rw-r--r-- 1,113 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
log.level := 5

a = sine(duration=20., 440.)
a =
  metadata.map(
    insert_missing=true,
    update=false,
    fun (_) ->
      [
        ("liq_cross_duration", "5."),
        ("liq_fade_out_type", "exp"),
        ("liq_fade_out_curve", "10"),
        ("liq_fade_out_delay", "2"),
        ("liq_fade_out", "3.")
      ],
    a
  )

b = sine(duration=20., 880.)
b =
  metadata.map(
    insert_missing=true,
    update=false,
    fun (_) ->
      [
        ("liq_fade_out_type", "lin"),
        ("liq_fade_in_delay", "2"),
        ("liq_fade_in", "2.")
      ],
    b
  )

b = once(b)

s = sequence([a, b])

dir = file.temp_dir("plot")
on_cleanup({file.rmdir(dir)})

s = cross.plot(dir=dir, png="crossfade-plot.png.gen", s)

clock.assign_new(sync='none', [s])

base_dir = path.dirname(argv(0))

def on_stop() =
  file.copy(
    path.concat(dir, "old.txt"),
    path.concat(base_dir, "crossfade-plot.old.txt.gen")
  )
  file.copy(
    path.concat(dir, "new.txt"),
    path.concat(base_dir, "crossfade-plot.new.txt.gen")
  )
  test.pass()
end

o = output.dummy(fallible=true, s)
o.on_stop(synchronous=true, on_stop)