cwbowron
Apr 13 2006, 12:04
foo_cwb_hooks adds various functions and variables to global title formatting. It also adds a timestamp action to masstagger scripts, and the ability to run a script on files added to the media library (New File Tagger).
More information on my components page:
http://www.bazquux.com/wiki/Foobar2000:Hooks
Silversight
Apr 13 2006, 12:25
The download works, but the archive is corrupted.
foosion
Apr 13 2006, 12:26
Is there a special reason why this function is not called "urldecode" like in other languages? Just wondering.
cwbowron
Apr 13 2006, 12:32
Archive has been fixed. I had forgotten to switch to binary mode when uploading it.
QUOTE(foosion @ Apr 13 2006, 02:26 PM)

Is there a special reason why this function is not called "urldecode" like in other languages? Just wondering.
I was unaware that it was commonly called urldecode in other languages. I do not do much work in applications that require decoding url's. Based on that feedback, I will make it recognize either function.
cwbowron, could you, please add other functions to your hook plugin?
- playing playlist's name
- active playlist's name
- queue index of track
I would like to request
-current playback order
cwbowron
Aug 11 2006, 13:23
I added a couple more things today to foo_cwb_hooks:
QUOTE
Release 1.0.2
* added $removethe() function which removes "The " and "A " at the beginning of a string. Good for removing articles in the names of bands.
* added %systemdate% [yyyy-mm-dd] and %systemdatetime% [yyyy-mm-dd hh:mm:ss]
thank you for this update, cwbowron. what are you thoughts on the other requests?
Squeller
Aug 12 2006, 06:06
QUOTE(cwbowron @ Aug 11 2006, 11:23)

* added $removethe() function which removes "The " and "A " at the beginning of a string. Good for removing articles in the names of bands.
Erm, narrow. What if band names begin with "der, die, das, la, le, les, het, ein, eine, ...etc..."?
What we rather need is a $ltrim, $rtrim in foobars language. Well, that would be really helpful.
$ltrim('The doors','The') = ' doors'
Squeller, i'm all for new functions in tagz for some tasks that take quite some formatting to do in current version, but i still think that it's not bad idea to have such specialized function like $removethe() available - there could be some failsafe logic implemented ...
saivert
Aug 13 2006, 15:35
You could make a component that enables the use of LUA in order to expand the possibilities of the title formatting language. like foo_lua_formatting.
I'd like to vote for queue index. Please see also
this thread.
cwbowron
Aug 15 2006, 11:21
After looking into some of the SDK documentation, I don't know that its possible to safely add functions for activeplaylist, playing playlist or whether an item is in the database. Queue index looks possible, but it might not be that useful depending on what you want to use the queue index for. (if you want to display it in the playlist view, it might not be very useful because the item will not get redrawn if the queue index changes)
That's sad, that it is not possible to automatically redraw the queue indexes. Then it really won't help in what I planed to do. At least we have a queue viewer.
If somebody got an idea on how to workaround this problem I'd really appreciate it.
Chronial
Aug 17 2006, 09:17
I don't know if this is possible, but: just redraw all playlist entries of songs that are in the queue?
cwbowron
Aug 17 2006, 09:20
QUOTE(Chronial @ Aug 17 2006, 11:17)

I don't know if this is possible, but: just redraw all playlist entries of songs that are in the queue?
I dont know that there is a way for me to tell the playlist to redraw the items.
EDIT: I may have found a way to do this using metadb::dispatch_refresh
cwbowron
Aug 17 2006, 11:07
I just put up 1.0.3 on my web site, which adds %queueindex%, %playinglist% and %activelist%.
Playlist *will* get updated when the queue index changes. The queue, the playing list and the active list are all cached via callbacks so that during handle formatting, no SDK functions should be called.
roentgen
Aug 17 2006, 12:16
QUOTE(cwbowron @ Aug 17 2006, 20:07)

I just put up 1.0.3 on my web site, which adds %queueindex%, %playinglist% and %activelist%.
Playlist *will* get updated when the queue index changes. The queue, the playing list and the active list are all cached via callbacks so that during handle formatting, no SDK functions should be called.
Finally .... great work.
Still... when there are some items in queue, and manually double click an item in the playlist the queue gets erased (why???), but %queueindex% doesn't get updated (reloading info from files seems to solve the display)
Chronial
Aug 17 2006, 12:21
Great work there

I have some more suggestions concerning the queue:
foobar stores the playlist of the queued file - could you make this accessible to tagz, so we can check it against %playlist_name% to see if it is really _this_ playlist entry that is enqueued? (I don't think the default %queueindex% should do this - this would keep interesting information away from us ("Is _this file_ enqueued?").
Another problem is the fact that the same file may be enqueued multiple times. It might be usefull to have a comma-seperated list of all indexes that this file is enqueued as (so we have %queueindex% and %queueindexes%).
cwbowron
Aug 17 2006, 12:32
QUOTE(roentgen @ Aug 17 2006, 14:16)

QUOTE(cwbowron @ Aug 17 2006, 20:07)

I just put up 1.0.3 on my web site, which adds %queueindex%, %playinglist% and %activelist%.
Playlist *will* get updated when the queue index changes. The queue, the playing list and the active list are all cached via callbacks so that during handle formatting, no SDK functions should be called.
Finally .... great work.
Still... when there are some items in queue, and manually double click an item in the playlist the queue gets erased (why???), but %queueindex% doesn't get updated (reloading info from files seems to solve the display)
The manual double click thing is out side my control.
I think I know the issue with the not refreshing is, and I will fix it.
EDIT: I did fix it, 1.0.3b has been uploaded to my web site. Get it while it's hot.
q-stankovic
Aug 17 2006, 13:56
Great thing and thanks, Chris!
I tested %queueindex" and everything worked as it should do! Just like to repeat Chronials request for a comma seperated list of all indexes. But i don't think that an second variable %queueindexes% is necessary
QUOTE(roentgen @ Aug 17 2006, 19:16)

Still... when there are some items in queue, and manually double click an item in the playlist the queue gets erased (why???)
Why? Ask Peter!
If i would give an answer i would say: What else should happen?
just wanted to thank you, cwbowron ... this queue stuff is what many guys here, including me, wanted. %queuesize% would be nice to have (though i realize that with one track queued more than once it wouldn't be enough to find whether given queued track is last in the queue or not).
Chronial
Aug 17 2006, 16:15
I added some stuff and sent it to cwbowron - hope he likes it ^^.
My current format string (inserted before the tracklength):
$if(%queueindex%,'['%queueindexes%/%queuelength%']')
(With some additional colorcodes)
This gives results like:
[2/5]
[3,4/5]
looks great and gives a perfect overview of the queue.
PS:
QUOTE
If i would give an answer i would say: What else should happen?
The same as in winamp: keep the queue untouched.
Thanks a lot cwbowron, it works great. The queue indexes was the last feature of Winamp I've been missing in fb2k. But I agree with Chronial, that the queue shouldn't be touched if I double click a file. Is anywhere an official foobar2000 feature request thread, where I could post this?
q-stankovic
Aug 18 2006, 06:29
QUOTE(vlada @ Aug 18 2006, 00:05)

But I agree with Chronial, that the queue shouldn't be touched if I double click a file. Is anywhere an official foobar2000 feature request thread, where I could post this?
Post just a new topic under "General". But i don't understand your problem: Why should you define a queue and then start playback by doubleclicking?
cwbowron
Aug 18 2006, 06:58
I incorporated the changes sent to my by Chronial and released version 1.0.4. In addition to those changes, I renamed all the functions and variables provided by foo_cwb_hooks with a 'cwb_' prefix for potentially faster comparisons and so that i will not have to worry if other devs want to write hooking plugins.
Complete info is available at the website:
http://wiki.bowron.us/index.php/Foobar2000#foo_cwb_hooks
QUOTE(Chronial @ Aug 18 2006, 00:15)

I added some stuff and sent it to cwbowron - hope he likes it ^^.
My current format string (inserted before the tracklength):
$if(%queueindex%,'['%queueindexes%/%queuelength%']')
(With some additional colorcodes)
This gives results like:
[2/5]
[3,4/5]
I don't get it. Tried putting your line in a new column, tried putting in in front of the length-column, nothing happened, althougs there are songs in the queue.
Can you explain? TIA!
cwbowron
Aug 18 2006, 14:50
QUOTE(bfly @ Aug 18 2006, 16:46)

I don't get it. Tried putting your line in a new column, tried putting in in front of the length-column, nothing happened, althougs there are songs in the queue.
Can you explain? TIA!
In the release version I added cwb_ prefixes to all the variables, so that this plugin wont step on any other potential plugins toes and for potentially faster comparisons.
Try:
CODE
$if(%cwb_queueindex%,'['%cwb_queueindexes%/%cwb_queuelength%']')
Thanks Christopher, that worked. Great plugin, thanks a lot!
year98
Aug 19 2006, 03:29
Can playback order variable be possible? I think that will be a great feature...^^
QUOTE(q-stankovic @ Aug 18 2006, 14:29)

QUOTE(vlada @ Aug 18 2006, 00:05)

But I agree with Chronial, that the queue shouldn't be touched if I double click a file. Is anywhere an official foobar2000 feature request thread, where I could post this?
Post just a new topic under "General". But i don't understand your problem: Why should you define a queue and then start playback by doubleclicking?
Sometimes I put some songs in a queue which I want to hear. Then I decide, that right now I want to listen do a certain song, so I double click it. But I'd like my queue to continue then.
It is also useful when more people are operating with the player (at a party). You don't want anybody else to delete so simply your queue.
Btw. Is it possible to delete a file from a queue?
QUOTE
Btw. Is it possible to delete a file from a queue?
No or not yet.
cwbowron
Aug 19 2006, 08:17
QUOTE(vlada @ Aug 19 2006, 05:31)

Sometimes I put some songs in a queue which I want to hear. Then I decide, that right now I want to listen do a certain song, so I double click it. But I'd like my queue to continue then.
It is also useful when more people are operating with the player (at a party). You don't want anybody else to delete so simply your queue.
Btw. Is it possible to delete a file from a queue?
Discussion of how the queue operates and suggestions as to how it should work are well outside the scope of this plugin.
QUOTE(cwbowron @ Aug 19 2006, 16:17)

Discussion of how the queue operates and suggestions as to how it should work are well outside the scope of this plugin.
Sure, I'm sorry. Let's continue
here.
q-stankovic
Aug 20 2006, 07:27
Some ideas for new variables and functions:
1.
%cwb_replaygain_mode% 2.
%cwb_hotness% (look here:
http://www.hydrogenaudio.org/forums/index....showtopic=31287 , with permission of topdownjimmy)
3.
$group() Examples for the group-function:
$group(%date%,5) creates:
1980 - 1985
1985 - 1990
1990 - 1995
...
$group($cut(%album%,1),3) creates:
A - C
D - F
G - I
...
What do you think?
Chronial
Aug 20 2006, 08:52
%cwb_replaygain_mode% is not a good idea - if you really want access to the player settings this has to be done with a more general approach - like $cwv_setting(replaygain_mode) - otherwise you will create far to many fields.
About this group function:
so it just simply round down the given value and generate something like
"*roundedvalue* - *roundedvalue*+*step*"
and the same for letters?
%cwb_replaygain_mode% is for displaying what mode you're using not set it as I see. And I don't think changing player settings with tagz string is a good idea although it seems to be convenient.
cwbowron
Aug 20 2006, 18:52
QUOTE(thuan @ Aug 20 2006, 20:10)

%cwb_replaygain_mode% is for displaying what mode you're using not set it as I see. And I don't think changing player settings with tagz string is a good idea although it seems to be convenient.
I dont think anyone was suggesting that we have tagz variables set player settings. I believe the request was to display the replaygain mode, not to be able to change.
And I am not sure that its even possible. Title formatting hooks cannot access SDK functions because they might be called from the main thread. The other functions work by caching the information and they can do this because there are callbacks availble that let know when the playlists change or the playing song changes. I don't know if there are any callbacks that inform plugins when replaygain mode changes.
If it's so then maybe it should be call $cwb_info(a) with a is replaygain_mode or sth like that. I misinterpret the $cwv_setting(replaygain_mode) part.
Squeller
Aug 21 2006, 00:54
You have introduced two variables for displaying playlist names. I'd really appreciate variables for both, which indicate the playlists length and the current index position. I personally would like to have a $progress bar with those data in my trackinfo panel...
foosion
Aug 21 2006, 02:05
QUOTE(cwbowron @ Aug 21 2006, 02:52)

I don't know if there are any callbacks that inform plugins when replaygain mode changes.
I'm afraid there aren't any, though I already asked Peter about adding that some time ago, since it would be highly useful for things like a ReplayGain toolbar as well.
q-stankovic
Aug 21 2006, 10:35
QUOTE(Chronial @ Aug 17 2006, 19:21)

I have some more suggestions concerning the queue:
foobar stores the playlist of the queued file - could you make this accessible to tagz, so we can check it against %playlist_name% to see if it is really _this_ playlist entry that is enqueued? (I don't think the default %queueindex% should do this - this would keep interesting information away from us ("Is _this file_ enqueued?").
Now i know what you mean, Chronial! Can repeat the request and also the demand that %queueindex% shouldn't do it. Great would be a variable like %cwb_entry_inqueue% that is true if the entry is enqueued and false if just the file is enqueued.
Have a nice day, you all!
Chronial
Aug 21 2006, 12:05
unfortunately there is no way to access the name of the playlist the file is in from within the titleformating hook.
%cwb_entry_inqueue% would also be quite problemtic since this doesn't deliver good results if the same file is enqueued multipe times.
So I thought about the problem and in my opinion the only use of such a variable would be to have the answer to one question: "on which playlist will the queue end?" - so I created a field that will hold just this information(%cwb_queue_end_playlist%). You'll have access to it, once cwbrown adds it to his release (if he decides to do so)
rendom
Aug 21 2006, 12:33
Any ways to get info from specific file from playlist?
cwbowron
Aug 22 2006, 09:37
Release 1.0.5
* $cwb_datediff(d1,d2) - number of days between two dates in the format yyyy-mm-dd or yyyy-mm-dd hh:mm:ss
* added %cwb_queue_end_playlist% (Chronial)
* fixed $cwb_ltrim to not automatically add a space to the paramaters
Squeller
Aug 22 2006, 10:00
QUOTE(Chronial @ Aug 21 2006, 10:05)

So I thought about the problem and in my opinion the only use of such a variable would be to have the answer to one question: "on which playlist will the queue end?" - so I created a field that will hold just this information(%cwb_queue_end_playlist%). You'll have access to it, once cwbrown adds it to his release (if he decides to do so)
I don't understand. So this is useful only in case I add files to playback queue? Now it returns "?" to my trackinfo panel (also to columns global variables)
Chronial
Aug 22 2006, 10:27
%cwb_queue_end_playlist% returns the playlist the last song of the queue belongs to. If there is not queue, or the llast song hast no playlist, it will return nothing ("?");
q-stankovic
Aug 22 2006, 11:15
QUOTE(Chronial @ Aug 22 2006, 17:27)

%cwb_queue_end_playlist% returns the playlist the last song of the queue belongs to. If there is not queue, or the llast song hast no playlist, it will return nothing ("?");
I understand how it works but i can't see what i should use it for.
Chronial
Aug 22 2006, 12:39
CODE
$if(%cwb_queueindex%,'['$if($strcmp(%cwb_queue_end_playlist%,%playlist_name%),'->'
%cwb_queueindexes%/%cwb_queuelength%']')
I'm not sure if I used $strcmp correctly. But this should be done with color codes, after all.
Russell777
Aug 22 2006, 14:30
Is it possible to get system time even when no track is playing?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.