When you click on the button and the sorting context menu comes up, one choice in the context menu is "Reset", which resets the $sorted(field) values and brings back all of the original choices of fields to sort by (when you sort by artist, it goes away after). Why couldn't you have all of the choices (eg Artist, Album,etc) remain in the context menu after sorting by them, and adjust the values of $sorted(field) with each sorting selection?
why would you need the choices after you've used it? eg you can's sort by "artist" twice. There's another way you can sort which may be what you're after.
$button2(2,8,0,0,18,24,'$font(Wingdings 3,12,,0-0-0)u','$font(Wingdings 3,12,,255-0-0)u','FILTER:source|!source!',)
$if($filtered(genre),
$alignabs(20,2,40,16,left,top)$font(calibri,9,underline,0-0-0)genre
$alignabs(20,16,40,16,left,top)$font(,,,)$filtered(genre)
,
$button2(20,2,0,0,40,16,'$font(calibri,9,,0-0-0)genre','$font(calibri,9,,255-0-0)genre','FILTER:genre|%genre%',)
)
$if($sorted(album),
$button2(62,4,0,0,20,16,'$font(Wingdings 3,9,,255-0-0)q$font(calibri,9,,255-0-0)$sorted(album)','$font(Wingdings 3,9,,0-0-0)q$font(calibri,9,,255-0-0)$sorted(album)','SORT:album|%album%',)
,
$button2(62,4,0,0,20,16,'$font(Wingdings 3,9,,0-0-0)q','$font(Wingdings 3,9,,255-0-0)q','SORT:album|%album%',)
)
$if($filtered(decade),
$alignabs(86,2,40,16,left,top)$font(calibri,9,underline,0-0-0)decade
$alignabs(86,16,40,16,left,top)$font(,,,)$filtered(decade)
,
$button2(86,2,0,0,40,16,'$font(calibri,9,,0-0-0)decade','$font(calibri,9,,255-0-0)decade','FILTER:decade|$mul($div(%date%,10),10)',)
)
$if($sorted(date),
$button2(128,4,0,0,20,16,'$font(Wingdings 3,9,,255-0-0)q$font(calibri,9,,255-0-0)$sorted(date)','$font(Wingdings 3,9,,0-0-0)q$font(calibri,9,,255-0-0)$sorted(date)','SORT:date|%date%',)
,
$button2(128,4,0,0,20,16,'$font(Wingdings 3,9,,0-0-0)q','$font(Wingdings 3,9,,255-0-0)q','SORT:date|%date%',)
)
$if($filtered(composer),
$alignabs(152,2,50,16,left,top)$font(calibri,9,underline,0-0-0)composer
$alignabs(152,16,50,16,left,top)$font(,,,)$filtered(composer)
,
$button2(152,2,0,0,50,16,'$font(calibri,9,,0-0-0)composer','$font(calibri,9,,255-0-0)composer','FILTER:composer|%composer%',)
)
$if($sorted(composer),
$button2(204,4,0,0,20,16,'$font(Wingdings 3,9,,255-0-0)q$font(calibri,9,,255-0-0)$sorted(composer)','$font(Wingdings 3,9,,0-0-0)q$font(calibri,9,,255-0-0)$sorted(composer)','SORT:composer|%composer%',)
,
$button2(204,4,0,0,20,16,'$font(Wingdings 3,9,,0-0-0)q','$font(Wingdings 3,9,,255-0-0)q','SORT:composer|%composer%',)
)
5-Function to calculate the of number of lines of text resulting from word wrapping of given text (helpful for adjusting display to match different sized fields)
you can use $calcheight then divide by the font size.
Is there a way to add support for dynamical button position?
I want to make my progress clickable where the "already played area" acts as a seek back button and the other part, as a seek ahead button.
Right now, seek back button works, but not the other one. It seems to me the button width and height support dynamic values, but coordinates does not.
Here is my code:
$puts(pbarLength,996)
$puts(percentage,$muldiv(%_time_elapsed_seconds%,$get(pbarLength),%_time_total_seconds%))
$puts(pbarProgress,$muldiv($get(percent),1000,1000))
$button(15,3,0,0,$get(pbarProgress),3,,,'Seek back by 10 seconds',)
$button($get(pbarProgress),3,0,0,$sub($get(pbarLength),$get(pbarProgress)),3,,,'Seek ahead by 10 seconds',)
buttons have to be // PerTrack so you can't have buttons depend of // PerSecond variables. I will try to add button support to the // PerSecond section for the next version.
Ah yea, I didn't realise about the #. Any chance of this being fixed in a future version, or not do-able?
yes, eventually.
Button bug: I have a large 300x300 button overlaying some artwork. The bug seems to be that when I open up the preferences foobar box if this box is over the button I can't click anything within it and the button essentially acts through it.
the preferences buttons don't work or the trackinfo buttons?
I'm testing a simple button\rating configuration using the following code:
//Global
$puts(rating,$if(%rating%,%rating%,0))
//PerTrack
$button(3,300,0,0,13,13,images\trackinfo\rating$get(rating).png,images\trackinfo\rating1.png,r1,)
$button(3,300,13,0,13,13,images\trackinfo\rating$get(rating).png,images\trackinfo\rating2.png,r2,)
$button(3,300,26,0,13,13,images\trackinfo\rating$get(rating).png,images\trackinfo\rating3.png,r3,)
$button(3,300,39,0,13,13,images\trackinfo\rating$get(rating).png,images\trackinfo\rating4.png,r4,)
$button(3,300,52,0,13,13,images\trackinfo\rating$get(rating).png,images\trackinfo\rating5.png,r5,)
The problem is that the code never gets loaded when I open foobar and start playing a track. The only
way to get it to work is to go into my trackinfo settings and click "ok". From there on out everything
works fine.
Is there something I'm missing to get trackinfo to load my script when foobar fires up?
Thanks for any tips!
for relative paths start with a "/" character... eg "/images\trackinfo\rating$get(rating).png", etc.