Foobar2000:Components 0.9/Custom Info (foo custominfo)

From Hydrogenaudio Knowledgebase

Introduction

It is basically a 0.9 successor for Quicktag SQL, that allows you to set info fields for files without modifying them. Fields can be set using context menu commands that can be customized in the component preferences. Fields can be accessed in title formatting scripts by using simple variables like %RATING% etc (or functions, which are explained below).

I've also been working on a mini-sdk that allows other components to set their own fields using foo_custominfo. And I hope that components like foo_playcount would some day add an option for this. The sdk also has an interface for implementing other methods for storing the information, in case someone wants to export the info to MySQL or something.

Installation & Configuration

Just copy the dll file to fb2k\components as usual. Open "Preferences\Tools\Custom info". Select a method for storing custominfo data and press "Switch" button.

  • Foobar2k config file: saves all info fields in foobar's configuration file. Reasonable loading time, fast reading of info, fast writing of info. This is also insecure, you will lose all changes since the last config file saving if foobar crashes or something.
  • Text file (foobar2kdir\custominfo.txt): Utf-8 encoded text file (which shouldn't be modified though). Slow loading, fast reading of info, fast writing of info. This is also insecure, changes are not written to disk until you exit foobar.
  • SQLite database (foobar2kdir\custominfo_sqlite.db): Slow loading, fast reading of info, slow writing of info. Changes are immediately written to disk which is why I personally recommend this option.

Available functions in titleformatting scripts

  • $cinfo(X,Y). Returns value with field name X and index Y. Similar to $meta(X,Y).
  • $cinfo_num(X). Number of values in field X. Similar to $meta_num(X).
  • $cinfo_sep(X,Y,Z). Returns all values in field X separated with strings Y & Z as in $meta_sep(X,Y,Z).
  • $cinfo_list(X,Y). Returns all custominfo values for current track using Y as a separator between field name and value, and X as separator between field/value-pairs.

Some advanced features in context menu commands

  • You can set several fields at a time by separating field names and values with "|". For example "MYFIELD1|MYFIELD2|MYFIELD3" with corresponding value string "value1|value2|value3".
  • Use # in front of field name to add new value, instead of replacing existing values. This can also be combined with the separators, for example: "MYFIELD|#MYFIELD|#MYFIELD".
  • You can access system date and time in context menu commands using following variables: %_system_year%, %_system_month%, %_system_day%, %_system_dayofweek%, %_system_hour%, %_system_minute%, %_system_second%, %_system_millisecond%

Limitations

  • Custom info cannot be accessed in track info panel "now playing" mode when playback is stopped. Also, masstagger doesn't seem to recognize custom info fields.
  • Branching of multivalued custom info fields in Playlist Tree/Browser using %<tag>%-syntax is not possible.

Link