JsTitleFormat
This will be used in the examples below:
var tfo = fb.TitleFormat("%artist%");
Methods
Eval()#
Returns a string. It will be empty if foobar2000 is not playing.
EvalPlaylistItem(playlistIndex, playlistItemIndex)#
| Arguments | ||
|---|---|---|
| playlistIndex | number |
|
| playlistItemIndex | number |
Returns a string.
Use if you want access to playlist specific fields such as %list_index%, %list_total%, %isplaying% etc.
Full details here.
EvalWithMetadb(handle)#
| Arguments | ||
|---|---|---|
| handle | JsMetadbHandle |
Returns a string.
Example
var item = fb.GetFocusItem();
if (item) {
var artist = tfo.EvalWithMetadb(item);
}
Note
You should try and avoid using this method inside a loop. It's preferable
to use the EvalWithMetadbs method just below.
EvalWithMetadbs(handle_list)#
| Arguments | ||
|---|---|---|
| handle_list | JsMetadbHandleList |
Returns an array.
Example
var handle_list = fb.GetLibraryItems();
var artists = tfo.EvalWithMetadbs(handle_list);
console.log(handle_list.Count === artists.length); // True