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

foo_cwb_hooks

Reply #150
I do not know if it's your plugins mistake, or trackinfo_mod panels:

When I update a playlist, e.g. with foo_playlist_bind, %cwb_activelist_count% does not refresh. It does refresh if I go to another playlist and then return.

Can you fix that or ist it the trackinfo_mods job? BTW, I have notifications turned on.


It's on my end.  I will fix it.
There used to be a link to my website here.

foo_cwb_hooks

Reply #151

I do not know if it's your plugins mistake, or trackinfo_mod panels:

When I update a playlist, e.g. with foo_playlist_bind, %cwb_activelist_count% does not refresh. It does refresh if I go to another playlist and then return.

Can you fix that or ist it the trackinfo_mods job? BTW, I have notifications turned on.


It's on my end.  I will fix it.

Thank you. Can you make the trackinfo_mod refresh when time variables change AND no track is playing (you know normally it doesn't refresh when nothing happens)?

foo_cwb_hooks

Reply #152
thank you for your explinations and for your work with the plugin, its very much appreciated. Ive got one question and one request.

Q: cwb_next_user1 - how does a user define it? I feel silly asking, but im tired today, pardon.
EDIT: FOUND IT, THANKS

request: can you make a cwb_unhex function? the included hex function is useful, but in order to turn hex > regular numbers, I have to do something like this:

Code: [Select]
$puts(unhex,$pad_right(FF,6,0))

$puts(hex1,$replace($substr($get(unhex),6,6),A,10,B,11,C,12,D,13,E,14,F,15))
$puts(hex2,$mul($replace($substr($get(unhex),5,5),A,10,B,11,C,12,D,13,E,14,F,15),16))
$puts(hex3,$mul($replace($substr($get(unhex),4,4),A,10,B,11,C,12,D,13,E,14,F,15),256))
$puts(hex4,$mul($replace($substr($get(unhex),3,3),A,10,B,11,C,12,D,13,E,14,F,15),4096))
$puts(hex5,$mul($replace($substr($get(unhex),2,2),A,10,B,11,C,12,D,13,E,14,F,15),65536))
$puts(hex6,$mul($replace($substr($get(unhex),1,1),A,10,B,11,C,12,D,13,E,14,F,15),1048576))

$puts(unhex,$add($get(hex1),$get(hex2),$get(hex3),$get(hex4),$get(hex5),$get(hex6)))

$get(unhex) = $hex($get(unhex),)


Sometimes I want to 'unhex' a number so I can use arithmetic functions on it, and I cant do $add(FF,1). But $hex($add($cwb_unhex(FF),1)) would work fine. Also, its useful for unicode characters that are sometimes listed in hex: $char($cwb_unhex(41)) = $char(65) = A

thank you kindly, again, for your time and effort.

foo_cwb_hooks

Reply #153
Request:

%cwb_playinglist_index% so as to allow one to display the playlist number of the track that is playing on a given playlist, like %list_index%.

foo_cwb_hooks

Reply #154
A few ideas..
  • Media Library Values. Be able to access values such as number of songs in library, total filesize of songs in libray, total length of songs in library, most played song in library, number of artists in library, etc..
  • New String Functions. Function such as a tokenize command, for splitting up string with a common delimiter. Also, there could be a function for finding out how many times a string is in another string. Etc..
  • Filesize Function. A function which would convert bytes into another format (i.e. mb, gb, etc..), and give a precise value (to x decimal places). I.E. something like $cwb_filesize(4512345623,2,4) would result in 4303.3081 (divide by 1024 twice, to four decimal places)

foo_cwb_hooks

Reply #155
I've experienced an issue I'd like to report. I use the option "Playback follows cursor" and the variables cwb_next_*. I've got a playlist called "Library View" which is created by the albumlist panel. When I select a song in this playlist it works fine until I change for example the artist in the albumlist panel while a song is playing. The "Library View" playlist switches, I select (not playing, only selecting) a song but the cwb_next_* variables will not be updated until I really play a song from the newly created playlist. Same with the the playlist created by quicksearch component.

So whenever a playlist is modified by a component while a track is playing, the cwb_next_* variables won't change by only selecting a song from this playlist though "Playback follows cursor" is turned on.

I hope you understand, it sounds kinda complicated, but it happens all the time because I navigate a lot with the albumlist component.

I'd also like to thank you for your amazing work, great component!

foo_cwb_hooks

Reply #156
I have a small request:

Could you add a function that converts a date into "seconds since date", and a function that could complete a part of a date?

I would use this to add tags to tracks, that would usually be played in a specific time. This could be:

* Tracks that should be played in the morning
* Tracks that should be played in the evening
* Christmas songs (obviously)
* Summer songs
* Other holiday songs.

Then I assume I can use this hook with foo_skip and/or foo_autoplaylist ? 

Suppose you tagged your files with <prefdatestart> = ????-12-01 00:00:00 and <prefdateend> ????-12-25 00:00:00, it could complete the dates with the current year appended. Then a function could convert the date into seconds since, say 01-01-2000, which you could easily evaluate. Take the following pseudo code:

Code: [Select]
$puts(prefdatestart,$cwb_convertdate($cwb_completedate(%prefdatestart%)))
$puts(prefdateend,$cwb_convertdate($cwb_completedate(%prefdateend%)))
$puts(currentdate,$cwb_convertdate(%cwb_systemdatetime%))


My brain is not clear right now, i need something like $ifinbetween(), but I guess it can be accomplished by a series of $ifgreater() to evaluate whether the songs should be added or not.
Can't wait for a HD-AAC encoder :P

foo_cwb_hooks

Reply #157
@cwbowron
I don't know if this is a bug with $cwb_datediff or I'm misunderstanding its function.

Code: [Select]
System Date: %cwb_systemdatetime% $char(10)
Last played: %last_played% $char(10)
Date diff: $cwb_datediff(%cwb_systemdatetime%,%last_played%)

Renders this:


Shouldn't the date difference be 1 rather than 0?

foo_cwb_hooks

Reply #158
My brain is not clear right now, i need something like $ifinbetween(), but I guess it can be accomplished by a series of $ifgreater() to evaluate whether the songs should be added or not.


Something like this?:
Code: [Select]
$ifgreater($ifgreater(%tag%,LOWER LIMIT,%tag%,),UPPER LIMIT,,%tag%)


*untested

foo_cwb_hooks

Reply #159
metal_termite is it less then one day from your last_played field. I think it's a logical result.

foo_cwb_hooks

Reply #160
Yeah. I realized after I posted that I should have used %cwb_systemdate% instead, and truncated the time from the %last_played% tag before finding the difference in days.

foo_cwb_hooks

Reply #161
My brain is not clear right now, i need something like $ifinbetween(), but I guess it can be accomplished by a series of $ifgreater() to evaluate whether the songs should be added or not.
Something like this?:
Code: [Select]
$ifgreater($ifgreater(%tag%,LOWER LIMIT,%tag%,),UPPER LIMIT,,%tag%)
Exactly  Thanks
Can't wait for a HD-AAC encoder :P

 

foo_cwb_hooks

Reply #162
You don't need any other functions for that - that is possible right now.


foo_cwb_hooks

Reply #164
yes
just use a string like:
Code: [Select]
$if($and($greater(%cwb_systemdatetime%,%play_after%),$greater(%play_before%,%cwb_systemdatetime%),PLAY,Donot play)


But you will have to remove the year part first if you want it to work every year

foo_cwb_hooks

Reply #165
just use a string like:
Code: [Select]
$if($and($greater(%cwb_systemdatetime%,%play_after%),$greater(%play_before%,%cwb_systemdatetime%),PLAY,Donot play)


But you will have to remove the year part first if you want it to work every year
Are you sure it works with dates and not just integers?

Edit: It appearently does:
Code: [Select]
Compares two integers, tests if X>Y, intended for use with $if() and logical operators.

Anyway, I still have a problem replacing the chars. I'm missing a $for function to evaluate every char or something like that... Actually a weekday function could be nice too
Can't wait for a HD-AAC encoder :P

foo_cwb_hooks

Reply #166
a mix of request and feasibility-question:

would it be possible to "collect" tag-data from a couple of tracks depending on a certain criteria, e.g. same %album% or %directory%???

i am asking because we face f2k limitations with a good idea (from my point of view).

in this case it would be great if one could $add the %rating% based on different %track%s out of the same %album%, e.g. "cwb_compare(%tag%)"

there may be a thousand better ways to implement this than "cwb_compare(%tag%)" but as i am not that much into programming i won't post all my ideas of how one could use the outcome.

just hope the idea is easy to understand!

foo_cwb_hooks

Reply #167
that's probably not going to happen, LXtreme. it would be too much stress to do that everytime. things like this need other mechanism with caching the results custom_info's sort of way.

foo_cwb_hooks

Reply #168
that's probably not going to happen, LXtreme. it would be too much stress to do that everytime. things like this need other mechanism with caching the results custom_info's sort of way.


foo_cwb_hooks

Reply #169
Personally I'd like to do $cwb_samealbumtag(tracknumber,tag), and it'd only do it on demand.
err... i'm not using windows any more ;)

foo_cwb_hooks

Reply #170
things like this make sense in single column playlist plugin. for other uses we would need some sort of additional data structure to provide quick link from albums to album tracks with some hash table, consistency update mechanism etc ---> bug peter about this to think about it for new foobar versions in the future.

foo_cwb_hooks

Reply #171
is it normal that %cwb_next_title% doesnt work in shuffle mode? It doesnt give me the good next song.


foo_cwb_hooks

Reply #173
Hi. I'm trying to show in the track info panel the playback order. It works ok, but when I first start foobar, %cwb_playback_order% returns nothing. when i start playing then it does work.

Is this a bug? or not possible to retrieve that information at startup?

sune

foo_cwb_hooks

Reply #174
Release 1.0.14

    * update cwb_next_* variables when another playlist is activated
    * fixed missing update and notification of cwb_activelist_* on playlist changes
    * cwb_playing_index (1 based)
    * $cwb_fileexists() - returns whether a file exists. useful for determining whether albumart file exists. example: $cwb_fileexists($replace(%_path%,%_filename_ext%,)folder.jpg)
There used to be a link to my website here.