Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: foo_playlist_tree (Read 709938 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

foo_playlist_tree

Reply #1725
I put up a new version today.

Biggest improvement is that I added two scheme functions that let you ask for input when the query gets refreshed. This allows you to create a generic query that will prompt you for input. See the bottom of the post for an example.

ChangeLog:
Quote
* don't ask about the user map.
* new scheme functions that allow interaction:
o (prompt-user-string "foo") - prompts the user for input. Returns a string. "" for cancel.
o (prompt-user-list "foo" ("option 1" "option 2" ... "option n")) - prompts the user to select from given options - returns zero-based index of selection. -1 for cancel.

Example of prompting query:
Code: [Select]
(let ((tags (list "artist" "album" "title")))
(let ((n (prompt-user-list "Tag:" tags)))
(when (>= n 0)
(let ((criteria (prompt-user-string "Criteria:")))
(display criteria)
(when (> (string-length criteria) 0)
(for-each-db-entry
(lambda (handle)
(add-node
handle
(list (format-title handle "%artist%")
(format-title handle "%album%")
(format-title handle "%title%"))))
(string-append (list-ref tags n) " " criteria)))))))


 

nothing displayed!
Music is my first love.

foo_playlist_tree

Reply #1726
nothing displayed!


What ui component are you using?  Was there an error message displayed on the console?
There used to be a link to my website here.

foo_playlist_tree

Reply #1727
columns
->"reference to undefined identifier: prompt-user-list"

edit: sorry, i haven't use latest dll
Music is my first love.

foo_playlist_tree

Reply #1728
Help. I can't stand this anymore, I want to change double click in the playlist tree to expand/collapse, but there is no such option in the configuration window. Yet I've seen people talk about it. What am I doing wrong?

I have the latest version from http://wiki.bowron.us/index.php/Playlist_Tree

foo_playlist_tree

Reply #1729
Help. I can't stand this anymore, I want to change double click in the playlist tree to expand/collapse, but there is no such option in the configuration window. Yet I've seen people talk about it. What am I doing wrong?

I have the latest version from http://wiki.bowron.us/index.php/Playlist_Tree

I can't do this either. It's not a feature I've been missing, but now as you say it, there's nothing wrong implementing it (after all, it's the way all other UIs work).

foo_playlist_tree

Reply #1730
I am trying to make a dynamic playlist of all the file of one file type.  I have tried using the following things in the criteria box but each time the playlist is just returning every item in my database.

$ext(%_path%) IS mp3
$ext(_path) IS mp3
$ext(path) IS mp3

I am a little confused as to why the criteria box doesnt use %% for the syntax when referring to tags.  I got $ext(%_path%) IS mp3 from the example queries wiki page.

Thank you for your guidance.
-vader897

foo_playlist_tree

Reply #1731
I have a quite large library (almost 20000 entrys) and with Playlist Tree plugin loaded, everytime I do anything in a playlist (start play/add or remove files etc) it hangs 1-2 sec. This is VERY annoying, since it doesn't matter how small a playlist I edit.

Is it because I enabled refresh in one of my querys? I doubt it's nessesary to refresh the library ALL THE TIME ?!?!?
Can't wait for a HD-AAC encoder :P

foo_playlist_tree

Reply #1732
Is it because I enabled refresh in one of my querys?

Yep. Do as I do - map the refresh function to F5, so that you can press F5 whenever you want to update the playlist tree.

foo_playlist_tree

Reply #1733
$if(%album artist%,$puts(ar,%<album artist>%),$puts(ar,%<artist>%))
$get(ar)|%album%|%title%

i read that <%tag%> is not working...  but this "lambda" request language is very hard-to-find for me...

please, can someone explain to me, how i can realize this function with that difficult query language?

foo_playlist_tree

Reply #1734
$if(%album artist%,$puts(ar,%<album artist>%),$puts(ar,%<artist>%))
$get(ar)|%album%|%title%

i read that <%tag%> is not working...  but this "lambda" request language is very hard-to-find for me...

please, can someone explain to me, how i can realize this function with that difficult query language?

$put(ar,%<album artist>%) makes a variable called ar, sets it to %<album artist>% and returns that value. $puts(ar,%<album artist>%) (think "put silent") does the same, but does not return the value (i.e. it only makes the variable). You can call that variable later using $get.

In other words: Using $put(ar,%<album artist>%) is the same as using just %<album artist>%, except it works.

You can also use the $puts command first thing in the script for every tag you want to do it with, and call them later using $get, but it's easier just using $put and putting it where you'd else want it (you can still call them later anyway).

By the way, the $if check at the beginning is pointless - using %album artist% returns the album artist tag if present, otherwise returns the artist tag (and then goes on to a few more if artist isn't found either).


So, to sum it up - the script you're looking for is probably this:

Code: [Select]
$put(ar,%<album artist>%)|%album%|%title%


Easy as pie.

foo_playlist_tree

Reply #1735
$put(ar,%<album artist>%) makes a variable called ar, sets it to %<album artist>% and returns that value. $puts(ar,%<album artist>%) (think "put silent") does the same, but does not return the value (i.e. it only makes the variable). You can call that variable later using $get.

In other words: Using $put(ar,%<album artist>%) is the same as using just %<album artist>%, except it works.

You can also use the $puts command first thing in the script for every tag you want to do it with, and call them later using $get, but it's easier just using $put and putting it where you'd else want it (you can still call them later anyway).

By the way, the $if check at the beginning is pointless - using %album artist% returns the album artist tag if present, otherwise returns the artist tag (and then goes on to a few more if artist isn't found either).


So, to sum it up - the script you're looking for is probably this:

Code: [Select]
$put(ar,%<album artist>%)|%album%|%title%


Easy as pie.


thank u for help, but i know this.

in previous post my script was:

$if(%album artist%,$puts(ar,%<album artist>%),$puts(ar,%<artist>%))
$get(ar)|%album%|%title%

but ive tryed and these schemes:

1. %<album artist>%|%album%|%title%
2. $if($meta(%album artist%),%<album artist>%,%<artist>%)|%album%|%title%
3. $if($meta(%album artist%),puts(ar,%<album artist>%), puts(ar, %<artist>%) $get(ar)|%album%|%title%
shure it works, but not all releases are in list!

i readed somewhere that in playlist tree  %<tag>% is not working, but this mechanism can be realized by special query language...

but this is very hard-to understand... so if anyone can halp me with this, please help.
---
i need query script for this query (in simple form): %<album artist>%|%album%|%title%

foo_playlist_tree

Reply #1736
i need query script for this query (in simple form): %<album artist>%|%album%|%title%

Set the source to @scheme and the format to:

Code: [Select]
(for-each-db-entry
 (lambda (handle)
  (for-each
    (lambda (album-artist)   
      (add-node
      handle
      (list album-artist
    (format-title handle "%album%")
    (format-title handle "%title%"))))
    (meta-list handle "album artist"))))
There used to be a link to my website here.

foo_playlist_tree

Reply #1737


aha! thank you it works!

but how i must change this script if i want to use %<artist>% instead of %<album artist>% if the last is empty?
i feel that i must change somethink it this place?
Code: [Select]
   (for-each 
    (lambda (album-artist)


because this is dont work:
Code: [Select]
(for-each-db-entry
(lambda (handle)
   (add-node
    handle
    (list (format-title handle "$if($meta(%album artist%),%<album artist>%,%<artist>%)")
      (format-title handle "%album%")
      (format-title handle "%title%")))))

foo_playlist_tree

Reply #1738
are there any good tutorials for this? i want a most played & a recently added script

foo_playlist_tree

Reply #1739
but how i must change this script if i want to use %<artist>% instead of %<album artist>% if the last is empty?

Code: [Select]
(for-each-db-entry
 (lambda (handle)
  (for-each
    (lambda (artist-or-album)   
      (add-node
      handle
      (list artist-or-album
    (format-title handle "%album%")
    (format-title handle "%title%"))))
    (let ((album-artist-list
  (meta-list handle "album artist")))
      (if (null? album-artist-list)
  (meta-list handle "artist")
  album-artist-list)))))
There used to be a link to my website here.

foo_playlist_tree

Reply #1740
Like 2Pacalypse asked: Are there any good tutorials for this scripting language? Preferably focused on foobar2000 use?

foo_playlist_tree

Reply #1741
but how i must change this script if i want to use %<artist>% instead of %<album artist>% if the last is empty?

Code: [Select]
(for-each-db-entry
 (lambda (handle)
  (for-each
    (lambda (artist-or-album)   
      (add-node
      handle
      (list artist-or-album
    (format-title handle "%album%")
    (format-title handle "%title%"))))
    (let ((album-artist-list
  (meta-list handle "album artist")))
      (if (null? album-artist-list)
  (meta-list handle "artist")
  album-artist-list)))))


wohoho! it works! thanks! when i click on the whole query folder... playlist get file list with many duplicates... i know this is because 1 track can be in many nodes... well this is not important.

but this query language is VERY hard!! and not transparent!
иге I feel how it powerfull!

i look at tutorial... and i note this functions:
(for-each-node-entry node-name fn)
(get-file-size handle) => returns size in bytes

and for example with previous query can I transform it and make some query, which will show summary size of every node?:

for example:
artist (size of all child nodes)
-label(size of all child nodes)
--album(size)
-label(size of all child nodes)
--album(size)

is this realizeable too? if it is not much simply for u then just say "yes" and all

foo_playlist_tree

Reply #1742
Sorry for a noobish question, but...
I'm new to playlist_tree (never used any "browsers" like albumlist either). But i'm quite adequate to TAGZ.
So: how do i make my playlist tree look and function the same way as the standart Playlist Switcher?  But with one exclusion, i don't want to create and use hundreds of playlists (before that, i used one static (handmade) playlist for each %artist% folder in my library). But i want to use only ONE dynamic playlist connected to Playlist Tree. For ex: when i leftclick on an item in the tree, this playlist is filled with songs, appropriate to a criteria. When i click on another item, it's filled with other songs
I'm sure, it's a simpliest thing
Help is greatly appreciated
ps: sorry for poor english

foo_playlist_tree

Reply #1743
Quote
But i want to use only ONE dynamic playlist connected to Playlist Tree.

Use the Library playlist as I do.

foo_playlist_tree

Reply #1744
When I add files to my media library I tag them with a timestamp in %ADDED% can someone please tell me how to sort a query by the newest %added% ie recently added playlist.

foo_playlist_tree

Reply #1745
Quote
Use the Library playlist as I do.

Useful solution, thnx a lot
Zhosh )

foo_playlist_tree

Reply #1746
Hi, how do you get this working in foobar2000 under default UI? I can't seem to figure out how to insert a new UI Element where I'd like to, and use Playlist Tree as that element. Thanks for your great work.

foo_playlist_tree

Reply #1747
columns_ui panels and UI elements are completely incompatible.

foo_playlist_tree

Reply #1748
columns_ui panels and UI elements are completely incompatible.


david_dl, thanks! so does that mean I can't use playlist_tree in the Default UI under 0.9.5? Ouch.

foo_playlist_tree

Reply #1749
Hola... Newbie question - Installed Playlist Tree (all the files in the right place), clicked library/playlist tree menu, but none of the menu buttons work... I click "new folder", "file/open", nothing happens... (upd: i thought my problem could be like the one stated above with default ui... but it's the same with columns ui..)