Help - Search - Members - Calendar
Full Version: Title formating
Hydrogenaudio Forums > Hosted Forums > foobar2000 > General - (fb2k)
mihkel
Hello

Could somebody tell me what is wrong with this code
CODE
// ***
// First track on playlist - Generate header code for entire page
// ***
$puts(text_bitrate,$if2($pad(%__bitrate_dynamic%,3)'kbps',$if2( ~ %__bitrate%'kbps',)))
$puts(text_extrainfo,[ %__extrainfo%])
//**************************************
// codec
//**************************************
$if(%__codec%,

$if($stricmp(%__codec%,musepack),$puts(codec,'MPC'),
$if($stricmp(%__codec%,vorbis),$puts(codec,'Ogg Vorbis'),
$puts(codec,%__codec%)
))
,
//If no codec tag and not streaming, read file extention
$if($and(%_time_total%,$not(%__codec%)),
$puts(codec,$upper($ext(%_path%)))
)

)

//**************************************
// bitrate
//**************************************
$puts(bitrate,$get(spacer)$get(text_bitrate))

$if($stricmp(%__codec%,musepack),
$if(%__mpc_profile%,
$puts(bitrate,$get(spacer)%__mpc_profile%$get(spacer)$get(text_bitrate))
)
)
//**************************************
// extrainfo
//**************************************

$puts(extrainfo,$get(spacer)$get(text_extrainfo))

$if($stricmp(%__codec%,musepack),
$if(%__mpc_streamversion%,$puts(extrainfo,$get(spacer)'sv'%__mpc_streamversion%))
)

$if($strstr($num(%_playlist_number%,10),$num('1',10)),

<HTML>$char(10)
<HEAD>$char(10)
<TITLE>My Playlist</TITLE>$char(10)
</HEAD>$char(10)
<BODY>$char(10)

Playlist Generated from %_foobar2000_version% <BR>$char(10)
<P>
<ul>      $char(10)
<li id="foldheader">MP3s</li> $char(10)
<ul id="foldinglist" style="display:none" style=&{head};>      $char(10),
)
// ***
// End Header Code
// ***

// First track in an album - Generate header code for this album
$if($strstr($num(%tracknumber%,10),$num('1',10)),

// Generate Footer Album Code only if NOT first track
$if($strstr($num(%_playlist_number%,10),$num('1',10)),,
</ul>

<P>$char(10)
)

// Generate Header Album Code

<li id="foldheader"><b>%artist% - %date% - %album% -> $get(codec)</b>
</li> $char(10)
<ul id="foldinglist" style="display:all" style=&{head};>      $char(10)

)

// Code For Each Track
<li>$num(%tracknumber%,2). %title% '['$ifgreater($len(%_length%),4,,0)%_length%']' <code>$get(bitrate) $get(extrainfo)<
/code></li>  $char(10)



// Generate Code for the last track - Footer code
$if($and(%_playlist_number%,$strstr($num(%_playlist_number%,10),$num(%_playlist_total%,10))),
</ul>
</ul>
</BODY>$char(10)
</HTML>$char(10)
)

// END PLAYLIST GENERATION



I put together pices of code i found in this board, but it does not do everything it has to biggrin.gif

And also i would add the total number of albums at the end of the list


Thank you
mihkel
Anyone huh.gif
Tri
You should set your custom variable 'spacer' with put/puts. That would be a first step unsure.gif
mihkel
QUOTE(Tri @ Sep 18 2004, 04:28 PM)
You should set your custom variable 'spacer' with put/puts. That would be a first step unsure.gif
*



I am a total n00b, so i didn't understand nothing blush.gif
Tri
Klick the help button in the title formatting window to see a list of functions and fields. 'spacer' is not among them, the same goes e.g. for 'text_bitrate'. As you can see, the latter is first used with 'puts' and then called with 'get' (read the help for put/puts/get).
If you call a variable with 'get', you need to have stored a value in it before with put/puts.
Simply write 'puts(spacer,' ')' in front of everything and it works, though not as I'd expect it... huh.gif
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.