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: Syntax help for title along with track length combination (Read 1843 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Syntax help for title along with track length combination

First of all, as this being my first post here, I would like to introduce myself. Sebastian, long time user of foobar2000, who at the time of the software's discovery was extremely exited that a magnificent alternative to Winamp (and other players that don't really deserve mentioning), was born. I watched the program grow and go through a lot of transformations before it got where it is today, undoubtedly the only audio player anyone should have installed.

Now, regarding the problem that has brought me here. I've always kept the design of the player simple, with no extra skins installed and just general, easy to use syntaxes. Today, apparently i've come across an imposibility for me. A syntax that would result in the following:

One column for the playlist (important), track title centre alignment + track length right alignment. Screenshot below for a better explination as to what i'm aiming at.



So what I want to do is, regardles of the player's width to centre align the track titles and, right after it, in the same field, to have the track time, but centered to the right. The reason for this is simple: Track title column strecthes pretty wide and moves the titles too much to the left, bringing an overall unsatisfying aspect to the playlist.

My current syntaxes for track title and track time are as follows:

[%title%] and [%_time_elapsed% / ]%_length%

In short, to resume, I would like these two syntaxes to be put together in such a way that they have an individual alignment on the same column.

In hope that I will get a helping answer I thank you for the time spent reading this and eventually replying as well. Please excuse any language errors, English is not my mother tongue. All the best!

Syntax help for title along with track length combination

Reply #1
You didn't mention...are you using the default UI (DUI) or Columns UI (CUI)?

Why must this be in one column? If that's an absolute requirement, then I doubt it can be done. You'd need to generate a calculated # of spaces between the title and duration, and display it right-aligned. Calculating the # of spaces would be easy if you're using a fixed-width font, but with a variable-width font, the width of the rendered text is unpredictable.

Syntax help for title along with track length combination

Reply #2
Thank you for the answer, I'll cover the gaps I left in my original post now. Columns UI 0.3.8.6 with foobar2000 1.1.2 beta 1. Font is Segoe UI.

I want one column because aesthetically I'd be more pleased with the track title being centered in respect to the whole player window, not one column (that now makes it look shifted to the left).

Syntax help for title along with track length combination

Reply #3
Since ColumnsUI supports $tab() try:
Code: [Select]
$tab()[%title%]$tab()[%_time_elapsed% / ]%_length%
I can't remember the exact alignment rules with tab but I think that is the closest you can get single column. Otherwise you would have to switch to something like ELPlaylist.

Syntax help for title along with track length combination

Reply #4
i observed that $tab() takes the latter to the right
so this would suffice: %artist%$tab()%length%
provided you make this column center aligned


EDIT: i swear this worked for a moment
 

EDIT2: ok, you could do this.
optionally, you could make the length column a bit smaller
anyways... the real thing is:
in the title column you could use $pad(' ',value) as an offset to adjust the center
eg: $pad(' ',30)[%title%]
well... not a universally optimal fix but a quick fix nonetheless.