Hi,

I realise that there has been quite a lot of discussion in previous threads 
about getting playlists to reload when they are scheduled in a switch. I have 
been trying to get my test script below to reload a playlist so that it starts 
on time and at the beginning of a randomised playlist with each scheduled 
switch.

But each time the playlist is scheduled to start, it does not refresh the 
playlist and start from the beginning. I have my test schedule below set to 
switch to a new playlist every 5 minutes (this is just so I can monitor the 
transitions for now, but I’ll obviously extend the play time length later). 
What seems to happen is that the playlist doesn’t start afresh. It continues 
from where it left off previously. I’ve tried adding a reload time of 6 minutes 
to each playlist (so that the playlists will have reloaded before the next 
scheduled switch is due) but this doesn’t seem to work either.

Can anyone tell me the best or easiest way to get the switch to start a new 
playlist so that it is randomised and at the beginning of the playlist on each 
scheduled switch time?


#!/usr/bin/liquidsoap
# Log Dir
set("log.file.path","/tmp/ssr.log")
set("server.telnet",true)

# Electronica Playlist Parts
elid = playlist(mode="randomize", reload=360, reload_mode = "watch", 
"/home/admin/music/elid")
elfre = playlist(mode="randomize", reload=360, reload_mode = "watch", 
"/home/admin/music/elfre")
elgen = playlist(mode="randomize", reload=360, reload_mode = "watch", 
"/home/admin/music/elgen")
elarc = playlist(mode="randomize", reload=360, reload_mode = "watch", 
"/home/admin/music/elarc")

# Ambient Playlist Parts
ambid = playlist(mode="randomize", reload=360, reload_mode = "watch", 
"/home/admin/music/ambid")
ambfre = playlist(mode="randomize", reload=360, reload_mode = "watch", 
"/home/admin/music/ambfre")
ambgen = playlist(mode="randomize", reload=360, reload_mode = "watch", 
"/home/admin/music/ambgen")

# If something goes wrong, this file will play
security = single("/home/admin/music/default.mp3")

# Electronica Playlist Rotation
electronica = rotate(weights = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
1, 1, 1],
[elid, elfre, elgen, elfre, elgen, elfre, elgen, elfre, elgen, elid, elfre, 
elgen, elfre, elgen, elfre, elgen, elfre, elgen, elarc])

# Ambient Playlist Rotation
ambient = rotate(weights = [1, 1, 1, 1, 1, 1, 1, 1, 1],
[ambid, ambfre, ambgen, ambfre, ambgen, ambfre, ambgen, ambfre, ambgen])

#Switch-based Transition
def 
crossfade(a,b)add(normalize=false,[sequence([blank(duration=15.),fade.initial(duration=0.,b)]),fade.final(duration=15.,a)])end

# Playlist Schedule
radio = fallback([switch(track_sensitive = 
false,transitions=[crossfade,crossfade,crossfade,crossfade],[

#Shedule
({7h-19h55}, electronica),
({19h55-20h00}, ambient),
({20h00-20h05}, electronica),
({20h05-7h}, ambient),

# Security
# radio = fallback(track_sensitive = false, [radio, security])

# Stream it out
output.icecast(%mp3(bitrate=128,samplerate=44100,internal_quality=0,id3v2=true,stereo=true,stereo_mode="stereo"),
host="localhost",
port=8000,password="**********",
mount = "SSR",genre="Ambient / Electronica",
description="Systrum Sistum",
name="SSR",url="http://localhost",radio)

- - -
I prefer to use encrypted email.
My public key fingerprint is 77CC 9087 0A92 F55D 75A3  660B 68F2 1FA9 B26E CAC7

Attachment: signature.asc
Description: Message signed with OpenPGP

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Savonet-users mailing list
Savonet-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to