This is a specific example of what I mean. This is a YAML file. It could be used to generate a liq script. Of course, it's not complete, I have nothing in there about playlist rotation and weights, but you'll get the idea.
station_description: This is my station. Enjoy! station_url: http://website.com normailze: true skip_blank: true live_source: http://mystreamserver:8000/ local_playlist_sources: fast_songs: path: /radio/1.pls slow_songs: path: /radio/2.pls jingles: path: /radio/3.pls outputs: icecast: format: mp3 bitrate: 64 stereo: false address: 127.0.0.1 port: 1234 mount: /64.mp3 username: source password: password icecast: format: mp3 bitrate: 128 stereo: false address: 127.0.0.1 port: 1234 mount: /128.mp3 username: source password: password On Fri, Apr 17, 2009 at 11:03 AM, Romain Beauxis <[email protected]> wrote: > Le vendredi 17 avril 2009 10:07:37, Brandon Casci a écrit : >> I think I get it. fun -> is a way to create a anonymous function, and >> you'd probably use fun() -> if your function code is only a single >> line and used in one place. You would go with a full def, if your >> custom function were more advanced or was used repeatedly. Correct? > > Yep ! > >> >> add_protocol("dolebrai", >> >> fun (arg,delay) -> >> >> get_process_lines("#{scripts}dolebrai-filename #{quote(arg)}")) >> >> In this case, the function has two args, arg and delay. How are the >> values for those arguments being supplied? I don't see any explicit >> calls to to add_protocol. > > Yes. This function registers a new request protocol. It will be used when a > request of the form: "dolebrai:arg" is received. > > The two arguments are the arg (part after dolebrai:) and the delay for getting > the song (usually 60 seconds). This possibility is very useful if you want to > extend liquidsoap's capabilities for fetching songs or applying a treatement > to the song. > >> I'm not sure there if you sense much need for this, but if you help me >> understand the language I can try to write a code generator for simple >> use cases. Maybe something something like a config file that defines >> how you want tracks rotated, backup sources and so on, and a ruby >> script (that's what I use most) that generates a .liq based on >> contents of config. > > Héhé, nice idea. > > I have written a similar thing which you can find here: > http://savonet.rastageeks.org/browser/trunk/liq-contrib/simpleliq.in > However, it is nothing serious and was just a proof-of-concept. > > But, clearly, a tool to generate a script based on some fixed parameters would > be a great thing for newcomers who don't want (yet) to program their streams > but still benefit from the flexibility :) > > > > Romain > ------------------------------------------------------------------------------ Stay on top of everything new and different, both inside and around Java (TM) technology - register by April 22, and save $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. 300 plus technical and hands-on sessions. Register today. Use priority code J9JMT32. http://p.sf.net/sfu/p _______________________________________________ Savonet-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/savonet-users
