Hi,
(sorry if I sent this message to your private email by mistake...)


Thank you for your reply and the great suggestion.

I'll add my script below. I basically followed your recommendation, with the exception that for now, I tried using a "Switch" instead of a "Fallback" operator.


But that actually doesn't yet matter, because I still keep failing at what I guess is a basic level.

Whichever way I try writing that piece of code, I don't get a "increase song counter" function to work.

The error currently thrown at me by Liquidsoap is:


Line 15, Char 5, before "=": Parse Error!

(where I add the "!!!" comment)


These are the first, and the relevant, lines of my script

#Set initial value
songsplayed = 8

#Transition to Live Source

def GoLive(old, new) =
songsplayed = 0
source.skip(old)
sequence([old, new])
end
# When Live Feed Ends:
def ComeHome(old,new) =
sequence([old,new])
end
#(trying to) increase counter of played songs
def counton(z) =
fun (z) ->
(z = z+1) # !!! This is where it can't parse :-(
end


#Playlist Definitions
offairloop = mksafe(playlist("/home/pi/radio/loop/"))
themusic = playlist("/mnt/storage/radio/music/sfl")

#Adding on_end

themusic = on_end(counton(songsplayed),themusic)

nonliveradio = switch (track_sensitive=true, [
({songsplayed < 10}, themusic), # should become false at the end of track 10.
({true}, offairloop) # Will always work.
])


#Then I add a live source, a fallback, an output etc etc...

So, can you see where I go wrong?

Best Regards,
René




------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to