Help - Search - Members - Calendar
Full Version: Track Display - How on earth do you put in a line break?
Hydrogenaudio Forums > Hosted Forums > foobar2000 > 3rd Party Plugins - (fb2k)
haloeight
I don't know if at this point I am just missing the obvious, but how do you insert a line break in Track Display settings?

I just want some text to start on new lines, and if the text is too long for a line, for there to be ellipses instead of wrapping text to the next line.

I tried searching the Wiki and posts here but couldn't find anything. I was using $char(10) initially, but then this creates problems with very long text.

Here's what I have:

CODE

$drawrect(0,0,0,0,pencolor-null brushcolor-SYSCOL-1)
$padding(2,4)$align(center,middle)$font(Calibri,11,,192-192-192)

$if(%_trackinfo_notrack%,
    ' '
,

    $if(%contentgroup%,%contentgroup%,%content group%) '\' %genre% $char(10)
    
    $font(Calibri,13,,255-0-0)
    %directoryname% '\ ' $char(10)
    
    $if($strcmp($ext(%_path%),cue),$if2(%subsong%' - ',)$if2(%artist%' - ',)$if2(%title%,),%_filename%))
    
    $font(Calibri,10,,192-192-192)
    %bitrate% kbps %codec% %codec_profile%
    $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)$char(10)


    


)

// PerSecond
    $padding(2,4)$align(center,bottom)$font(Calibri,12,,192-192-192)
    [%_time_elapsed% / ]%_length%$char(10)
Yotsuya
An alternative approach you may wish to consider would be to use $alignabs() to explicitly define an area for each line of text to appear in, for example:
CODE
// Background
$drawrect(0,0,0,0,pencolor-null brushcolor-SYSCOL-1)

// PerTrack
$if(%_trackinfo_notrack%,,

$font(Calibri,11,,192-192-192)
$alignabs(2,4,%_width%,15,center,)[[$if2(%contentgroup%,%content group%) \ ]%genre%]

$font(Calibri,13,,255-0-0)
$alignabs(2,19,%_width%,15,center,)[%directoryname% '\ ']

$alignabs(2,34,%_width%,15,center,)
$if($strcmp($ext(%_path%),cue),
[%subsong% - ][%artist% - ]%title%
)

$font(Calibri,10,,192-192-192)
$alignabs(2,49,%_width%,15,center,)
[%bitrate% kbps ]%codec%[ %codec_profile%]

$alignabs(2,64,%_width%,15,center,)
$ifgreater(%_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
)

)

// PerSecond
$font(Calibri,12,,192-192-192)
$alignabs(2,$sub(%_height%,15),%_width%,15,center,)
[%_time_elapsed% / ]%_length%

I tried working with the code example you posted, I don't know if this is what you are looking for.
Keikonium
$lineheight(16)$char(10)

That will set the height of each line to 16 pixels, and the $char(10) will pop down to the next line. If you want to have a kind of word wrap where you can type a paragraph and as soon as it hits the edge automatically goes down to the next line, use $wordwrap().
haloeight
Thank you both for the help. I'll try out what you suggest.

Yotsuya I saw you suggest something similar to someone else in a previous thread and gave the align functions a try, but then the code I had previously stopped working. Obviously I'm not doing something right with it.
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.