section lookinfo string name "See trought CoverArt" string author "Melomane, thank to desigrid & TK32 for ours strings!" string date "mar-10-2004" section window int width 220 int height window.width lua windowFade alpha = 100 fadeto = 40 function onupdate(this) if (look_insideSprite(this,look_mouseX(),look_mouseY())) then if (alpha < 100) then alpha = alpha + 10 window_setAlpha(alpha) end elseif (alpha > fadeto) then alpha = alpha - 10 window_setAlpha(alpha) end end endlua lua syncFb2kUI -- sprites: array of sprites to sync to Fb2k's minimised to tray/activated status visible = true savedVisStatus = {} function onupdateplayerstatus(this) if (visible and not fb2k_uiIsActivated()) then -- iterate through array of sprites i = 1 while (i <= getn(sprites)) do -- save visible status savedVisStatus[i] = look_getVisible(sprites[i]) -- if visible, hide if (savedVisStatus[i]) then look_setVisible(sprites[i], false) end i = i + 1 end visible = false elseif (not visible and fb2k_uiIsActivated()) then -- iterate through array of sprites i = 1 while (i <= getn(sprites)) do -- check saved visible status, show if true if (savedVisStatus[i]) then look_setVisible(sprites[i], true) end i = i + 1 end visible = true end end endlua lua dragLook function onleftbuttondown(this) look_drag() end endlua lua albumartDisplay defaultArtFile = "" function updateImage(sprite,index,artindex) look_setPlaylistIndex(sprite,index) look_updateAlbumArt(look_getPlaylistIndex(sprite)) r = look_getRect(sprite) art = look_getAlbumArtList() if (getn(art) > 0 and artindex <= getn(art) and artindex > 0) then look_setImage(sprite, look_loadThumbImage(art[artindex],r.width,r.height)) else look_setImage(sprite,look_loadThumbImage(defaultArtFile,r.width,r.height)) end end function onattach(this) updateImage(this,fb2k_playlistGetFocus(),1) end function onplaylistfocuschange(this,from,to) updateImage(this,to,1) end function onplaybacknewtrack(this) updateImage(this,fb2k_getNowPlaying(),1) end endlua section globals list statemap states.None sprite background list rect int { 0 0 window.width window.width } list rendermap int { render.Erase } list scripts string { "syncFb2kUI[sprites={albumArt}]" } sprite albumArt list rect int { 0 0 window.width window.width } list scripts string { "dragLook", "albumartDisplay" } string search1 "*front*" string search2 "*cover*" string search3 "*back*" string search4 "*cd*" string search5 "*"