Help - Search - Members - Calendar
Full Version: Foobar2000 format strings
Hydrogenaudio Forums > Hosted Forums > foobar2000 > General - (fb2k)
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25
voltron
QUOTE(ap1978 @ Mar 9 2003 - 11:39 AM)
Hehe tongue.gif The control's made by X-Fixer and sadly, doesn't work with the latest versions of foobar2000. I sent him a mail a few mins ago asking him to update it...

the latest version is .57 as per your screenshot.
neoufo51
Oh man, I didn't know those buttons and seekbar existed!

When he updates it, please tell him to let us know.
billcow
Just whipped this one up. works under .57, haven't tested older versions.
CODE

FFFFFF|FFFFFF$lower($num(%_playlist_number%,4). |
CCFFCC|CCFFCC
$repeat( ,$add($div($sub(32,$len(%artist%)),2),$mod($sub(32,$len(%artist%)),2)))%artist%$repeat( ,$div($sub(32,$len(%artist%)),2))
FFFFFF|FFFFFF|
FFFFCC|FFFFCC
$repeat( ,$add($div($sub(40,$len($if(%album%,'['$ifgreater($len(%album%),29,%album%…,%album%)[ #$num(%tracknumber%,2)]']',))),2),$mod($sub(40,$len($if(%album%,'['$ifgreater($len(%album%),29,%album%…,%album%)[ #$num(%tracknumber%,2)]']',))),2)))$if(%album%,'['$ifgreater($len(%album%),29,%album%…,%album%)[ #$num(%tracknumber%,2)]']',)$repeat( ,$div($sub(40,$len($if(%album%,'['$ifgreater($len(%album%),29,%album%…,%album%)[ #$num(%tracknumber%,2)]']',))),2))
FFFFFF|FFFFFF|
FFCCCC|FFCCCC
$repeat( ,$add($div($sub(50,$len(%title%)),2),$mod($sub(50,$len(%title%)),2)))%title%$repeat( ,$div($sub(50,$len(%title%)),2))
FFFFFF|FFFFFF|
) CCCCFF|CCCCFF%_length%


screenshot

works best with a black background and a fixed-width font. The reason I used "|"s instead of a block-drawing character is 'cause the font i'm using doesn't have those (it's a Type1 conversion from the computer modern TeX fonts, if anyone's curious)

pseudo-code for centering text is as follows:
CODE

$repeat( ,$add($div($sub(width,$len(string)),2),$mod($sub(width,$len(string)),2)))string$repeat( ,$div($sub(width,$len(string)),2))


BTW, $get and $put are back.

[edit]
Oops. Me = stupid. I used $strchr when i could have easily used $len. It's fixed now tho. I also added a function to add ellipses to the album name when it's 30 characters long (therefore indicating that it's a maxed-out ID3v1 tag, and thus not likely to be the whole album name). i could do it for the track name and artist too, but it's messy enough as it is.
[/edit]
ap1978
QUOTE(voltron @ Mar 9 2003 - 11:49 PM)
QUOTE(ap1978 @ Mar 9 2003 - 11:39 AM)
Hehe tongue.gif The control's made by X-Fixer and sadly, doesn't work with the latest versions of foobar2000. I sent him a mail a few mins ago asking him to update it...

the latest version is .57 as per your screenshot.

Yeah, the toolbar component shows up in recent versions of foobar2k but it's unusable, nothing works. I just started it in the version of foobar2k i use, just as an example of how it looks like -what to expect when/if it's updated smile.gif
billcow
CODE

$puts(SPACING,$if(%_isplaying%,FFFFFF|00003F$char(9608), ))
FFFFFF|FFFFFF$lower($num(%_playlist_number%,4). $char(9553)
$if(%title%,
$repeat($get(SPACING),$add($div($sub(32,$len(%artist%)),2),$mod($sub(32,$len(%artist%)),2)))CCFFCC|CCFFCC%artist%$repeat($get(SPACING),$div($sub(32,$len(%artist%)),2))
FFFFFF|FFFFFF$char(9553)
$repeat($get(SPACING),$add($div($sub(40,$len($if(%album%,'['%album%[ #$num(%tracknumber%,2)]']',))),2),$mod($sub(40,$len($if(%album%,'['%album%[ #$num(%tracknumber%,2)]']',))),2)))FFFFCC|FFFFCC$if(%album%,'['%album%[ #$num(%tracknumber%,2)]']',)$repeat($get(SPACING),$div($sub(40,$len($if(%album%,'['%album%[ #$num(%tracknumber%,2)]']',))),2))
FFFFFF|FFFFFF$char(9553)
$repeat($get(SPACING),$add($div($sub(50,$len(%title%)),2),$mod($sub(50,$len(%title%)),2)))FFCCCC|FFCCCC%title%$repeat($get(SPACING),$div($sub(50,$len(%title%)),2))
,
$repeat($get(SPACING),$add($div($sub(124,$len(%_filename%)),2),$mod($sub(124,$len(%_filename%)),2)))0000FF|0000FF%_filename%$repeat($get(SPACING),$div($sub(124,$len(%_filename%)),2))
FFFFFF|FFFFFF
)
FFFFFF|FFFFFF$char(9553)
) CCCCFF|CCCCFF%_length%


Updated mine to use $get and $put to allow for a nice highlighting of the playing song, and to display the filename if the title tag isn't found (in my mp3 collection this generally means that the playlist is pointing to the old location of a song that has since been moved to better fit my organization system, so it also sets the text color to red, and doesn't bother trying to look for any other tags)

screenshot
Bushwack
billcow I really like that centred text idea, nice work.

Keep the strings coming everyone, but keep the discussion about GUI hacks out of this thread please.
ak
After some fooling around had settled down with this:
QUOTE
$if(%_isplaying%,$puts(C,$char(9632)),$puts(C,$char(9633)))
$puts(N, $char(3)c7c7c7|c7c7c7$char(3))
$puts(D,$char(3)6c6c6c|6c6c6c$char(3)$get©)
$puts(L,%_length_seconds%)
$lower($get(D)$get(N)$padcut($if(%artist%,%artist%, ),16)
$get(D)$get(N)$padcut($if(%date%,%date%, ),4)
$get(D)$get(N)$padcut($if(%album%,$if(%disc%,$padcut(%album%,16)
'['%disc%']',$if(%volume%,$padcut(%album%,16)
'('%volume%')',%album%)), ),20)
$get(D)$get(N)$if(%tracknumber%,$num(%tracknumber%,2),
$if(%track%,$num(%track%,2),$padcut( ,2)))
$get(D)$get(N)$if(%title%,%title%,%_filename%)$char(9)
$get(D)$get(N)$ifgreater(1,$get(L),00:00,
$ifgreater(600,$get(L),0%_length%,
$ifgreater(3600,$get(L),%_length%,
$puts(H,$div($get(L),3600))
$puts(X,$sub($get(L),$mul($get(H),3600)))
$puts(M,$num($div($get(X),60),2))
$puts(S,$num($sub($get(X),$mul($get(M),60)),2))
$ifgreater(6000,$get(L),$add($get(M),60):$get(S),$get(H)h:$get(M))))) )
$get(D)$char(3)$char(3)

Edit: OMG, looks like ( C ) is converted to © automatically, is it new software or it always has been this way?
musicmusic
QUOTE(ak @ Mar 10 2003 - 05:33 PM)
Edit: OMG, looks like ( C ) is converted to © automatically, is it new software or it always has been this way?

yeh i think they upgraded to 1.1.1 from beta 4 or something.

try using a code block instead:

CODE
(c)
smok3
can i do something like:
'when 2nd backslash is found cut off the rest of the string and including that backslash' type of display on playlist? (for the paths)

edit:
so i get something like 'g:\music...' or 'd:\mp3...'
TurinsRevenge
Someone said that puts() and get() are back in .57 but they're not listed in help and I can't find the syntax. Can someone verify that they ARE back and if so, is this the correct syntax:

$puts(variable_name, value)
// Variable_name can be existing or it will be dynamically created.
// Value can be any string, numeric or hex value

$get(variable_name)
// Returns current value of variable_name. if there is no value or variable-name has not been created, returns null.


Thanks
billcow
nope, they aren't in the docs. and yup, that's how they work.
frod
For .58:

CODE

$puts(Q,$mod($div($get(COUNT),256),2))
$if($strcmp($get(Q),0),$puts(L,$mod($get(COUNT),256)),$puts(L,$sub(255,$mod($get(COUNT),256))))

$puts(HEX10,A)$puts(HEX11,B)$puts(HEX12,C)$puts(HEX13,D)$puts(HEX14,E)$puts(HEX15,F)
$puts(H,$get(L))$puts(T,$div($get(H),16))
$if($greater(10,$get(T)),$puts(V,$get(T)),$puts(V,$get(HEX$get(T))))
$puts(T,$sub($get(H),$mul($div($get(H),16),16)))
$if($greater(10,$get(T)),$puts(V,$get(V)$get(T)),$puts(V,$get(V)$get(HEX$get(T))))
$puts(BWG,$get(V)$get(V)$get(V))

// Playlist #
1212d0|1212d0$num(%_playlist_number%,4)':'

// Display replaygain indicator
$if(%__replaygain_album_gain%,9a3a45|9a3a45ώ,)
$if($and(%__replaygain_track_gain%, $not(%__replaygain_album_gain%)),5b2329|5b2329ώ,)
$if(%__replaygain_track_gain%%__replaygain_album_gain%,,0000FF|0000FFω)

$if(%_isplaying%,
$if(%title%,00e9f4|00e9f4$padcut($if(%artist%,%artist%,),25) $if(%tracknumber%,$padcut(DDDDDD|DDDDDD-00e9f4|00e9f4 $num(%tracknumber%,2) ,36),DDDDDD|DDDDDD-   ) $padcut($if(%title%,0000FF|0000FF- 00e9f4|00e9f4%title%,),70) $if(%date%,$padcut( DDDDDD|DDDDDD-00e9f4|00e9f4 '['%date%']',41), - '[    ]')
$if(%album%,$padcut(- 00e9f4|00e9f4%album%,52),$padcut('-   ',35)), $padcut(808080%_filename%BF408F,85)NO TAGS FOUND!$padcut(,33)),

$if(%title%,0078b9|1189ca$padcut($if(%artist%,%artist%,),25) $if(%tracknumber%,$padcut(DDDDDD|DDDDDD-1212d0|0000ff $num(%tracknumber%,2) ,36),DDDDDD|DDDDDD-   ) $padcut($if(%title%,0000FF|0000FF- DDDDDD|EEEEEE%title%,),70) $if(%date%,$padcut( -0078b9|1189ca '['%date%']',26), - '[    ]')

$if(%album%,$padcut(- 5B5B5B%album%,45),$padcut('-   ',35)), $padcut(808080%_filename%BF408F,85)NO TAGS FOUND!$padcut(,33))
)
[c4c441|FFFF80%_length%]$get(BWG)|$get(BWG)³FFB0FF|FFB0FF$pad_right($num(%__bitrate%,3),3)C080FF|C080FFkbps


Screenshot is here.

And here's an interesting snippet. It could probably be made a bit tighter, but oh well. It's a gradient thing that fades from one color to another. (Screenshot here)

CODE

// Define Gradient Start Color
$puts(R1,20)$puts(G1,254)$puts(B1,254)
// Define Gradient End Color
$puts(R2,254)$puts(G2,220)$puts(B2,1)
// Set Fade Speed
$puts(FS,5)

// Cycle RGB value for gradient
$puts(COUNT,$mul($get(FS),$sub(%_playlist_number%,1)))
$puts(RDIF,$sub($get(R2),$get(R1)))
$puts(GDIF,$sub($get(G2),$get(G1)))
$puts(BDIF,$sub($get(B2),$get(B1)))
$puts(BIGDIF,$max($max($get(RDIF),$get(GDIF)),$get(BDIF)))
$if($greater($get(BIGDIF),0),,$puts(BIGDIF,$mul($get(BIGDIF),-1)))
$puts(RSC,$div($mul($get(RDIF),$get(COUNT)),$get(BIGDIF)))
$puts(GSC,$div($mul($get(GDIF),$get(COUNT)),$get(BIGDIF)))
$puts(BSC,$div($mul($get(BDIF),$get(COUNT)),$get(BIGDIF)))
$puts(RDIR,$mod($div($get(RSC),$get(RDIF)),2))
$puts(GDIR,$mod($div($get(GSC),$get(GDIF)),2))
$puts(BDIR,$mod($div($get(BSC),$get(BDIF)),2))
$if($greater($get(RDIF),0),$puts(RDIR,$add($get(RDIR),1)),$puts(RDIR,$add($get(RDIR),1)))
$if($greater($get(GDIF),0),$puts(RDIR,$add($get(RDIR),1)),$puts(GDIR,$add($get(GDIR),1)))
$if($greater($get(BDIF),0),$puts(RDIR,$add($get(RDIR),1)),$puts(BDIR,$add($get(BDIR),1)))
$puts(RT,$mod($get(RSC),$get(RDIF)))
$puts(GT,$mod($get(GSC),$get(GDIF)))
$puts(BT,$mod($get(BSC),$get(BDIF)))

$if($strcmp($get(RDIF),0),$puts(R,0),$select($get(RDIR),$puts(R,$add($get(R1),$get(RT))),$puts(R,$sub($get(R2),$get(RT)))))
$if($strcmp($get(GDIF),0),$puts(G,0),$select($get(GDIR),$puts(G,$add($get(G1),$get(GT))),$puts(G,$sub($get(G2),$get(GT)))))
$if($strcmp($get(BDIF),0),$puts(B,0),$select($get(BDIR),$puts(B,$add($get(B1),$get(BT))),$puts(B,$sub($get(B2),$get(BT)))))

// Create Hex Code for Gradient
$puts(HEX10,A)$puts(HEX11,B)$puts(HEX12,C)$puts(HEX13,D)
$puts(HEX14,E)$puts(HEX15,F)

// Blue
$puts(H,$get(B))$puts(T,$div($get(H),16))
$if($greater(10,$get(T)),$puts(V,$get(T)),$puts(V,$get(HEX$get(T))))
$puts(T,$sub($get(H),$mul($div($get(H),16),16)))
$if($greater(10,$get(T)),$puts(V,$get(V)$get(T)),$puts(V,$get(V)$get(HEX$get(T))))
$puts(HEX,$get(HEX)$get(V))

// Green
$puts(H,$get(G))$puts(T,$div($get(H),16))
$if($greater(10,$get(T)),$puts(V,$get(T)),$puts(V,$get(HEX$get(T))))
$puts(T,$sub($get(H),$mul($div($get(H),16),16)))
$if($greater(10,$get(T)),$puts(V,$get(V)$get(T)),$puts(V,$get(V)$get(HEX$get(T))))
$puts(HEX,$get(HEX)$get(V))

// Red
$puts(H,$get(R))$puts(T,$div($get(H),16))
$if($greater(10,$get(T)),$puts(V,$get(T)),$puts(V,$get(HEX$get(T))))
$puts(T,$sub($get(H),$mul($div($get(H),16),16)))
$if($greater(10,$get(T)),$puts(V,$get(V)$get(T)),$puts(V,$get(V)$get(HEX$get(T))))
$puts(HEX,$get(HEX)$get(V))


Should be self-explanatory. You put the starting RGB value in R1,G1, and B1 and the end in R2,G2, and B2. The final hex code is in the variable HEX. To use that you just need something like:

CODE

$get(HEX)
Look at the colors!



If you find any bugs/see any way to make the code smaller, i'd like to know!
JEN
With the addition of a viewable seekbar in the statusbar, foobar (for me!) now feels complete

screenshot! smile.gif
Nivo
is it possible to leave out part of the filename? For example; right now its showing the filename if no tag is found, including .mp3... zo how do i leave the extention out?
Case
QUOTE(Nivo @ Mar 14 2003 - 03:08 PM)
is it possible to leave out part of the filename? For example; right now its showing the filename if no tag is found, including .mp3... zo how do i leave the extention out?

You get filename without extension by using %_filename% instead of %_filename_ext%. For more general text manipulation refer to 'functions' section in help text.
Nivo
doh... i knew it would be something simple... thanks smile.gif
Volcano
After upgrading to v0.58, I re-arranged some of the strings. The
status bar now displays a progress bar and the Track Gain value.

My current setup is listed here (it would be kinda hard to post it in
the thread without either loosing the spaces or contributing to the
mess caused by people not capable of using forum markup code
properly :alien:). I'll mess with colors and "real" columns later.

Here's a screenshot.
matrix
thank you all for providing nice formattin layout for n00bs like myself biggrin.gif foobar owns!!!!!
Canar
QUOTE(frod @ Mar 14 2003 - 01:34 AM)
For .58:

[snip]

If you find any bugs/see any way to make the code smaller, i'd like to know!

That's freakin' ugly... If only we had some sort of macro support, now, eh? I'm getting to the point where I could do some really interesting things if I had some way to implement functions, but unless that comes, there's now way I'm going to insert the amount of redundant code needed for proper formatting. I'm thinking of things like RGB to HSL conversion and vice-versa. HSL is so much nicer than RGB, but there's no easy way to do it right now in FB2K, at least numerically.
Solka
Mine is very simple, and it's like many others, maybe I must set it if there aren't tags, but atm is good enough for me biggrin.gif

CODE

$padcut(%_playlist_number%,5)B89425|  
$padcut([%artist%],20) B89425|      
$padcut([%album%] #[%tracknumber%],40)B89425|    
$padcut([%title%],40)B89425|  
$padcut([%comment%],25)B89425|
$char(9)%_length%


Screenshot: click. [~300kb]
billcow
I can't post my actual formatting string, or any actual strings, as I'm away from home for the weekend.

However, I did do some neat stuff with .58 before i left, so i'll give a short synopsis of that:

1.) I created code that creates a smooth transition from 0 to a value "n" and back every "n" seconds. It's neat to create a pulsing color effect in the statusbar, or to create a "Throbber" that's more complex than can be done with a $switch style statement like in the default statusbar string for .58. Unfortunately, it's limited to a resolution of one update per second, so it's more of a slow cdhange than an actual pulsing if you use it for color, and if used for a "throbber" the animation can be (IE is) kinda jerky.

2.) Improved my earlier centering code a bit to use variables to avoid duplicating code.

Plus, does anyone know how "$put" works? "$puts" stores a string to a variable, but what is "$put"? I would try to figure it out, but i'm currently stuck with a webtv for 'net access (blech), so I can't do anything more than theory until sunday. So my only guess is that it might be for macros ("$put(function,value,params)" or something like that maybe)
Solka
I changed my string, now fb2k looks a little bit different, just added date, CD if present and some colours...

shot. [~400kb]

string:
CODE

$padcut(%_playlist_number%,5)B89425|  
$padcut([%artist%],20) B89425|      
$padcut([%album%] $if(%CD%,CD%CD%) #[%tracknumber%],40)B89425|    
$padcut([%title%],50)B89425|    
FBF3CE$padcut([%comment%],25)B89425|
F3C994$padcut($if(%date%,y:%date%),7)B89425|
$char(9)6F6AFF%_length%
Dibrom
QUOTE(billcow @ Mar 14 2003 - 01:48 PM)
2.) Improved my earlier centering code a bit to use variables to avoid duplicating code.

Can you go a little more in depth into what you mean by this?

I've been putting together a rather complex display myself and have been working on making it as clean and easily configurable as possible, so I've been looking for more ways to do this sort of thing. So far I've been unsuccessful in creating anything like a 'function' though because the variables created with $puts are only evaluated on creation, not when they are called later with $get. As a result I've been having to duplicate rather large blocks of code... so have you found a way around this?

QUOTE
Plus, does anyone know how "$put" works? "$puts" stores a string to a variable, but what is "$put"? I would try to figure it out, but i'm currently stuck with a webtv for 'net access (blech), so I can't do anything more than theory until sunday. So my only guess is that it might be for macros ("$put(function,value,params)" or something like that maybe)


As far as I can tell, $put does the exact same thing as $puts, except that the second argument is sent to the display immediately at the same time it is sent to the variable, whereas with $puts, the second argument is not sent to the display until called with $get.
TurinsRevenge
I put this together so I could get a better feel for what the actual problems would be with creating functions/macros out of the current capability.

//Initialize Variables

//Store Reset Color Sequence
$puts(color_reset,)

//Store Color Red
$puts(color_red,0000FF)

//Store Color Black
$puts(color_black,000000)

//Store Elapsed and Total Time
$puts(time_elap_tot, %_time_elapsed%[ / %_time_total%])

//Store Time Percentage
$puts(time_percent,[ $div($mul(100,%_time_elapsed_seconds%),%_time_total_seconds%)])

//Store Progress Bar
$puts(progress_bar,$progress(%_time_elapsed_seconds%,%_time_total_seconds%,20,<$get(color_red)$get(time_percent)'%'$get(color_black)>,'—'))


//----Begin Status Bar Display----//

$Get(color_reset)
'|'
$Get(progress_bar)

$Get(color_reset)
'| '
$Get(time_elap_tot)

//----End Status Bar Display----//



Here're just a few thoughts for starters.

1. Need the ability to create andname functions so they can be reused across all of FB2K

2. functions and variables need to be global or local so different functions can communicate between scripts

3. Need the ability to have an init/DIM section. In the above example I'm initing the colors on every pass, which is unnecessary.

4. Ability to nest functions

5. Need looping, i.e. Do While

6. Return codes from functions

7. Ability to pass variables between local or global functions, i.e. FooU(artist, length, ret_code)

8. Evaluate variables at execution
Dibrom
QUOTE(TurinsRevenge @ Mar 14 2003 - 04:58 PM)
Here're just a few thoughts for starters.

1. Need the ability to create andname functions so they can be reused across all of FB2K

2. functions and variables need to be global or local so different functions can communicate between scripts

3. Need the ability to have an init/DIM section.  In the above example I'm initing the colors on every pass, which is unnecessary.

4. Ability to nest functions

5. Need looping, i.e. Do While

6. Return codes from functions

7. Ability to pass variables between local or global functions, i.e. FooU(artist, length, ret_code)

8. Evaluate variables at execution

I would like to see more flexibility in the tagz stuff myself, but I seriously doubt we'll ever see things progress to this level.

Most of the current problems could be resolved simply by an $eval() tag of some sort that would take a string and evaluate it as tagz code. In combination in with $puts and $get, this would allow for quite a bit more flexibility. The problem with this is that it would allow people to create scripts that would freeze fb2k. I talked to Peter about this last night and he said the only reason he hasn't added this sort of thing is just because of that. Maybe there is a solution somewhere that could be found that would allow for a safe system of doing this, but I don't know.
TurinsRevenge
Yeah, I agree. After writing this I came back to reality and realized what a Pandora's box it was. Going down that road, sooner or later someone would eventually ask him to write a FB-specific compiler. hehehe

The reason I like FB2K is that it's more about the accurate reproduction of music than it is about the player's technology or looks. In spite of what some may say, I like the UI because it's intuitive, easy to use and flexible. And the fact that FB2K is resource friendly completes the packasge.

It's a very tricky balancing act for a developer to figure out what the most important features are, put them together in the right way, keep his options open for future requirements and keep it easy-to-maintain, efficient and bug-free (not to mention maybe making some money from it in the future).

So often it's easy for people who don't see the full product vision to throw out ideas that would take the product in the wrong direction. And as keeper of the vision, I guess only Peter knows the right path wink.gif

Now about that compiler... biggrin.gif
Canar
QUOTE(TurinsRevenge @ Mar 14 2003 - 05:40 PM)
Now about that compiler...  biggrin.gif

I've said it before, and I'll say it again: Why not compile Perl in? Hell, even LISP? ph34r.gif
TurinsRevenge
Actually, I was thinking COBOL. biggrin.gif
Golly
hey dudes, for those who are interested i made a little thingy for the colour of the bitrate when i display it.
If the bitrate is below a 128kbps it will display in red, if not it will be somewhere between 128(green) and 320(blue) so the colour for 224kbps will be halfway between green and blue, get i mean?
U can customise the low bitrate and the colours with the vars at the top, i'm terrible with colour coordination so i'll probably get someone else to pick better colour for me later tongue.gif


//Shit bitrate threshold and colour
$puts(SB_T,127)
$puts(SB_C,0000FF)

//Low and High Bitrate colours
$puts(LB_R,20)
$puts(LB_G,128)
$puts(LB_B,20)
$puts(HB_R,0)
$puts(HB_G,0)
$puts(HB_B,255)

//////////////// dont change below ////////////////

//Set bitrate colour
$if($greater(%__bitrate%,$get(SB_T)),
$puts(BR,$div($mul($sub(%__bitrate%,$get(SB_T)),255),$sub(320,$get(SB_T))))
$puts(BR_R,$add($get(LB_R),$div($mul($sub($get(HB_R),$get(LB_R)),$get(BR)),255)))
$puts(BR_G,$add($get(LB_G),$div($mul($sub($get(HB_G),$get(LB_G)),$get(BR)),255)))
$puts(BR_B,$add($get(LB_B),$div($mul($sub($get(HB_B),$get(LB_B)),$get(BR)),255)))
$puts(BR_C,$hex($get(BR_B),2)$hex($get(BR_G),2)$hex($get(BR_R),2))
,
$puts(BR_C,$get(SB_C)))

//////////////// bitrate colour now stored in BR_C ////////////////

//Display Bitrate
$get(BR_C)'['%__bitrate% kbps']'
DarkAngel
this is a slightly modified version of the excellent formatting posted by frod on page 5 of this thread.

Its 2:30am here, and my modifications are such an ugly hack of it all i wont post the code in all its glory here for fear of causing shock, instead look here.

A screenshot is here: screenshot
(note: the far right coloumns do highlight on select, but it wont capture. HypserSnap has a crap GIF encoder, JPEG is even worse at 100% quality.)

its also quite large, screen real-estate wise, but i do run at 1600x1200.

edit, forgot to say, background is (R,G,B) 32,36,49, font is ProFontWindows, frame is 167,167,167
billcow
Dibrom:
What I meant by cleaning up my centering code was that I created a variable for the text that was being centered, and then referenced that variable everywhere it was used. For simple strings like %artist% it didn't simplify things much, but for longer things, such as if the artist is deduced from the filename, it makes it a lot more readable. I would attempt to put it here, but like i said, I'm stuck with a WebTV at the moment, and trying to type anything very long is complicated enough, and when i have to worry about parentheses, i'd be likely to mess it up so bad as to seriously confuse anyone who tried to use it.

Basically, what it came down to is that it comes out as (formatted more as C than fb2k code, btw. less parens to type wrong):
CODE

$repeat( ,$get(SPACELEFT))
$get(STR)
$repeat( ,$get(SPACERIGHT))


If nothing else, now I can change the text that gets centered without having to change it in about 8 places.

And my personal opinion about solving the scripting problem - formatting plugins. The script could include something like '$function(component,function,parameters', foobar would call the corrosponding component DLL with the function name and the parameters, the DLL would return a string, and foobar would put that in the output.

It wouldn't have the problem with easily crashing foobar, or at least not the problems associated with that, because presumably, anyone who can write a plugin should know better than to complain to Peter when their untested code crashes his program.

It wouldn't have issues with bloating foobar, because all the code would be in a seperate file.

It would also be simple to prevent unnecessary duplication of code - foobar could process the parameter string before it passes it to the DLL (replacing anything tagz recognizes), and then do the same with what it gets back before it prints it. Any recursion there could be elimiated by bypassing anything that would call another DLL.

And if someone wanted to get really crazy, they could write their own script language as a function. Then they could implement anything from Perl to COBOL to Brainf*ck.
penvzila
Don't know if it's my favorite but I did make it:

Playlist:

CODE
$if(%_isplaying%,D39850$padcut($num(%_playlist_number%,4),4)
$padcut(%_filename_ext%,100)
|
$padcut(%_length%,7)
$padcut(%_length_seconds%s,5)
|
%__bitrate%,
CB30CF|A7EDCC$padcut($num(%_playlist_number%,4),4) 000000|EE6C35$padcut(%_filename_ext%,100) 99762D|404080|$padcut(%_length%,7) $padcut(%_length_seconds%s,5)|A35C5A|FFFFFF
$if(%__bitrate%,$padcut(%__bitrate%,3),???))

|$if(%__replaygain_track_gain%,%__replaygain_track_gain%, )


System Tray

CODE
$abbr(%_filename%,50)


Window Title

CODE
%_foobar2000_version% is now playing %_filename_ext% %_length% at %__bitrate%Kbps %__samplerate%Hz in $if(%__channels%,$ifgreater(%__channels%,2,%__channels%ch,$ifgreater(%__channels%,1,stereo,mono)) ,)[%__extrainfo%]


Status Bar Now with mad colors

CODE
:::FB006A%_time_elapsed% $progress($div($mul(100,%_time_elapsed_seconds%),%_time_total_seconds%),100,100,595959$num($div($mul(100,%_time_elapsed_seconds%),%_time_total_seconds%),2)'%',808080'|')808080'|' 408000%_time_remaining% 0CB407 '('%_time_total%')' 0059B3Replaygain:$if(%__replaygain_track_gain%,%__replaygain_track_gain%, None) 27278BPeak: $if(%__replaygain_track_peak%,%__replaygain_track_peak%, None)    8000FF-={

$select($add($mod(%_time_elapsed_seconds%,12),1),'f','fo','foo','foob','fooba','foobar','fooba','foob','foo','fo','f',' ')

8000FF}=- 
DustMagnet
One trick that I haven't seen posted yet:

CODE
$if2($if($stricmp(the ,$left(%artist%,4)),
$right(%artist%,$sub($len(%artist%),4)),%artist%),'Artist')


I'm removing "The " from the start of Artist if it exists. That way "The Doors" and "Doors", for example, display the same. The code is a bit convoluted because I need a $cut_right(A,x) function. (hint hint wink.gif ). Or maybe I'm just being retarded.

And in case you're wondering, I've renamed the band "The The" as "The The The" to avoid code for that one case. laugh.gif
Dibrom
QUOTE(billcow @ Mar 14 2003 - 09:01 PM)
Dibrom:
What I meant by cleaning up my centering code was that I created a variable for the text that was being centered, and then referenced that variable everywhere it was used. For simple strings like %artist% it didn't simplify things much, but for longer things, such as if the artist is deduced from the filename, it makes it a lot more readable. I would attempt to put it here, but like i said, I'm stuck with a WebTV at the moment, and trying to type anything very long is complicated enough, and when i have to worry about parentheses, i'd be likely to mess it up so bad as to seriously confuse anyone who tried to use it.

Basically, what it came down to is that it comes out as (formatted more as C than fb2k code, btw. less parens to type wrong):
CODE

$repeat( ,$get(SPACELEFT))
$get(STR)
$repeat( ,$get(SPACERIGHT))


If nothing else, now I can change the text that gets centered without having to change it in about 8 places.

Ah, yes. I wasn't sure if this is what you meant, or if you'd found a way to create something like a function. I've been doing exactly what you're speaking of with the layout that I'm working on right now (which, btw, borrows your idea of centered text smile.gif). I'm basically working on making a highly configurable, easily readible, script with reusable components. The part that is a bit of a pain in the ass is in having to repeat a rather large code block for each column, even when using variables. I had come up with a really nice setup for solving this problem before I realized that no matter what you do, strings are evaluated on declaration with $puts, and so they never chagne, even if they rely on variables that are modified before $get is called :/ (This was my first real experimentation with $put[s]/$get and trying to create something non-basic)

At any rate, I'll post what I'm working on here when I get more of my initial ideas implemented.

QUOTE
And my personal opinion about solving the scripting problem - formatting plugins. The script could include something like '$function(component,function,parameters', foobar would call the corrosponding component DLL with the function name and the parameters, the DLL would return a string, and foobar would put that in the output.


An interesting idea, but I think this would still allow for the type of problems that Peter seems to want to avoid, mainly that with this level of power in scripting, the possibility to freeze foobar with a bad script becomes much easier.

QUOTE
It wouldn't have the problem with easily crashing foobar, or at least not the problems associated with that, because presumably, anyone who can write a plugin should know better than to complain to Peter when their untested code crashes his program.


Hrmm.. I do recall this very thing happening with one of the early fb2k plugins for which links were removed from this forum wink.gif

While technically people shouldn't bitch at Peter, I'm not so sure it would actually happen that way. No matter how clearly you try to point out possible risks or problems, people still seem to find a way to be surprised when it happens.

QUOTE
It wouldn't have issues with bloating foobar, because all the code would be in a seperate file.


True, though I don't think that adding the type of functionality necessary to have something like an $eval function (which would allow for recursion) would really add too much bloat though.

QUOTE
And if someone wanted to get really crazy, they could write their own script language as a function. Then they could implement anything from Perl to COBOL to Brainf*ck.


It would be pretty cool to have a plugin which could leverage the power of languages like Perl or Python for string manipulation. I wonder if the current SDK would allow for something like this.

While we're at it, I think it would be rather cool if a plugin were made that would allow for loading an entire tagz display setup, along with fonts, color setups, etc, from an archive of sorts. That way people could distribute tagz display schemas easily. Functionality could even be added to select from different archives on the fly and have them update the playlist in realtime. Kind of like a skin browser, but just for tagz. It seems rather like a logical progression to me given the increasing complexity of the scripts we are seeing and the continued interest people have in creating new layouts and trying out new ideas. smile.gif
neoufo51
I dunno bout you guys, but I want to see the best possible status bar display that you guys could produce. I really dislike the default one.
xamphear
QUOTE(neoufo51 @ Mar 15 2003 - 01:34 AM)
I dunno bout you guys, but I want to see the best possible status bar display that you guys could produce. I really dislike the default one.

CODE
'['$progress(%_time_elapsed_seconds%,%_time_total_seconds%,30,'©','–')']'
[ '['%__bitrate%kbps @ %__samplerate%khz']']
I like simplicity.
penvzila
QUOTE(neoufo51 @ Mar 14 2003 - 10:34 PM)
I dunno bout you guys, but I want to see the best possible status bar display that you guys could produce. I really dislike the default one.

How about this monster? I took the color bitrate thing from some guy here.

CODE
:::FB006A%_time_elapsed%:::$progress($div($mul(100,%_time_elapsed_seconds%),%_time_total_seconds%),100,100,595959$num($div($mul(100,%_time_elapsed_seconds%),%_time_total_seconds%),2)'%',808080'|')808080'|' :::408000%_time_remaining%:::0CB407 '('%_time_total%')' 0059B3Track Peak:$if(%__replaygain_track_peak%,%__replaygain_track_peak%, None) 

$puts(SB_T,127)
$puts(SB_C,0000FF)

$puts(LB_R,20)
$puts(LB_G,128)
$puts(LB_B,20)
$puts(HB_R,0)
$puts(HB_G,0)
$puts(HB_B,255)

$if($greater(%__bitrate%,$get(SB_T)),
$puts(BR,$div($mul($sub(%__bitrate%,$get(SB_T)),255),$sub(320,$get(SB_T))))
$puts(BR_R,$add($get(LB_R),$div($mul($sub($get(HB_R),$get(LB_R)),$get(BR)),255)))
$puts(BR_G,$add($get(LB_G),$div($mul($sub($get(HB_G),$get(LB_G)),$get(BR)),255)))
$puts(BR_B,$add($get(LB_B),$div($mul($sub($get(HB_B),$get(LB_B)),$get(BR)),255)))
$puts(BR_C,$hex($get(BR_B),2)$hex($get(BR_G),2)$hex($get(BR_R),2))
,
$puts(BR_C,$get(SB_C)))

$get(BR_C)%__bitrate%kbps

 8000FF-={
$select($add($mod(%_time_elapsed_seconds%,12),1),'f','fo','foo','foob','fooba','foobar','fooba','foob','foo','fo','f',' ')

8000FF}=- 
Golly
i like mine. as usual though i'm still indecsisive about my choice of colours.......
......although see how ive got a low bitrate thershold, i'm thinking about adding a high one too.......
Screen shot here

//Progress bar colours
$puts(PB_C1,0000FF)
$puts(PB_C2,FF0000)
$puts(PB_C3,B80000)
$puts(PB_C4,0000A8)

//Shit bitrate threshold and colour
$puts(SB_T,127)
$puts(SB_C,0000FF)

//Low and High Bitrate colours
$puts(LB_R,0)
$puts(LB_G,116)
$puts(LB_B,0)
$puts(HB_R,160)
$puts(HB_G,0)
$puts(HB_B,220)

////////////////////////////////////////////////////

//Set bitrate colour
$if($greater(%__bitrate%,$get(SB_T)),
$puts(BR,$div($mul($sub(%__bitrate%,$get(SB_T)),255),$sub(320,$get(SB_T))))
$puts(BR_R,$add($get(LB_R),$div($mul($sub($get(HB_R),$get(LB_R)),$get(BR)),255)))
$puts(BR_G,$add($get(LB_G),$div($mul($sub($get(HB_G),$get(LB_G)),$get(BR)),255)))
$puts(BR_B,$add($get(LB_B),$div($mul($sub($get(HB_B),$get(LB_B)),$get(BR)),255)))
$puts(BR_C,$hex($get(BR_B),2)$hex($get(BR_G),2)$hex($get(BR_R),2))
,
$puts(BR_C,$get(SB_C)))

//Filename
%_path%

//bitrate
'['$get(BR_C)
%__bitrate%kbps$get(BR_C)
[ $div(%__samplerate%,1000)kHz$get(BR_C)]
$if(%__channels%,$ifgreater(%__channels%,2, %__channels%ch$get(BR_C),$ifgreater(%__channels%,1, Stereo, Mono)),)
']'

//Progress
$get(PB_C1)'['$get(PB_C3)%_time_elapsed%
$get(PB_C1)|$progress(%_time_elapsed_seconds%,%_time_total_seconds%,16,$get(PB_C2)#$get(PB_C1),=)|
[$get(PB_C4)%_time_total%$get(PB_C1)']']
Golly
man i suck with colours, i changed em again, this looks better (i'm talking about the playlist btw, not status bar)

if anyone has any better ideas with colours lemme know

screenshot here

$puts(SB_C,0048C0)
$puts(LB_R,255)
$puts(LB_G,92)
$puts(LB_B,22)
$puts(HB_R,255)
$puts(HB_G,255)
$puts(HB_B,182)
anza
As I already told in the other thread, I changed the title formatting a bit. Actually it's just been little fine tuning, but there's also some "bigger" changes (like theprogress bar).

QUOTE
Playlist:
// the playlist number
DBDBDB|CCCCCC$num(%_playlist_number%,4).

// if the file is mp3PRO (has a %mp3% -tag), the first · is red
$if(%mp3%,0000FF|0000FF,DBDBDB|CCCCCC)·

// if the file hasn't got replaygain-track info, the second · is red
$if(%__replaygain_track_gain%,DBDBDB|CCCCCC,0000FF|0000FF)·

// if the file is playing, it'll show a red » in front of the "artist - title"
$if(%_isplaying%,0000FF|0000FF »,)
[ 535353|535353%artist%]
[DBDBDB|DBDBDB - %title%][ '['%comment%']']  
[$char(9)535353|535353%_length%]

System tray:
%_foobar2000_version% [playing: %genre%]

Window title:
'['%_length%']' "%title%" by %artist%

Status bar:
// shows time elapsed in the progress bar
|$progress(%_time_elapsed_seconds%,%_time_total_seconds%,20,%_time_elapsed%,'—')|

//bit- and samplerate
$char(9)[%__bitrate%kbps ][$div(%__samplerate%,1000).$substr(%__samplerate%,3,3)kHz]


The font's the same, ProFontWindows, 7
PL text color: 219, 219, 219
PL BG color: 0, 0, 0
PL selection color: 20, 20, 20
Selected item frame color: 0, 0, 0
musicmusic
my current strings, commented:

playlist

could be better, but stupid font doesnt have all the other chars, and no other font has same vertical spacing and looks nice

features: tab hack columns, new long field truncatator (using "…" char) which checks if they end in a space after trucation and eliminates it, separate now playing script (needs work) to remove truncations for current playing file and easily show it, colour transitions for current highlighted track (needs work too).

font: trebuchet ms, point 7
background: 15, 17, 19
designed for window about 750 pixels wide
selection colour: 55, 78, 128
item frame: 194, 205, 231

CODE
//now playing artist colour
$puts(artistcol,0BC886|26DF50)

//nowplayling main colour
$puts(plcol,10AFE4|12B9EF)

//enable for red nowplaying main col
//$puts(plcol,0C00D5|322DFF)

// playlist colour, old colour was c47F5e, temp disabled.
//$puts(normcol,D88163|ffAA80)

// now playing in front character
$puts(plfc,>)

// now playing separator
$puts(plsep,$char(9642))

// artist field truncatation length
$puts(tartist,33)

// title field truncatation length
$puts(ttitle,92)

// album field truncatation length
$puts(talbum,24)

// check if playing
$if(%_isplaying%,

// if playling use this for formatting
$get(plcol)
$repeat($get(plfc),4)   Now Playing:   $get(artistcol)%artist%  $get(plsep)  %title%$if(%album%,  $get(plsep)  From The Album "%album%",)  

// colours + separators
$get(plcol)$repeat($get(plfc),2)  

// display length
%_length%

// if not playing
,

// declare colour code
$get(normcol)

// store artists + truncate
$puts(artist,$ifgreater($len(%artist%),$get(tartist),$cut(%artist%,$sub($get(tartist),2))…,%artist%))
$puts(artist2,$ifgreater($len(%artist%),$get(tartist),$cut(%artist%,$sub($get(tartist),3))…,%artist%))

// artist
$transition($if($strcmp($strrchr($get(artist),' '),31),$get(artist2),$get(artist)),$rgb(99,129,217,152,70,0),$rgb(99,129,217,0,0,0))

// column
$repeat($char(9),1)

// store titles + truncate
$puts(title,$ifgreater($len(%title%),$get(ttitle),$cut(%title%,$sub($get(ttitle),2))…,%title%))
$puts(title2,$ifgreater($len(%title%),$get(ttitle),$cut(%title%,$sub($get(ttitle),3))…,%title%))

// title
$transition($if($strcmp($strrchr($get(title),' '),53),$get(title2),$get(title)),$rgb(99,129,217,0,0,0),$rgb(99,129,217,152,70,0))

// column
$repeat($char(9),3)

// redeclare colour code for column
$get(normcol)

// store album + truncate
$puts(album,$ifgreater($len(%album%),$get(talbum),$cut(%album%,$sub($get(talbum),2))…,%album%))
$puts(album2,$ifgreater($len(%album%),$get(talbum),$cut(%album%,$sub($get(talbum),3))…,%album%))

// display album
$if(%album%,
$transition($if($strcmp($strrchr($get(album),' '),22),$get(album2),$get(album)),$rgb(99,129,217,152,70,0),$rgb(99,129,217,0,0,0))
,)

// right aligned
$repeat($char(9),1)

// redeclare colour code for right aligned part of playlist
$get(normcol)

// display length
$transition(%_length%,$rgb(99,129,217,0,0,0),$rgb(99,129,217,152,70,0))

// end isplaying if statement
)


statusbar

this i am happy with.

features: virtual separators like those previously between fileinfo/status, colour custom coded progress bar with time moving towards total time. will prolly add more fields to this as i need them.

CODE
// set main text colour, BGR
$puts(colour,$rgb(77,77,77))

// set separator
$puts(sep, CDBDB1|$get(colour) )

// get colourcode
$get(colour)

// display track if present, and is not 00, with seperator
$if($strcmp(%tracknumber%,00),,Track: %tracknumber%$get(sep))

// display year if present with seperator. not using [] because dont work.
$if(%date%,Year: %date%$get(sep),)

// display bitrate with seperator
$if(%__bitrate%,%__bitrate%kbps$get(sep),)

// display channels + sep
$if(%__channels%,$ifgreater(%__channels%,2,%__channels%ch,$ifgreater(%__channels%,1,Stereo,Mono)),)
$get(sep)

// extension + sep
$upper($ext(%_filename_ext%))
$get(sep)

// trackgain,cut-off at 1dp
[Gain: $left(%__replaygain_track_gain%,$add($strchr(%__replaygain_track_gain%,.),1)) dB$get(sep)]

// display extra infos, disabled
//[%__extrainfo%$get(sep)]

// second thing, disabled
// $select($add($mod(%_time_elapsed_seconds%,4),1),$char(8213),' \',' |',' /')

// progress slider, disabled
// 1000D2$progress(%_time_elapsed_seconds%,%_time_total_seconds%,35,0392C0%_time_elapsed%056B1F,'»')

// custom progress bar

// length, not including indicator. $progress counts indicator as single char so value here is one higher than that in $progress
$puts(plen,35)

// left char
$puts(leftchar,«)

// right char
$puts(rightchar,»)

// indicator
$puts(mbit,%_time_elapsed%)

// offset for first/last position, leave alone
$puts(offset,

// due to decimals getting cut off, effectively rounding them down, we check if this has happened as the only decimal would be .5 and this should round up. we could actually get the same effect by adding one before divide always instead of using an $ifgreater statement
$ifgreater(
$div(%_time_total_seconds%,$get(plen)),
$mul($div(%_time_total_seconds%,$mul($get(plen),2)),2),

// these lines calculate half of the period of time that the indicator takes to move one char
$add($div(%_time_total_seconds%,$mul($get(plen),2)),1),
$div(%_time_total_seconds%,$mul($get(plen),2))

//close $ifgreater ad $put
))

// calculate how many left chars to show
$puts(gone,$div($mul($add(%_time_elapsed_seconds%,$get(offset)),$get(plen)),%_time_total_seconds%))

// before colour
2222EE
//1000D2

// show before part
$repeat($get(leftchar),$get(gone))

// indicator col
0392C0

// show indicator
$get(mbit)

// right part col
0B8A5E
//0B9565
//056B1F
//0A9E6A

//show right part, generated from whats currently on left part to prevent rounding problems
$repeat($get(rightchar),$sub($get(plen),$add($get(gone),0)))

// colour
$get(colour)

// total time
[$get(sep)%_time_total%]$get(sep)


edit: updated strings. if %_volume% comes, i already have a script for it wink.gif
edit: minor fix for forum as i was asked about it. and added colours for playlist item frame/selection etc.
Golly
QUOTE(musicmusic @ Mar 15 2003 - 02:56 PM)
progress bar feature req
ability to use different chars for before and after indicator, e.g. <<<<<<<<56%>>>>>>>

yeah, i just made this dude, go here
musicmusic
QUOTE(Golly @ Mar 16 2003 - 12:25 AM)
yeah, i just made this dude, go here

hehe, made my own custom progress silder instead.

my progress silder part of status bar is now:

CODE
// custom progress bar

// length, not including indicator. $progress counts indicator as single char so value here is one higher than that in $progress
$puts(plen,35)

// left char
$puts(leftchar,«)

// right char
$puts(rightchar,»)

// indicator
$puts(mbit,%_time_elapsed%)

// offset for first/last position, leave alone
$puts(offset,
$ifgreater(
$div(%_time_total_seconds%,$get(plen)),
$mul($div(%_time_total_seconds%,$mul($get(plen),2)),2),
$add($div(%_time_total_seconds%,$mul($get(plen),2)),1),
$div(%_time_total_seconds%,$mul($get(plen),2))
))

// calculate how many left chars to show
$puts(gone,$div($mul($add(%_time_elapsed_seconds%,$get(offset)),$get(plen)),%_time_total_seconds%))

// before colour
2222EE

// show before part
$repeat($get(leftchar),$get(gone))

// indicator col
0392C0

// show indicator
$get(mbit)

// right part col
0B8A5E

//show right part, generated from whats currently on left part to prevent rounding problems
$repeat($get(rightchar),$sub($get(plen),$add($get(gone),0)))


edit: whoops forgot i put this here to. this is the updated version im am using, in fact ill edit my whole string above. whoever used it (anza,bluescreenjunky) you may want to change to this code instead, it works better.
Spadge
Here's mine:

CODE

//If isplaying = true
$ifgreater(%_isplaying%,0,

//////////////////////////////////Do this

//     Playlist Number
0000FF%_playlist_number%$repeat($char(9),2)'│'

//     Artist
$if(%artist%,0000FF$upper(%artist%),'UNKNOWN ARTIST')$repeat($char(9),17)'│'

//     Title
$if(%title%, 0000FF$upper(%title%),'UNKNOWN TITLE')$repeat($char(9),19)

//     Length
'['0000FF%_length%']'$repeat($char(9),3)'│'

//     Album
$if(%album%, 0000FF$upper(%album%),'UNKOWN ALBUM')$repeat($char(9),20)

//     Tracknumber
$if(%tracknumber%,0000FF '[#'$num(%tracknumber%,2)']',' ')$repeat($char(9),3)
' '

//////////////////////////////////////////Otherwise do this

//      Playlist Number
,%_playlist_number%$repeat($char(9),2)'│'

//     Artist
$if(%artist%,%artist%,'UNKNOWN ARTIST')$repeat($char(9),17)'│'

//     Title
$if(%title%,%title%,'Unkown Title')$repeat($char(9),19)

//     Length
'['%_length%']'$repeat($char(9),3)'│'

//      Album
$if(%album%,%album%,'Unkown Album')$repeat($char(9),20)

//     Tracknumber
$if(%tracknumber%,'[#'$num(%tracknumber%,2)']','    ')$repeat($char(9),3)' ')


font: Century Gothic (Bold)

Playlist Backgroud: Black
Playlist Font Colour: White


EDIT: Added Colours
Ghim
Why don't you just use : $if(%_is_playing%, , ) instead of $ifgreater(%_is_playing%, , ) ??

And you could easily make your code shorter...

by example :
$if(%_is_playing%,$puts(color,0000FF),$puts(color,))
anza
As people have begun to use colors in their status-bars, I decided to do so also. So here's my new formatting for the status bar:
CODE
$puts(barlength,20)
$puts(elapsed,|)
$puts(timeleft,—)
$puts(pos,$select($add($mod(%_time_elapsed_seconds%,4),1),'—,'\','|','/'))
$puts(gone,$div($mul(%_time_elapsed_seconds%,$get(barlength)),%_time_total_seconds%))

'['0000FF
$repeat($get(elapsed),$get(gone))
000000
$get(pos)
$repeat($get(timeleft),$sub($get(barlength),$get(gone)))
']'

$char(9)
$ifgreater(%__bitrate%,0,0000FF,)
$ifgreater(%__bitrate%,99,0080FF,)
$ifgreater(%__bitrate%,160,008000,)
$ifgreater(%__bitrate%,319,FFFF00,)
%__bitrate%kbps

$ifgreater(%__samplerate%,0,0000FF,)
$ifgreater(%__samplerate%,22050,008000,)
$ifgreater(%__samplerate%,44100,FFFF00,)
$div(%__samplerate%,1000).$substr(%__samplerate%,3,3)kHz


Should look something like this:
[|||||||||/——————————] 192kbps 44.1kHz
Where the "/" is the rotating thing smile.gif
BlueScreenJunky
Okay, here's mine. It's rather simple, I've shamelessly stolen what others have done, but I like it :-)

Screenshot here


Playlist :
CODE
9E9E9E$num(%_playlist_number%,3). $if(%artist%,%artist%,'Unknown Artist') $if(%album%, - %album%,)


$repeat($char(9),7)
$if(%title%,%title%,%_filename%)
$repeat($char(9),6)

$ifgreater(%__bitrate%,0,0000FF,)
$ifgreater(%__bitrate%,95,4080FF,)
$ifgreater(%__bitrate%,127,00CC00,)
$ifgreater(%__bitrate%,159,008000,)
$ifgreater(%__bitrate%,191,A00000,)
$ifgreater(%__bitrate%,255,FF0000,)


%__bitrate%kbps $ext(%_path%)

$repeat($char(9),3)
%_length%


Status bar :
CODE
$puts(plen,50)
$puts(leftchar,|)
$puts(rightchar,|)

[%_time_elapsed%]

$puts(gone,$div($mul(%_time_elapsed_seconds%,$get(plen)),%_time_total_seconds%))

$if(%_time_total%,
'['
$repeat($get(leftchar),$get(gone))
919191$get(mbit)
B2B2B2$repeat($get(rightchar),$sub($get(plen),$get(gone)))
']'
[%_time_total%], '['Total Time Unavailable']')

$char(9)
%__bitrate%kbps
$div(%__samplerate%,1000) kHz


Update !!! : Is now compatible with files which don't have total time (like TFMX). The status bar displays a "total time unavailable" message instead of the progress bar becoming insanely long. (hey, I actually found that myself tongue.gif )
penvzila
screenshot
Rommel
@penvzila
the extension of the file in your screenshot link is .txt huh.gif
I think your image is .png smile.gif
spase
here we are... format string version 2.0... complete with imaginary columns and a jazzy screenshot!

i havent inspected everyone elses strings, but this one makes some special provisions for .cue files... i havent seen such things anywhere else.

CODE
$if(%_isplaying%,1E67FF|FFFFFF,)$pad_right(%_playlist_number%,4) $repeat($char(9),1) 808080- $if(%_isplaying%,1980FF|FFFFFF,)$if($stricmp($right(%_filename_ext%,3),cue),%TRACK_ARTIST%,$if2(%artist%,'Unknown Artist'))$repeat($char(9),8) 808080- $if(%_isplaying%,1980FF|FFFFFF,)$if2(%title%,%_filename%)$repeat($char(9),10) 808080- $if(%_isplaying%,1980FF|FFFFFF,)['('$num(%tracknumber%,2)') ']$if2(%album%,'Unknown Album')$repeat($char(9),7) 808080- $if(%_isplaying%,1980FF|FFFFFF,)[%genre%]$repeat($char(9),6) 808080- $if(%_isplaying%,1980FF|FFFFFF,)%_length%


screenshots: Desktop screenshot and foobar2000 screenshot
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.