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

foo_cwb_hooks

Reply #100
Looks like a bug: When switching to an autoplaylist, %cwb_activelist% does not refresh in my trackinfo_mod panel. It does refresh on all other playlists.

EDIT. Hmm. After playing a track in this playlist for the first time, %cwb_activelist% now always refreshes, no matter if it is active or not. Maybe this is a more general issue with new playlists (the autoplaylist I meantioned above was newly created).

EDIT2: The problem is the following: If no playlist entry is marked, the variable doesn't get refreshed.

foo_cwb_hooks

Reply #101
I just released 1.0.9, but it should not have any user visible changes.  Details on the callback service are availble at http://wiki.bowron.us/index.php/Foobar2000...per_Information.  I will contact terrestrial and see if he is willing to support this in foo_trackinfo_mod

Quote
Release 1.0.9

    * added service so other components can get notified of changes to cwb_hook variables
There used to be a link to my website here.

foo_cwb_hooks

Reply #102
Could you introduce %cwb_autoplaylist% as a binary variable which detects, if a playlist is an autoplaylist?
Or does someone know if this is already possible with maybe another plugin?

foo_cwb_hooks

Reply #103
There is a situation there %cwb_next_title% won't show the next title wich is going to be played after the current one: If the last track in the queue wasn't added from a playlist but from a media library viewer (PT, Database search,...).

foo_cwb_hooks

Reply #104
Hey cwbowron,  I was wondering if it might be possible to add in "%cwb_next_album% to the available strings.

Thanks!

Edit:  A question for you as well.  Do these strings not work in Columns_UI?

foo_cwb_hooks

Reply #105
Hey cwbowron,  I was wondering if it might be possible to add in "%cwb_next_album% to the available strings.


I'm adding two user definable strings for the next track.  By default they are going to be album and path.

Quote
Edit:  A question for you as well.  Do these strings not work in Columns_UI?


They should, but it might not be getting updated correctly, depending on which variables you are using and where you are using them.
There used to be a link to my website here.

foo_cwb_hooks

Reply #106
They should, but it might not be getting updated correctly, depending on which variables you are using and where you are using them.

I think it is how I was trying use them....or at least how I thought they could be used.  For some reason I was thinking that %cwb_next_artist% was going to allow me to pull info from any track, not just the selected (or playing) track.  I was planing to used this to group unrelated tracks under a single heading in the Single Column Playlist.  Unfortunately, it won't work as the strings only work with selected tracks.

foo_cwb_hooks

Reply #107
Hey cwbowron,  I was wondering if it might be possible to add in "%cwb_next_album% to the available strings.


I'm adding two user definable strings for the next track.  By default they are going to be album and path.


what about previous as well? and how far ahead can you look? for example, can you do something like this:

$cwb_next(#,tag)
$cwb_prev(#,tag)

where the # is how many tracks ahead/back, and the tag is the tag to read?

thanks for the plugin, btw. Great stuff

foo_cwb_hooks

Reply #108
what about previous as well? and how far ahead can you look? for example, can you do something like this:

$cwb_next(#,tag)
$cwb_prev(#,tag)

where the # is how many tracks ahead/back, and the tag is the tag to read?


You cannot really do $cwb_next or $cwb_prev function because you really are not supposed to work with other files and stuff inside a title formatting callback.  cwb_hooks works around this by caching all the information and just retrieving it from its own variables.  This is why it is limited to next_artist, next_title, next_user1, and next_user2.
There used to be a link to my website here.

foo_cwb_hooks

Reply #109
Is it possible to make %cwb_next_user1% avaiable for EACH track of the playlist?
I really need it to determine first (or last) track in a folder.

foo_cwb_hooks

Reply #110
Is it possible to make %cwb_next_user1% avaiable for EACH track of the playlist?
I really need it to determine first (or last) track in a folder.


No.

No more requests regarding %cwb_next_*%.
There used to be a link to my website here.

foo_cwb_hooks

Reply #111
To explain cwbworon's answer a little bit further:
While title formating is done, the only accessible data is data stored in the current Song, or data the plugin got from foobar before title formating was running.
Info about next song is not aviable at all, cwbowron does make quite some assumbtions about foobars behaviour to get the data for the next song - so this feature is allready quite buggy.
Developing any further into that direction does not make any sense at all.

foo_cwb_hooks

Reply #112
Hi

I have a request. I would really like to get rid of the status bar. But right now i can't because it displays some infos that we can see nowhere else. I would prefer to have those infos displayed the way i want in a trackinfo panel.
What i would need is the volume level (i think it has already been requested) and the length of the selected item(s) in the active playlist.
Is it possible ?

Thanks

foo_cwb_hooks

Reply #113
Quote
No.

No more requests regarding %cwb_next_*%.


Well, I just gotta try:  clearly you can't do things against the file itself.  But perhaps you could at least allow for a simple cwv_prev in addition to the existing cwb_next.  Cache as before.  Don't worry about iterators or indexing or arbitrary field lookup (I agree its too much and violates the whole spirit of the quick callback).  But, for me and others, a quick look back allows for proper album formatting, better "now playing" experience, etc., while a glance forward does not.  I only know if the current track is the first on an album if it differs from the one prior (you cannot rely on tracknumber=1)

Also, your solution for user-definable is appropriate and tuned properly, not overkill.  Good idea.

For me cwb_prev would actually be more useful than cwb_next, and arguably (my dull understanding of the fb interface in question) cleaner/legal.

+Reardon

foo_cwb_hooks

Reply #114
Well, I just gotta try:  clearly you can't do things against the file itself.  But perhaps you could at least allow for a simple cwv_prev in addition to the existing cwb_next.  Cache as before.  Don't worry about iterators or indexing or arbitrary field lookup (I agree its too much and violates the whole spirit of the quick callback).  But, for me and others, a quick look back allows for proper album formatting, better "now playing" experience, etc., while a glance forward does not.  I only know if the current track is the first on an album if it differs from the one prior (you cannot rely on tracknumber=1)


What would you use this for?
There used to be a link to my website here.

foo_cwb_hooks

Reply #115
What would you use this for?


#1 usage is for proper album formatting (grouping).  Currently there is no reliable way of doing this.  With cwb_prev I can simply test whether the previous track is part of the same album as current track.  Relying on tracknumber==1 is not useful.  There are too many scenarios, some because of sorts and more often because of ad-hoc playlists, where that test is invalid for album grouping.

Secondary usage is for Now Playing stuff... allowing for the last track info to be displayed.  Just a simple way of answering the "what was that last song?" question in my main music hall, mostly for guests.

+Reardon

foo_cwb_hooks

Reply #116
#1 usage is for proper album formatting (grouping).  Currently there is no reliable way of doing this.  With cwb_prev I can simply test whether the previous track is part of the same album as current track.  Relying on tracknumber==1 is not useful.  There are too many scenarios, some because of sorts and more often because of ad-hoc playlists, where that test is invalid for album grouping.


This is not possible.  Even if I did add %cwb_prev_% variables, they would only refer to the LAST PLAYED track, not the previous track for every entry in the playlist.  What you are asking for is not possible inside a title formatting callback.
There used to be a link to my website here.

foo_cwb_hooks

Reply #117
Quote
Release 1.0.11

    * %cwb_volume%
    * %cwb_selection_duration% - in seconds
    * %cwb_activelist_duration%
    * %cwb_playinglist_duration%
    * $cwb_hms() converts a time in seconds into hh:mm:ss
    * %cwb_playback_state% - stop, play, pause
There used to be a link to my website here.


foo_cwb_hooks

Reply #119
Wow that's wonderful, thank you so much
Bye Bye status bar 

foo_cwb_hooks

Reply #120
Bye bye status bar indeed! All that's left is %cwb_activelist_locked% and %cwb_activelist_lockname%.
They call me random_n...

foo_cwb_hooks

Reply #121
* $cwb_hms() converts a time in seconds into hh:mm:ss
Could you maybe make this more universal?

I'm dreaming of: $cwb_timeconv(%variablewithseconds%,wk,dd,hh,mm,ss,nn)

so that we can have the string:

$get(wk) weeks $get(dd) days $get(hh) hours ...

I know we could do the conversion ourselves, but a) the complex code and b) probably better performance if you do the conversions...

 

foo_cwb_hooks

Reply #122
Ahm, sorry, it seems that I missed something ...

---> What is the difference from %cwb_queueindexes% to %cwb_queueindex% ...??
For me, both show the same value ...

foo_cwb_hooks

Reply #123
What is the difference from %cwb_queueindexes% to %cwb_queueindex% ...??

If an item is present 2 (or more) times in the playback queue, %cwb_queueindexes% will display all its indexes and %cwb_queueindex% will display only the first index.
You can try by adding many times the same song

foo_cwb_hooks

Reply #124
Just enqueue the same file multiple times and you will see the difference:
%cwb_queueindex% holds _one_ number - the first index of this file in the queue
%cwb_queueindexes% holds a comma seperated list of numbers - all indexes of this file in the queue
As long as the file is only enqueued once, they both hold the same value.