Hello David, We'd like to change the existing metadata (artist and title) to the current unixdate for an instant and change it back immedietly to the original one. The point is, most clients save the streams according to the artist/title/whatever metadata into separate files. And we'd like to make the stream non- or hardly-saveable. So changing the metadata to something different quite often makes saving the stream a nightmare. So is the insert_metadata our choice?
And there's one more thing we'd like to do. We'd like to display on the website the current and next song for each stream (artist, title and maybe album would be enough). I haven't seen functions for this functionality in the docs, nor ways how could another application recieve this information. Could you also help us please on this one? Thanks for your reply On Tue, 10 Feb 2009 17:03:57 +0100 David Baelde <[email protected]> wrote: > Hi Gergely, > > Here are a couple snippets that should be useful. > > If I understand correctly, map_metadata is not what you need, because > it only changes existing metadata. Anyway, here's an example (a > simplification of the definition of rewrite_metata in utils.liq): > > def map(m) > # m is the list of metadata, as pairs of metadata. > # l is a list of pairs (field_name,pattern) > # for each of those, we evaluate the pattern on the current metadata > def apply(x) > label = fst(x) > value = snd(x) > (label,value % m) > end > list.map(apply,l) > end > map_metadata(map,s) > > What you need is easier :) As you guessed you need add_timeout(), but > if you print() it will print on stdout (which might be closed in > daemon mode); if you log() it will go in the logs; if you want to > insert some metadata at some place, you have to setup an > insert_metadata() operator at this point, and then invoke its > insertion command from the add_timeout(): > > s = insert_metadata(id="xxx",s) > add_timeout(10.,{ execute('xxx.insert key1="val1",key2="val2"') }) > > Instead of statically putting val1, val2, you can use the result of a > system call (using get_process_output()) to one of your script. You > may also be able to generate your random string using our scripting > language, which has random.float() and random.bool(). > > Hope that helps, -- Sincerely, Gergely CZUCZY Tel: +36-30-8414202 ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Savonet-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/savonet-users
