Difference between revisions of "Foobar2000:0.9 CwBowron's Title formating (foo cwb hooks)"
From Hydrogenaudio Knowledgebase
(added new variables) |
|||
(5 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
+ | '''foo_cwb_hooks''' adds various functions and variables to global title formatting. The [http://wiki.bowron.us/index.php/Foobar2000#foo_cwb_hooks author's component page] may contain more up-to-date information on the plugin. | ||
+ | |||
+ | '''Download:''' [http://foobar.bowron.us/foo_cwb_hooks.zip foo_cwb_hooks.zip] | ||
+ | |||
=Description= | =Description= | ||
+ | |||
+ | ==Functions== | ||
+ | *$cwb_urldecode / $cwb_httpclean - decodes characters in URLs | ||
+ | *$cwb_removethe - removes The and A at the beginning of a string | ||
+ | *$cwb_ltrim - example: $cwb_ltrim(%artist%,The) $cwb_ltrim(%artist%,The ,A ,La ) | ||
+ | *$cwb_datediff(d1,d2) - number of days between two dates in the format yyyy-mm-dd or yyyy-mm-dd hh:mm:ss | ||
+ | |||
+ | ==Variables== | ||
+ | ''Tagz updated September 11th 2006'' | ||
+ | |||
+ | *%cwb_systemdate% - date in the formay yyyy-mm-dd | ||
+ | *%cwb_systemdatetime% - date and time in the format yyyy-mm-dd hh:mm:ss | ||
+ | *%cwb_activelist% - active playlist name | ||
+ | *%cwb_activelist_count% - number of items in the active list | ||
+ | *%cwb_playinglist% - playing playlist name | ||
+ | *%cwb_playinglist_count% - number of items in the playing list | ||
+ | *%cwb_queueindex% - queueindex if in the queue, false otherwise | ||
+ | *%cwb_queueindexes% - indices of the item in the queue, false otherwise | ||
+ | *%cwb_queuelength% - length of the queue | ||
+ | *%cwb_queue_end_playlist% - playlist of the last item in the queue | ||
+ | *%cwb_next_title% - title of the next song in the playlist of the playing item or the next item in the queue | ||
+ | *%cwb_next_artist% - artist of the next song in the playlist of the playing item or the next item in queue | ||
+ | *%cwb_playback_order% - e.g. Default, random, etc. | ||
+ | |||
+ | ==Known Bugs== | ||
+ | *%cwb_playinglist% and %cwb_activelist% changes won't refresh in displays | ||
+ | |||
+ | ==Feature Requests== | ||
+ | '''NOTE: These are NOT implemented.''' | ||
* Add variables for the following: | * Add variables for the following: | ||
− | ** | + | **length of active playlist and playing list |
− | ** | + | **%_playbackorder% |
− | ** | + | **%_replaygain_mode% - not really possible |
− | * | + | **%_database% - gives back if a file belongs to database or not |
− | * | + | ***not easily possibe because you cannot use SDK functions in the title formatting callback |
+ | ***only way I could see to do it is to cache the library and test against that | ||
+ | **%_added% - timestamp when a file was added to database | ||
+ | ***not really possible - timestamp is not stored when added when added to library | ||
+ | ***could be possible with a plugin that stores the date added to the library | ||
+ | ***library_callback implementing on_items_added() to store timestamps | ||
+ | |||
+ | ==Useful Strings== | ||
+ | |||
+ | 'Played Today', 'Played Yesterday', 'Played n days ago' or 'No last played info' | ||
+ | |||
+ | $if(%last_played%, $puts(diff,$cwb_datediff(%last_played%,%cwb_systemdate%)) Played $ifgreater(1,$get(diff),Today, $ifgreater(2,$get(diff),Yesterday, $get(diff) days ago)), No last played info) | ||
=Link= | =Link= | ||
Line 12: | Line 56: | ||
* [http://www.hydrogenaudio.org/forums/index.php?showtopic=43606&hl=foo_cwb_hooks Discussion thread] | * [http://www.hydrogenaudio.org/forums/index.php?showtopic=43606&hl=foo_cwb_hooks Discussion thread] | ||
− | [[Category: Other | + | [[Category:foobar2000 Other Components|cwb_hooks]] |
− | + |
Latest revision as of 15:00, 11 September 2006
foo_cwb_hooks adds various functions and variables to global title formatting. The author's component page may contain more up-to-date information on the plugin.
Download: foo_cwb_hooks.zip
Contents
Description
Functions
- $cwb_urldecode / $cwb_httpclean - decodes characters in URLs
- $cwb_removethe - removes The and A at the beginning of a string
- $cwb_ltrim - example: $cwb_ltrim(%artist%,The) $cwb_ltrim(%artist%,The ,A ,La )
- $cwb_datediff(d1,d2) - number of days between two dates in the format yyyy-mm-dd or yyyy-mm-dd hh:mm:ss
Variables
Tagz updated September 11th 2006
- %cwb_systemdate% - date in the formay yyyy-mm-dd
- %cwb_systemdatetime% - date and time in the format yyyy-mm-dd hh:mm:ss
- %cwb_activelist% - active playlist name
- %cwb_activelist_count% - number of items in the active list
- %cwb_playinglist% - playing playlist name
- %cwb_playinglist_count% - number of items in the playing list
- %cwb_queueindex% - queueindex if in the queue, false otherwise
- %cwb_queueindexes% - indices of the item in the queue, false otherwise
- %cwb_queuelength% - length of the queue
- %cwb_queue_end_playlist% - playlist of the last item in the queue
- %cwb_next_title% - title of the next song in the playlist of the playing item or the next item in the queue
- %cwb_next_artist% - artist of the next song in the playlist of the playing item or the next item in queue
- %cwb_playback_order% - e.g. Default, random, etc.
Known Bugs
- %cwb_playinglist% and %cwb_activelist% changes won't refresh in displays
Feature Requests
NOTE: These are NOT implemented.
- Add variables for the following:
- length of active playlist and playing list
- %_playbackorder%
- %_replaygain_mode% - not really possible
- %_database% - gives back if a file belongs to database or not
- not easily possibe because you cannot use SDK functions in the title formatting callback
- only way I could see to do it is to cache the library and test against that
- %_added% - timestamp when a file was added to database
- not really possible - timestamp is not stored when added when added to library
- could be possible with a plugin that stores the date added to the library
- library_callback implementing on_items_added() to store timestamps
Useful Strings
'Played Today', 'Played Yesterday', 'Played n days ago' or 'No last played info'
$if(%last_played%, $puts(diff,$cwb_datediff(%last_played%,%cwb_systemdate%)) Played $ifgreater(1,$get(diff),Today, $ifgreater(2,$get(diff),Yesterday, $get(diff) days ago)), No last played info)