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
vcv
QUOTE(largesock @ Mar 14 2004, 01:20 AM)
Wouldn't $if($and(a,b),c,d) be a little more readable?

Of course, didn't know of $and, thank you.

QUOTE
maybe not, but i really like this layout

what font are you using?
Thanks. Lucida Console.
lav-chan
Heh, i just can't keep away from here.


Something just occurred to me. Let me know if this is painfully obvious, but i've tried a few formatting strings now, and i haven't seen anyone use this method. Maybe it's because it won't work. I dunno, i haven't tried it, so it's almost like i'm thinking aloud here.

Anyway, it seems to me like a good (maybe the best?) way to solve the problem of choosing between singles and album mode in a format string would be to get the information relative to the surrounding files. That is, figure out whether the previous and/or next track on the play list is of the same album as a given track. If it is, you use album mode. If it isn't, you use singles mode.

I'm not sure how one would go about getting information from a specific file, though. Is there a function to get information from a certain song in the play list? For example, something like $getmeta(56,%album%). 56 being the number on the play list, and %album% obviously being the tag that you want to get. $meta() doesn't seem to be able to do this.... Is there any other way?

If not... i think it'd be a nice feature to add. :,)
jasnic02
Another possible solution would be to have the ability to assign per-playlist properties. Most of the time my playlists consist of full albums, but if I want to make a playlist of, for instance, my favorite Metallica tracks I could create a new playlist called whatever and assign it a 'Singles' property .. or something. Then, of course, the formatting string could read the playlist properites and act accordingly.

Something along these lines would be a great feature!
picmixer
This is actually possible already using %_playlist_name% combined with the right functions.

This is one example how I use it in my old string:
CODE
$if($stricmp($left(%_playlist_name%,3),-s-),$puts(albummode,0))


Basically it checks wether the playlistname starts with -s- and will skip the album mode for all playlists that do so.

Of course there are several ways to achieve this. IIRC UpNorth also uses something similar, so you could maybe have a look at his code as well.
jasnic02
Doh! Perfect! Thanks!
Sandman2012
I did a highly customized variation of one I found at the formatting strings site. Since all my music is ripped from my own CDs and I usually listen to whole albums it works well. I also made it so that it checks for standard tags and if they aren't present uses a different formatting, so things like internet radio streams and such look ok. I like to keep my stuff simple and minimalistic.

Screenshot of my foo

CODE
$puts(color_text,000000|FFFFFF)
$puts(color_1,FF0000|FFFFFF)
$puts(color_2,408000|FFFFFF)
$puts(color_3,C08000|FFFFFF)

$get(color_text)

$if(%album%,

// formatiing for albums

$select(%tracknumber%,$repeat('-',999),
$get(color_1)$char(32)$char(32)%artist%,
$get(color_2)$char(32)$char(32)%album%)

$tab(1)

$get(color_3)$pad_right($num(%tracknumber%,2).,4, )
$get(color_2)$char(32)$char(32)%title%
$select(%tracknumber%,$get(color_text)$char(32)$repeat('-',999))

$tab(2)
$get(color_3)$pad_right(%_length%,7, )  ,

// formatting for other stuff

$get(color_3)$pad_right($num(%_playlist_number%,2).,5, )
$get(color_2)$char(32)$char(32)$if(%title%,%title%,%_filename_ext%)

$tab(2)
$if(%_length%,$get(color_3)$pad_right(%_length%,7, ),)  

)
filon
Because Billcow is not doing anything with the plugin and I wanted to have the bugs fixed, I have taken the source and maed some changes.

The changes in version 2.6.0 are:
- fixed wrong file loading/saving issues
- fixed refreshing of config list (entries in menu are always fresh)
- rearanged config page
- compile with VC 6 (no mscrt70.dll dependency)

Get it from foo_syfm.zip
Sandman2012
Haven't had any issues with the old one but I updated anyway. Any work on foobar components is much appreciated. smile.gif
Czokalapik
i want something like that:
CODE

Artist / Album - Tracknumber - Title

but if i got album with various artist:
CODE

Album / Artist - Tracknumber - Title

for exemple
smok3
QUOTE(Czokalapik @ Mar 17 2004, 11:35 PM)
First i have string for my playlist made by 'smok3'

well, iam glad some1 is actually using my hardworked script tongue.gif ,

btw, iam doing some slight updates right now:
http://pelit.koillismaa.fi/fb2k/strings.php?f=49

changelog:
-fixed arg display in singles mode
-simplification of some parts
-dot in the playlist name switches to single mode as well
ect...
trooper
Hello all, I'm new here to the formatting strings topic and was looking for a little assistance. Is there a compiled list somewhere that includes all of the 'tech info field names' ie., %__bitrate%. I am already aware of the TAGZinfo.txt, as well as the Title formatting help file that is included with Foobar2K download.

Thanks in advance, trooper
picmixer
Basically Foobar supports all technical field that are also listed in the right column of the file properties. However this might change from codec to codec a bit.

You'll just have to have a look at it a few times and I am sure you will discover them all.

Currently there is no up to date title formatting help unfortunately either. Although this would only be neccessary for commands and extra info fields, since you can indeed determine tech fields quite easily yourself.
Czokalapik
is it possible to somehow name colums in playlist??

for ex:
CODE

[B]artist           tracknumber        bitrate[/B]
 a-ha                   01                 128
 a-ha                   02                 128
smok3
QUOTE(Czokalapik @ Apr 18 2004, 04:31 PM)
is it possible to somehow name colums in playlist??

make a dummy audio file named 'dummy.wav' or something, and script like 'if filename=dummy then display the info'.
Linkin
QUOTE(Lav @ Mar 22 2004, 02:31 AM)
Works fine for me, Czokalapik. :/


Hm. I finally got around to actually doing some work on mine, and i think i'm actually starting to really understand how foobar's scripting works. I still wish it was more like mIRC, but eh. :,)

Here's mine. It's mostly modified from... this one. Heh.

I like your formatting string wink.gif

Can you post it please?
viveztigrou
i love this one too; can we use alternate fonts with? huh.gif
trooper
RE:

[QUOTE]
Czokalapik Posted on Apr 18 2004, 06:31 AM
is it possible to somehow name colums in playlist??


Have you seen this?:
Foobar forum page

Foobar addin/plugin called ui_columns. Very cool.
Actually, I just found this the other day, and don't even use the formatting strings any more.

Check it out and see if it's what you're looking for.
Czokalapik
thx thx thx thx thx thx thx trooper!
liekloo
QUOTE(Lav @ Mar 22 2004, 06:48 AM)
a good way to solve the problem of choosing between singles and album mode in a format string would be to get the information relative to the surrounding files. That is, figure out whether the previous and/or next track on the play list is of the same album as a given track. If it is, you use album mode. If it isn't, you use singles mode.

Is there a function to get information from a certain song in the play list? If not... i think it'd be a nice feature to add. :,)

Very good point! rolleyes.gif

No, it doesn't exist yet.
It'd be very useful IMO. If foobar can get info from a previous track in the playlist, formatting could become much more elegant & powerful. smile.gif An example: removing needless repetitions:
QUOTE
01. Scene 1: Prelude
02. Scene 1: Intro: Sur la place chacun passe
03. Scene 1: Intro: Regardez donc cette petite
04. Scene 1: Marche et choeur des gamins: Avec la garde montante
05. Scene 1: Marche et choeur des gamins: Repos!

Such a new function would allow to mention Scene 1 only once (for track 1) and the other tracks could for example indent:
QUOTE
01. Scene 1: Prelude
02. . . . Intro: Sur la place chacun passe
03. . . . Intro: Regardez donc cette petite
04. . . . Marche et choeur des gamins: Avec la garde montante
05. . . . Marche et choeur des gamins: Repos!

In practice, such a function could be for example: previous(%artist%)
(which refers to the artist field in the metadata of the previous track)
What do you other guys think? smile.gif
Speek
For lossless files I like to show the compression ratio in the status bar. I do this with:
CODE
$muldiv(%__bitrate%,100,1411)

This is nice, but it only results in integral numers and I would like one decimal (example: 60.3 instead of 60). Can this be done?
foosion
Speek:
CODE
$puts(ratio,$muldiv(%__bitrate%,1000,1411))
$div($get(ratio),10)'.'$mod($get(ratio),10)
Speek
Thanks Foosion.
Czokalapik
hmmmmmm, i have another problem...

i have something like that:
CODE

track1 (album1)
track2 (album1)
track3 (album1)
track4 (album1)
  track5 (album1) <-NOW PLAYING
track1 (album2)
track2 (album2)
track3 (album2)
track4 (album2)
track5 (album2)


and i want:
CODE

  track1 (album1)
  track2 (album1)
  track3 (album1)
  track4 (album1)
  track5 (album1) <-NOW PLAYING
track1 (album2)
track2 (album2)
track3 (album2)
track4 (album2)
track5 (album2)



so basically, is it possible to move right all tracks from album with "now playing' track??
picmixer
Hmh, AFAIK, this is not possibe. Current titleformatting syntax is only able to identify the playing track from all others and it's not possible to get any information on the surrounding tracks.
lav-chan
QUOTE
I like your formatting string  wink.gif

Can you post it please?

Oh, yes, sorry. :,)

CODE
//    COLOUR VARIABLES

// colour_bg:     background
// colour_grid:   grid
// colour_num:    play-list number / track number / time
// color_artist:  artist
// colour_album:  album
// colour_tech:   tech. information / date
// colour_title:  title
// colour_ind:    playing indicator (NOT USED)
// colour_file:   file name
// colour_dir:    directory
// colour_va:     artist on various-artist album




//    SET COLOURS

$puts(colour_bg,804000|A85400)
$puts(colour_grid,AA9E9A|AA9E9A)
// $puts(colour_num,474141|474141)
$puts(colour_artist,000000|000000)
$puts(colour_album,5D5D5D|5D5D5D)
// $puts(color_con,AA9E9A|AA9E9A)
$puts(colour_tech,AA9E9A|AA9E9A)
$puts(colour_title,$if(%_isplaying%,000000|000000,A36852|A36852))
// $puts(colour_ind,$if(%_isplaying%,000000|000000,000000|000000))
$puts(colour_file,$if(%_isplaying%,FFFFFF|FFFFFF,C08080|B5804A))
$puts(colour_dir,81460C|81460C)
// $puts(colour_va,$if(%_isplaying%,FFFFFF|FFFFFF,FF8855|FF8855))
$puts(colour_num,$if(%_isplaying%,000000|000000,AA9E9A|AA9E9A))
// $puts(color_rpg,AE5700|804000)




//    SET COLUMN WIDTHS

$puts(column_1,2)
$puts(column_2,6)
$puts(column_3,50)
$puts(column_4,100)
$puts(column_5,30)




//    GET VORBIS QUALITY INFORMATION
$puts(v_ogg_qset,$if($strcmp(%__bitrate_nominal%,80),1.0)
$if($strcmp(%__bitrate_nominal%,88),1.5)$if($strcmp(%__bitrate_nominal%,96),2.0)
$if($strcmp(%__bitrate_nominal%,104),2.5)$if($strcmp(%__bitrate_nominal%,112),3.0)
$if($strcmp(%__bitrate_nominal%,120),3.5)$if($strcmp(%__bitrate_nominal%,128),4.0)
$if($strcmp(%__bitrate_nominal%,144),4.5)$if($strcmp(%__bitrate_nominal%,160),5.0)
$if($strcmp(%__bitrate_nominal%,176),5.5)$if($strcmp(%__bitrate_nominal%,192),6.0)
$if($strcmp(%__bitrate_nominal%,208),6.5)$if($strcmp(%__bitrate_nominal%,224),7.0)
$if($strcmp(%__bitrate_nominal%,240),7.5)$if($strcmp(%__bitrate_nominal%,256),8.0)
$if($strcmp(%__bitrate_nominal%,288),8.5)$if($strcmp(%__bitrate_nominal%,320),9.0)
$if($strcmp(%__bitrate_nominal%,410),9.5)$if($strcmp(%__bitrate_nominal%,499),10.0))




' '



// { -------- }

$if(%artist%,



//    FIRST TRACK (GRID)

$if($strcmp($num(%tracknumber%,1),1),$get(colour_grid)$repeat('?',100),)


//    SECOND TRACK (ARTIST)

$if($strcmp($num(%tracknumber%,1),2),
$iflonger(%artist%,50,$get(colour_artist) $cut(%artist%,50)...,
$get(colour_artist) %artist%))


//    THIRD TRACK (ALBUM)

$if($strcmp($num(%tracknumber%,1),3),
$iflonger(%album%,50,$get(colour_album) $cut(%album%,50)...
$if($strstr(%_directoryname%,disc 0),
$get(colour_tech)' ('%_directoryname%')',),
$get(colour_album) %album%
$if($strstr(%_directoryname%,disc 0),
$get(colour_tech)' ('%_directoryname%')',)))


//    FOURTH TRACK (DATE)

$if($stricmp($num(%tracknumber%,1),4),$get(colour_tech) [%date%],)


//    FIFTH TRACK (CODEC INFORMATION)

//        MP3
$if($stricmp($info(codec),mp3),
$puts(v_codec,$info(codec):)
$puts(v_compression,$if($stricmp(%__extrainfo%,vbr),VBR,%__bitrate% kbps)),)

//        VORBIS
$if($stricmp($info(codec),vorbis),
$puts(v_codec,$info(codec):)
$iflonger($get(v_ogg_qset),1,
$puts(v_compression,-q $get(v_ogg_qset) $char(40)
%__bitrate_nominal% kbps nominal$char(41)),
$puts(v_compression,%__bitrate_nominal% kbps nominal)),)

//        AAC
$if($stricmp($info(codec),AAC),
$puts(v_codec,$info(codec))
$puts(v_compression,%__bitrate%kbps),)

//        FLAC
$if($stricmp($info(codec),FLAC),
$puts(v_codec,$info(codec)),)

//        APE
$if($stricmp($info(codec),monkey''s audio),
$puts(v_codec,$info(codec))
$puts(v_version,$info(version))
$puts(v_compression,$caps($info(compression))),)

//        MPC
$if($stricmp($info(codec),musepack),
$puts(v_codec,$caps($info(codec)))
$puts(v_version,$info(mpc_encoder))
$puts(v_compression,$info(mpc_profile)))

//       DISPLAY IT
$if($strcmp($num(%tracknumber%,1),5),
$get(colour_tech) $get(v_codec)[' '$get(v_version)]
[' '$get(v_compression)],),)

// { -------- }




//    IF THERE'S NO TRACK NUMBER...

$if($not(%tracknumber%),
// 1

$if($and(%artist%,%title%),
// 2

$get(colour_artist)' '

$puts(no_track,%artist%[  $get(colour_grid)-  $get(colour_album)
%album%]$if($strstr(%_directoryname%,disc 0),
$get(colour_tech)' ('%_directoryname%')',))

$iflonger($get(no_track),80,$cut($get(no_track),80)...,$get(no_track))))

$repeat($char(9),$get(column_3))




//    TRACK NUMBER

$char(32)$get(colour_bg)
$if(%artist%,
$if(%tracknumber%,
$get(colour_num)$pad_right(%tracknumber%,2,' '),$get(colour_num)--),)
$if(%artist%,$get(colour_num)') ',)




//    TITLE

$iflonger(%title%,90,$get(colour_title)$cut(%title%,90)...,
$get(colour_title)%title%)

$if(%artist%,
$if($strcmp($num(%tracknumber%,1),1),
$get(colour_grid)' '$repeat('?',100),),$get(colour_file)%_filename_ext%)

$repeat($char(9),$get(column_4))




//    TIME

$get(colour_num)$pad_right(%_length%,5,0)' '


(Broke some parts up so it doesn't stretch the tables....)

There are some parts i'd like to clean up a little, but it works, mostly. :9


Er, also. The font i use is Bitstream Vera Sans Mono, but of course it works with any monospaced font. What it looks like with variable-width fonts, i couldn't say, since i've never tried it. But i imagine it's rather unpredictable.

Heh, damn it. Also, where it says this:

//    FIRST TRACK (GRID)

$if($strcmp($num(%tracknumber%,1),1),$get(colour_grid)$repeat('?',100),)


That question mark in $repeat() is supposed to be an em dash. You can get that by holding Alt and typing 0 1 5 1 on your number pad.
analogy
I spent far too much time Ishoudl have been working creating the following monster. Basically, I like my playlist like I don't like my women, obscenely skinny, so some of the longer things get cut off.

The basic format is Artist / Album (Tracknumber) - Track Name. I wanted to abbreviate things to fit. I started out with simply abbreviating the individual fields if they were over a certain size. I didn't like seeing it chopping off more than it had to, though, so I rewrote it to abbreviate the longest of the three fields. Usually, this was the track name, which I wanted to see more, so I rewrote it again to weight the fields relative to each other to give precedence to the track name, artist, and album in that order. Then I noticed that when the two arguments to a $greater() function were equal, it returned a zero, and there was no "greater than or equal" function, so I made up a big truth table and started fooling around with boolean logic.

The result:

CODE

$if(%title%,
$puts(maxlen,38)
$puts(actlen,$add($len(%artist%),$len(%album%),$len(%title%)))
$puts(artist,%artist%)
$puts(lr,$len(%artist%))
$puts(album,%album%)
$puts(ll,$len(%album%))
$puts(title,%title%)
$puts(lt,$len(%title%))

//If the entry needs to be abbreviated...
$if($greater($get(actlen),$get(maxlen)),

//Abbreviate everything based on a weighted system of what I'd rather see.
//Artist
$puts(tl,$muldiv($get(ll),4,3))
$puts(tt,$muldiv($get(lt),3,4))
$if(
$and(
$greater(
$get(lr),
$get(tl)
),
$not(
$greater(
$get(tt),
$get(lr))
)
),
$puts(artist,$abbr(%artist%))
$puts(abbed,artist)
)

//Album
$puts(t1,$muldiv($get(lr),3,4))

$if(
$and(
$not($greater(
$get(t1),
$get(ll)
)),
$not($greater(
$get(tt),
$get(ll)
))
),
$puts(album,$abbr(%album%))
$puts(abbed,album)
)

//Title
$puts(t1,$muldiv($get(lr),4,3))
$if(
$and(
$greater(
$get(lt),
$get(t1)
),
$greater(
$get(lt),
$get(tl)
)),
$puts(title,$abbr(%title%))
$puts(abbed,title)
)
)

//Further abbreviate if it's still too long
$puts(actlen,$add($len($get(artist)),$len($get(album)),$len($get(title))))
$if($greater($get(actlen),$get(maxlen)),

//If the artist was abbreviated
$if($strcmp($get(abbed),artist),
$if(
$greater(
$get(lt),
$muldiv($get(la),3,2)
),
$puts(title,$abbr(%title%)),
$puts(album,$abbr(%album%))
)
)

//If the album was abbreviated
$if($strcmp($get(abbed),album),
$if(
$greater(
$get(lt),
$muldiv($get(lr),4,3)
),
$puts(title,$abbr(%title%)),
$puts(artist,$abbr(%artist%))
)
)

//If the title was abbreviated
$if($strcmp($get(abbed),title),
$if(
$greater(
$get(lr),
$muldiv($get(ll),4,3)
),
$puts(artist,$abbr(%artist%)),
$puts(album,$abbr(%album%))
)
)

)

//Highlight the entry if it's playing
$if(%_isplaying%,FF0000)
%_playlist_number%:

//Show the info
$get(artist) /
$get(album)
'('$num(%tracknumber%,)')' -
$get(title)

//If some idiot forgot metatags, just display the filename.
,%_filename_ext%)

$char(9)
//Show the song length and a play/paused icon
$if(%_isplaying%,FF0000|$if(%_ispaused%,'|','>') )%_length%


So there. I got paid to write that. =D

By the way, it would be REALLY useful if there were a way to tab indent stuff as we're coding. Make it more readable.
lav-chan
QUOTE
By the way, it would be REALLY useful if there were a way to tab indent stuff as we're coding. Make it more readable.

SIGNED ^
mazy
well you can use the new script formatting, though it doesn't have all the functions etc
upNorth
QUOTE(mazy @ Apr 28 2004, 11:24 PM)
well you can use the new script formatting, though it doesn't have all the functions etc

Any news about when this will be "released"?

Edit: spelling...
picmixer
Hmh, no actually.

Unfortunately there is still no documentation on the new script formatting available at this point.

AFAIK it should already be possible to use it, but is simply not documented yet.

Although I fully agree with you that it would be nice to have that documentaion biggrin.gif
Czokalapik
my new string, operates album and single mode (when there's no tracknumber)

CODE

font: Lucida Console 8
bgcolor: 0,0,0
selection color: 25,25,25
item frame: 116,116,116



CODE

//       FONT:
//  font: Lucida Console 8

//       COLOURS THAT I PREFER:
//  bgcolor: 0,0,0              (black, eventually dark blue)
//  selection color: 25,25,25   (dark grey)
//  item frame: 116,116,116     (medium grey)



//     white
$puts(white,ffffff|ffffff)
//     black
$puts(black,000000|000000)
//     light grey
$puts(l_grey,D3D3D3|D3D3D3)
//     medium grey
$puts(m_grey,A2A2A2|A2A2A2)
//     dark grey
$puts(d_grey,5F5F5F|5F5F5F)
//     red
$puts(red,0500CE|0500CE)
//     dark red
$puts(d_red,03006A|03006A)



//////////////////PLAYLIST NUMBER/////////////////
$get(d_grey)
$repeat(0,$sub(4,$len2(%_playlist_number%)))
$if(%_isplaying%,$get(l_grey),$get(m_grey))%_playlist_number%



/////////////// tracknumber IF then: <normal mode>
$if(%tracknumber%,
 
$if($strcmp($num(%tracknumber%,1),1),$get(red)┼──,   )






/////////////// artist in normal mode on 1st track
$if($strcmp($num(%tracknumber%,1),1),
$get(red)╥┤ $get(white)$if(%artist%,$caps($replace(%artist%,_, )),$get(m_grey)'No '$get(white)'ARTIST '$get(m_grey)'tag...') $get(red)├$repeat(─,$sub(34,$len(%artist%)))
$if(%date%,┬,─)─────╥──
,)



/////////////// album\\date in normal mode on 2nd track
$if($strcmp($num(%tracknumber%,1),2),
$get(red)╟────┤ $get(m_grey)
$puts(album,$if(%album%,$caps($replace(%album%,_, )),$get(m_grey)'No '$get(white)'ALBUM '$get(m_grey)'tag...'))
$get(album)  
$if(%date%,$get(red)
$pad_right(└┤$get(m_grey)%date%,
$sub(53,$len($get(album))))
$get(red)║,

$pad_right($get(red)║,
$sub(53,$len($get(album))))
)
,)



/////////////// 3rd track
$if($strcmp($num(%tracknumber%,1),3),
$get(red)║ $get(m_grey)$pad_right($get(red)║,60))



/////////////// info in normal mode on 4th track
$if($strcmp($num(%tracknumber%,1),4),
$get(red)╙──

$if(%genre%, $get(d_grey)$caps(%genre%) $get(red)│,)
$get(d_grey)
%__bitrate%kpbs
$get(red)│$get(d_grey)
$caps($ext(%_path%))

$get(red)├$repeat(─,
$sub(29,
$add(
$if(%genre%,$add($len(%genre%),3),),
$len(%__bitrate%),1)))



,)



/////////////// vertical line in normal mode
// $ifgreater(%tracknumber%,4,$get(red)│,)





$tab(7)

$get(red)
$if($strcmp($num(%tracknumber%,1),1),
┼,├)


/////////////// tracknumber
$if(%_isplaying%,$get(l_grey),
$if($strcmp($num(%tracknumber%,1),1),$get(m_grey),$get(d_grey)))
$num(%tracknumber%,2)

$get(red)
$if($strcmp($num(%tracknumber%,1),1),
┼─
$if(%_isplaying%,──,)
─┤
,┤  )

$if(%_isplaying%,
$transition($repeat(>,2) ,$get(d_red),$get(red)),)


/////////////// title
$if(%_isplaying%,$get(white),$get(m_grey))
$if(%title%,$caps($replace(%title%,_, )),$caps($replace(%_filename_ext%,_, )))


$if($strcmp($num(%tracknumber%,1),1),
$transition(

$if(%_isplaying%,
 $repeat(<,$sub(81,$len($if(%title%,%title%,%_filename_ext%)))),
 $repeat(─,$sub(100,$len(%title%)))
)

,$get(red),$get(black))
,
$transition(
$if(%_isplaying%,
 $repeat(<,$sub(81,$len(%title%))),)
,$get(red),$get(black))
)



$tab(10)

/////////////// tracknumber IF else: <single mode>
,
 $get(red)  ─  



/////////////// artist in single mode
$get(white)$if(%artist%,$caps($replace(%artist%,_, )),$get(m_grey)'No '$get(white)'ARTIST '$get(m_grey)'tag...')

$tab(6)


$get(red)├

/////////////// album in single mode
$get(m_grey)$if(%album%,$caps($replace(%album%,_, )),
'No '$get(white)'ALBUM '$get(m_grey)'tag...')

/////////////// date in single mode
$tab(5)
$get(red)│
$if(%date%,$get(m_grey)%date%,$get(d_grey)----)



/////////////// genre in single mode
$get(red)
$if(%genre%,┤ $get(d_grey)$caps(%genre%),┤)
$get(d_grey)



$tab(5)
/////////////// title
$get(red)├


$if(%_isplaying%,
$transition($repeat(>,3) ,$get(d_red),$get(red)),)



$if(%_isplaying%,$get(white),$get(m_grey))
$if(%title%,$caps($replace(%title%,_, )),$caps($replace(%_filename_ext%,_, )))

$transition(
$if(%_isplaying%,
 $repeat(<,$sub(81,$len($if(%title%,%title%,%_filename_ext%)))),)
,$get(red),$get(black))

$tab(12)
)


$tab(5)
/////////////// length

$if(%_isplaying%,$get(l_grey),$get(m_grey))
$if(%_length%,$pad_right(%_length%,8),)
   

/////////////// bitrate
$if(%_isplaying%,$get(m_grey),$get(d_grey))
$pad_right(%__bitrate%' kbps',8)
   
Czokalapik
How to do this:


--------------------------------------------------------------
Serve The Servant
I Miss You
Nosebleed
The Unnamed Feeling
--------------------------------------------------------------

I think it needs code determinating color of first character after every space in title of the track (but i don't know how to do this... :/)

Thanks In Advance
analogy
If the scripting lang supported loops it would be relatively simple to find the number of spaces in the title, do a for loop for the number of spaces and highlight the letter after each space, plus the first letter. Without loops... Errr, I give up.

EDITL I suppose you could replace each space with a space plus a color code, but there's the matter of closing the color code that's the real trick...
Dr PerLine
I've just had a go at the string Czokalapik has requested, and here's the result. It works by putting the %title% (could be any field I suppose) through the $caps2 function making the first letter in a word capital. The highlight colour is then added at the start and every space is replaced by a space and the highlight colour. The uppercase letters and numbers are then replaced by the uppercase letter / number plus the code to turn the rest of the string back to the normal colour. There is also a replace to make sure in a set of brackets, the first letter of the word inside is highlighted and the letters of acronym in a title are also highlighted correctly. I'm sure that some eventualities are not covered, but it should be fairly easy to add them.

Here's the code:
CODE

//[-- A First Letter Highlight String by Dr PerLine --]

//the normal text colour

$puts(normal_colour,FFFFFF|FFFFFF)

//the colour of the first letter in each word

$puts(highlight_colour,0000FF|0000FF)

//add to a title variable

$puts(title,

//place the highlight colour for the first letter

$get(highlight_colour)

//convert the starting letters in the %title% to uppercase

$replace($caps2(%title%),

//replace the uppercase letters and numbers with there values
//plus the normal colour, to terminate the colour from the
//space / beginning of the title

A,A$get(normal_colour),
B,B$get(normal_colour),
C,C$get(normal_colour),
D,D$get(normal_colour),
E,E$get(normal_colour),
F,F$get(normal_colour),
G,G$get(normal_colour),
H,H$get(normal_colour),
I,I$get(normal_colour),
J,J$get(normal_colour),
K,K$get(normal_colour),
L,L$get(normal_colour),
M,M$get(normal_colour),
N,N$get(normal_colour),
O,O$get(normal_colour),
P,P$get(normal_colour),
Q,Q$get(normal_colour),
R,R$get(normal_colour),
S,S$get(normal_colour),
T,T$get(normal_colour),
U,U$get(normal_colour),
V,V$get(normal_colour),
W,W$get(normal_colour),
X,X$get(normal_colour),
Y,Y$get(normal_colour),
Z,Z$get(normal_colour),
0,0$get(normal_colour),
1,1$get(normal_colour),
2,2$get(normal_colour),
3,3$get(normal_colour),
4,4$get(normal_colour),
5,5$get(normal_colour),
6,6$get(normal_colour),
7,7$get(normal_colour),
8,8$get(normal_colour),
9,9$get(normal_colour),

//some special characters, which are handled differently

'(',$get(normal_colour)'('$get(highlight_colour),
.,$get(normal_colour).$get(highlight_colour),

//replace space with space and the highlight colour

' ',' '$get(highlight_colour))
)

//display the complied title
$get(title)



And here is a example

Hope this helps,

Edit: Made the code paste friendly. smile.gif
Czokalapik
~Dr PerLine!!!!!!!!
You are my favorite savior and private Jesus Christ!

It works great, just like I wanted!
Great!
Again many thanks!
Insolent
I like it simple:
CODE

$num(%_playlist_number%,$len(%_playlist_total%)). $if2(%artist% - %title%,%_filename%)
[$char(9)$if(%_isplaying%,'» ')%_length%]
cyborg
Could someone tell me what is wrong with this script:

CODE
$if($strcmp(%__codec%,Monkey's Audio),$puts(text_extrainfo,%__compression%))
.
.
[$caps2($get(text_extrainfo))]


I made a similar script to Wavpack format and it works fine:

CODE
$if($strcmp(%__codec%,wavpack),$puts(text_extrainfo,%__compression%))
.
.
[$caps2($get(text_extrainfo))]


I also found another problem with my scripts, I use this script to display the file size of my songs and it didn't work with LPAC files, it says the file size is zero bytes:

CODE
$puts(Tkoko,$if($greater(%_filesize%,1048576),$num($left($num($muldiv(%_filesize%,100,1048576),6),4),1).$right($muldiv(%_filesize%,100,1048576),2) MB,$num($left($num($muldiv(%_filesize%,100,1024),6),4),1).$right($muldiv(%_filesize%,100,1024),2) kB))
.
.
[<> $get(Tkoko)]


Could someone help me?
upNorth
It's the single quote in Monkey's Audio that causes the first problem.
Write it like this:
CODE
Monkey''s Audio
cyborg
Thanks, upNorth!
DeepDose
Czokalapik......i like the playlist format a lot......i'm using it
Yota
perhaps you know it : soundserver

one of the best MP3 playlist manager... but one of the worst designed player interface.

The best of all, a Nextsep-like playlist browser with ONE marvellous feature : it orders songs following real folders and filename...

fuck off ID3 tag ^^... with an half-million of mp3 stored in various folders more or less well ordered no human could possibly tag all of this.
So with a arborescence based on relative path (each file is taken as a /artist/album/track.mp3... it work very well) I could easily found all my mp3 even thoses with awfull filename (and so un-tag-able).

Is it possible, only with string format, to display an arborescence ? and is it possible to to it from the real pathname and not from the tag ?

(when I use the word arboresence I think also to the ability of hiding all unselected branch, to avoid an "all expanded" tree... with an 300 000 file library it's impossible to read ^^)

If you don't understand a word of what I'm saying please complain to my english teacher ;p
(and have a look to soundserver ^^ a lot a good ideas for foobar2k improvement)


one other very good feature is the separation of the library and the playlist... which is not so well designed in foobar2k but it is'nt the topic here ^^
Yota
perhaps using UI columns ...

it's funny... foobar developpers let the developpement of the GUI to the users...
far from the "ready to download" skins of winamp...

It reminds me linux... you can use it as a computer be you only spend time to tweak it ^^

does foobar user have time to listen music ?
anza
QUOTE(Yota @ Jun 9 2004, 06:54 AM)
it's funny...  foobar developpers let the developpement of the GUI to the users... 
far from the "ready to download" skins of winamp...

As far as I see it, the default UI is still being developed (well - actually it seems quite finished for now, but who knows what Peter has in store for us), even though it doesn't have as many functions and settings as foo_ui_columns.
Ruby
QUOTE(Yota @ Jun 9 2004, 06:54 AM)
It reminds me linux... you can use it as a computer be you only spend time to tweak it ^^

does foobar user have time to listen music ?

Yup. Foobar user listens to music while tweaking. biggrin.gif
upNorth
QUOTE(Ruby @ Jun 9 2004, 10:56 AM)
QUOTE(Yota @ Jun 9 2004, 06:54 AM)
It reminds me linux... you can use it as a computer be you only spend time to tweak it ^^

does foobar user have time to listen music ?

Yup. Foobar user listens to music while tweaking. biggrin.gif

laugh.gif
IMHO, tweaking and listening is a perfect and sometimes necessary combination.
Tweaking enhances my listening experience, as I can see, navigate and access my music collection in new and better ways. I must admit thought, that I also enjoy the tweaking itself smile.gif
Czokalapik
~DeepDose
Nice to hear that at least You like it tongue.gif (besides me of course biggrin.gif)
Sandman2012
I like mine simple as well.

user posted image



CODE
$puts(color_text,000000|000000)
$puts(color_1,408000|408000)
$puts(color_2,C08000|C08000)
$puts(color_3,AAAAAA|AAAAAA)

$char(32)
$get(color_3)$num(%_playlist_number%,$len(%_playlist_total%)). $get(color_2)$if(%album artist%,%album artist% - ,[%artist% - ])
$get(color_1)$if(%title%,%title%,%_filename_ext%)

$tab(1)
$get(color_2)$if(%_length%, %_length%,)$char(32)
jec3
Can fb2k scripting compute the total playing time for the active setlist and show it in the status bar? Is there access to the total time for a track beyond one-second resolution (e.g., milliseconds)?

Thanks,

jec3
DeepDose
Yea Czokalapik.....I like it a lot.....the colors and the red lines and the layout.....it's real slick like Blade Runner or something....Do you have a status bar string for it?
Czokalapik
status bar:
CODE
$char(9553)%_time_elapsed%$char(9566)0500CE
$progress(%_time_elapsed_seconds%,%_time_total_seconds%,25,000000$char(9569)$select($add($mod(%_time_elapsed_seconds%,30),1),'<(^-^)v','<(^-^<)','^(^-^<)','^(^-^)^','<(-.-)>',' (>.<) ','<(O.<) ','<(O.O)>','<(o.O)v','v(o.o)v','^(º.o)v','^(º-º)^','v(O.º)^','v(O.o)>','(>o.o)>','(>-.-)^','^(^.^)^','<(^-^)>','v(^.^)v',' (>.<) ','<(o.o)>','<(O.o)>','<(o.O)>','<(O.o)>','<(o.O)>',' (>.<) ','<(º.o)>','<(o.º)>','<(º.o)>','<(º-º)v')$char(9566),0500CE$char(9552))000000$char(9569)%_time_remaining%$char(9553)
DEA368

0600FF'||'000000

$tab(6)
$if(%_ispaused%,000000
$ifgreater(
$len($if(%title%,%title%,%_filename_ext%)),57,
$cut($if(%title%,::/$caps(%title%),::/$caps(%_filename_ext%)),54)'...'/::
, $if(%title%,::/$caps(%title%)/::,::/$caps(%_filename_ext%)/::))

 is  0600FF P   A   U   S   E   D ,


$tab(6)
$if(%artist%,$caps(%artist%),)
$if(%album%,::/$caps(%album%)/,)
$ifgreater($add(
$len(%artist%),
$len(%album%),
$len($if(%title%,%title%,%_filename_ext%)),
6),90,
$cut($if(%title%,::$caps(%title%),::$caps(%_filename_ext%)),
$sub(90,$add(7,$len(%artist%),$len(%album%)))
)'...'
,
$if(%title%,::$caps(%title%),::$caps(%_filename_ext%))
))

$tab(6)
0600FF'||'000000
['['%__bitrate_dynamic%kbps']'
DEA368'/'000000]
%__bitrate%kbps
DEA368'/'000000
%_length%min
DEA368'/'000000
'['$div(%_filesize%,1048576).
$cut($mod(%_filesize%,1048576)00,2)']'MB
DEA368'/'000000
'['$caps($ext(%_path%))']'  
//►◄


sys tray (&copy command):
CODE

ARTIST : $if(%artist%,$caps($replace(%artist%,_, )) ,Unknown) $crlf()
ALBUM : $if(%album%,$caps($replace(%album%,_, )),Unknown)$crlf()

[$caps2(<-%genre%)]
$if($and(%genre%,%date%), | ,$if(%genre%,->,)$if(%date%,<-,))
[%date%]
$if($and(%genre%,%date%),->,$if(%date%,->,))
$if($or(%genre%,%date%),$crlf(),)
TITLE : $if(%tracknumber%,$num(%tracknumber%,2) - ,)
$if(%title%,$caps($replace(%title%,_, )),$caps($replace(%_filename_ext%,_,)))
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.