Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Simple formatting string syntax question (Read 2334 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Simple formatting string syntax question

All I'm trying to do is add a string to the playlist to display the genre right after the album name.  I've seen some great sample playlist formats but they double or triple my RAM usage which I don't like. 

I've tried pasting (%genre%) here and there in the following code with no luck.  Is this C++ syntax? 

Yes, I am a noob.

Code: [Select]
// check if all standard tags are present
$if($and($and(%title%,$not($strcmp(%title%,))),$and($and(%artist%,$not($strcmp(%artist%,))),$and(%album%,$not($strcmp(%album%,))))),
$puts(alltags,1),)

$if($get(alltags),
// formatting for files with tags:

// check if track belongs to VA album
$if($or($stricmp(%album artist%,VA),$stricmp($left(%album artist%,7),various)),$puts(va,1),)

// 'album' formatting
$puts(album,'['%album%[ - CD$num(%disc%,1)]']'[ '['$num(%tracknumber%,2)']']
)

//if 'album artist' tag is present
$if(%album artist%,
// set 'artist' to VA for VA albums, and to 'album artist' otherwise:
$if($get(va),$puts(artist,VA),$puts(artist,%album artist%))
//if 'artist' is different from 'album artist', append the former to the title
$if($strcmp(%album artist%,%artist%),$puts(title,%title%),
$puts(title,%title% '//' %artist%)),
//no 'album artist' found
$puts(artist,%artist%)$puts(title,%title%)
)

// formatting for files without all the tags:
,
$if(%title%,
$puts(title,%title%)$if(%artist%,$puts(artist,%artist%)),
$puts(title,$if($stricmp($left(%_path_raw%,7),'http://'),%_path_raw%,
%_filename_ext%)))
)

$num(%_playlist_number%,$len(%_playlist_total%)).' '
[$get(artist) - ]
[$get(album) - ]
[$get(title)]
[$char(9)$if(%_isplaying%,'|> ')%_length%]

Simple formatting string syntax question

Reply #1
I'm using v0.7.7b default playlist formatting string (shown in the post above) and have had no luck trying to get the codec name to show right before the track time (like the previous versions of foobar did). I've tried copying and pasting various parts of the codec section that is in the status bar string, but keep getting syntax errors. It would look like this:

Code: [Select]
01. Billy Squier - [16 Strokes: The Best Of Billy Squier] [01] - The Stroke      [Musepack] 3:38


Thanks.

Rob

Simple formatting string syntax question

Reply #2
You'll need to escape those parenthesis, like so:

Code: [Select]
'('%genre%')'

Simple formatting string syntax question

Reply #3
Quote
I'm using v0.7.7b default playlist formatting string (shown in the post above) and have had no luck trying to get the codec name to show right before the track time (like the previous versions of foobar did). I've tried copying and pasting various parts of the codec section that is in the status bar string, but keep getting syntax errors. It would look like this:

Code: [Select]
01. Billy Squier - [16 Strokes: The Best Of Billy Squier] [01] - The Stroke      [Musepack] 3:38


Thanks.

Rob

Just add [%__codec%] before string displaying time and it should work:

['['%__codec%']'] [%_length%]