foo. bar. baz. quux.

Foobar2000:Playlist Tree

From WikiBazQuux

Revision as of 14:30, 7 May 2008; view current revision
←Older revision | Newer revision→
Jump to: navigation, search
Image:Playlist tree cropped.png
A cropped picture of playlist tree in action
As of May 2009, I'm taking down all foobar2000 related files.
As of May 2008, I will no longer be developing foobar2000 components.

I no longer wish to contribute my time to a closed source, single platform app.
Also, certain actions by the foobar2000 developers have lead to my no longer wishing to contribute. These include removing features utilized by developers and users because they dislike they way they are being used and allowing only an elite few access to new API features.
Thank you to loyal users over the past years.
If you are a developer and are interested in taking over development of one of my components, please email me at chris SQUIGGLE bowron SLAM us.

foo_playlist_tree is a powerful tree based media library plugin for foobar2000 that is highly customizable. Playlist Tree allows you to create static hierarchical playlists as well as automatic playlists that can be generated from a large variety of conditions. It also includes an embedded scheme interpreter for playlist generation and scripting.

Contents

Known Bugs

  • autorefreshed @playlists queries dont autorefresh the individual playlists
  • rearranging playlists does not refresh @playlists queries
  • Issues with %<tagz>% processing (use the new @scheme feature for complicated multi-value tags)
  • panels can get reordered by modifying layout.
  • Sorting not working correctly for unicode characters
  • Unicode issues in edit dialog
  • @node<> uses display - having sizes in format can cause issues with using @node queries

Not Bugs

  • If you click on the +/- of a node, and no node in the tree has been selected, it will select that node
  • If you have hide lines enabled, the top level nodes will not have +/- buttons. (you can use the left/right arrow keys to expand and contract the nodes)

Feature Requests

  • reimplement @browse_as<>
  • send album art panel selected item
  • ignore nested playlists in drops
  • dropping a file to a @drop'ed playlist adds the file to the actual playlist file too
  • auto refresh @node queries
  • allow criteria in @playlists query (i.e. only playlists with PT: in the name or something) (use a fancy @scheme query)
  • remove duplicates option for sending to library playlist operations
  • reorder queue/playlist by @queue and @playlist query drag and drop reorder
  • refresh @database queries on tag changes
  • global setting to ignore "The" and "a" when sorting
  • option to always have the box checked for 'sort by display name' when creating a new query
  • option to disable drag and drop
  • allow drag and drop to other apps
  • vertical padding options
  • add "[local] menus" in "Selection Action" in main preference, so we would be able to automatically refresh queries when selecting them
  • be able to get the selected playlist items in scheme query

Unlikely Candidates

    • Inline label editting - I think having all editing done in the dialog makes things cleaner and you dont have to worry that what you meant as a double click be interepreted as a label edit.

Forums

Documentation

Note that some of the documentation refers to older version of Playlist Tree.

If you know of a good playlist tree resource such as a tutorial in a language other than English, please post it in one of the above forums and I will add it to this list.

Frequently Asked Questions

How do I load a .col file?

You don't. The collection files that were available from my website are for previous versions of playlist tree. For examples of queries for the current version of playlist tree, please see the examples.

How do I access the playlist tree specific context menu?

By default, you can access the playlist tree menu by middle clicking on a node, or by holding SHIFT while you right click on a node. These can be configured under the mouse and keyboard options in playlist tree.

For Developers

Playlist tree supports notifying other components when the selected node is changed.

class callback_node
{
public:
   virtual bool   get_entries( pfc::list_base_t<metadb_handle_ptr> & list ) const = 0;
   virtual bool   is_leaf() const     = 0;
   virtual bool   is_folder() const   = 0;
   virtual bool   is_query() const    = 0;
   virtual int    get_entry_count() const = 0;
   virtual void   get_name( pfc::string_base & out ) const = 0; 
};

class NOVTABLE node_select_callback : public service_base 
{
public:
   virtual void on_node_select( const callback_node * node ) = 0;

   FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT(node_select_callback);
};

const GUID node_select_callback::class_guid = 
{ 0x9c2ae3c3, 0xdc04, 0x4042, { 0xad, 0xf3, 0x88, 0x84, 0x11, 0x7b, 0x49, 0x55 } };

Embedded Scheme

Beginning with Playlist Tree 3.0.beta0 Playlist Tree contains an embedded Scheme Interpreter using MzScheme. This is intended for advanced users with programming experience. This allows you to build queries in a real programming language. To create a scheme based query, set the "Source" of the query to "@scheme" and the "Format" to the scheme code to evaluate.

The scheme console output functions such as display and write will be directed to the foobar2000 console.

Playlist Tree specific scheme primitives:

  • (for-each-db-entry fn [filter-string] [sort-string])
  • (add-node handle folder-list)
  • (now-playing)
  • (console-print [object1] [object2] ... [objectn])
  • (format-title handle title-format-string)
  • (meta-list handle tag)
  • (for-each-playlist fn)
  • (for-each-playlist-entry playlist-name fn) - first parameter can be playlist name or index
  • (get-subsong-index handle)
  • (get-path handle)
  • (get-length handle) => returns time in seconds
  • (get-file-size handle) => returns size in bytes
  • (for-each-queue-entry fn)
  • (for-each-node-entry node-name fn)
  • (add-query-node label source criteria format [population-order] [sortp] [max-n] [max-type]) => returns a tree-node which can be used in refresh-query, max-type can be one of tree-max-tracks, tree-max-minutes, tree-max-megs, tree-max-subfolders
  • (refresh-query query-node)
  • (handle-apply function path [subsong-index])
  • (file-creation filename) => retusn the file creation in seconds, same scale as the mzScheme (current-seconds) results. more info.
  • (file-last-access filename) => see file-creation
  • (file-last-write filename) => see file-creation
  • (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])
  • (prompt-user-string "foo") - prompts the user for input. Returns a string. "" for cancel.
  • (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.

See examples here.

Personal tools