mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 21:38:38 +00:00
Small improvements
This commit is contained in:
@@ -40,9 +40,7 @@ def queue_processing()
|
|||||||
file.remove("/home/pi/Conjurer/request.playlist")
|
file.remove("/home/pi/Conjurer/request.playlist")
|
||||||
f = file.open("/home/pi/Conjurer/request.playlist", create=true)
|
f = file.open("/home/pi/Conjurer/request.playlist", create=true)
|
||||||
f.close()
|
f.close()
|
||||||
log.info("done")
|
log.info("Request queued")
|
||||||
else
|
|
||||||
log.info("no requests")
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -55,6 +53,8 @@ jingles = (playlist(reload_mode="watch", "/home/pi/Conjurer/jingles.playlist"))
|
|||||||
# Create the main stream with random playlist and jingles
|
# Create the main stream with random playlist and jingles
|
||||||
s = rotate(id="randomizer", weights=[20, 1], [s4, jingles])
|
s = rotate(id="randomizer", weights=[20, 1], [s4, jingles])
|
||||||
|
|
||||||
|
s = crossfade(fade_out=3., fade_in=3., duration=5., fallback(id="switcher", track_sensitive=false, [requests_queue, s]))
|
||||||
|
|
||||||
# Set up an interactive harbor for controlling the stream
|
# Set up an interactive harbor for controlling the stream
|
||||||
interactive.harbor(port = 9999)
|
interactive.harbor(port = 9999)
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ s = add([s, b])
|
|||||||
|
|
||||||
# Set up interactive control for main volume
|
# Set up interactive control for main volume
|
||||||
a = interactive.float("main_volume", min=0., max=20., 1.)
|
a = interactive.float("main_volume", min=0., max=20., 1.)
|
||||||
s = compress.multiband.interactive(bands=3, s)
|
s = compress.multiband.interactive(bands=7, s)
|
||||||
|
|
||||||
# Apply audio processing effects
|
# Apply audio processing effects
|
||||||
s = nrj(normalize(s))
|
s = nrj(normalize(s))
|
||||||
@@ -87,14 +87,15 @@ set("log.level", loglevel)
|
|||||||
set("log.file", log_to_file)
|
set("log.file", log_to_file)
|
||||||
set("log.file.path", logpath)
|
set("log.file.path", logpath)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Set up emergency fallback track
|
# Set up emergency fallback track
|
||||||
emergency = single("/home/pi/RetroPie/mp3/Youtube/Dr. Peacock - Trip to Ireland [GvrvQTUbUcA].mp3")
|
emergency = single("/home/pi/RetroPie/mp3/Youtube/Dr. Peacock - Trip to Ireland [GvrvQTUbUcA].mp3")
|
||||||
|
radio = fallback(id="switcher2", track_sensitive=false, [s, emergency])
|
||||||
# Create a fallback stream with the main stream and emergency track
|
|
||||||
cross_s = crossfade(fade_out=3., fade_in=3., duration=5., fallback(id="switcher", track_sensitive=false, [requests_queue, s]))
|
|
||||||
radio = fallback(id="switcher2", track_sensitive=false, [cross_s, emergency])
|
|
||||||
# Set up an interactive control for skipping tracks
|
# Set up an interactive control for skipping tracks
|
||||||
p = interactive.bool("r1", false)
|
p = interactive.bool("Skip track", false)
|
||||||
|
|
||||||
# Function to process the request queue and skip the current track if requested
|
# Function to process the request queue and skip the current track if requested
|
||||||
def check_skip()
|
def check_skip()
|
||||||
@@ -106,7 +107,7 @@ def check_skip()
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Run the queue processing function every 60 seconds
|
# Run the queue processing function every 60 seconds
|
||||||
thread.run(every=60., queue_processing)
|
thread.run(every=5., queue_processing)
|
||||||
|
|
||||||
|
|
||||||
# Run the check_skip function every 5 seconds
|
# Run the check_skip function every 5 seconds
|
||||||
|
|||||||
Reference in New Issue
Block a user