liquidsoap-prettier 1.8.2 → 1.8.3

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 (67) hide show
  1. package/.github/workflows/check-formatting.yml +32 -0
  2. package/README.md +31 -5
  3. package/package.json +1 -1
  4. package/src/cli.js +104 -9
  5. package/tests/liq/audio.liq +460 -0
  6. package/tests/liq/autocue.liq +1081 -0
  7. package/tests/liq/clock.liq +14 -0
  8. package/tests/liq/cron.liq +74 -0
  9. package/tests/liq/error.liq +48 -0
  10. package/tests/liq/extra/audio.liq +677 -0
  11. package/tests/liq/extra/audioscrobbler.liq +482 -0
  12. package/tests/liq/extra/deprecations.liq +976 -0
  13. package/tests/liq/extra/externals.liq +196 -0
  14. package/tests/liq/extra/fades.liq +260 -0
  15. package/tests/liq/extra/file.liq +66 -0
  16. package/tests/liq/extra/http.liq +160 -0
  17. package/tests/liq/extra/interactive.liq +917 -0
  18. package/tests/liq/extra/metadata.liq +75 -0
  19. package/tests/liq/extra/native.liq +201 -0
  20. package/tests/liq/extra/openai.liq +150 -0
  21. package/tests/liq/extra/server.liq +177 -0
  22. package/tests/liq/extra/source.liq +476 -0
  23. package/tests/liq/extra/spinitron.liq +272 -0
  24. package/tests/liq/extra/telnet.liq +266 -0
  25. package/tests/liq/extra/video.liq +59 -0
  26. package/tests/liq/extra/visualization.liq +68 -0
  27. package/tests/liq/fades.liq +941 -0
  28. package/tests/liq/ffmpeg.liq +605 -0
  29. package/tests/liq/file.liq +387 -0
  30. package/tests/liq/getter.liq +74 -0
  31. package/tests/liq/hls.liq +329 -0
  32. package/tests/liq/http.liq +1048 -0
  33. package/tests/liq/http_codes.liq +447 -0
  34. package/tests/liq/icecast.liq +58 -0
  35. package/tests/liq/io.liq +106 -0
  36. package/tests/liq/liquidsoap.liq +31 -0
  37. package/tests/liq/list.liq +440 -0
  38. package/tests/liq/log.liq +47 -0
  39. package/tests/liq/lufs.liq +295 -0
  40. package/tests/liq/math.liq +23 -0
  41. package/tests/liq/medialib.liq +752 -0
  42. package/tests/liq/metadata.liq +253 -0
  43. package/tests/liq/nfo.liq +258 -0
  44. package/tests/liq/null.liq +71 -0
  45. package/tests/liq/playlist.liq +1347 -0
  46. package/tests/liq/predicate.liq +106 -0
  47. package/tests/liq/process.liq +93 -0
  48. package/tests/liq/profiler.liq +5 -0
  49. package/tests/liq/protocols.liq +1139 -0
  50. package/tests/liq/ref.liq +28 -0
  51. package/tests/liq/replaygain.liq +135 -0
  52. package/tests/liq/request.liq +467 -0
  53. package/tests/liq/resolvers.liq +33 -0
  54. package/tests/liq/runtime.liq +70 -0
  55. package/tests/liq/server.liq +99 -0
  56. package/tests/liq/settings.liq +41 -0
  57. package/tests/liq/socket.liq +33 -0
  58. package/tests/liq/source.liq +362 -0
  59. package/tests/liq/sqlite.liq +161 -0
  60. package/tests/liq/stdlib.liq +172 -0
  61. package/tests/liq/string.liq +476 -0
  62. package/tests/liq/switches.liq +197 -0
  63. package/tests/liq/testing.liq +37 -0
  64. package/tests/liq/thread.liq +161 -0
  65. package/tests/liq/tracks.liq +100 -0
  66. package/tests/liq/utils.liq +81 -0
  67. package/tests/liq/video.liq +918 -0
@@ -0,0 +1,447 @@
1
+ # List of HTTP codes. Stolen from en.wikipedia.org.
2
+
3
+ # List of HTTP response codes and statuses.
4
+ # @category Interaction
5
+ let http.codes =
6
+ [
7
+ (100, "Continue"),
8
+ #This means that the server has received the request headers, and that the client
9
+ #should proceed to send the request body (in the case of a request for which a
10
+ #body needs to be sent; for example, a POST request). If the request body is
11
+ #large, sending it to a server when a request has already been rejected based
12
+ #upon inappropriate headers is inefficient. To have a server check if the request
13
+ #could be accepted based on the request's headers alone, a client must send
14
+ #Expect: 100-continue as a header in its initial request and check if a 100
15
+ #Continue status code is received in response before continuing (or receive 417
16
+ #Expectation Failed and not continue).
17
+
18
+ (
19
+ 101,
20
+ "Switching Protocols"
21
+ ),
22
+ #This means the requester has asked the server to switch protocols and the server
23
+ #is acknowledging that it will do so.
24
+
25
+ (102, "Processing"),
26
+ #As a WebDAV request may contain many sub-requests involving file operations, it
27
+ #may take a long time to complete the request. This code indicates that the
28
+ #server has received and is processing the request, but no response is available
29
+ #yet. This prevents the client from timing out and assuming the request was
30
+ #lost.
31
+
32
+ (
33
+ 122,
34
+ "Request-URI too long"
35
+ ),
36
+ #This is a non-standard IE7-only code which means the URI is longer than a
37
+ #maximum of 2083 characters. (See code 414.),
38
+
39
+ #2xx Success
40
+
41
+ #This class of status codes indicates the action requested by the client was
42
+ #received, understood, accepted and processed successfully.
43
+
44
+ (200, "OK"),
45
+ #Standard response for successful HTTP requests. The actual response will depend
46
+ #on the request method used. In a GET request, the response will contain an
47
+ #entity corresponding to the requested resource. In a POST request the response
48
+ #will contain an entity describing or containing the result of the action.
49
+
50
+ (201, "Created"),
51
+ #The request has been fulfilled and resulted in a new resource being created.
52
+
53
+ (202, "Accepted"),
54
+ #The request has been accepted for processing, but the processing has not been
55
+ #completed. The request might or might not eventually be acted upon, as it might
56
+ #be disallowed when processing actually takes place.
57
+
58
+ (
59
+ 203,
60
+ "Non-Authoritative Information"
61
+ ),
62
+ #The server successfully processed the request, but is returning information that
63
+ #may be from another source.
64
+
65
+ (
66
+ 204,
67
+ "No Content"
68
+ ),
69
+ #The server successfully processed the request, but is not returning any
70
+ #content.
71
+
72
+ (
73
+ 205,
74
+ "Reset Content"
75
+ ),
76
+ #The server successfully processed the request, but is not returning any content.
77
+ #Unlike a 204 response, this response requires that the requester reset the
78
+ #document view.
79
+
80
+ (
81
+ 206,
82
+ "Partial Content"
83
+ ),
84
+ #The server is delivering only part of the resource due to a range header sent by
85
+ #the client. The range header is used by tools like wget to enable resuming of
86
+ #interrupted downloads, or split a download into multiple simultaneous
87
+ #streams.
88
+
89
+ (207, "Multi-Status"),
90
+ #The message body that follows is an XML message and can contain a number of
91
+ #separate response codes, depending on how many sub-requests were made.
92
+
93
+ (
94
+ 226,
95
+ "IM Used"
96
+ ),
97
+ #The server has fulfilled a GET request for the resource, and the response is a
98
+ #representation of the result of one or more instance-manipulations applied to
99
+ #the current instance.
100
+
101
+ #3xx Redirection
102
+
103
+ #The client must take additional action to complete the request.
104
+ #This class of status code indicates that further action needs to be taken by the
105
+ #user agent in order to fulfil the request. The action required may be carried
106
+ #out by the user agent without interaction with the user if and only if the
107
+ #method used in the second request is GET or HEAD. A user agent should not
108
+ #automatically redirect a request more than five times, since such redirections
109
+ #usually indicate an infinite loop.
110
+
111
+ (
112
+ 300,
113
+ "Multiple Choices"
114
+ ),
115
+ #Indicates multiple options for the resource that the client may follow. It, for
116
+ #instance, could be used to present different format options for video, list
117
+ #files with different extensions, or word sense disambiguation.
118
+
119
+ (
120
+ 301,
121
+ "Moved Permanently"
122
+ ),
123
+ #This and all future requests should be directed to the given URI.
124
+
125
+ (302, "Found"),
126
+ #This is an example of industrial practice contradicting the standard.
127
+ #HTTP/1.0 specification (RFC 1945) required the client to perform a temporary
128
+ #redirect (the original describing phrase was "Moved Temporarily"), but
129
+ #popular browsers implemented 302 with the functionality of a 303 See Other.
130
+ #Therefore, HTTP/1.1 added status codes 303 and 307 to distinguish between the
131
+ #two behaviours. However, the majority of Web applications and frameworks
132
+ #still[as of?] use the 302 status code as if it were the 303.[citation needed]
133
+
134
+ (
135
+ 303,
136
+ "See Other"
137
+ ),
138
+ #The response to the request can be found under another URI using a GET method.
139
+ #When received in response to a POST (or PUT/DELETE), it should be assumed that
140
+ #the server has received the data and the redirect should be issued with a
141
+ #separate GET message.
142
+
143
+ (
144
+ 304,
145
+ "Not Modified"
146
+ ),
147
+ #Indicates the resource has not been modified since last requested. Typically,
148
+ #the HTTP client provides a header like the If-Modified-Since header to provide a
149
+ #time against which to compare. Using this saves bandwidth and reprocessing on
150
+ #both the server and client, as only the header data must be sent and received in
151
+ #comparison to the entirety of the page being re-processed by the server, then
152
+ #sent again using more bandwidth of the server and client.
153
+
154
+ (
155
+ 305,
156
+ "Use Proxy"
157
+ ),
158
+ #Many HTTP clients (such as Mozilla and Internet Explorer) do not correctly
159
+ #handle responses with this status code, primarily for security reasons.
160
+
161
+ (
162
+ 306,
163
+ "Switch Proxy"
164
+ ),
165
+ #No longer used.
166
+
167
+ (
168
+ 307,
169
+ "Temporary Redirect"
170
+ ),
171
+ #In this occasion, the request should be repeated with another URI, but future
172
+ #requests can still use the original URI. In contrast to 303, the request
173
+ #method should not be changed when reissuing the original request. For instance,
174
+ #a POST request must be repeated using another POST request.
175
+
176
+ #4xx Client Error
177
+
178
+ #The 4xx class of status code is intended for cases in which the client seems to
179
+ #have erred. Except when responding to a HEAD request, the server should include
180
+ #an entity containing an explanation of the error situation, and whether it is a
181
+ #temporary or permanent condition. These status codes are applicable to any
182
+ #request method. User agents should display any included entity to the user.
183
+ #These are typically the most common error codes encountered while online.
184
+
185
+ (
186
+ 400,
187
+ "Bad Request"
188
+ ),
189
+ #The request cannot be fulfilled due to bad syntax.
190
+
191
+ (401, "Unauthorized"),
192
+ #Similar to 403 Forbidden, but specifically for use when authentication is
193
+ #possible but has failed or not yet been provided. The response must include a
194
+ #WWW-Authenticate header field containing a challenge applicable to the requested
195
+ #resource. See Basic access authentication and Digest access authentication.
196
+
197
+ (
198
+ 402,
199
+ "Payment Required"
200
+ ),
201
+ #Reserved for future use. The original intention was that this code might be
202
+ #used as part of some form of digital cash or micropayment scheme, but that has
203
+ #not happened, and this code is not usually used. As an example of its use,
204
+ #however, Apple's MobileMe service generates a 402 error (httpStatusCode:402" in
205
+ #the Mac OS X Console log) if the MobileMe account is delinquent.
206
+
207
+ (403, "Forbidden"),
208
+ #The request was a legal request, but the server is refusing to respond to it.
209
+ #Unlike a 401 Unauthorized response, authenticating will make no difference.
210
+
211
+ (
212
+ 404,
213
+ "Not Found"
214
+ ),
215
+ #The requested resource could not be found but may be available again in the
216
+ #future. Subsequent requests by the client are permissible.
217
+
218
+ (
219
+ 405,
220
+ "Method Not Allowed"
221
+ ),
222
+ #A request was made of a resource using a request method not supported by that
223
+ #resource; for example, using GET on a form which requires data to be
224
+ #presented via POST, or using PUT on a read-only resource.
225
+
226
+ (
227
+ 406,
228
+ "Not Acceptable"
229
+ ),
230
+ #The requested resource is only capable of generating content not acceptable
231
+ #according to the Accept headers sent in the request.
232
+
233
+ (
234
+ 407,
235
+ "Proxy Authentication Required"
236
+ ),
237
+ (
238
+ 408,
239
+ "Request Timeout"
240
+ ),
241
+ #The server timed out waiting for the request. According to W3 HTTP
242
+ #specifications: "The client did not produce a request within the time that the
243
+ #server was prepared to wait. The client MAY repeat the request without
244
+ #modifications at any later time."
245
+
246
+ (409, "Conflict"),
247
+ #Indicates that the request could not be processed because of conflict in the
248
+ #request, such as an edit conflict.
249
+
250
+ (410, "Gone"),
251
+ #Indicates that the resource requested is no longer available and will not be
252
+ #available again. This should be used when a resource has been intentionally
253
+ #removed and the resource should be purged. Upon receiving a 410 status code, the
254
+ #client should not request the resource again in the future. Clients such as
255
+ #search engines should remove the resource from their indices. Most use cases do
256
+ #not require clients and search engines to purge the resource, and a "404 Not
257
+ #Found" may be used instead.
258
+
259
+ (
260
+ 411,
261
+ "Length Required"
262
+ ),
263
+ #The request did not specify the length of its content, which is required by the
264
+ #requested resource.
265
+
266
+ (
267
+ 412,
268
+ "Precondition Failed"
269
+ ),
270
+ #The server does not meet one of the preconditions that the requester put on the
271
+ #request.
272
+
273
+ (
274
+ 413,
275
+ "Request Entity Too Large"
276
+ ),
277
+ #The request is larger than the server is willing or able to process.
278
+
279
+ (
280
+ 414,
281
+ "Request-URI Too Long"
282
+ ),
283
+ #The URI provided was too long for the server to process.
284
+
285
+ (
286
+ 415,
287
+ "Unsupported Media Type"
288
+ ),
289
+ #The request entity has a media type which the server or resource does not
290
+ #support. For example, the client uploads an image as image/svg+xml, but the
291
+ #server requires that images use a different format.
292
+
293
+ (
294
+ 416,
295
+ "Requested Range Not Satisfiable"
296
+ ),
297
+ #The client has asked for a portion of the file, but the server cannot supply
298
+ #that portion. For example, if the client asked for a part of the file that
299
+ #lies beyond the end of the file.
300
+
301
+ (
302
+ 417,
303
+ "Expectation Failed"
304
+ ),
305
+ #The server cannot meet the requirements of the Expect request-header field.
306
+
307
+ (
308
+ 418,
309
+ "I'm a teapot"
310
+ ),
311
+ #This code was defined in 1998 as one of the traditional IETF April Fools' jokes,
312
+ #in RFC 2324, Hyper Text Coffee Pot Control Protocol, and is not expected to be
313
+ #implemented by actual HTTP servers.
314
+
315
+ (
316
+ 422,
317
+ "Unprocessable Entity"
318
+ ),
319
+ #The request was well-formed but was unable to be followed due to semantic
320
+ #errors.
321
+
322
+ (423, "Locked"),
323
+ #The resource that is being accessed is locked.
324
+
325
+ (
326
+ 424,
327
+ "Failed Dependency"
328
+ ),
329
+ #The request failed due to failure of a previous request (e.g. a PROPPATCH).
330
+
331
+ (
332
+ 425,
333
+ "Unordered Collection"
334
+ ),
335
+ #Defined in drafts of "WebDAV Advanced Collections Protocol", but not present
336
+ #in "Web Distributed Authoring and Versioning (WebDAV) Ordered Collections
337
+ #Protocol".
338
+
339
+ (
340
+ 426,
341
+ "Upgrade Required"
342
+ ),
343
+ #The client should switch to a different protocol such as TLS/1.0.
344
+
345
+ (
346
+ 444,
347
+ "No Response"
348
+ ),
349
+ #A Nginx HTTP server extension. The server returns no information to the client
350
+ #and closes the connection (useful as a deterrent for malware).
351
+
352
+ (
353
+ 449,
354
+ "Retry With"
355
+ ),
356
+ #A Microsoft extension. The request should be retried after performing the
357
+ #appropriate action.
358
+
359
+ (
360
+ 450,
361
+ "Blocked by Windows Parental Controls"
362
+ ),
363
+ #A Microsoft extension. This error is given when Windows Parental Controls are
364
+ #turned on and are blocking access to the given webpage.
365
+
366
+ (
367
+ 499,
368
+ "Client Closed Request"
369
+ ),
370
+ #An Nginx HTTP server extension. This code is introduced to log the case when the
371
+ #connection is closed by client while HTTP server is processing its request,
372
+ #making server unable to send the HTTP header back.
373
+
374
+ #5xx Server Error
375
+
376
+ #The server failed to fulfill an apparently valid request.
377
+ #Response status codes beginning with the digit "5" indicate cases in which the
378
+ #server is aware that it has encountered an error or is otherwise incapable of
379
+ #performing the request. Except when responding to a HEAD request, the server
380
+ #should include an entity containing an explanation of the error situation, and
381
+ #indicate whether it is a temporary or permanent condition. Likewise, user agents
382
+ #should display any included entity to the user. These response codes are
383
+ #applicable to any request method.
384
+
385
+ (
386
+ 500,
387
+ "Internal Server Error"
388
+ ),
389
+ #A generic error message, given when no more specific message is suitable.
390
+
391
+ (
392
+ 501,
393
+ "Not Implemented"
394
+ ),
395
+ #The server either does not recognise the request method, or it lacks the ability
396
+ #to fulfill the request.
397
+
398
+ (
399
+ 502,
400
+ "Bad Gateway"
401
+ ),
402
+ #The server was acting as a gateway or proxy and received an invalid response
403
+ #from the upstream server.
404
+
405
+ (
406
+ 503,
407
+ "Service Unavailable"
408
+ ),
409
+ #The server is currently unavailable (because it is overloaded or down for
410
+ #maintenance). Generally, this is a temporary state.
411
+
412
+ (
413
+ 504,
414
+ "Gateway Timeout"
415
+ ),
416
+ #The server was acting as a gateway or proxy and did not receive a timely
417
+ #response from the upstream server.
418
+
419
+ (
420
+ 505,
421
+ "HTTP Version Not Supported"
422
+ ),
423
+ #The server does not support the HTTP protocol version used in the request.
424
+
425
+ (
426
+ 506,
427
+ "Variant Also Negotiates"
428
+ ),
429
+ #Transparent content negotiation for the request results in a circular
430
+ #reference.
431
+
432
+ (
433
+ 507,
434
+ "Insufficient Storage"
435
+ ),
436
+ (
437
+ 509,
438
+ "Bandwidth Limit Exceeded"
439
+ ),
440
+ #This status code, while used by many servers, is not specified in any RFCs.
441
+
442
+ (
443
+ 510,
444
+ "Not Extended"
445
+ )
446
+ #Further extensions to the request are required for the server to fulfill it.
447
+ ]
@@ -0,0 +1,58 @@
1
+ %ifdef output.icecast
2
+ # Encode and output the stream to a shoutcast server.
3
+ # @category Source / Output
4
+ # @argsof output.icecast[!method,!mount,!description,!protocol]
5
+ # @param ~icy_reset Reset shoutcast source buffer upon connecting (necessary for NSV).
6
+ # @param ~dj Set DJ name.
7
+ # @param e Encoding format. Should be mp3 or AAC(+).
8
+ # @param s The source to output
9
+ def output.shoutcast(
10
+ %argsof(output.icecast[!method,!mount,!description,!protocol]),
11
+ ~icy_reset=true,
12
+ ~dj=getter(""),
13
+ ~aim="",
14
+ ~icq="",
15
+ ~irc="",
16
+ e,
17
+ s
18
+ ) =
19
+ icy_reset = if icy_reset then "1" else "0" end
20
+ headers =
21
+ [
22
+ ("icy-aim", aim),
23
+ ("icy-irc", irc),
24
+ ("icy-icq", icq),
25
+ ("icy-reset", icy_reset),
26
+ ...headers
27
+ ]
28
+
29
+ def map(m) =
30
+ dj = getter.get(dj)
31
+ if dj != "" then ("dj", dj)::m else m end
32
+ end
33
+
34
+ s = metadata.map(insert_missing=false, map, s)
35
+ output.icecast(
36
+ %argsof(output.icecast[!method,!mount,!headers,!description,!protocol]),
37
+ mount="",
38
+ headers=headers,
39
+ protocol="icy",
40
+ e,
41
+ s
42
+ )
43
+ end
44
+
45
+ # Encode and output the stream to an icecast server.
46
+ # @category Source / Output
47
+ # @argsof output.icecast[!protocol, !icy_id]
48
+ # @param e Encoding format.
49
+ # @param s The source to output
50
+ def output.icecast(%argsof(output.icecast[!protocol,!icy_id]), e, s) =
51
+ output.icecast(
52
+ %argsof(output.icecast[!protocol,!icy_id]),
53
+ protocol="http",
54
+ e,
55
+ s
56
+ )
57
+ end
58
+ %endif
@@ -0,0 +1,106 @@
1
+ let replaces output = output.dummy
2
+ %ifdef output.ao
3
+ let replaces output = output.ao
4
+ %endif
5
+
6
+ %ifdef output.alsa
7
+ let replaces output = output.alsa
8
+ %endif
9
+
10
+ %ifdef output.oss
11
+ let replaces output = output.oss
12
+ %endif
13
+
14
+ %ifdef output.portaudio
15
+ let replaces output = output.portaudio
16
+ %endif
17
+
18
+ %ifdef output.pulseaudio
19
+ let replaces output = output.pulseaudio
20
+ %endif
21
+
22
+ # Output a stream using the default operator. The input source does not need to
23
+ # be infallible, blank will just be played during failures.
24
+ # @category Source / Output
25
+ # @param ~id Force the value of the source ID.
26
+ # @param ~fallible Allow the child source to fail, in which case the output will be (temporarily) stopped.
27
+ # @param ~start Automatically start outputting whenever possible. If `true`, an infallible (normal) output will start as soon as it is created, and a fallible output will (re)start as soon as its source becomes available for streaming.
28
+ # @param s Source to play.
29
+ def replaces output(~id=null, ~fallible=true, ~start=true, s) =
30
+ output(id=id, fallible=fallible, start=start, s)
31
+ end
32
+
33
+ let output.video = output.dummy
34
+ %ifdef output.sdl
35
+ def output.video(%argsof(output.sdl), s) =
36
+ if
37
+ output.sdl.has_video()
38
+ then
39
+ (output.sdl(%argsof(output.sdl), s) : unit)
40
+ else
41
+ # Avoid using SDL when there is no video output.
42
+ (output.dummy(fallible=fallible, s) : unit)
43
+ end
44
+ end
45
+ %endif
46
+
47
+ %ifdef output.graphics
48
+ let output.video = output.graphics
49
+ %endif
50
+
51
+ # Output a video stream using the default operator. The input source does not
52
+ # need to be infallible, blank will just be played during failures.
53
+ # @category Source / Output
54
+ # @param ~id Force the value of the source ID.
55
+ # @param ~fallible Allow the child source to fail, in which case the output will be (temporarily) stopped.
56
+ # @param ~start Automatically start outputting whenever possible. If `true`, an infallible (normal) output will start outputting as soon as it is created, and a fallible output will (re)start as soon as its source becomes available for streaming.
57
+ # @param s Source to play.
58
+ def output.video(~id=null, ~fallible=true, ~start=true, s) =
59
+ output.video(id=id, fallible=fallible, start=start, s)
60
+ end
61
+
62
+ # Output a stream with audio and video using the default operator. The input
63
+ # source does not need to be infallible, blank will just be played during
64
+ # failures.
65
+ # @category Source / Output
66
+ # @param ~id Force the value of the source ID.
67
+ # @param ~fallible Allow the child source to fail, in which case the output will be (temporarily) stopped.
68
+ # @param ~start Automatically start outputting whenever possible. If `true`, an infallible (normal) output will start outputting as soon as it is created, and a fallible output will (re)start as soon as its source becomes available for streaming.
69
+ # @param s Source to play.
70
+ def output.audio_video(~id=null, ~fallible=true, ~start=true, s) =
71
+ let {audio, video} = source.tracks(s)
72
+ output(id=id, fallible=fallible, start=start, source({audio = audio}))
73
+
74
+ output.video(id=id, fallible=fallible, start=start, source({video = video}))
75
+ end
76
+
77
+ def replaces input(~id=null, ~start=true, ~fallible=false) =
78
+ ignore(start)
79
+ ignore(fallible)
80
+ blank(id=id)
81
+ end
82
+
83
+ %ifdef input.alsa
84
+ let replaces input = input.alsa
85
+ %endif
86
+
87
+ %ifdef input.oss
88
+ let replaces input = input.oss
89
+ %endif
90
+
91
+ %ifdef input.portaudio
92
+ let replaces input = input.portaudio
93
+ %endif
94
+
95
+ %ifdef input.pulseaudio
96
+ let replaces input = input.pulseaudio
97
+ %endif
98
+
99
+ # Input an audio stream using the default operator.
100
+ # @category Source / Input / Active
101
+ # @param ~id Force the value of the source ID.
102
+ # @param ~fallible Allow the child source to fail, in which case the output will be (temporarily) stopped.
103
+ # @param ~start Automatically start outputting whenever possible. If `true`, an infallible (normal) output will start outputting as soon as it is created, and a fallible output will (re)start as soon as its source becomes available for streaming.
104
+ def replaces input(~id=null, ~start=true, ~fallible=false) =
105
+ input(id=id, start=start, fallible=fallible)
106
+ end
@@ -0,0 +1,31 @@
1
+ let liquidsoap.chroot = ()
2
+
3
+ # Export all the files required to install liquidsoap in a root folder. Useful
4
+ # for packaging and docker images.
5
+ # @category Liquidsoap
6
+ def liquidsoap.chroot.make(chroot) =
7
+ def chroot(p) =
8
+ path.concat(chroot, p)
9
+ end
10
+
11
+ def mkdir(p) =
12
+ process.run(
13
+ "mkdir -p #{process.quote(p)}"
14
+ )
15
+ end
16
+
17
+ def cp(source) =
18
+ mkdir(chroot(path.dirname(source)))
19
+ process.run(
20
+ "cp -rf #{process.quote(source)} #{process.quote(chroot(source))}"
21
+ )
22
+ end
23
+
24
+ cp(configure.libdir)
25
+ cp(configure.bindir)
26
+ if file.exists(settings.default_font()) then cp(settings.default_font()) end
27
+ mkdir(chroot(configure.logdir))
28
+ mkdir(chroot(configure.rundir))
29
+ cp(liquidsoap.executable)
30
+ ()
31
+ end