# Lines starting with # are comments, they are ignored.
# aac encoder lines have been commented out because I found out there is a hefty initial fee to use aac

settings.server.socket := true
settings.server.socket.path := "/home/cor/webradio/liquidsoap/main.sock"
settings.server.socket.permissions := 432
settings.server.timeout := 4800.0

transport=http.transport.tls(certificate="/home/cor/liquidsoap-daemon/certs/cert.pem", key="/home/cor/liquidsoap-daemon/certs/privkey.pem")

log.level := 6

settings.decoder.priorities.ogg := 15


#Note: a blank.strip source could be added in case I want to wiretap omy own aprtment


dojja = input.harbor(id="dojja",
transport=http.transport.tls(certificate="/home/cor/liquidsoap-daemon/certs/cert.pem", key="/home/cor/liquidsoap-daemon/certs/privkey.pem"),
replay_metadata=true,
"dojja.ogg",
port=8092,
password="BananaSpy53/",
buffer=1.0)


lojja = blank.strip(max_blank=60.0, dojja)

nojja = amplify(7.5, lojja)

output.file(%opus(vbr="unconstrained", samplerate=48000, channels=2),
id="nojja",
fallible=true,
#append=true,
reopen_when = {true},
#on_close= mail_me,
reopen_delay=5.0,
time.string("/top/secret/path/UTC - %Y-%m-%d %H:%M:%S"),
nojja)


live = input.harbor(id="live", replay_metadata=true, "test.ogg", port=9999, password="classified", buffer=1.0)

jive = amplify(5.0, live)

jive = server.insert_metadata(id="jive", jive)


evil = (input.harbor(id="evil", transport=http.transport.tls(certificate="/home/cor/liquidsoap-daemon/certs/cert.pem", key="/home/cor/liquidsoap-daemon/certs/privkey.pem"), replay_metadata=true, "tset.ogg", port=9999, password="classified", buffer=1.0))

ejiv = amplify(7.5, evil)

ejiv = server.insert_metadata(id="ejiv", ejiv)


mopidy = input.harbor(id="mopidy", replay_metadata=true, "mopidy", port=9999, password="TrippoPotamus", buffer=1.0)

mopidy = server.insert_metadata(id="mopidy", mopidy)


mixxx = input.harbor(id="mixxx", "mixxx.ogg", port=9999, password="NARCodile", buffer=1.0)

mixxx = server.insert_metadata(id="mixxx", mixxx)



sjrpt = input.http(id="sjrpt", "http://http-live.sr.lm/p1-aac-96")



radio = fallback(track_sensitive=false,[

switch(track_sensitive=false, [({5h54m0s-6h1m30s}, sjrpt)])])


full = fallback(track_sensitive=false,

[radio])



hefault = single("/mnt/Media/Musik/diverse/tyst.flac")

grejs = playlist(mode='randomize',reload=1,reload_mode="rounds", "/mnt/Media/Musik/dull/")


dull =
fallback(track_sensitive=false,
[(jive),
(ejiv),
(mopidy),
(mixxx),
(full),
(grejs),
(hefault)])



output.icecast(%opus(vbr="unconstrained", samplerate=48000, channels=2),
host="localhost",
port=8000,
password="LuckLuckHoe",
mount="dull.opus",
description="Hobby stream",
genre="Alternative, eclectic",
url="https://mydomain.org/~cor",
name="dull opus",
public=true,
dull)


#output.icecast(%fdkaac(bitrate=64, transmux="adts", channels=2, samplerate=48000, aot="mpeg4_he_aac_v2", afterburner=false, sbr_mode=false),
#host="localhost",
#port=8000,
#password="LuckLuckHoe",
#mount="dull",
#description="Hobby stream",
#genre="Alternative, eclectic",
#url="https://mydomain.org/~cor",
#name="dull",
#public=true,
#dull)



default = single("/mnt/Media/Musik/dommunity/Instängd/03-instangd-kott_ar_mord.mp3")

lista = playlist(mode='randomize',reload=600,reload_mode="rounds", "/mnt/Media/Musik/dommunity/")

badio = fallback(track_sensitive=false, [lista, default])


kive = amplify(5.0, input.harbor(id="kive", replay_metadata=true, "dommunitykive.ogg", port=9999, password="DipsterBeard76", buffer=1.0))
give = amplify(5.0, input.harbor(id="give", transport=transport, replay_metadata=true, password="DipsterBeard76", "dommunitygive.ogg", port=9999, buffer=1.0))

trassel = fallback(track_sensitive=false, [kive, give])


dommunity = fallback(track_sensitive=false, [trassel, badio])



#output.icecast(%fdkaac(bitrate=64, transmux="adts", channels=2, samplerate=48000, aot="mpeg4_he_aac_v2", afterburner=false, sbr_mode=false),
#host="localhost",
#port=8000,
#password="LuckLuckHoe",
#mount="dommunity",
#description="Bands from dommunity",
#genre="Mainly Skunk",
#url="https://www.dommunityumea.lm",
#name="dommunity",
#dommunity)



output.icecast(%opus(vbr="unconstrained", samplerate=48000, channels=2),
host="localhost",
port=8000,
password="LuckLuckHoe",
mount="dommunity.opus",
description="Bands from dommunity",
public=true,
genre="Mainly Skunk",
url="https://www.dommunityumea.lm",
name="dommunity opus",
dommunity)