Help - Search - Members - Calendar
Full Version: foo_uie_graphical_browser
Hydrogenaudio Forums > Hosted Forums > foobar2000 > 3rd Party Plugins - (fb2k)
Pages: 1, 2, 3, 4, 5
Warchief
Kiteroa

thx,
CODE
$replace(%path%,%filename_ext%,)../cover.jpg


works fine wink.gif
BuM
hmmm.... im using $rand(10) to display no cover art pics..
i noticed that when i mouse over the pic it changes.. not a problem
my problem is im on a pos computer and its using alot of memory.

so i was thinking is there a way to load images according to First Letter of album or something similar?

exp: $if(%artist%, First Letter T, NoCover2.jpeg,First Letter M, NoCover5.jpeg)


Edit: I Figgered a work around... I have the $rand() Looking inside the code instead of looking tho my computer.

CODE
$puts(nocover0,C:\Program Files\Foobar\images\NoCover2\nocover0.jpeg)
$puts(nocover1,C:\Program Files\Foobar\images\NoCover2\nocover1.jpeg)
$puts(nocover2,C:\Program Files\Foobar\images\NoCover2\nocover2.jpeg)
$puts(nocover3,C:\Program Files\Foobar\images\NoCover2\nocover3.jpeg)
$puts(nocover4,C:\Program Files\Foobar\images\NoCover2\nocover4.jpeg)
$puts(nocover5,C:\Program Files\Foobar\images\NoCover2\nocover5.jpeg)
$puts(nocover6,C:\Program Files\Foobar\images\NoCover2\nocover6.jpeg)
$puts(nocover7,C:\Program Files\Foobar\images\NoCover2\nocover7.jpeg)
$puts(nocover8,C:\Program Files\Foobar\images\NoCover2\nocover8.jpeg)
$puts(nocover9,C:\Program Files\Foobar\images\NoCover2\nocover9.jpeg)
$puts(nocover10,C:\Program Files\Foobar\images\NoCover2\nocover10.jpeg)
$puts(nocover11,C:\Program Files\Foobar\images\NoCover2\nocover11.jpeg)
$puts(nocover12,C:\Program Files\Foobar\images\NoCover2\nocover12.jpeg)

$draw_image(0,0,$eval(%gb_width%),$eval(%gb_width%),
$if($cwb_fileexists($replace(%path%,%filename_ext%,)folder.jpeg),
$replace(%path%,%filename_ext%,)folder.jpeg,
$if($cwb_fileexists($replace(%path%,%filename_ext%,)folder.jpg),
$replace(%path%,%filename_ext%,)folder.jpg,

$get(nocover$rand(12))

)),
255,nokeepaspect)


If any1 has a better way plz let me know but with my basic skillz thats what i got smile.gif
Zarkon
Whenever I need "sufficiently random" numbers, I use a combination of the mod/length functions, as in
CODE
$mod($len(%album artist%%album%),###)


I know others have used the $crc32 function to similar effect.
BuM
ok Ty smile.gif i havnt played with the $mod or $len yet and never heard of $crc32, ill tinker around and see what i can get
thuan
@BuM: in your code, you should use $select instead of using a bunch of custom variables. It's faster and has less overhead. The mod len combi is a little faster but the variation is worse than crc32. I don't know how $rand is implemented in foobar but anyway crc32 calculation time is proportion to length of strings so more often than not I think $rand is faster especially in case the pool is small like yours.
buktore
New version is out.

From the change log, there's %gb_isplaying% command (among others) which may make some of you really happy. biggrin.gif
thuan
Yeah, me included, but this new version has so much more to be happy with. It's just getting better and better.

@Keikonium: I've sent you the new readme.
Kiteroa
Thanks for a great update - I love the per-track pop-up and am using it already!


thuan
Updated config:
IPB Image

Require graphical browser rev010
Images required:
Play icon
Glare image
Put those images into foobar components folder, or any other places you like. In this case, you need to change the path for these images.

Prominent changes: all are in popup rendering:
* Half transparent popup background frame.
* Display currently playing song in popup of the currently playing item.
* Total length of item and total played times.
* Arithmetic mean album rating. Later, I might be able to do weighted mean album rating (using play_count statistic) with future version of this component.

Settings:
IPB Image

As before, you have some freedom with item size and popup size. For item size, horizontal size is about double of vertical size. And for popup size, vertical size is bigger (about 40 pixels is best) than horizontal size. Remember that, if you set those sizes too small, everything will be out of order. But with suitable size, my code will automatically set itself in fine.

Item code:
CODE
//cover sources, if you add more sources please add more $draw_image functions below
$puts(cpath1,$replace(%path%,%filename_ext%,*))
$puts(cpath2,$replace(%path%,%directory%\%filename_ext%,*))

//no cover source, remember to change this if needed
$puts(nocover,components\default.png)

//other image sources
$puts(glareImage,components\glareyo0.png)
$puts(playIcon,components\Play-icon256-by-nagaya.png)

//font settings
$puts(fontName,Segoe UI)
$puts(fontSize,9)
$puts(fontStyle1,)
$puts(fontStyle2,i)

//dimensions and positions of objects
$puts(itemW,$eval(%gb_width%-1))
$puts(itemH,$eval(%gb_height%-1))
$puts(frameD,$eval(%gb_height%-8))
$puts(frameCu,$eval(%gb_height%/30))
$puts(coverD,$eval($get(frameD)-4))
$puts(textX,$eval($get(frameD)+7))
$puts(textW,$eval(%gb_width%-$get(textX)-4))
$puts(textH,$eval(%gb_height%-20))
$puts(subitem_countY,$eval($get(textH)+6))
///////////////////////////////////

$if(%gb_focused%,
$set_pen(44-98-139)
$draw_rect(0,0,$get(itemW),$get(itemH))
$gp_set_brush(255-109-182-221,0,%gb_height%,0-255-255-255,0,0)
$gp_fill_rectangle(1,1,$eval(%gb_width%-2),$eval(%gb_height%-2)),
$set_brush(240-240-240,cross)
$fill_rect(0,0,%gb_width%,%gb_height%)

$select($add($mod(%gb_item_index%,2),1),
$gp_set_brush(100-200-200-200),
$gp_set_brush(100-240-240-240)
)
$gp_fill_rectangle(0,0,%gb_width%,%gb_height%)
)

$set_pen(0-0-0)
$set_brush(0-0-0)
$round_rect(5,4,$get(frameD),$get(frameD),$get(frameCu),$get(frameCu))

//add more cover sources here
$if3(
$draw_image(7,6,$get(coverD),$get(coverD),$get(cpath1),255,nokeepaspect),
$draw_image(7,6,$get(coverD),$get(coverD),$get(cpath2),255,nokeepaspect),
$draw_image(7,6,$get(coverD),$get(coverD),$get(nocover),255,nokeepaspect)
)

$draw_image(7,6,$get(coverD),$get(coverD),$get(glareImage),50,nokeepaspect)

$if(%gb_isplaying%,
$draw_image(7,6,$get(coverD),$get(coverD),$get(playIcon),128)
)

$set_font($get(fontName),$get(fontSize),$get(fontStyle1))
$draw_text(%gb_group%,$get(textX),6,$get(textW),$get(textH),right,wordbreak,end_ellipsis)
$set_font($get(fontName),$get(fontSize),$get(fontStyle2))
$draw_text($add(%gb_item_index%,1)/%gb_item_count% %gb_track_count%
$ifgreater(%gb_track_count%,1, tracks, track),
$get(textX),$get(subitem_countY),$get(textW),12,right,singleline,bottom)

$if(%gb_mouse_over%,
$gp_set_brush(128-255-255-255,0,0,0-255-255-255,%gb_width%,%gb_height%)
$gp_fill_rectangle(0,0,%gb_width%,%gb_height%)
)


Popup code:
CODE
//cover sources, if you add more sources please add more $draw_image functions below
$puts(cpath1,$replace(%path%,%filename_ext%,*))
$puts(cpath2,$replace(%path%,%directory%\%filename_ext%,*))

//no cover source, remember to change this if needed
$puts(nocover,components\default.png)

//Font settings for artist display
$puts(aFontName,Segoe Print)
$puts(aFontSize,9)
$puts(aFontStyle,)

//Font settings for item info
$puts(iFontName,Arial)
$puts(iFontSize,9)
$puts(iFontStyle,)

//Dimensions
$puts(coverD,$eval(%gb_width%-8))
$puts(textY,$eval($get(coverD)+6))
$puts(textH,$eval(%gb_height%-$get(textY)-2))
$puts(textW,$eval(%gb_width%-4))
$puts(infoY,$eval(%gb_width%-24))

//Album rating calculation
$puts(temp,$muldiv($sum('%rating%'),100,%gb_track_count%))
$puts(aRating,
$ifgreater($get(temp),449,5,
$ifgreater($get(temp),349,4,
$ifgreater($get(temp),249,3,
$ifgreater($get(temp),149,2,
$ifgreater($get(temp),49,1,
0
)
)
)
)
)
)
//////////////////////////////////////

$gp_set_brush(128-128-128-128)
$gp_fill_rectangle(0,0,%gb_width%,%gb_height%)
$gp_set_pen(255-0-0-0,1)
$gp_draw_rectangle(0,0,$eval(%gb_width%-1),$eval(%gb_height%-1))

//add more cover sources here
$if3(
$draw_image(4,4,$get(coverD),$get(coverD),$get(cpath1),255),
$draw_image(4,4,$get(coverD),$get(coverD),$get(cpath2),255),
$draw_image(4,4,$get(coverD),$get(coverD),$get(nocover),255)
)

$gp_set_font($get(aFontName),$get(aFontSize),$get(aFontStyle))
$gp_set_pen(255-255-255-255,3,,bevel)
$gp_set_brush(255-0-0-0)
$gp_set_string_format(center,center,ellipsis_word)
$gp_set_smoothing_mode(1)
$gp_draw_string_path($if(%album artist%,by %album artist%,Unknown Artist),12,,0,$get(textY),$get(textW),$get(textH)),

$gp_set_font($get(iFontName),$get(iFontSize),$get(iFontStyle))
$gp_set_string_format(far,center)
$gp_draw_string_path(%gb_length% #$sum('%play_count%'),12,,4,$get(infoY),$get(coverD),20)

$gp_set_string_format(near,center)
$gp_draw_string_path(
$repeat(★,$get(aRating))
$repeat(☆,$sub(5,$get(aRating)))
,12,,4,$get(infoY),$get(coverD),20)


If you're using WinXP, you need to have East Asian languages support. Those rating star characters need it.
IPB Image

Per track (Popup) code:
CODE
//Font settings for playing track
$gp_set_font(Tahoma,9,b)
$gp_set_pen(128-255-255-255,3,,bevel)
$gp_set_brush(255-0-0-0)
$gp_set_smoothing_mode(1)
$gp_set_string_format(center,near)
//////////////////////////////////////

$if(%gb_isplaying%,
$set_org(6,6)
$gp_draw_string_path([%tracknumber%. ]%title%,12,,0,0,$eval(%gb_width%-12),$eval(%gb_width%-32))
)


Lastly, I want to thank the developer of this component again. All of this wouldn't have been possible, if he hadn't started it.

EDIT: Add one to %gb_item_index%.
EDIT2: Fix some mistakes and add rounded rating.
BuM
Looking Good thuan, Thank you and every1 else for posting ur configs.
for ppl that learn from seeing(like me) it really helps biggrin.gif
larryT

Hi,


with the last version, 0.10, it's not possible to desactivate the graphical browser scroll bar.

It was desactivable with the 0.9 version :

right click > settings > bottom right :

- show scroll bar
- scroll by a multiple of scroll size
- scroll size

no more choice ?
thuan
Those settings are in the Others Tab beside Draw Tab. Look at the 2nd picture in my previous post.
larryT
QUOTE(thuan @ Mar 10 2008, 10:02) *

Those settings are in the Others Tab beside Draw Tab. Look at the 2nd picture in my previous post.



oh yeah !!!!

I'm stupid !!! or, may be, becoming too old.......

Thanks, thuan.
cristox
Thanks for this great component!

But what is the function of the "transparent mode" checkmark in the options dialog?
Keikonium
Does anyone know how to get the track list of an album to display in the popup? I can get the currently playing track, but I want them all... Kinda like in this image: http://foobar2000.xrea.jp/up/files/up808.jpg

Also, rev011 is out if anyone hasn't updated yet smile.gif. http://www.tv2ch.info/fb2k/
Kiteroa
QUOTE(Keikonium @ Mar 11 2008, 12:16) *

Does anyone know how to get the track list of an album to display in the popup? I can get the currently playing track, but I want them all... Kinda like in this image: http://foobar2000.xrea.jp/up/files/up808.jpg


This works for me:
CODE

$set_org(0,$mul(12,%gb_track_index%))
$if(%gb_isplaying%,$gp_set_brush(255-0-255-0),$gp_set_brush(255-0-0-0))
$gp_set_font(Tahoma,9)
$gp_set_string_format(near,near,ellipsis_word)
$gp_draw_string(%gb_playlist_number% $add(%gb_track_index%,1). %title%,0,0,%gb_width%,15)


Make sure you have "maximum tracks processed by "Per Track" set suitably high on the Others tab.


To the developer - thanks again!

I'm still getting a problem with albums with the same name where all the tracks appear under the first listing for the album - even though the tracks are in different parts of the playlist. Could you fix it so that the tracks for an album group only show only under that album?

Also, I'd love to be able to fix the display to a particular named playlist - not just the active playlist which I keep changing all the time!
Keikonium
Ah! My problem was that I had the tracks processed by // PerTrack was set to 0 lol. Thanks Kiteroa happy.gif.

Also, I don't know if anyone else noticed this, but when you type a $ and wait a couple seconds, a box will pop up with the possible variables you can use... REALLY awesome.
thuan
QUOTE(cristox @ Mar 11 2008, 02:42) *

But what is the function of the "transparent mode" checkmark in the options dialog?

Read the readme I translated in the first post. Basically, with it, you can set different transparent levels for each object you draw using GDI+. My config uses that, too.

QUOTE(Kiteroa @ Mar 11 2008, 07:07) *
QUOTE(Keikonium @ Mar 11 2008, 12:16) *

Does anyone know how to get the track list of an album to display in the popup? I can get the currently playing track, but I want them all... Kinda like in this image: http://foobar2000.xrea.jp/up/files/up808.jpg


This works for me:
CODE

$set_org(0,$mul(12,%gb_track_index%))
$if(%gb_isplaying%,$gp_set_brush(255-0-255-0),$gp_set_brush(255-0-0-0))
$gp_set_font(Tahoma,9)
$gp_set_string_format(near,near,ellipsis_word)
$gp_draw_string(%gb_playlist_number% $add(%gb_track_index%,1). %title%,0,0,%gb_width%,15)


Make sure you have "maximum tracks processed by "Per Track" set suitably high on the Others tab.

And here is a code snippet to draw dynamically height popup:
CODE

$puts(recH,$add($mul(%gb_track_count%,18),46)) //46 is the static part and 18 is verticle size of each line.
//then draw a rec or whatever using the appropriate function
$draw_rect(0,0,$eval(%gb_width%-1),$get(recH))

I have tried to mimic that up808 popup config, it's pretty easy to write. The problem is with it, you have to set a very high value for vertical popup size (to accommodate long item). This pose a problem, with my vertical scroll config (unlike his is a horizontal one and drawn at upper of the screen), that is sometimes with lower item that has little tracks in it, the popup appears at the upper of the screen and not beside the mouse which looks really weird crying.gif . I have also think of a dynamic horizontal size popup with multiple tracklist columns on it. It's feasible, will do that later when I have the time.
QUOTE(Kiteroa @ Mar 11 2008, 07:07) *
I'm still getting a problem with albums with the same name where all the tracks appear under the first listing for the album - even though the tracks are in different parts of the playlist. Could you fix it so that the tracks for an album group only show only under that album?

This is actually hard to fix consider how this component works (grouping item by group titleformat which return group strings). You should do something with your group titleformat yourself or the tag of particular items to return different group strings. It can be fixed with some workaround on his side but oh well, I think this is more of a problem of your group string titleformat. Why not group items which return the same group string together?
QUOTE(Kiteroa @ Mar 11 2008, 07:07) *
Also, I'd love to be able to fix the display to a particular named playlist - not just the active playlist which I keep changing all the time!

I have mailed the developer about this, he said that this will likely be implimented when he has the time, please be patient.
nightfishing
QUOTE(Kiteroa @ Mar 10 2008, 19:07) *


This works for me:
CODE

$set_org(0,$mul(12,%gb_track_index%))
$if(%gb_isplaying%,$gp_set_brush(255-0-255-0),$gp_set_brush(255-0-0-0))
$gp_set_font(Tahoma,9)
$gp_set_string_format(near,near,ellipsis_word)
$gp_draw_string(%gb_playlist_number% $add(%gb_track_index%,1). %title%,0,0,%gb_width%,15)





I cannot seem to change the font color of the tracklist. Can I get a little help? Either it can't be done, or I am just overlooking something..whatever I do the font color stays constant.

TIA
thuan
Change the $gp_set_brush parameter to change the color of text drawn by $gp_draw_string function. In this code the first one is color for playing song and the 2nd is for other songs.
Hakubo
Wow, revision 11 introduces keyboard letter navigation. smile.gif
Not quite what I expected (different from Album list and Filter), but still great. Thanks to the developer.
SmilerSmiles
Rev 12 now out.
thuan
Changelog:
2008/03/11 rev012
Fixed - Resource fatal leak.
Added - Image cache options.
The new image cache option (default) does not purges the cache when you change playlists and it has an upper limit compares to the old way.
Keikonium
rev013 is now out. Looks like it fixed some selection, and GDI Bugs.
Falstaff
QUOTE(Keikonium @ Mar 11 2008, 18:57) *

rev013 is now out. Looks like it fixed some selection, and GDI Bugs.


Some display bugs when playing with the option 'Image Cache' (vertical shift of picture of 1 or 2 pixels)

but ok with Old cache mode smile.gif

So, here is just a try inspired by Delicious Library style :

IPB Image

what about this gb layout ?
Keikonium
That looks aweeeesome!! Good job smile.gif.
nightfishing
Feature request: could it be possible to activate the popup with middle click and not have it popup on mouse over?

Great project, the adjustable image cache is a nice addition.
Falstaff
QUOTE(Keikonium @ Mar 11 2008, 22:28) *

That looks aweeeesome!! Good job smile.gif.


thanks, i'll make a complete config with this (i've to complete the actual one i'm working on)
thuan
I have an idea, that I haven't mailed him, yet. It's kinda complicated to implement but if it is indeed implemented, you won't need a playlist to compliment this component anymore. That is, a left click on item will bring up a drop down popup (kinda like the drop down auto complete in the code section of this component) that lists tracks in that item and you can click on any track in the popup to play. What do you guys (and gals) think?

@BTW: Falstaff, could you upload your images used in your latest config somewhere, some of my friends are bugging me to create something similar. I'm good at imitating but not good with creating pictures (more like I haven't done anything much into image manipulation). Thanks in advance, your config looks cool.
Keikonium
QUOTE(thuan @ Mar 11 2008, 20:06) *

I have an idea, that I haven't mailed him, yet. It's kinda complicated to implement but if it is indeed implemented, you won't need a playlist to compliment this component anymore. That is, a left click on item will bring up a drop down popup (kinda like the drop down auto complete in the code section of this component) that lists tracks in that item and you can click on any track in the popup to play. What do you guys (and gals) think?

@BTW: Falstaff, could you upload your images used in your latest config somewhere, some of my friends are bugging me to create something similar. I'm good at imitating but not good with creating pictures (more like I haven't done anything much into image manipulation). Thanks in advance, your config looks cool.



I emailed him on the third of march with the exact same idea. I didn't receieve any response back. I think he may have misunderstood my request because he seemed to add the // PerTrack stuff after my email, but then again I didn't really explain myself very well. But I think it would be amazing if it were added to this component.

This was my email:

QUOTE
It would be awesome to right click on an entry, and have the tracks from that playlist be shown in a little popup window. Just like the current popup window, but interactive.

それは記入項目で右クリックするために驚くばかりであってその再生リストからのトラックを小さくポップアップな窓で示してもらう。ちょうど現在のポップアップな窓のように、しかし相互。
Kiteroa
QUOTE(Keikonium @ Mar 12 2008, 14:36) *

QUOTE(thuan @ Mar 11 2008, 20:06) *

I have an idea, that I haven't mailed him, yet. It's kinda complicated to implement but if it is indeed implemented, you won't need a playlist to compliment this component anymore. That is, a left click on item will bring up a drop down popup (kinda like the drop down auto complete in the code section of this component) that lists tracks in that item and you can click on any track in the popup to play. What do you guys (and gals) think?

@BTW: Falstaff, could you upload your images used in your latest config somewhere, some of my friends are bugging me to create something similar. I'm good at imitating but not good with creating pictures (more like I haven't done anything much into image manipulation). Thanks in advance, your config looks cool.



I emailed him on the third of march with the exact same idea. I didn't receieve any response back. I think he may have misunderstood my request because he seemed to add the // PerTrack stuff after my email, but then again I didn't really explain myself very well. But I think it would be amazing if it were added to this component.

This was my email:

QUOTE
It would be awesome to right click on an entry, and have the tracks from that playlist be shown in a little popup window. Just like the current popup window, but interactive.

それは記入項目で右クリックするために驚くばかりであってその再生リストからのトラックを小さくポップアップな窓で示してもらう。ちょうど現在のポップアップな窓のように、しかし相互。




Great idea. Rather than hardcode in a play option, hopefully it would be just as easy to code to allow the actions to be chosen on the preferences menu. That way different people could get the click(s) on the track to do different things (e.g. send to queue, play, send to playlist etc.).
nightfishing
I'm sure I am not the only one doing something similar to this, but, I have it set up to popup back covers on hover.

Nice organic way to pull track listings ;-)

I have the popup delay set quite high and would prefer to be able to do this with a middle/single click instead of thru hovering.
BuM
WoWzEr.... Leave for a day and 4 new versions come out l0l just downloaded v13 and it has colors!!!

@Keikonium hope ur telling them how much every1 is loving this component in thos emails tongue.gif
krondor
HI!!...someone help me!!!
..my config use the per-track popup and show all the tracks of a disc on mouse hover...but i'll be very happy if the popup shows the tracks lenghts too (mm:ss) like this: http://foobar2000.xrea.jp/up/files/up808.jpg
...and with automatic vertical resize too pleaseeeee..

this is my per track conf:

$set_org(4,$mul(14,%gb_track_index%))
$if(%gb_isplaying%,$gp_set_brush(255-255-0-0),$gp_set_brush(255-0-0-0))
$gp_set_font(Tahoma,9)
$gp_set_string_format(near,ellipsis_word)
$gp_draw_string($add(%gb_track_index%,1). %title%,0,44,%gb_width%,15)


Somebody modify this to me please.., cause' i don't know to much about code...

Thank you!!.wink.gif
oScARSh
Great Plugin!Thanks!

I'd tried it out :

IPB Image
bowen_tk
I am really interest to add the track of the album in my Pop up config.
How do you do this please ?

Edit I have found...

How can I make that the pop up adapt itself to the number of song? and that the tex which is too long was cut because i try this but it doesn't work

CODE
//Dimensions  
$puts(textY,$eval(%gb_height%/2))
$puts(textH,$eval(%gb_height%-$get(textY)-2))
$puts(textYY,$eval(%gb_height%/2-50))
//Font setting for artist display  
$gp_set_font(Segoe Print,12)
$gp_set_brush(255-255-255-255)
$gp_fill_rectangle(0,0,%gb_width%,%gb_height%)
$gp_set_pen(255-0-0-0,1)
$gp_draw_rectangle(0,0,$eval(%gb_width%-1),$eval(%gb_height%-1))
$gp_set_brush(255-18-18-18)
$gp_set_text_rendering_hint(ct)
$gp_set_string_format(center,end_ellipsis)
$if(%album%,
$gp_draw_string(%album%,0,0,%gb_width%,$get(textH)),
Unknown Album
)
$gp_set_font(Segoe Print,9)
$if(%album artist%,
$gp_draw_string(by %album artist%,0,20,%gb_width%,$get(textH)),
Unknown Artist
)


Thanks by advance
Varluche
Hi all,
Please forgive my silly question but I am a newbie to this plugin and I just cannot make it work. I am using the default code supplied with the latest version of graphical browser. I get small blue squares displayed, with album's name in the middle, but no picture at all in each square. All album arts in my collection are folder.jpg files that I stored in each album folder.
Did I miss something ?
What should I do to make it work ?
Thank you for your help.
buktore
You have to draw them yourself.

Try this basic one. Place it on first line.

$draw_image(0,0,%gb_width%,%gb_height%,$replace(%path%,%filename_ext%,folder.jpg),255,nokeepaspect)

I suggest if you don't know how to config them, Just copy someone else config. thuan config is pretty nice.
thuan
@krondor
Per track popup code with length
CODE

$set_org(4,$mul(15,%gb_track_index%))
$if(%gb_isplaying%,$gp_set_brush(255-255-0-0),$gp_set_brush(255-0-0-0))
$gp_set_font(Tahoma,9)
$gp_set_string_format(near,near)
$gp_draw_string($add(%gb_track_index%,1). %title%,0,44,$eval(%gb_width%-40),15)
$gp_draw_string(%length%,$eval(%gb_width%-38),44,36,15)

You didn't give your popup code, so I can't really help you with dynamic vertical size popup.

@bowen_tk
CODE
//Dimensions (46 is the static part for album and artist size, change 15 to your desired track height size)
$puts(popupH,$eval(15*%gb_track_count%+46))
////////////////////////////////////

$gp_set_font(Segoe Print,12)
$gp_set_brush(255-255-255-255)
$gp_fill_rectangle(0,0,%gb_width%,$get(popupH))
$gp_set_pen(255-0-0-0,1)
$gp_draw_rectangle(0,0,$eval(%gb_width%-1),$eval($get(popupH)-1))
$gp_set_brush(255-18-18-18)
$gp_set_text_rendering_hint(aa)
$gp_set_string_format(center,near,ellipsis_word)
$gp_draw_string($if2(%album%,Unknown Album),0,0,%gb_width%,22)
$gp_set_font(Segoe Print,9)
$gp_draw_string($if(%album artist%,by %album artist%,Unknown Artist),0,24,%gb_width%,20)

You need to select transparent mode check box in Others Tab of this panel settings. When in this mode, you have to use $gp_set_text_rendering_hint(aa) if you draw string using $gp_draw_string and $gp_set_smoothing_mode(1) if you draw string using $gp_draw_string_path to have acceptable string rendering.

Edit: I added some small changes to my config.
radecke
this is what i did with this plugin:

IPB Image

i really love it, thanks smile.gif

one request would be to define the height of the popup in dependency of the number of tracks and to make the tracks in the popup clickable.
krondor
Thank you so much THUAN !!!!!!!.biggrin.gif

This is my Popup code (to do autosize): 380x330 (now static size)

$gp_set_brush(255-247-255-223,$div(%gb_width%,2),0,255-211-241-255,$div(%gb_width%,2),%gb_height%)
$gp_fill_rectangle(0,0,%gb_width%,%gb_height%)
$gp_set_pen(255-0-80-255,2)
$gp_draw_rectangle(0,0,%gb_width%,%gb_height%)
$gp_set_text_rendering_hint(aa)

$set_font(Tahoma,10,b)
$draw_text(%gb_group%,0,0,%gb_width%,%gb_height%,wordbreak)



Now i put the transparency enabled.., how can i do less transparent??...cause' some whited-light backgrounds 'cover' the popup letters and the words disappear...

Thanks in advance..!!
thuan
@krondor:
Popup code:
CODE
//Dimensions
$puts(itemH,$eval(15*%gb_track_count%+46))
//////////////////////////////

$gp_set_brush(255-247-255-223,$div(%gb_width%,2),0,255-211-241-255,$div(%gb_width%,2),$get(itemH))
$gp_fill_rectangle(0,0,%gb_width%,$get(itemH))
$gp_set_pen(255-0-80-255,2)
$gp_draw_rectangle(1,1,$eval(%gb_width%-2),$eval($get(itemH)-2))

$gp_set_brush(255-0-0-0)
$gp_set_font(Tahoma,10,b)
$gp_set_string_format(near,near,ellipsis_word)
$gp_set_text_rendering_hint(aa)
$gp_draw_string(%gb_group%,4,4,%gb_width%,36)


Per track popup code:
CODE
$set_org(4,$mul(15,%gb_track_index%))
$if(%gb_isplaying%,$gp_set_brush(255-255-0-0),$gp_set_brush(255-0-0-0))
$gp_set_font(Tahoma,9)
$gp_set_string_format(near,near)
$gp_set_text_rendering_hint(aa)
$gp_draw_string($add(%gb_track_index%,1). %title%,0,42,$eval(%gb_width%-38),15)
$gp_draw_string(%length%,$eval(%gb_width%-38),42,36,15)


Popup transparency should be 255 and Transparent mode need to be enabled. Set the vertical size of popup to a suitable height to accommodate long album (this has its downfall if set too long as I have said in one of my previous posts).
bowen_tk
thanks thuan.
I need a bit more help

CODE
$set_org(4,$mul(14,%gb_track_index%))
$if(%gb_isplaying%,$gp_set_brush(255-255-0-0),$gp_set_brush(255-0-0-0))
$gp_set_font(Tahoma,9)
$gp_set_text_rendering_hint(aa)
$gp_set_string_format(near,ellipsis_word)
$gp_draw_string($add(%gb_track_index%,1). %title%,0,50,%gb_width%,40)


Here is my popup per track code?
How can I make that if the title is too long it cut it and not put it on two lines

Thanks in advance
nightfishing
QUOTE(bowen_tk @ Mar 15 2008, 21:19) *



Here is my popup per track code?
How can I make that if the title is too long it cut it and not put it on two lines

Thanks in advance


$gp_draw_string($add(%gb_track_index%,1). $cut(%title%,15),0,50,%gb_width%,40)

adjust the "15" to fit your display

krondor
Thuan: beer.gif w00t.gif wub.gif laugh.gif emot-haw.gif wink.gif
thuan
@bowen_tk
CODE
$set_org(4,$mul(14,%gb_track_index%))
$if(%gb_isplaying%,$gp_set_brush(255-255-0-0),$gp_set_brush(255-0-0-0))
$gp_set_font(Tahoma,9)
$gp_set_text_rendering_hint(aa)
$gp_set_string_format(near,near,ellipsis_word)
$gp_draw_string($add(%gb_track_index%,1). %title%,0,50,%gb_width%,14)

You should have read the readme I translated on the first post.

EDIT: A little too slow, but my code should be better behave than nightfishing's IMHO.

EDIT2: @radecke: I and my friend have come up with a very detail use case of your 2nd request (interactive popup) and sent it to the developer. He said he will consider it. As for your other request I think a better way to realize it is to detect the area which you have drawn then draw the popup accordingly. Your idea is a little hard to implement both for us and him, I think.
bowen_tk
So many thanks for your fast answer and your help

I will better read the readme
radecke
QUOTE(thuan @ Mar 16 2008, 03:32) *

EDIT2: @radecke: I and my friend have come up with a very detail use case of your 2nd request (interactive popup) and sent it to the developer. He said he will consider it. As for your other request I think a better way to realize it is to detect the area which you have drawn then draw the popup accordingly. Your idea is a little hard to implement both for us and him, I think.

sounds good
Varluche
QUOTE(buktore @ Mar 15 2008, 06:52) *

You have to draw them yourself.

Try this basic one. Place it on first line.

$draw_image(0,0,%gb_width%,%gb_height%,$replace(%path%,%filename_ext%,folder.jpg),255,nokeepaspect)

I suggest if you don't know how to config them, Just copy someone else config. thuan config is pretty nice.

Thanks Buktore, your code line is working fine.
One more question please : Everytime I doubleclick an album cover to play the album, picture disapppears and I get a blue square in its place. What's up ?! Thanks.
thuan
new version out. readme is below.

@Keikonium: put this at the front page please.
CODE
Graphical Browser

● What this component does:
Album cover browser for the active playlist.


● Caution
Settings are per panel so if you delete a panel, the settings for that panel
also disappear.


● Sort
Blank → Whatever works.
* → Sorted by grouped strings.

If you want to arrange in the same order as the playlist → $num(%gb_playlist_number%,10)


● Popup
Transparent mode
You can apply different level of transparence to every pixel. (e.g.: transparent background
with full opacity image and text.)
I think that GDI can't be used, please use GDI+ only.
Even with GDI+, text rendering without using $gp_set_text_rendering_hint(aa) doesn't look
good enough.

Per track
Draw order:
Popup → Per track(0) → Per track(1) → ...
Rendering settings (e.g.: pen, brush, font, ...) can't be set again midway.


● Image cache methods
Old
rev011 and older way. Cache images of all items.
Image cache is purged when switching playlist.

Default
Cache images to the set size.
Image cache is not purged when switching playlist.
If the image cache reach the limit, it will be purged.


● Variables
%gb_group%
[Item], [Popup], [Per track(Popup)]
Return the group string. E.g.: If you used $if2(%album%,@skip) to group,
it will return %album%.

%gb_width%
[Item]
Item width
[Popup], [Per track(Popup)]
Popup width

%gb_height%
[Item]
Item height
[Popup], [Per track(Popup)]
Popup height

%gb_focused%
[Item], [Popup], [Per track(Popup)]
Check whether focus is on the item or not

%gb_mouse_over%
[Item]
Check whether mouse cursor is on the item or not
[Popup], [Per track(Popup)]
Probably always true

%gb_item_index%
[Item], [Popup], [Per track(Popup)]
Return item index

%gb_item_count%
[Item], [Popup], [Per track(Popup)]
Return item count

%gb_track_count%
[Sort], [Item], [Popup], [Per track(Popup)]
Return number of songs in an item

%gb_playlist_number%
[Sort], [Item], [Popup]
Return position of song in playlist for the first song in an item
[Per track(Popup)]
Return position of song in playlist

%gb_col%
[Item], [Popup], [Per track(Popup)]
Return item column number

%gb_row%
[Item], [Popup], [Per track(Popup)]
Return item row number

%gb_col_count%
[Item], [Popup], [Per track(Popup)]
Return number of columns

%gb_row_count%
[Item], [Popup], [Per track(Popup)]
Return number of rows

%gb_isplaying%
[Item], [Popup]
Return true if a song in the item is playing
[Per track (Popup)]
Return true if it is playing

%gb_track_index%
[Per track (Popup)]
Position of track in item (O based)

%gb_length%
[Sort], [Item], [Popup], [Per track(Popup)]
Total length of item/track

%gb_length_seconds%
[Sort], [Item], [Popup], [Per track(Popup)]
Total length in seconds of item/track

%gb_calc_x%
%gb_calc_y%
%gb_calc_width%
%gb_calc_height%
[Item], [Popup], [Per track(Popup)]
Dimension calculations
Values change with functions below
$calc_text
$gp_calc_string
$gp_calc_string_path
$draw_image


● About functions:
Functions are divided into GDI and GDI+. They are different in pens, brushes and points.
For GDI, to set color with "r-g-b", use a base 10 number for each color component;
otherwise use base 16 number with "rrggbb". For GDI+, to set color with "a-r-g-b",
use a base 10 number for each color component and alpha channel; otherwise use
base 16 number with "aarrggbb". If you want to draw some thing with transparency
or effects like anti-aliasing, use GDI+. Some fonts (probably OpenType fonts with
PostScript outline) can't be used in GDI+ mode. Full-width hyphen can't be
displayed right in GDI+ mode.


● GDI function
$set_font(name,size,style)
Set font
name - font name
size - font size
style - style
Set multiple styles by combining options
"b" - bold
"i" - italic
"u" - underline
"s" - strikethrough

$set_font_color(color)
Set font color
color - color

$draw_text(str,x,y)
Draw text
str - string
x - start point x coordinate
y - start point y coordinate

$draw_text(str,x,y,width,height,[option1],[option2],...)
Draw text within the set limit
str - string
x - start point x coordinate
y - start point y coordinate
width - drawing width
height - drawing height
option - other option
"bottom" - draw at bottom, needs singleline
"center" - center aligned
"end_ellipsis" - if out of limit, append "...."
"left" - left aligned
"noclip" - no clip, same as no settings for width and height
"path_ellipsis" – like end_ellipsis but used for file path
"right" – right aligned
"singleline" - display with 1 line
"top" - draw at top
"vcenter" - vertical center aligned, needs singleline
"wordbreak" - display with multiple lines
"word_ellipsis" - truncates any word that does not fit in the
rectangle and adds ellipsis.
Details at http://msdn2.microsoft.com/en-us/library/ms533909.aspx

$calc_text(str)
$calc_text(str,width,height,[option1],[option2],...)
Calculate size of str when drawn.
Arguments are the same as $draw_text except x and y.
Use %gb_calc_*% to obtain values after this function.

$set_pen(color)
$set_pen(color,width)
$set_pen(color,width,style)
Pen settings
color - color
width - width[1], only effective when using "solid" style
style - style["solid"]
"solid" - solid line
"dash" - dashed line
"dot" - dotted line
"dashdot" - line with alternating dashes and dots
"dashdotdot" - line with alternating dashes and double dots
Details at http://msdn2.microsoft.com/en-us/library/m...467(VS.85).aspx

$set_brush(color)
$set_brush(color,style)
Brush settings
color - color
style - style: if it is not set, then brush is solid
"bdiagonal" - A 45-degree upward, left-to-right line pattern
"cross" - Horizontal and vertical cross pattern
"diagcross" - 45-degree cross pattern
"fdiagonal" - A 45-degree downward, left-to-right line pattern
"horizontal" - Horizontal line pattern
"vertical" - Vertical line pattern

$draw_rect(x,y,width,height)
Draw rectangle using pen
x - start point x coordinate
y - start point y coordinate
width - width
height - height

$fill_rect(x,y,width,height)
Fill rectangle using brush
x - start point x coordinate
y - start point y coordinate
width - width
height - height

$fill_draw_rect(x,y,width,height)
Draw rectangle using pen and brush
x - start point x coordinate
y - start point y coordinate
width - width
height - height

$round_rect(x,y,width,height,ellipse_width,ellipse_height)
Draw round corner rectangle with pen and brush
x - start point x coordinate
y - start point y coordinate
width - width
height - height
ellipse_width - ellipse width
ellipse_height - ellipse height

$draw_line(x1,y1,x2,y2)
Draw line using pen, end point is not drawn.
x1 - start point x coordinate
y1 - start point y coordinate
x2 - end point x coordinate
y2 - end point y coordinate


● GDI+ function
Because pen, brush, font do not have default values, please set them up with
$gp_set_* before using.

$gp_set_pen(argb,width)
$gp_set_pen(argb,width,style,line_join)
○ Overview:
Pen settings
○ Arguments:
argb - color
width - width
style - style ["solid"]
"solid" - solid line
"dash" - dashed line
"dot" - dotted line
"dashdot" - line with alternating dashes and dots
"dashdotdot" - line with alternating dashes and double dots
line_join - stroke corner style ["miter"]
"miter"
"bevel"
"round"

$gp_set_brush(argb)
○ Overview:
Monocolor brush setting
○ Arguments:
argb - color

$gp_set_brush(style,argb1,argb2)
○ Overview:
Hatch brush settings
○ Argument:
style - Style
Use number in range 0 ~ 53.
Details at http://msdn2.microsoft.com/en-us/library/ms534127.aspx
argb1 - Foreground color.
argb2 - Background color.

$gp_set_brush(argb1,x1,y1,argb2,x2,y2)
○ Overview:
Set brush with linear gradual effect
○ Arguments:
argb1 - color 1
x1 - color 1 x coordinate
y1 - color 1 y coordinate
argb2 - color 2
x2 - color 2 x coordinate
y2 - color 2 y coordinate

$gp_set_font(name,size)
$gp_set_font(name,size,style_1,style_2...)
○ Overview:
Font settings
○ Arguments:
name - font name
size - font size
style - style
"b" - bold
"i" - italic
"bi" - bold and italic
"u" - underline
"s" - strikethrough

$gp_set_string_format(alignment,line_alignment,[trimming])
○ Overview:
Text drawing method settings
○ Arguments:
alignment - horizontal alignment
"near" - left
"center" - center
"far" - right
line_alignment - vertical alignment
"near" - top
"center" - center
"far" - bottom
trimming - Trimming.
"character"
"word"
"ellipsis_character"
"ellipsis_word"
"ellipsis_path"

$gp_set_smoothing_mode(antialias)
○ Overview:
Shape anti-alias setting
○ Arguments:
antialias - anti-alias
0 - disable
1 - enable

$gp_set_text_rendering_hint(mode)
○ Overview:
Text rendering method setting
○ Arguments:
mode - method
"default" - default
"sb+" - single bit per pixel grid fit
"sb" - single bit per pixel
"aa+" - anti alias grid fit
"aa" - anti alias
"ct" - clear type

$gp_draw_arc(x,y,width,height,start_angle,sweep_angle)
○ Overview:
Draw arc using pen
○ Arguments:
x - top left x coordinate
y - top left y coordinate
width - width
height - height
start_angle - start angle (degree)
sweep_angle - end angle (degree)
○ Settings:
$gp_set_pen
$gp_set_smoothing_mode

$gp_draw_ellipse(x,y,width,height)
○ Overview:
Draw ellipse using pen
○ Arguments:
x - top left x coordinate
y - top left y coordinate
width - width
height - height
○ Settings:
$gp_set_pen
$gp_set_smoothing_mode

$gp_draw_line(x1,y1,x2,y2)
○ Overview:
Draw line using pen
○ Arguments:
x1 - start point x coordinate
y1 - start point y coordinate
x2 - end point x coordinate
y2 - end point y coordinate
○ Settings:
$gp_set_pen
$gp_set_smoothing_mode

$gp_draw_pie(x,y,width,height,start_angle,sweep_angle)
○ Overview:
Draw pie (fan shape) using pen
○ Arguments:
x - top left x coordinate
y - top left y coordinate
width - width
height - height
start_angle - start angle (degree)
sweep_angle - end angle (degree)
○ Settings:
$gp_set_pen
$gp_set_smoothing_mode

$gp_draw_rectangle(x,y,width,height)
○ Overview:
Draw rectangle using pen
○ Arguments:
x - top left x coordinate
y - top left y coordinate
width - width
height - height
○ Settings:
$gp_set_pen
$gp_set_smoothing_mode

$gp_draw_string(str,x,y)
$gp_draw_string(str,x,y,width,height)
○ Overview:
Draw string using brush
○ Arguments:
str - string
x - top left x coordinate
y - top left y coordinate
width - width
height - height
○ Settings:
$gp_set_font
$gp_set_brush
$gp_set_text_rendering_hint
$gp_set_string_format

$gp_calc_string(str)
$gp_calc_string(str,width,height)
○ Overview
Calculate size of str when drawn

$gp_fill_ellipse(x,y,width,height)
○ Overview:
Fill ellipse using brush
○ Arguments:
x - top left x coordinate
y - top left y coordinate
width - width
height - height
○ Settings:
$gp_set_brush
$gp_set_smoothing_mode

$gp_fill_pie(x,y,width,height,start_angle,sweep_angle)
○ Overview:
Fill pie using brush
○ Arguments:
x - top left x coordinate
y - top left y coordinate
width - width
height - height
start_angle - start angle (degree)
sweep_angle - end angle (degree)
○ Settings:
$gp_set_brush
$gp_set_smoothing_mode

$gp_fill_rectangle(x,y,width,height)
○ Overview:
Fill rectangle using brush
○ Arguments:
x - top left x coordinate
y - top left y coordinate
width - width
height - height
○ Settings:
$gp_set_brush
$gp_set_smoothing_mode

$gp_draw_string_path(str,size,mode,x,y)
$gp_draw_string_path(str,size,mode,x,y,width,height)
○ Overview:
Draw string with border.
○ Arguments:
str - string
size - character size, px unit (different from current font size)
mode - draw mode
"" - fill and border
"stroke" - only border
"fill" - only fill
x - top left x coordinate
y - top left y coordinate
width - width
height - height
○ Settings:
$gp_set_pen
$gp_set_brush
$gp_set_font
$gp_set_string_format
$gp_set_smoothing_mode
○ Examples:
$gp_set_font(Tahoma,9,b)
$gp_set_pen(ff1500ff,2,,round)
$gp_set_brush(ffddeeff)
$gp_set_string_format(center,center)
$gp_set_smoothing_mode(1)
$gp_draw_string_path(%gb_group%,16,,0,0,%gb_width%,%gb_height%)

$gp_calc_string_path(str,size,mode)
$gp_calc_string_path(str,size,mode,width,height)
○ Overview
Calculate size of str with border when drawn


● Draw image function
$draw_image(x,y,width,height,path)
$draw_image(x,y,width,height,path,alpha)
$draw_image(x,y,width,height,path,alpha,option)
$draw_image(x,y,width,height,path,alpha,option,rotate_flip)
○ Overview:
Draw image
○ Arguments:
x - starting point x coordinate
y - starting point y coordinate
width - width
height - height
path - absolute path to image, wild cards are accepted.
alpha - degree of opacity[255]
option - other options[""]
"nokeepaspect" - don't keep picture aspect ratio
"top" - draw at the top
"topright" - draw on the top right
"right" - draw from the right
"bottomright" - draw on the bottom right
"bottom" - draw at the bottom
"bottomleft" - draw on the bottom left
"left" - draw from the left
"topleft" - draw on the top left
rotate_flip - Rotation and flip [0]
0 - No rotation = Rotate right 180 degrees,
flip vertically then horizontally
1 - Rotate right 90 degrees = Rotate right 270 degrees,
flip vertically then horizontally
2 - Rotate right 180 degrees = Flip vertically then
horizontally
3 - Rotate right 270 degrees = Rotate right 90 degrees,
flip vertically then horizontally
4 - Flip horizontally = Rotate right 180 degrees,
flip vertically
5 - Rotate right 90 degrees, flip horizontally = Rotate
right 270 degrees, flip vertically
6 - Rotate right 180 degrees, flip horizontally = Flip
vertically
7 - Rotate right 270 degrees, flip horizontally = Rotate
right 90 degrees, flip vertically
○ Reference
After executing this function, you can use
%gb_calc_*% to obtain the real dimensions used.


● Other functions
$set_size(width,height)
○ Overview
Modify popup size, please use it only when drawing the popup.
Popup size is the upper limits, you can only set to smaller sizes.
%gb_width%,%gb_height% values are changed accordingly.
When width or height is 0 or less, popup won't be drawn.
○ Arguments:
width - width
height - height

$set_org(x,y)
○ Overview
Starting point setting
○ Arguments:
x - starting point x coordinate
y - starting point y coordinate

$sum(tf)
○ Overview
Calculate sum of values designated by TitleFormat.
○ Arguments:
tf - TitleFormat
○ Example: Total number played
$sum('%play_count%')


$eval(expression)
Evaluate the expression and calculate
expression - expression
E.g.: $eval(5+3)
E.g.: $eval({%gp_width%-10}/2)
※ Divide by zero expression returns 0.
Can be used with sort

● Change logs:
2008/03/16 rev014
Added - $set_size function
Added - %gb_calc_x% variable
Added - %gb_calc_y% variable
Added - %gb_calc_width% variable
Added - %gb_calc_height% variable
Added - $calc_text function
Added - $gp_calc_string function
Added - $gp_calc_string_path function
Fixed - $draw_image function
Fixed - $gp_set_string_format function(trimming argument) (however, they can always be used before,
just forgot to write here…
Fixed - Several bugs fixed

2008/03/12 rev013
Fixed - Fixed the slip happens sometimes when using keyboard to jump from item to item
Fixed - When drawing in GDI mode, fixed a drawing background bug

2008/03/11 rev012
Fixed - Fatal resource leak
Added - Image cache options

2008/03/10 rev011
Added - Ability to move focus to an item when pressing the first character of %gb_group%
using keyboard
Added - Ability to add to specified playlist instead of replacing it
Fixed - Fixed a bug that prevents you to scroll in Windows 2000 (probably...)
(TL's note: not sure about the last one, the meaning is a little vague and I don't have
Windows 2000 to test)

2008/03/09 rev010
Fixed - For some reason, I changed the variable name %gb_subitem_count% to %gb_track_count%
(the one before can still be used)
Added - Function $gp_set_brush(style,argb1,argb2)
Added - Function $set_org(x,y)
Added - Popup display transparent mode
Added - Popup delay setting
Added - Function $sum(tf)
Added - Variable %gb_isplaying%
Added - Variable %gb_track_index%
Added - Variable %gb_length%
Added - Variable %gb_length_seconds%

2008/03/02 rev009
Fixed - Fixed the bug that causes rotateflip does nothing
Fixed - Fixed behavior when there's no scroll bar
Added - Added mouse over popup.

2008/03/02 rev008
Fixed - Fixed bug that prevent the use of wild cards in $draw_image function

2008/03/02 rev007
Added - Ability to [always show|if necessary show|hide] scroll bar
Fixed - $set_font function (style)
Fixed - $draw_image function (rotate_flip)
Added - Middle mouse button action
Added - Ability to send to specified playlist
Older change logs omitted.


● Copyright
TitleFormatting Editor
Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org> All Rights Reserved
http://scintilla.sourceforge.net/
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.