Merge branch '2.4.x'
This commit is contained in:
commit
6b12dcdc2a
29 changed files with 744 additions and 410 deletions
|
@ -1,6 +1,7 @@
|
|||
import logging
|
||||
import sys
|
||||
import time
|
||||
import traceback
|
||||
from api_clients.api_client import AirtimeApiClient
|
||||
|
||||
def generate_liquidsoap_config(ss):
|
||||
|
@ -26,19 +27,21 @@ def generate_liquidsoap_config(ss):
|
|||
fh.close()
|
||||
|
||||
logging.basicConfig(format='%(message)s')
|
||||
ac = AirtimeApiClient(logging.getLogger())
|
||||
attempts = 0
|
||||
max_attempts = 5
|
||||
max_attempts = 10
|
||||
successful = False
|
||||
|
||||
while True:
|
||||
while not successful:
|
||||
try:
|
||||
ac = AirtimeApiClient(logging.getLogger())
|
||||
ss = ac.get_stream_setting()
|
||||
generate_liquidsoap_config(ss)
|
||||
break
|
||||
successful = True
|
||||
except Exception, e:
|
||||
if attempts == max_attempts:
|
||||
print "Unable to connect to the Airtime server."
|
||||
logging.error(str(e))
|
||||
logging.error("traceback: %s", traceback.format_exc())
|
||||
sys.exit(1)
|
||||
else:
|
||||
time.sleep(3)
|
||||
|
|
|
@ -40,6 +40,14 @@ source_id = ref 0
|
|||
def create_source()
|
||||
l = request.equeue(id="s#{!source_id}", length=0.5)
|
||||
l = cue_cut(l)
|
||||
|
||||
l = audio_to_stereo(id="queue_src", l)
|
||||
l = amplify(1., override="replay_gain", l)
|
||||
|
||||
# the crossfade function controls fade in/out
|
||||
l = crossfade_airtime(l)
|
||||
|
||||
l = on_metadata(notify, l)
|
||||
sources := list.append([l], !sources)
|
||||
server.register(namespace="queues",
|
||||
"s#{!source_id}_skip",
|
||||
|
@ -62,12 +70,6 @@ create_source()
|
|||
|
||||
queue = add(!sources, normalize=false)
|
||||
|
||||
queue = audio_to_stereo(id="queue_src", queue)
|
||||
queue = amplify(1., override="replay_gain", queue)
|
||||
|
||||
# the crossfade function controls fade in/out
|
||||
queue = crossfade_airtime(queue)
|
||||
queue = on_metadata(notify, queue)
|
||||
output.dummy(fallible=true, queue)
|
||||
|
||||
http = input.http_restart(id="http")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue