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: Question about title formatting (Read 2474 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Question about title formatting

Code: [Select]
[$char(9) $if(%album%,$abbr(%album%,25),%_directoryname%)    ::    %_length%]

I use that to display Track Length and Album Name (or directory name).  They are aligned to the right.  Now, here is my problem.

Code: [Select]
Artist - BlahBlahBlah               Album Name  ::  4:20
Another Artist - NahNah            Album Name  ::  10:57

When the time is longer than 9:59 I get a space in there that I don't want.  Is there some formatting string I can put in there to insure that this doesn't happen? 

For instance:

If the time is less than 9:59 seconds, display like this "%artist% - %title%    %album%  ::  %length%" if over 9:59 seconds display like this "same as above, but with one less space after the :: section"

I went through the documentation, but some of this is waaayyyy over my head.  I ran a search, but the only thing I could think of was "title formatting" which returned some interesting results, but not what I was looking for.  If this answer is super-obvious, forgive me, I have only been using fb2k for about 10 months now.  I am just branching out into the more complex formatting strings (was using %artist% - %title% for the longest time).

Thanks

PS: Using version 0.8.3 on Windows XP SP2, up to date.
-Wanna die?

Question about title formatting

Reply #1
Why not
[$if(%album%,$abbr(%album%,25),%_directoryname%)    ::    $char(9) %_length%]

or consider $pad() [or $pad_right()]
[$char(9) $if(%album%,$abbr(%album%,25),%_directoryname%)    ::    $pad(%_length%,6)]

Question about title formatting

Reply #2
Hello, richard123

The tags you gave me didn't yield the results I had wanted, but they put me in the right direction, nonetheless.

Code: [Select]
[$char(9) $if(%album%,$abbr(%album%,25),%_directoryname%)    $pad(::,5) $pad_right(%_length%,5,0)]

I went with this, and just padded the spaces with a 0, which looks okay from where I am sitting.  Thanks a lot, would have taken me ages to get this on my own.
-Wanna die?

 

Question about title formatting

Reply #3
Using $tab() seems like the most sensible suggestion, but just for messing about I use:

Code: [Select]
$num($div(%_length_seconds%,60),2):$num($mod(%_length_seconds%,60),2)

... to display durations.  This provides a 00:00 format so all durations (under 100:00) are the same length in a monospace font.

I also have an adaption that flashes the colon every second, but that's just silly.
I'm on a horse.