I am trying to write a script which will define a souce in one function,
and then have another function to shutdown the source.
I've tried reading the documentation and following the Dynamic Sources
script, but haven't been able to get it working.
I keep getting variations on:
vrtisworks@audiobox /var/audiobox $ ./trySoap.sh
At line 41, char 25:
this value has type
(?id:_,?replay_metadata:_,?track_sensitive:_,?transitions:_,_)->_
(infered at line 19, char 17-18)
but it should be a subtype of (the type of the value at line 41, char
19-25)
ref(_)
vrtisworks@audiobox /var/audiobox $
Here is the script (line 41 is the source.shutdown statement)
#!/usr/bin/liquidsoap
#
# Put the log file in some directory where
# you have permission to write.
#set("log.file.path","./liquidtesting.log")
set("log.file",false)
# Print log messages to the console,
set("log.stdout", true)
# Use the telnet server for requests while testing
set("server.telnet", true)
#We have a dummy/blank source/output to keep things running
blanksource = blank(id='blanksource')
output.dummy(fallible=false, blanksource);
#A few functions/stuff we need to control the player
#we need a boolean reference to set (true|false), initially false
player_on = ref false
radio = fallback()
def turn_player_on()
#Only turn it on if it is currently off
if !player_on == false then
#set the flag it is on
player_on := true
#create the playlist and then output it to the speakers.
thelist=playlist(mode="normal", reload=1, reload_mode="rounds","
http://localhost:3000/getNextSongFileName")
radio=fallback(track_sensitive=false,
[thelist,blanksource])
myout = output.alsa(id='localAudio', device="hw: Set",radio)
end
end
#A function to create 'thelist' playlist when we have node all up and ready
def turn_player_off()
#Only turn it off if it is already on
if !player_on == true then
#set the flag it is off
player_on := false
#Shutdown the node source
source.shutdown(radio)
end
end
turn_player_on()
------------------------------------------------------------------------------
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users