Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: foo_cwb_hooks (Read 297415 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

foo_cwb_hooks

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
There used to be a link to my website here.

foo_cwb_hooks

Reply #1
The download works, but the archive is corrupted.
Nothing is impossible if you don't need to do it yourself.

foo_cwb_hooks

Reply #2
Is there a special reason why this function is not called "urldecode" like in other languages? Just wondering.

foo_cwb_hooks

Reply #3
Archive has been fixed.  I had forgotten to switch to binary mode when uploading it.

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.
There used to be a link to my website here.

foo_cwb_hooks

Reply #4
cwbowron, could you, please add other functions to your hook plugin?

- playing playlist's name
- active playlist's name
- queue index of track

foo_cwb_hooks

Reply #5
I would like to request

-current playback order

foo_cwb_hooks

Reply #6
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]
There used to be a link to my website here.


foo_cwb_hooks

Reply #8
* 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'

foo_cwb_hooks

Reply #9
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 ...

foo_cwb_hooks

Reply #10
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.

foo_cwb_hooks

Reply #11
I'd like to vote for queue index. Please see also this thread.

foo_cwb_hooks

Reply #12
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)
There used to be a link to my website here.

foo_cwb_hooks

Reply #13
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.

foo_cwb_hooks

Reply #14
I don't know if this is possible, but: just redraw all playlist entries of songs that are in the queue?

foo_cwb_hooks

Reply #15
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
There used to be a link to my website here.

foo_cwb_hooks

Reply #16
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.
There used to be a link to my website here.

foo_cwb_hooks

Reply #17
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)

foo_cwb_hooks

Reply #18
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%).

foo_cwb_hooks

Reply #19

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.
There used to be a link to my website here.

 

foo_cwb_hooks

Reply #20
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


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?

foo_cwb_hooks

Reply #21
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).

foo_cwb_hooks

Reply #22
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.

foo_cwb_hooks

Reply #23
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?

foo_cwb_hooks

Reply #24
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?