Knowing what will play next can be impossible in complex liquidsoap scripts. But this isn't a problem for you, since you're already looking at getting the information from the playlist source, which can tell you reasonably well what it's going to do next.
On Tue, Feb 7, 2012 at 8:48 PM, Alexandru Matei <[email protected]> wrote: > I plan to get the filename for the next three tracks by executind a > server command: my_playlist.next. But I don't know what to do next. Yes, this gives you filenames but not metadata. To obtain metadata, you need requests (a file that has been prepared for playing). You can create them by hand using request.create(), request.resolve(), request.metadata(): http://savonet.sourceforge.net/doc-svn/reference.html#Liquidsoap Hope this help, David PS: This is a decent solution, but you might be wondering whether the playlist doesn't already have requests and thus metadata, which could be a way to avoid resolving a request twice -- not that it is very expensive. In queued request operators, such as playlist, there are requests already built for files that are in the primary queue. They are marked by a [ready] flag in the output of playlist.next. Example: [playing] /home/dbaelde/media/audio/cake/fashion_nugget/open_book.mp3 [ready] /home/dbaelde/media/audio/Sex_Mob/Entrance_Music.ogg Note that the primary queue will tend to be always empty unless you increase the queue length parameter, and/or make the source conservative. Unfortunately there is no direct way to access those requests from the queue, because the playlist has no "queue" command that would return request IDs. If you need it, this is easy to add; but note that this only makes sense for you if you force requests to be prepared in advance, which you may not like. The indirect way to access those requests is to go through all alive requests (request.alive server command; not a function name in the language, this is confusing but Romain already commented on this) and find the one with the right filename. Of course, it sucks to have to do this. ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ Savonet-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/savonet-users
