//
// INIT
//
$puts(art.size,370)
$puts(left.size,400)
$puts(x.offset,$div($sub($get(left.size),$get(art.size)),2))
$init_ps_global(use_transparent_art,0)
$init_ps_global(max_w,9)
$init_ps_global(curr_w,1)
//
// Paths
//
$puts(main.dir,%ps_foobar2000_path%\)
$puts(fdir,$replace(%path%,%filename_ext%,))
$puts(adir,$replace(%path%,%directoryname%\%filename_ext%,))
$puts(pdir,C:\Documents and Settings\All Users\Documents\My music\music_art)
//edit this 3 vars to set image load priority according to you
$puts(kcp,$findfile(
$get(pdir)\albums\%artist%\%album%.jpg,
$get(pdir)\albums\%artist%\%album%.png,
$get(pdir)\albums\%artist%\%album%.gif,
$get(fdir)*front.jpg,
$get(fdir)*front.png,
$get(fdir)folder.*,
$get(fdir)cover.*,
$get(fdir)front_bv.*,
$get(fdir)*.jpg
))
$puts(kap,$findfile(
$get(adir)%artist%.jpg,
$get(adir)artist.jpg,
$get(pdir)\artists\%artist%\%artist%*.png,
$get(pdir)\artists\%artist%\%artist%*.jpg,
$get(pdir)\artists\%artist%\%artist%*.gif,
$get(adir)%artist%_bv.jpg,
$get(adir)%artist%.gif,
$get(adir)artist.gif,
$get(adir)%artist%_bv.gif,
$get(adir)%artist%.png,
$get(adir)artist.png,
$get(adir)%artist%_bv.png
))
$replace(kap,':')
$puts(kgp,
$findfile($get(main.dir)\images\genre_$lower(%genre%).jpg)
)
// wallpaper changer during startup
$if($isvisible_c('IsStartup'),,
$set_ps_global(curr_w,$add($get_ps_global(curr_w),1))
$ifgreater($get_ps_global(curr_w),$get_ps_global(max_w),
$set_ps_global(curr_w,1),)
$showpanel_c('IsStartup',1)
)
$puts(wpp,$get(main.dir)/images/w$get_ps_global(curr_w).jpg)
//default bg color
$puts(default.bgcolor,020-020-020)
$drawrect(0,0,%_width%,%_height%,$get(default.bgcolor),,)
// Bg cover display
$puts(bgimg.a,70)
// bg load priority
// kap - artist image
// kcp - album art
// kgp - genre bg image
// wpp - wallpaper
$if($and(%ps_isplaying%,$not($strcmp($substr(%path%,1,4),'http'))),
$puts(bg.p,$findfile(
$get(wpp),
$get(kap),
$get(kcp),
$get(kgp),
))
,
$puts(bg.p,$get(wpp))
)
//$puts(bg.p,$get(wpp))
$imageabs(0,0,,,$get(bg.p),nodisplay,,)
$puts(ratio,$div($mul($getimagewidth($get(bg.p)),10),$getimageheight($get(bg.p))))
// --> if square img(ratio 9,10,11)
$ifgreater($get(ratio),8,
$ifgreater(12,$get(ratio),
$ifgreater(%_height%,%_width%,
$puts(ddd,$div($sub(%_height%,%_width%),2))
$drawimage($sub(0,$get(ddd)),0,%_height%,%_height%,$get(bg.p),nokeepaspect,,$get(bgimg.a))
,
$puts(ddd,$div($sub(%_width%,%_height%),3))
$drawimage(0,$sub(0,$get(ddd)),%_width%,%_width%,$get(bg.p),nokeepaspect,,$get(bgimg.a))
)
,)
,)
// --> if landscape img(ratio>=12)
$ifgreater($get(ratio),11,
$puts(rtf,$div($mul($getimagewidth($get(bg.p)),10000),$getimageheight($get(bg.p))))
$ifgreater(%_height%,%_width%,
$puts(pic.w,$div($mul(%_height%,$get(rtf)),10000))
$puts(ddd,$div($sub($get(pic.w),%_width%),2))
$drawimage($sub(0,$get(ddd)),0,$get(pic.w),%_height%,$get(bg.p),nokeepaspect,,$get(bgimg.a))
,
$puts(pic.h,$div($mul(%_width%,10000),$get(rtf)))
$ifgreater(%_height%,$get(pic.h),
$puts(new.w,$div($mul(%_height%,$get(rtf)),10000))
$puts(ddd,$div($sub($get(new.w),%_width%),2))
$drawimage($sub(0,$get(ddd)),0,$get(new.w),%_height%,$get(bg.p),nokeepaspect,,$get(bgimg.a))
,
$puts(ddd,$div($sub($get(pic.h),%_height%),2) )
$drawimage(0,$sub(0,$get(ddd)),%_width%,$get(pic.h),$get(bg.p),nokeepaspect,,$get(bgimg.a))
)
)
,)
// --> if portrait img (ratio<9)
$ifgreater(9,$get(ratio),
$puts(rtf,$div($mul($getimagewidth($get(bg.p)),10000),$getimageheight($get(bg.p))))
$puts(pic.h,$div($mul(%_width%,10000),$get(rtf)))
$ifgreater(%_height%,$get(pic.h),
$puts(new.w,$div($mul(%_height%,$get(rtf)),10000))
$puts(ddd,$div($sub($get(new.w),%_width%),2))
$drawimage($sub(0,$get(ddd)),0,$get(new.w),%_height%,$get(bg.p),nokeepaspect,,$get(bgimg.a))
,
$puts(ddd,$div($sub($get(pic.h),%_height%),2) )
$drawimage(0,$sub(0,$get(ddd)),%_width%,$get(pic.h),$get(bg.p),nokeepaspect,,$get(bgimg.a))
)
,)
//LYRICS BACKGROUND IF ENABLED
$if($isvisible_c(Lyric Show 2),
$drawroundrect(405,5,$sub(%_width%,411),$sub(%_height%,35),7,7,0-0-0-90,0-0-0-90,)
$drawroundrect(410,10,$sub(%_width%,421),$sub(%_height%,45),5,5,0-0-0-120,0-0-0-120,)
,)
$if($isvisible_c('Info'),
$drawroundrect(15,395,370,$sub(%_height%,425),7,7,0-0-0-90,0-0-0-90,)
,)
//---Toolbar panel
$imageabs(0,$sub(%_height%,25),%_width%,25,$get(main.dir)images\bottom-bg.png,nokeepaspect,,)
//---Left buttons
$puts(display,$get(main.dir)\images\display.png)
$puts(libtree,$get(main.dir)\images\playlist.png)
$puts(trinfo,$get(main.dir)\images\trinfo.png)
$if($isvisible_c('Library Tree'),
$puts(libtree,$get(main.dir)images\playlisth.png),
$if($isvisible_c('Info'),
$puts(trinfo,$get(main.dir)\images\trinfoh.png),
$puts(display,$get(main.dir)\images\displayh.png)
)
)
$imagebutton(8,$sub(%_height%,25),16,25,$get(display),$get(main.dir)images\displayh.png,PANELSHOW:Library Tree:0;PANELSHOW:Info:0;PANELSHOW:Channel spectrum panel:1;PANELSHOW:Channel spectrum panel shadow:1;REFRESH,,)
$imagebutton(33,$sub(%_height%,25),16,25,$get(libtree),$get(main.dir)images\playlisth.png,PANELSHOW:Info:0;PANELSHOW:Channel spectrum panel:0;PANELSHOW:Channel spectrum panel shadow:0;PANELSHOW:AlbumArt:0;PANELSHOW:Library Tree:1;REFRESH,,)
$imagebutton(58,$sub(%_height%,25),16,25,$get(trinfo),$get(main.dir)images\trinfoh.png,PANELSHOW:Channel spectrum panel:0;PANELSHOW:Channel spectrum panel shadow:0;PANELSHOW:Library Tree:0;PANELSHOW:Info:1;REFRESH,,)
$if(%ps_isplaying%,
$if(%ps_ispause%,
$puts(play,$get(main.dir)\images\play.png),
$puts(play,$get(main.dir)\images\pause.png)
),
$puts(play,$get(main.dir)\images\play.png)
)
$imagebutton(80,$sub(%_height%,27),25,27,$get(main.dir)\images\prev.png,$get(main.dir)\images\prev.png,COMMAND:Playback/Previous,,)
$imagebutton(105,$sub(%_height%,27),25,27,$get(play),$get(play),COMMAND:Playback/Play or Pause,,)
$imagebutton(130,$sub(%_height%,27),25,27,$get(main.dir)\images\stop.png,$get(main.dir)\images\stop.png,COMMAND:Playback/Stop;COMMAND:View/ELPlaylist/Refresh,,)
$imagebutton(155,$sub(%_height%,27),25,27,$get(main.dir)\images\next.png,$get(main.dir)\images\next.png,COMMAND:Playback/Next,,)
//----Right buttons
$puts(playlist,$get(main.dir)images\listview.png)
$puts(lyr,$get(main.dir)images\lyrics.png)
$puts(bio,$get(main.dir)images\bio.png)
$if($isvisible_c('ELPlaylist'),
$puts(playlist,$get(main.dir)images\listviewh.png),
$if($isvisible_c('Lyric Show 2'),
$puts(lyr,$get(main.dir)images\lyricsh.png),
$puts(bio,$get(main.dir)images\bioh.png)
)
)
$imagebutton($sub(%_width%,105),$sub(%_height%,25),16,25,$get(main.dir)images\icon-toolbar.png,$get(main.dir)images\icon-toolbarh.png,COMMAND:View/Show toolbars,,)
$imagebutton($sub(%_width%,74),$sub(%_height%,25),16,25,$get(playlist),$get(main.dir)images\listviewh.png,PANELSHOW:Lyric Show 2:0;PANELSHOW:Biography:0;PANELSHOW:ELPlaylist:1;REFRESH,,)
$imagebutton($sub(%_width%,49),$sub(%_height%,25),16,25,$get(lyr),$get(main.dir)images\lyricsh.png,PANELSHOW:ELPlaylist:0;PANELSHOW:Biography:0;PANELSHOW:Lyric Show 2:1;REFRESH,,)
$imagebutton($sub(%_width%,25),$sub(%_height%,25),16,25,$get(bio),$get(main.dir)images\bioh.png,PANELSHOW:ELPlaylist:0;PANELSHOW:Lyric Show 2:0;PANELSHOW:Biography:1;REFRESH,,)
//----STATUS
$imageabs($sub(%_width%,230),$sub(%_height%,22),9,7,$get(main.dir)images\icon-volume.png,,,)
//-----ALBUM ART
$if($isvisible_c(Library Tree),
//tree round rect bck
$drawroundrect(5,5,290,$sub(%_height%,35),7,7,0-0-0-90,0-0-0-90,)
,
art round rect bck
//$drawroundrect(5,5,$add($get(art.size),20),$add($get(art.size),20),7,7,0-0-0-90,0-0-0-90,)
//$drawroundrect(10,10,$add($get(art.size),10),$add($get(art.size),10),5,5,0-0-0-50,0-0-0-90,)
$puts(art.transp,1)
$select($get_ps_global(use_transparent_art),
$puts(art.alpha,50)
$puts(art.transp,0))
//draw by internal pss reader or by artreader
//$drawroundrect(9,9,$add($get(art.size),11),$add($get(art.size),11),7,7,0-0-0-90,0-0-0-90,)
$if($get(kcp),
$drawimage($get(x.offset),$get(x.offset),$get(art.size),$get(art.size),$get(kcp),keepaspect,,$get(art.alpha))
,
$drawimage($get(x.offset),$get(x.offset),$get(art.size),$get(art.size),%path%,artreader keepaspect,,)
)
//button to hide album art
$textbutton(12,12,$get(art.size),$get(art.size),,,SETGLOBAL:use_transparent_art:$get(art.transp);REFRESH,,)
)
$if($isvisible_c('Info'),,
//------SONG INFOS
//date
$font(Calibri,52,)
$drawstring([%date%],$get(x.offset),$sub(%_height%,220),$get(art.size),50,200-200-200-70, vcenter hcenter elipchar nowrap aa,)
//artist
$font(Calibri,18 bold)
$drawstring([%artist%],$get(x.offset),$sub(%_height%,253),$get(art.size),50,220-220-220, vcenter hcenter elipchar nowrap aa, glow:3:163-43-43)
//album
$font(Calibri,16 bold)
$drawstring([%album%],$get(x.offset),$add($getlastpos(y),22),$get(art.size),50,220-220-220,vcenter hcenter elipchar nowrap aa,glow:3:244-254-254)
//title-button with play count and vew now playing
$font(Calibri,14 bold)
$puts(cnt,$add($add(%playcount%,%play_counter%),%play_count%))
$puts(char_base,832)
$puts(cnt,
$ifgreater($get(cnt),99,$char($get(char_base)$div($get(cnt),100)),)
$ifgreater($get(cnt),9,$char($get(char_base)$mod($div($get(cnt),10),10)),)
$ifgreater($get(cnt),0,$char($get(char_base)$mod($get(cnt),10)),)
)
$puts(t,[%title%] $get(cnt))
$puts(t.h,$add($getlastpos(y),33))
$drawstring($get(t),$get(x.offset),$get(t.h),$get(art.size),0,119-187-255,vtop hcenter wrap aa,glow:1:111-187-155)
$textbutton(12,$get(t.h),$get(art.size),20,,,COMMAND:View/Columns Playlist/Activate Now Playing,,)
$puts(rstate,$get(main.dir)images\heartw.png)
$puts(rcommand,CONTEXT:Playback Statistics/Rating/5)
$ifequal(%rating%,5,
$puts(rstate,$get(main.dir)images\heartrs.png)
$puts(rcommand,CONTEXT:Playback Statistics/Rating/<not set>)
,)
$puts(rcommand,$get(rcommand);'CONTEXT:Legacy Commands (unsorted)/Last.fm Love '''%title%''' By '''%artist%'')
$if(%ps_isplaying%,
$imagebutton($sub($getlastpos(x),18),$add($getlastpos(y),6),18,15,$get(rstate),$get(main.dir)images\heartrs.png,$get(rcommand);REFRESH,,)
,)
//$font(,8,)
//$drawstring($get(rcommand),$get(x.offset),$sub(%_height%,80),$get(art.size),50,220-220-220, vcenter hright,)
//END
)
$movepanel('Channel spectrum panel',5,$sub(%_height%,115),390,50)