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 297447 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

foo_cwb_hooks

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

foo_cwb_hooks

Reply #26
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!

foo_cwb_hooks

Reply #27
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: [Select]
$if(%cwb_queueindex%,'['%cwb_queueindexes%/%cwb_queuelength%']')
There used to be a link to my website here.

foo_cwb_hooks

Reply #28
Thanks Christopher, that worked. Great plugin, thanks a lot!

foo_cwb_hooks

Reply #29
Can playback order variable be possible? I think that will be a great feature...^^

foo_cwb_hooks

Reply #30

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?

foo_cwb_hooks

Reply #31
Quote
Btw. Is it possible to delete a file from a queue?
No or not yet.

foo_cwb_hooks

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


foo_cwb_hooks

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

foo_cwb_hooks

Reply #35
%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?

foo_cwb_hooks

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

foo_cwb_hooks

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

foo_cwb_hooks

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

foo_cwb_hooks

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

foo_cwb_hooks

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

foo_cwb_hooks

Reply #41
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! 

foo_cwb_hooks

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

foo_cwb_hooks

Reply #43
Any ways to get info from specific file from playlist?

foo_cwb_hooks

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

foo_cwb_hooks

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

foo_cwb_hooks

Reply #46
%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 ("?");

foo_cwb_hooks

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

foo_cwb_hooks

Reply #48
Code: [Select]
$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.

foo_cwb_hooks

Reply #49
Is it possible to get system time even when no track is playing?
Favourite artist:CD-R
Favourite album:700MB