Skip to main content

Topic: foo_cwb_hooks (Read 238425 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • cwbowron
  • [*][*][*][*][*]
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
  • Last Edit: 08 May, 2008, 08:21:37 PM by cwbowron
There used to be a link to my website here.

  • Silversight
  • [*][*][*][*]
foo_cwb_hooks
Reply #1
The download works, but the archive is corrupted.
  • Last Edit: 13 April, 2006, 02:25:35 PM by Silversight
Nothing is impossible if you don't need to do it yourself.

  • foosion
  • [*][*][*][*][*]
  • Moderator
foo_cwb_hooks
Reply #2
Is there a special reason why this function is not called "urldecode" like in other languages? Just wondering.
http://foosion.foobar2000.org/ - my components for foobar2000

  • cwbowron
  • [*][*][*][*][*]
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.

  • mazy
  • [*][*][*][*][*]
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
info about my tag guesser script for foo_lua (preview version available):
http://www.hydrogenaudio.org/index.php?showtopic=16987

  • year98
  • [*]
foo_cwb_hooks
Reply #5
I would like to request

-current playback order

  • cwbowron
  • [*][*][*][*][*]
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.

  • mazy
  • [*][*][*][*][*]
foo_cwb_hooks
Reply #7
thank you for this update, cwbowron. what are you thoughts on the other requests?
info about my tag guesser script for foo_lua (preview version available):
http://www.hydrogenaudio.org/index.php?showtopic=16987

  • Squeller
  • [*][*][*][*][*]
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'

  • mazy
  • [*][*][*][*][*]
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 ...
info about my tag guesser script for foo_lua (preview version available):
http://www.hydrogenaudio.org/index.php?showtopic=16987

  • saivert
  • [*][*][*]
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.
http://foobar2000.saivert.com - foobar2000 component repository

  • vlada
  • [*][*][*][*]
foo_cwb_hooks
Reply #11
I'd like to vote for queue index. Please see also this thread.

  • cwbowron
  • [*][*][*][*][*]
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.

  • vlada
  • [*][*][*][*]
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.

  • Chronial
  • [*][*][*][*]
  • Developer
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?

  • cwbowron
  • [*][*][*][*][*]
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
  • Last Edit: 17 August, 2006, 12:38:54 PM by cwbowron
There used to be a link to my website here.

  • cwbowron
  • [*][*][*][*][*]
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.

  • roentgen
  • [*][*][*][*]
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)

  • Chronial
  • [*][*][*][*]
  • Developer
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%).

  • cwbowron
  • [*][*][*][*][*]
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.
  • Last Edit: 17 August, 2006, 02:41:39 PM by cwbowron
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?
german support forum: www.foobar-users.de / user: qwert73

  • mazy
  • [*][*][*][*][*]
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).
  • Last Edit: 17 August, 2006, 05:10:42 PM by mazy
info about my tag guesser script for foo_lua (preview version available):
http://www.hydrogenaudio.org/index.php?showtopic=16987

  • Chronial
  • [*][*][*][*]
  • Developer
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.
  • Last Edit: 17 August, 2006, 06:46:03 PM by Chronial

  • vlada
  • [*][*][*][*]
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?
german support forum: www.foobar-users.de / user: qwert73