Updated config:
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.
* [!--sizeo:2--][span style=\"font-size:10pt;line-height:100%\"][!--/sizeo--]Arithmetic mean album rating.[/size][!--sizeo:2--][span style=\"font-size:10pt;line-height:100%\"][!--/sizeo--] Later, I might be able to do weighted mean album rating [/size][!--sizeo:2--][span style=\"font-size:10pt;line-height:100%\"][!--/sizeo--](using play_count statistic)[/size][!--sizeo:2--][span style=\"font-size:10pt;line-height:100%\"][!--/sizeo--] with future version of this component.
[/size]Settings:
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:
//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:
//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.
Per track (Popup) 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.