Brother John’s Projects: Foobar2000 Scripting

Scripting the Bars and Tooltip in 0.8.3

Finally below you can find the 0.8.3 scripts for the bars. Like in Foobar2000 0.9 enter them into the appropriate tabs on Preferences / Display / Title formatting.

The Title Bar Script

[%artist%' - ']
$if2(%title%,%_filename%)
[' ['%album%']']

The Status Bar Script

The changes to the part of the script involving %__channels% has not only the different field name (%channels% in 0.9) as a reason. The 0.9 field also returns ‘mono’ and ‘stereo’ for 1 and 2 channels automatically.

$puts(AltColour,$rgb(126,16,16))
$puts(pbarColour1,$rgb(126,16,16))
$puts(pbarColour2,$rgb(170,170,170))

$if($strcmp(%__codec%,'ATSC A/52'),'Dolby Digital AC3',
$if($info(lame_version),'Lame MP3',
$if($strcmp(%__codec%,'Vorbis'),'Ogg Vorbis',
$if($strcmp(%__codec%,'FLAC'),'FLAC lossless',
$if($strcmp(%__codec%,'PCM'),'PCM uncompressed',
%__codec%
)))))

$get(AltColour)'   '

[%__bitrate%' kbit/s'][' '%__samplerate%' Hz']

$ifgreater(%__channels%,2,' '%__channels%' channels',
$ifgreater(%__channels%,1,' Stereo',
$ifgreater(%__channels%,0,' Mono',
)))

'   '

%_time_elapsed%[' of '%_time_total%]

'   '

// progress bar
$if(%_time_total_seconds%
,
$progress2(%_time_elapsed_seconds%,%_time_total_seconds%,
10,
$get(pbarColour1)$char(9679),$get(pbarColour2)$char(9679)
)

' '
$muldiv(%_time_elapsed_seconds%,100,%_time_total_seconds%)
' %'
)

// paused status
$if(%_ispaused%,$char(9)'pause {on} ')

The System Tray Tooltip Script

$if(%title%,
[%artist%' - ']%title%
[$crlf()%album%][' #'$num(%tracknumber%,2)],
%_filename%)

Done

That’s it. You now have Dark Connections for Foobar2000 0.8.3 working completely. A screenshot really isn’t necessary, because visually no difference to the 0.9 version exists. As always you might want to download Dark Connections v1.0.1. If you already got the FCS before the porting chapter was finished, get it again because some minor changes were made.