// look info // section lookinfo string name "fooAMP Ultra" string author "tk32" string date "Jan-02-2003" double version 2.5 // compatible with foo_looks 2.0 string description "work in progress - please email any suggestions" string URL "fooamp.metalwings.org" // // NOTES: // //// things to do // // - make progress slider generic // - work on the shrink script // - get shrink/expand to remember last state for spectrum & albumart // //// // presets section// section presets int default_mode 0 // 0 = small, 1 = expanded int id3_headers 1 // int smart_tags 1 // int spectrum 1 // 1 = on int albumart 0 // 0 = off int always_on_top 1 // int small_font 0 // int minVolume -40 int albumart_width 70 int albumart_height this.albumart_width int time_display 1 // 1 = remaining time, 0 = elapsed time int use_tracknumber 1 // 1 = use id3 tracknumbers if present, 0 = always use playlistnumber // custom colours // section color // Alpha | Red | Green | Blue list invisible int { 0 0 0 0 } list white int { 255 255 255 255 } list offwhite int { 255 225 225 225 } list lightgray int { 255 200 200 200 } list ghostgray int { 150 200 200 200 } list midgray int { 255 150 150 150 } list gray int { 255 110 110 110 } list black int { 255 0 0 0 } list alttext int { 255 100 150 100 } list alttext2 int { 255 110 200 110 } list volume color.alttext section statemaps // Normal | Rollover | Pressed | Pressed-Roll | Disabled | Toggled | Toggled-Roll | Toggled-Press | Toggled-Press-Roll | Toggle-Disabled list press_only int { 0 0 1 1 0 0 0 1 1 0 } list press_toggle int { 0 0 1 1 0 2 2 1 1 0 } list toggle_only int { 0 0 1 1 0 1 1 0 0 0 } list roll_only int { 0 1 1 1 0 0 1 0 1 0 } list roll_toggle int { 0 1 2 2 0 2 2 1 1 0 } list shrink_togg int { 0 1 1 1 0 2 3 3 3 2 } // globals // section globals string image "fooAMP2.png" list fontcolor color.white int trimming trimming.EllipsisCharacter int textflags textflags.NoWrap string fontname "Arial Black" // int fontsize 8 int fontstyle 0 int halign align.near int valign align.center list statemap states.None list rendermap int { render.image } // window // section window int width 275 int height 200 int alphaBlend 100 bool showtooltips true list tooltipcolor color.white list tooltipfontcolor color.black // common sections // section metaShort // int fontsize 8 int layer 5 list rendermap int { render.text } section metaExtend int fontsize 9 // 8 bool enabled false int layer 5 list rendermap int { render.text } string plNum "$num(%_playlist_number%,3)." string trNum "$num(%tracknumber%,3)." string fnLength "$len(%_filename%)" string seperator "$if($strstr(%_filename%,' - '),' - ','-')" string fileName "$trim($replace($replace(%_filename%,_, ,--,-),%metaExtend._seperator%,-))" string fSep "$strchr(%metaExtend._fileName%,-)" string mSep "$add($strchr($substr(%metaExtend._fileName%,$add(%metaExtend._fSep%,1),%metaExtend._fnLength%),-),%metaExtend._fSep%)" string lSep "$strrchr(%metaExtend._fileName%,-)" string neatDir "$replace($replace($directory(%_path%,1),_, ),-, - )" string spacer "$ifgreater(%placeToggle._istoggled%,0,$ifgreater(%presets._small_font%,0, ,) ,)" string fNum "$ifgreater(%metaExtend._fSep%,4,, $substr(%metaExtend._fileName%,1, $sub(%metaExtend._fSep%,1)))" string fArtist "$ifgreater(%metaExtend._fSep%,4, $substr(%metaExtend._fileName%,1,$sub(%metaExtend._fSep%,1)), $substr(%metaExtend._fileName%,$add(%metaExtend._fSep%,1),$sub(%metaExtend._mSep%,1)))" string fTitle "$ifgreater(%metaExtend._fSep%,4, $substr(%metaExtend._fileName%,$add(%metaExtend._fSep%,1),%metaExtend._fnLength%), $substr(%metaExtend._fileName%,$add(%metaExtend._mSep%,1),%metaExtend._fnLength%))" section placeHolder list rendermap int { render.text } int halign align.far int fontsize 6 int layer 5 section id3 string neatAlbum "$trim($caps2($replace($if2(%album%,%metaExtend._neatDir%),_, ))) $if('('%date%')',)" string neatArtist "$trim($caps2($replace($if2(%artist%,$ifgreater(%smartToggle._istoggled%,0,%metaExtend._fArtist%,)),_, )))" string neatTitle "$trim($caps2($replace($if2(%title%,$ifgreater(%smartToggle._istoggled%,0,%metaExtend._fTitle%,)),_, )))" section tech int layer 5 bool enabled false list rendermap int { render.text } string bitsize "$len(%__bitrate%)" string rate "$div(%__samplerate%,1000)" string kbpkhz "kbps khz" string fileType "$upper($ext(%_filename_ext%)) [$lower('('%__extrainfo%')')]" string stereo "$select(%__channels%,MONO,STEREO,%__channels%ch)" // Scripts // lua slider moving, playing, trackx, tracky = false minx, maxx, miny, maxy = 0 bar = nil isSeek = false isVolume = false clickOffset = { x=0, y=0 } minVol = -40 realtime = 0 dragUpdateFn = function(pos) end gripUpdateDelay = 5 --higher number means slower update function onattach(this) if (isVolume == true) then vol = -(fb2k_getVolume() / 10000) local rect = look_getRect(this) local r2 = look_getRect(bar) local initPos = (rect.x + ceil((1-vol) * r2.width)) if (initPos > maxx) then initPos = maxx end if (initPos < minx) then initPos = minx end rect.x = initPos look_setRect(this, rect) --r2.width = initPos - r2.x --look_setRect(bar,r2) end end function update(this) local r2 = look_getRect(this) local xDelta = r2.x - minx if (xDelta < 0) then xDelta = 0 elseif (xDelta > (maxx - minx)) then xDelta = r2.width end seekPos = (xDelta * 100)/(maxx - minx) -- the handler could be passed in as a variable that points to a function dragUpdateFn(seekPos) -- Or we could assume the handler for the pos is in another script attached to this sprite look_callScript(this,"sliderPosUpdate",seekPos) end function endSlide(this) update(this) moving = false end function onleftbuttondown(this) moving = true local rect = look_getRect(this) clickOffset.x = look_mouseX() - rect.x clickOffset.y = look_mouseY() - rect.y end function onleftbuttonup(this) endSlide(this) end function onleftbuttonupoutside(this) endSlide(this) end function onplaybackstart(this) playing = true end function onplaybackstop(this) playing = false end function onplaybackpause(this) playing = false end function followCursor(this) local rect = look_getRect(this) if (trackx) then local newx = look_mouseX() - clickOffset.x if (newx >= minx and newx <= maxx) then rect.x = newx elseif (newx < minx) then rect.x = minx else rect.x = maxx end end if (tracky) then newy = look_mouseY() - clickOffset.y if (newy >= miny and newy <= maxy) then rect.y = newy elseif (newy < miny) then rect.y = miny else rect.y = maxy end end look_setRect(this, rect) if (bar) then --local r2 = look_getRect(bar) --r2.width = rect.x - r2.x + (rect.width / 2) --look_setRect(bar,r2) end end i = 0 function onupdate(this) if (moving == true) then followCursor(this) if (realtime == 1) then update(this) end elseif (playing == true and isSeek == true) then if ( i == gripUpdateDelay ) then local rect = look_getRect(this) local absPos = (floor(fb2k_getPlayPosition() * 10) / 10) local absTotal = floor(fb2k_getSongLength()) local percent = (absPos / absTotal) rect.x = 6 + floor(percent * 210) look_setRect(progressgrip,rect) i = 0 else i = i + 1 end end end endlua ////////////////////////////// lua draglook function onleftbuttondown(this) look_drag() end endlua lua toggleTarget target, init = 0 function onleftbuttonup(this) look_setVisible(target, not look_getVisible(target)) end function onattach(this) if (init == 0) then look_setVisible(target,false) elseif (init == 1) then look_setVisible(target,true) end end endlua lua freeMove moving = false clickOffset = { x=0, y=0 } spectrumwason = 0 function onrightbuttondown(this) moving = true if (look_getVisible(spectrum) == true) then look_setVisible(spectrum,false) spectrumwason = 1 end local rect = look_getRect(this) clickOffset.x = look_mouseX() - rect.x clickOffset.y = look_mouseY() - rect.y end function onrightbuttonup(this) moving = false if (spectrumwason == 1) then look_setVisible(spectrum,true) spectrumwason = 0 end end function onupdate(this) if (moving == true) then local rect = look_getRect(this) rect.x = look_mouseX() - clickOffset.x rect.y = look_mouseY() - clickOffset.y look_setRect(this, rect) end end endlua lua positionArt function onattach(this) local rect = look_getRect(this) rect.x = 265 - rect.width rect.y = 190 - rect.height look_setRect(this, rect) end endlua lua resetArt function onleftbuttonup(this) local rect = look_getRect(albumart) rect.x = 265 - rect.width rect.y = 190 - rect.height look_setRect(albumart, rect) end endlua lua fontSet grp1 = { shortArtist, shortTitle } grp2 = { expandArtist, expandTitle, expandAlbum } function onattach(this) if (look_getValue('presets','small_font') == 1) then look_setFontSize(grp1, 6) look_setFontSize(grp2, 7) end end endlua lua albumartDisplay height, width = 36 function updateImage(sprite) look_updateAlbumArt() art = look_getAlbumArtList() if (getn(art) > 0) then look_setImage(sprite, look_loadThumbImage(art[1],width,height)) else look_setImage(sprite,nil) end end function onattach(this) updateImage(this) end function onplaybacknewtrack(this) updateImage(this) end endlua lua shrink init = 1 group = { spectrum, expandMetaToggle, placeToggle, smartToggle, spectrumToggle, artToggle } function hideExpand() look_setVisible(group,false) end function showExpand() look_setVisible(group,true) end function showMiniLook() miniRect = { x=0, y=0, width=275, height=70 } look_moveSizeWindow(-1,-1,275,70) look_setRect(background,miniRect) end function showBigLook() bigRect = { x=0, y=0, width=275, height=200 } look_moveSizeWindow(-1,-1,275,200) look_setRect(background,bigRect) end function checkPresets(this) if (look_getValue('presets','spectrum') == 0) then look_setVisible(spectrum,false) look_setToggle(spectrumToggle, 0) else look_setVisible(spectrum,true) look_setToggle(spectrumToggle, 1) end if (look_getValue('presets','albumart') == 0) then look_setVisible(albumart,false) look_setToggle(artToggle, 0) else look_setVisible(albumart,true) look_setToggle(artToggle, 1) end end function onattach(this) look_setToggle(this,init) if (look_getToggle(this) == 0 ) then hideExpand() showMiniLook() end end function onleftbuttonup(this) if (look_getToggle(this) == 1 ) then hideExpand() showMiniLook() look_setToggle(this, 0) else showBigLook() showExpand() checkPresets() look_setToggle(this, 1) end end endlua lua playToggle pause = 0 stop = 1 toggleoff = pause function onattach(this) look_setToggle(this,0) end function onplaybackstart(this) look_setToggle(this,1) end function onplaybackstop(this) look_setToggle(this,0) end function onleftbuttonup(this) local t = look_getToggle(this); if (t == 0) then if (toggleoff == 0 and fb2k_isPaused()) then fb2k_playPause() else fb2k_playStart() end look_setToggle(this,1) else if (toggleoff == 0) then fb2k_playPause() else fb2k_playStop() look_setToggle(this,0) end end end function onrightbuttonup(this) fb2k_playStart() end endlua lua genericToggle toggle = 0 function onattach(this) look_setToggle(this, toggle) end function onleftbuttonup(this) if (look_getToggle(this) == 0) then look_setToggle(this, 1) else look_setToggle(this, 0) end end endlua lua visibleOnFocus function onactivate(this) look_setVisible(this,true) end function ondeactivate(this) look_setVisible(this,false) end endlua lua doubleClickInfo function onleftbuttondoubleclick(this) fb2k_playlistContextCommand('Show file info') end endlua /////// Skin code starts here /////// // background - just a regular sprite // sprite background string tooltip "" int width window.width int height window.height list scripts string { "draglook", "fontSet" } // add volumewheel // short section // section buttonCommon int y 49 int width 22 int height 17 list statemap statemaps.press_only sprite previous int x 6 list srcoff int { 309 0 } string include buttonCommon list scripts string { "[function onleftbuttonup(this) fb2k_playSkipStart(-1) end function onrightbuttonup(this) fb2k_playStart() end]" } sprite play int x 29 list srcoff int { 331 0 } string include buttonCommon list scripts string { "playToggle[toggleoff=pause]" } sprite stop int x 52 list srcoff int { 353 0 } string include buttonCommon list scripts string { "[function onleftbuttonup(this) fb2k_playStop() end]" } sprite next int x 75 list srcoff int { 375 0 } string include buttonCommon list scripts string { "[function onleftbuttonup(this) fb2k_playSkipStart(1) end function onrightbuttonup(this) fb2k_menuCommand('Playback/Random') end ]" } // lua fb2kToggle function onattach(this) if (fb2k_uiIsActivated()) then look_setToggle(this,1) end end function onleftbuttonup(this) if (fb2k_uiIsActivated()) then fb2k_menuCommand("Foobar2000/Hide main window") look_setToggle(this,0) else fb2k_menuCommand("Foobar2000/Activate main window") look_setToggle(this,1) end end endlua sprite plButton list rect int { 246 16 22 11 } list srcoff int { 310 36 } list statemap statemaps.press_toggle list scripts string { "genericToggle", "fb2kToggle" } sprite cfgButton list rect int { 246 28 22 11 } list srcoff int { 332 36 } list statemap statemaps.press_only list scripts string { "[function onleftbuttonup(this) fb2k_prefs() end" } // sprite fblogo list rect int { 5 4 11 9 } list srcoff int { 296 151 } sprite titlebar list rect int { 17 4 152 7 } list srcoff int { 0 201 } list scripts string { "visibleOnFocus", "draglook" } sprite closelook list rect int { 253 3 10 9 } list srcoff int { 381 183 } list scripts string { "[function onleftbuttonup(this) look_hide() end]" } sprite quitfb2k list rect int { 263 3 10 9 } list srcoff int { 391 183 } list scripts string { "[function onleftbuttonup(this) fb2k_menuCommand('Foobar2000/Exit') end]" } sprite shrinkexpand list rect int { 250 50 18 13 } list srcoff int { 291 23 } list statemap statemaps.shrink_togg list scripts string { "shrink[init=look_getValue('presets','default_mode')]" } // sprite shortArtist int fontsize 8 list fontcolor2 int { 100 100 100 100 } string fspec "$caps2($if(%artist%,%artist%,%_filename_ext%))" list rect int { 8 15 180 12 } string include metaShort list scripts string { "doubleClickInfo" } sprite shortTitle // string fspec " $caps2($if(%artist%, $if(%title%,%title%,untitled), /$directory(%_path%,1)))" string fspec " $caps2($if(%artist%,$ifgreater($strcmp(%title%,),0,,- %title%),/$directory(%_path%,1)))" list rect int { 8 25 180 12 } string include shortArtist sprite tracktime list fontcolor color.ghostgray int fontsize 16 int fontstyle 1 // string fspec "$ifgreater(%_istoggled%,0,-%rtm%,%etm%)" int halign align.far list rect int { 136 19 110 17 } list rendermap int { render.text } list scripts string { "genericToggle[toggle=look_getValue('presets','time_display')]" } // sprite alwaysontop string tooltip "Switch $ifgreater(%_istoggled%,0,Off,On) Always-on-Top" list rect int { 209 51 12 12 } list srcoff int { 296 76 } list statemap statemaps.toggle_only list scripts string { "genericToggle[toggle=look_getValue('presets','always_on_top')]", "[function onleftbuttonup(this) fb2k_menuCommand('Components/Look/Always on Top') end]" } // sprite playbackIndicator list rect int { 230 51 11 11 } list srcoff int { 295 101 } list scripts string { "[ function onplaybackstart(this) look_setSrcY(this,113) end function onplaybackpause(this) look_setSrcY(this,127) end function onplaybackstop(this) look_setSrcY(this,101) end ]" } // progress & volume controls // lua jumpToTime grip = nil moving = false function onleftbuttondown(this) local rect = look_getRect(grip) rect.x = look_mouseX() - (rect.width / 2) look_setRect(grip,rect) look_callScript(grip,"update",grip) moving = true end endlua sprite progress list rect int { 6 39 238 8 } list scripts string { "jumpToTime[grip = progressgrip]" } lua seekSliderPosUpdate function sliderPosUpdate(pos) --local percentPos = ceil(pos * 100) / 100 --LOG('seeking to '..percentPos..'%') local newTime = fb2k_getSongLength() newTime = (pos * newTime)/100.0 fb2k_playbackSeek(newTime) end endlua sprite progressgrip list rect int { 6 39 29 8 } list srcoff int { 275 11 } list scripts string { "slider[minx=6 maxx=215 trackx=true bar=progress isSeek=true]","seekSliderPosUpdate" } lua jumpToVol minVol = -4000 function onmousewheel(this, delta) vol = fb2k_getVolume() if (delta < 0 and vol > minVol) then vol = vol - 50 elseif (delta > 0 and vol < 0) then vol = vol + 50 end fb2k_setVolume(vol) end endlua sprite volumelevel list fillcolor color.black list fillcolor2 color.alttext2 list rect int { 173 6 60 3 } // list rendermap int { render.fill } list scripts string { "jumpToVol" } sprite volumegrip list rect int { 173 3 12 9 } list srcoff int { 287 0 } list scripts string { "slider[ dragUpdateFn = function (pos) local vol = fb2k_getVolume() local newVol = minVol * (100 - ceil(pos)) fb2k_setVolume(newVol) end minx=173 maxx=230 trackx=true bar=volumelevel isVolume=true minVol=look_getValue('presets','minVolume') realtime=1]" } // expanded section // // top line // lua updatePLnum grp = { expandTracknum, expandNumtype, expandHeading, expandMetaToggle, infobutton, expandTrackLength, expandArtist, expandTitle, expandAlbum, expandArtplace, expandTitplace, expandAlbplace, techMonoStereo, techFiletype, techKbsKhz, techKbsplace, techComments, } function update(this) local plindex = fb2k_getNowPlaying() look_setPlaylistIndex(grp,plindex) end function onattach(this) update(this) end function onplaybacknewtrack(this) update(this) end endlua sprite expandTracknum int fontsize 16 list fontcolor color.gray int playlistindex -1 string fspec "$ifgreater(%_istoggled%,0,$if(%tracknumber%,%metaExtend._trNum%,%metaExtend._plNum%),%metaExtend._plNum%)" list rect int { 3 72 61 18 } list rendermap int { render.text } list scripts string { "genericToggle[toggle=look_getValue('presets','use_tracknumber')]", "updatePLnum" } sprite expandNumtype string fspec "$ifgreater(%expandTracknum._istoggled%,0,$if(%tracknumber%,track,playlist),playlist)" int fontsize 7 list rect int { 7 88 50 8 } string include expandTracknum sprite expandHeading list fontcolor color.lightgray string fspec "$ifgreater(%expandMetaToggle._istoggled%,0,$if(%artist%,:: file data ::,:: no metadata ::),$if(%artist%,:: track metadata ::,:: no metadata ::))" int halign align.center list rendermap int { render.text } list rect int { 70 72 120 10 } sprite expandMetaToggle string fontname "arial" int fontstyle 1 int halign align.center list fontcolor color.alttext string fspec "$if($and(%artist%,%title%),$ifgreater(%_istoggled%,0,show metadata,show file data),$if($or(%artist%,%title%),$ifgreater(%smartToggle._istoggled%,0,show file data '(*)',show file data),$ifgreater(%smartToggle._istoggled%,0,guessing all tags..,)))" list rect int { 74 83 110 10 } list rendermap int { render.text } list scripts string { "genericToggle" } sprite expandTrackLength list fontcolor color.lightgray int halign align.far int fontsize 12 string fspec %_length% list rendermap int { render.text } list rect int { 188 71 80 17 } // mid section (id3 display) // sprite expandArtist string fspec "%metaExtend._spacer%$if($or(%artist%,$strcmp(%smartToggle._istoggled%,1)),$ifgreater(%expandMetaToggle._istoggled%,0,,%id3._neatArtist%),)" list rect int { 6 102 261 17 } string include metaExtend sprite expandTitle string fspec "%metaExtend._spacer%$if($or(%title%,$strcmp(%smartToggle._istoggled%,1)),$ifgreater(%expandMetaToggle._istoggled%,0,%_filename_ext%,%id3._neatTitle%),%_filename_ext%)" list rect int { 6 119 261 12 } string include metaExtend sprite expandAlbum list fontcolor color.midgray string fspec "%metaExtend._spacer%$if($or(%album%,$strcmp(%smartToggle._istoggled%,1)),$ifgreater(%expandMetaToggle._istoggled%,0,/$directory(%_path%,1),%id3._neatAlbum%),/$directory(%_path%,1))" list rect int { 6 131 261 17 } string include metaExtend sprite expandArtplace string fspec "$ifgreater(%placeToggle._istoggled%,0,$ifgreater(%expandMetaToggle._istoggled%,0,,$ifgreater(%smartToggle._istoggled%,0,artist:,$if(%artist%,artist:,))),)" list rect int { 6 102 35 17 } string include placeHolder sprite expandTitplace string fspec "$ifgreater(%placeToggle._istoggled%,0,$ifgreater(%expandMetaToggle._istoggled%,0,file:,$ifgreater(%smartToggle._istoggled%,0,title:,$if(%title%,title:,file:))),)" list rect int { 6 119 35 12 } string include placeHolder sprite expandAlbplace string fspec "$ifgreater(%placeToggle._istoggled%,0,$ifgreater(%expandMetaToggle._istoggled%,0,folder:,$ifgreater(%smartToggle._istoggled%,0,album:,$if(%album%,album:,folder:))),)" list fontcolor color.midgray list rect int { 6 131 35 17 } string include placeHolder // bottom section // section toggleCommon int layer 5 int y 150 int width 6 int height this.width list srcoff int { 357 37 } list statemap statemaps.roll_toggle sprite placeToggle string tooltip "toggle id3 placeholders" int x 8 string include toggleCommon list scripts string { "genericToggle[toggle=look_getValue('presets','id3_headers')]" } sprite smartToggle string tooltip "toggle smart-tags '(guess missing fields)'" int x 16 string include toggleCommon list srcoff int { 364 37 } list scripts string { "genericToggle[toggle=look_getValue('presets','smart_tags')]" } sprite spectrumToggle string tooltip "toggle spectrum" int x 24 string include toggleCommon list srcoff int { 371 37 } list scripts string { "genericToggle[toggle=look_getValue('presets','spectrum')]", "toggleTarget[target=spectrum init=look_getValue('presets','spectrum')]" } sprite artToggle string tooltip "toggle album art" int x 32 string include toggleCommon list srcoff int { 378 37 } list scripts string { "genericToggle[toggle=look_getValue('presets','albumart')]", "resetArt","toggleTarget[target=albumart init=look_getValue('presets','albumart')]" } // sprite techMonoStereo int fontsize 5 int texthint 3 list fontcolor color.midgray string fspec "%tech._stereo%" list rect int { 6 165 40 9 } string include tech sprite techFiletype int fontsize 10 list fontcolor color.lightgray string fspec "%tech._fileType%" list rect int { 5 171 80 13 } string include tech sprite techKbsKhz int fontsize 6 list fontcolor color.alttext string fspec "$if2(%__bitrate% %tech._rate%,N/A)" list rect int { 6 183 90 8 } string include tech sprite techKbsplace list fontcolor color.offwhite string fspec "$select(%tech._bitsize%, %tech._kbpkhz%,%tech._kbpkhz%, %tech._kbpkhz%, %tech._kbpkhz%)" list rect int { 19 183 80 8 } string include techKbsKhz sprite techComments string fontname "microsoft sans serif" int fontsize 7 int texthint 0 int halign align.center int textflags 0x00000000 list fontcolor color.lightgray string fspec "$ifgreater(%expandMetaToggle._istoggled%,0,,$if2(%comment%,))" list rect int { 87 161 108 33 } string include tech sprite albumart int layer 4 list srcoff int { 0 0 } list rect int { 265 190 presets.albumart_width presets.albumart_height } list scripts string { "albumartDisplay[width=look_getValue('presets','albumart_width') height=look_getValue('presets','albumart_height')]" "positionArt","freeMove" } list rendermap int { render.Image } string search1 "*front*" string search2 "*cover*" string search3 "*back*" string search4 "*cd*" string search5 "*" // Other // sprite spectrum bool enabled false int layer 0 list rect int { 6 85 260 107 } int bands 20 // 26 list srcoff int { 346 74 } // 331 list rendermap int { } sprite fooAMP int layer 2 list rect int { 84 154 183 38 } list srcoff int { 0 209 } sprite id3Overlay int layer 4 list rect int { 5 102 173 45 } list srcoff int { 187 203 } lua changeFlow current= nil rel = 1 flowlist = fb2k_enumFlowControl() i = 0 count = 0 index = 0 function getIndex() current = fb2k_getFlowControl() for i=1, getn(flowlist) do if (current == flowlist[i]) then index = i end end end function onattach(this) current = fb2k_getFlowControl() for i=1, getn(flowlist) do if (current == flowlist[i]) then index = i end count = count + 1 end updatefspec() end function updatefspec() local text = fb2k_getFlowControl() text = gsub(text,'One','1') look_setText(showflow,text) end function onleftbuttonup(this) --danZ, don't laugh - i know this is bad code getIndex() local temp1 = count + index + rel + 1 local newindex = mod(temp1, (count+1)) if (index == count and newindex == 0) then newindex = 1 end if (index == 1 and newindex == 0) then newindex = count end index = newindex fb2k_setFlowControl(flowlist[index]) updatefspec() end endlua sprite downflow list rect int { 148 56 13 9 } list srcoff int { 373 163 } list statemap statemaps.press_only list scripts string { "changeFlow[rel=1]" } sprite upflow list rect int { 148 48 13 9 } list srcoff int { 386 163 } list statemap statemaps.press_only list scripts string { "changeFlow[rel=-1]" } // list scripts string { "[function onleftbuttonup(this) look_callScript(changeFlow,"onleftbuttonup") end]" } sprite showflow int fontsize 5 int texthint 3 int fontstyle 1 string fontname "verdana" list rect int { 160 53 46 7 } int halign align.center list srcoff int { 367 65 } list rendermap int { render.text } string fspec "" sprite infobutton list rect int { 190 73 50 20 } list rendermap int { render.text } string fontname "garamond" int fontstyle 3 int fontsize 14 string fspec "i" string tooltip "show file info" list scripts string { "[function onleftbuttonup(this) fb2k_playlistContextCommand('Show file info') end]" }