FofR Configuration Pack v0.3
February 22nd, 2007, posted by FofR

An update to the code, the changes include:

  • Added global settings variables on PANELSUI code section to make setting up easier (image sources, images directory, colours, fonts, etc.)
  • Added a Full screen mode (make sure to set your resolution)
  • Added option to scale album art with window on Now Playing mode
  • Added Playlist Dropdown menu to the bottom menu (though it is buggy… PanelsUI or component bug)
  • Added rudimentary buttons for those that use them (I personally don’t)
  • A refined “more” configuration track display panel.

I have also included the artist download executables in this package, they’re only small.

This new version requires you to have the Playlist Dropdown menu component.

Download Version 0.3

Read the rest of this entry »

Automate Artist Image Downloads
February 21st, 2007, posted by FofR

Cover Art downloaders that utilise Amazon or another large online shop’s database of images are fairly well know and there’s a number of them to choose from. Artist images however are not so easy to come by. With Hydrogen Audio member Chronial’s help I set about creating a web based service that anyone can use as simply as possible to grab any artist’s picture and place it anywhere… whether it be through batch file downloading, foobar or elsewhere on the web.

The result is the aptly titled “Artist Images” site, located at http://artists.trivialbeing.org.

http://artists.trivialbeing.org/?a=ARTIST NAME
This page displays the artists thumbnail image and some information on how to use it, check out http://artists.trivialbeing.org/?a=blondie for instance. Maybe you want a bigger image, thumbnails too small? Simply append the URL with &imgs=large, for example http://artists.trivialbeing.org/?a=blondie&imgs=large.

This is all well and good for browsing but what’s the URL for including artist images either in a URLdownloader script or to include on forums etc.?

For a thumbnail, http://artists.trivialbeing.org/pic/blondie.jpg
For a full size image, http://artists.trivialbeing.org/bigpic/blondie.jpg

Blondie

This URL will always return an image, if the file is not in the cache it will locate it, download it and still show you. Only a few results will return a “no artist” image result.

Now, the exciting bit. How do you integrate this into Foobar2000? Up until now I have been recommending URL2File, a command line downloading application that you need to first install and then script. There is now a better more succinct way using AutoHotKey. You can install this and run a .ahk if you want, or you can download a standalone compiled executable (i.e. I have done the work for you).

Download Download Large Artist Images .exe
Download Download Thumbnail Images .exe

The AHK code contained within is simply:

#NoTrayIcon
SetWorkingDir, %A_ScriptDir%
UrlDownloadToFile, http://artists.trivialbeing.org/bigpic/%1%.jpg, %1%.jpg
exit

Place these in any directory you want and pass the artist name as an input parameter to them. The file will be downloaded as a .jpg file to the folder that the executable is in.

e.g. running C:\artistimagethumb.exe “blondie” via the command line will download blondie.jpg and save it in the root C:\ directory.

To integrate this into foobar you will need Foo_Run. Under the Run Services option add a new service, call it what you like, make sure the path to the executable is correct. Now you need to add the parameter, e.g.:

“C:\artistimagebig.exe” $replace($replace(%artist%, ,+),&,and)

This passes the selected artist to the executable to be downloaded. If “system of a down” is selected it will be changed to “system+of+a+down”, all & characters will be replaced with “and”. Please note: \ / : * ? ” < > | are all characters that cannot be used in file naming, as a result any artists containing these characters will be upset to find out they won’t be getting a profile pic.

Now assign this to a keyboard shortcut and you’re there.

How to make a Progress Bar
February 21st, 2007, posted by FofR

The standard seek bar is all well and good but it doesn’t integrate well with Track Display and SCPL. A new approach is to use PanelsUI, the $drawrect function and a few of foobar’s standard functions. $drawrect was introduced in the original track info mod panel by Terrestrial and it uses a format like so:

$drawrect(X,Y,W,H,brushColor-R-G-B penColor-R-G-B OPTIONS)
$drawrect(10,10,50,5,brushcolor-200-200-200 pencolor-null)

X and Y determine the position of the bar, W and H determine the width and height, the brush colour is the fill colour of the box, pen colour is the border. Options can include alpha, border width and blurriness. From this basis a rectangle can be built that has a size dependent on a changing value, for instance a track’s progress.

When a track is playing, its progress can be called up using the string %playback_time_seconds%, similarly its total length is given by %length_seconds%. To convert this value into one that is usable the percentage of the track played must be converted into a relative width. For instance if our progress bar is to be 50 pixels across, at 50% played the rectangle drawn must be 25 pixels. This can be done using the following:

$muldiv(%playback_time_seconds%,50,%length_seconds%)

$muldiv first multiplies %playback_time_seconds% by 50 (width of rectangle) then divides that value by %length_seconds%. So, to check, if the track is 60 seconds long and is 30 seconds (half way) through: 30×50 = 1500, 1500/60 = 25 pixels. Using $puts we can quietly store this value in a variable, let’s call it “progress“:

$puts(progress,$muldiv(%playback_time_seconds%,50,%length_seconds%))

If this code is placed in a //PerSecond section of PanelsUI then it will change its value as often as we need it to. To draw this rectangle we use the $get function to include the variable:

$drawrect(10,10,$get(progress),7,brushcolor-200-200-200 pencolor-null)

Thus the complete code is as follows, the first rectangle is a border and an $ifgreater clause has been added so that no rectangle is drawn if no time has passed:

// PROGRESS BAR
$drawrect(9,9,52,7,brushcolor-null pencolor-101-101-101)
$puts(progress,$muldiv(%playback_time_seconds%,$sub($get(imgw),20),%length_seconds%))
$ifgreater($get(progress),0,
$drawrect(10,10,$get(progress),5,brushcolor-200-200-200 pencolor-null)
,)

PanelsUI Tabs
February 20th, 2007, posted by FofR

PanelsUI has a number of fascinating uses. To get the ball rolling, the first Fooblog2000 tip shall explain how to make tabs in this component. An understanding of the trackinfo mod (now renamed Track Display) syntax and functions is helpful. This tip makes use of Three functions; $select which runs different code based on the stored value of a particular PVAR (or persisting variable); $panel which is new to PanelsUI and shows a panel, toolbar, visualisation or playlist in the desired configuration; and thirdly, $button2 which creates a button using text.

$select($add($getpvar(display.mode),1),
run this code when display.mode = 0
,
run this code when display.mode = 1
,
run this code when display.mode = 2
)

display.mode is the persisting variable, a value of 1 is added to its value to give correct $select operation. To change this PVAR a button such as the one below can be used:

$button2(0,160,0,0,140,14,'$font(Calibri,9,,155-155-155)Mode 1','$font(Calibri,9,underline,155-155-155)Mode 1,'PVAR:SET:display.mode:1',)'

This code creates a text button of size 140×14 pixels, 160 pixels down the page. The text is size 9, Calibri font and colour 155-155-155. When moused over the text becomes underlined. Clicking this button changes the value of display.mode from 0 to 1. Thus selecting and running a different set of code. If this code changes the panel that is shown then a tab system has been created – for example, showing a track display panel:

$panel(Option1,Track Display,0,20,%_width%,140,)

With name “Option1″ and panel determined by the second term “Track Display”, this code will show a panel the width of the screen of height 140, starting 20 pixels down the screen. Changing the second term to “Album list” for example will instead show the traditional album list panel.

A complete code would look a little like this:

$select($add($getpvar(display.mode),1),
$panel(Option1,Track Display,0,20,%_width%,140,)
,
$panel(Option2,Album list,0,20,%_width%,140,)
,
$panel(Option3,Console,0,20,%_width%,140,)
)
$button2(0,160,0,0,140,14,$font(Calibri,9,,155-155-155)Mode0,$font(Calibri,9,underline,155-155-155)Mode0,'PVAR:SET:display.mode:0',)
$button2(14,160,0,0,140,14,$font(Calibri,9,,155-155-155)Mode1,$font(Calibri,9,underline,155-155-155)Mode1,'PVAR:SET:display.mode:1',)
$button2(28,160,0,0,140,14,$font(Calibri,9,,155-155-155)Mode2,$font(Calibri,9,underline,155-155-155)Mode2,'PVAR:SET:display.mode:2',)

Download Panel Tabs.pui Example

FofR Configuration Pack v0.2
February 20th, 2007, posted by FofR

Many have asked for this, rather than rush out the first release I spent a while refining the code and commenting the various sections. Hopefully everything will be relatively understandable. All image sources are defined in variables at the top of the code, as are font sizes, colours and alignment variables. Please look at the readme.txt file which contains links and information about the required components, fonts and images. The code is in the new standard .pui format which should be placed in your ” C:\Documents and Settings\USER\Application Data\foobar2000\PanelsUI” folder and loaded through Foobar2000′s PanelsUI preferences dialogue.

The code has been released under the Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license which allows derivative works. Please do not remove the link back to this website or the copyright information.

Download Version 0.2

I am now openly accepting feature requests and answering questions. NOTE: For Single Column Playlist, Row Height: 17, Group Rows: 5. My Windows Visual Style is Inverso Reborn Balanced and a discussion and link can be found here. A good resource for downloading artist images is http://artists.trivialbeing.org

Components Required

Latest Version of PanelsUI
Quick Search
Custom info
CWB Hooks
ColumnsUI
Foo Run
Album List Panel
Windows Explorer Panel (direct link)

Fonts

Bebas
Calibri – Comes with Windows Vista and cannot be redistributed (but you may find a site that has it)
BigNoodleTitling

Read the rest of this entry »