foo_playlist_tree
New Release. This adds the ability to script foobar2000 menu actions as well as interact with the playlists via the embedded scheme language. You can also assign @scheme query refreshes to buttons to automate some stuff...Release 3.0beta 3 * GUID's for queries * main menu command for refreshing @scheme queries: Library/Playlist Tree/Refresh/* (you can refresh a query, for its side effects such as creating a new playlist and playing it with the new playlist interaction commands below) * for-each-playlist-entry can now take an integer playlist index OR a playlist name to specify which playlist * (in-library? handle) * (handle-test handle filter-string) - e.g. (handle-test handle "rating GREATER 3") * (mainmenu mainmenu-fun-string) * (playlist-contextmenu contextmenu-fn-string [playlist-index]) * (contextmenu contextmenu-fn-string handle-list) * (playing-playlist) * (active-playlist) * (find-or-create-playlist name) => returns a playlist-index * (add-to-playlist handle [playlist-index] [item-index]) => if no playlist-index is specified, active playlist is assumed. * (clear-playlist [playlist-index]) * (activate-playlist playlist-index) * (play-from-playlist [playlist-index] [item-index]) Examples of new features:;;; Fill *Scheme* playlist with an hours worth (let ((playlist-index (find-or-create-playlist "*Scheme*")) (total-time 0)) (clear-playlist playlist-index) (for-each-db-entry (lambda (handle) (let ((len (get-length handle))) (if (< (+ len total-time) (* 60 60)) (begin (add-to-playlist handle playlist-index) (set! total-time (+ total-time len)))))) "rating GREATER 3" "$rand()") (activate-playlist playlist-index) (play-from-playlist playlist-index)) ;;; Show properties of all playlist entries (let ((the-list (list))) (for-each-playlist (lambda (n) (for-each-playlist-entry n (lambda (handle) (set! the-list (cons handle the-list)))))) (contextmenu "Properties" the-list))