Help - Search - Members - Calendar
Full Version: Track Info Panel with ability to change font
Hydrogenaudio Forums > Hosted Forums > foobar2000 > 3rd Party Plugins - (fb2k)
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24
terrestrial
This is a modified foo_uie_trackinfo which uses a differet display function, which allows for different fonts / alignment.

Example screenshot:

IPB Image

and the code from the example:

CODE

$if(%_trackinfo_notrack%,
Stopped,

$align(left,top)
$font(forte,15,shadow,255-255-255)%title%$char(10)
$font(,12,,64-0-0)%album% ['['%date%']']$char(10)
$rgb(0,64,0)%artist%$char(10)
$rgb(64,0,0)%composer%test$char(10)

$align(right,bottom)
$font(Verdana,10,,0-0-0)%__codec%@%__bitrate%$char(10)
[%playback_time% / ]%length%

$align(left,bottom)
$font(Wingdings 2,13,,)
$if(%rating%,
$select(%rating%,
$rgb(155,0,0)κ,
κκ,
κκκ,
κκκκ,
$rgb(0,155,0)κκκκκ),
$rgb(155,155,155)κ)
)


This is very much still a beta, so please beware of bugs.

Download here.

For documentation, please refer to the wiki. (thanks to FofR, Sw!ng, and the other contributors).

Requires:

MS Visual C++ 2005 Runtime Library
GDI+ - only needed for Windows 2000
pepoluan
QUOTE(cvax @ Jul 18 2006, 00:08) *
Is it possible to use the scrolling feature only on a certain portion of the trackinfo?
With the standard trackinfo, no way.


QUOTE(terrestrial @ Jul 25 2006, 02:48) *
hey guys...
I have modified trackinfo a little bit to support mixing of different fonts/styles.
Sounds interesting. Will try and report ASAP.

QUOTE(terrestrial @ Jul 25 2006, 02:48) *
I had to remove some stuff (scrolling, alignment support), but otherwise this is the same as the original. This is my first plugin in for foobar, so beware
Happily, I don't need these, so if your plugin works, it fits my needs perfectly.

I assume the 0-0-0 is R-G-B values?

You PM creator of trackinfo and coordinate your development. Or if that is not possible, change the name so that people will not confuse your trackinfo and the 'standard' trackinfo.
Yotsuya
Would it be possible for you to change your font code to me more consistent with TAGZ? IE:

'#FONT,tahoma,14,BOLD,0-0-0#'

would become

$font(tahoma,14,bold,$rgb(0,0,0))



Just a suggestion.
terrestrial
made a couple of bug fixes, and other changes:

example screenshot:
IPB Image

config:
CODE

$if(%_trackinfo_notrack%,
,
$align(left,top)
$font(forte,22,,0-0-0)%title%$char(10)
$font(forte,18,,64-0-0)%album% ['['%date%']']$char(10)
$font(forte,18,,0-64-0)%artist%$char(10)
$align(right,bottom)
$font(tahoma,16,,0-0-0)%__codec%@%__bitrate%$char(10)
[%playback_time% / ]%length%
)


download

QUOTE(pepoluan @ Jul 24 2006, 17:28) *


I assume the 0-0-0 is R-G-B values?



Yes, R-G-B wink.gif
Yotsuya
First off I'd like to thank you for continuing the development of this popular plugin. There are, however, a few issues I'd like to point out.

1) No Default Font. Absolutely no text will appear unless a $font() is defined. So if you have code such as:
CODE
%album artist% - $font(tahoma,14,,0-0-0)%title%

You will see the title but not the artist. Perhaps you could reimplement the old font settings in the configuration, and use that as the default font. Also, the font appears to reset on every line of code. So unless you define a font at the beginning of every line text will disappear.

2) Inconsistent Font Size. If I use the function $font(tahoma,8,,0-0-0), text appears significantly smaller than when I choose Tahoma 8pt in other components.


3) Broken $rgb(). Both colors in the format of $rgb(0,0,0) and 000000 no longer appear and are displayed as normal text. The color can be redefined with a $font() command but this requires everyone to rewrite their existing code. Also, a simple $font(,,,0-0-0) does not work as apparently the $font() function requires an actual font to be specified.

4) Broken $tab(). The use of $tab() appears to simply bump the text to the next tabstop instead of the allignment behavior found in other foobar components. I am unable to figure out a way to right-allign text using this version of trackinfo.


On the other hand, I was pleasantly surprised to see that despite being a component of a different name and chosing not to save the settings for the old component, your component successfully inherited all my existing settings and code from the old component. Also, thank you for changing your font code format to be more consistent with TAGZ :)

Using multiple fonts in the same panel is definitely an improvement for this component, however I think some more development is in order for myself (and I would assume many others) to make the switch. Keep up the good work!
terrestrial
Thanks for your comments wink.gif

QUOTE(Yotsuya @ Jul 28 2006, 15:58) *

1) No Default Font. Absolutely no text will appear unless a $font() is defined. So if you have code such as:
CODE
%album artist% - $font(tahoma,14,,0-0-0)%title%


Yes, there needs to be a $font in the beginning and after every $align. I will bring back the font dialog and use that as the default.

QUOTE

2) Inconsistent Font Size. If I use the function $font(tahoma,8,,0-0-0), text appears significantly smaller than when I choose Tahoma 8pt in other components.


I am using the font size in pixels, whereas others are using point sizes... I think I can convert to make it more consistant.

QUOTE

3) Broken $rgb(). Both colors in the format of $rgb(0,0,0) and 000000 no longer appear and are displayed as normal text. The color can be redefined with a $font() command but this requires everyone to rewrite their existing code. Also, a simple $font(,,,0-0-0) does not work as apparently the $font() function requires an actual font to be specified.


can be fixed also wink.gif

QUOTE

4) Broken $tab(). The use of $tab() appears to simply bump the text to the next tabstop instead of the allignment behavior found in other foobar components. I am unable to figure out a way to right-allign text using this version of trackinfo.


unfortunately, this will not be easy to change, since this display system is completly different from the regular one. However, you should be able to achieve the same effect (with even more flexability) by using something like this:

CODE

$align(left,top)
$font(tahoma,11,,0-0-0)
This text will appear at the top left
$align(right,bottom)
$font(tahoma,11,,0-0-0)
This text will appear at the bottom right
pepoluan
2 suggestions:

1.
Please provide a readme.txt too to describe the difference with the old trackinfo, including new commands, how to align, change font, etc. Then put the readme.txt in a zip alongside the new .dll, and presto.

2.
Saving of not only trackinfo text, but also default font, default (background) color, etc. So just in case I screwed up my trackinfo, I only need to reload a .titagz file (or whatever extension) to restore. No need to fiddle manually the background color, fontsize, scroll speed, etc. like the older trackinfo.
mazy
terrestrial - amazing work, thank you so much for working on this plugin. few questions though:
  • is it possible to change fonts / sizes even on one line, or is it one style per line only?
  • [done: still $font with different arity and specialized style functions could be handy] i would like to be able to change only for example font, size or style, not everything ... does $font(,11,,) work like this? maybe you could add support for multiple $font functions with different arity, like $font(fontname), $font(fontname, style), $font(fontname, style, size). also $size and functions for quick bold / italics / underline would be great - maybe as $b() - or $b(text to be bold).
  • could you support custom info (foo_custominfo)?
  • [done] ability to disable / enable antialiasing or cleartype. some fonts work well only without it. this could be set in the configuration dialog
  • [done] when i change tracks (or during normal playback), when foobar is moving onto new song, there's registrable period of time when trackinfo thinks (probably properly), that there's no song playing - so it reacts to this (redraws itself) with the formatting having no song info available (which in my case means mostly that i do not output anything). this is distracting me *a lot*. could you find some workaround for this, please?
  • extra feature would be to be able to 'measure' text's width (in pixels or % of available space), would that be possible? something like $fontwidth(fontname,style,size,text to measure) or $fontwidth(text to measure using current style).
thoughts, anyone ...
[edit] i tried your version and stroked out things that already work ...
Squeller
QUOTE(terrestrial @ Jul 28 2006, 13:19) *
Please just one uie_trackinfo project!

This guy has fixed some annoying bugs and introduced an additional wrapping mode. Just to let you know.

http://www.hydrogenaudio.org/forums/index....st&p=415116
mil3s
Bug
In the latest foobar beta multiple trackinfo fields no longer work. sad.gif
terrestrial
QUOTE(mazy @ Jul 29 2006, 16:33) *

[*]i would like to be able to change only for example font, size or style, not everything ... does $font(,11,,) work like this? maybe you could add support for multiple $font functions with different arity, like $font(fontname), $font(fontname, style), $font(fontname, style, size). also $size and functions for quick bold / italics / underline would be great - maybe as $b() - or $b(text to be bold).


added. stuff like $font(,,bold,) should work now.
QUOTE

[*]ability to disable / enable antialiasing or cleartype. some fonts work well only without it. this could be set in the configuration dialog


added (although I haven't tested it). add nocleartype to the option to disable cleartype.

QUOTE

[*]when i change tracks (or during normal playback), when foobar is moving onto new song, there's registrable period of time when trackinfo thinks (probably properly), that there's no song playing - so it reacts to this (redraws itself) with the formatting having no song info available (which in my case means mostly that i do not output anything). this is distracting me *a lot*. could you find some workaround for this, please?


fixed.

QUOTE

[*]extra feature would be to be able to 'measure' text's width (in pixels or % of available space), would that be possible? something like $fontwidth(fontname,style,size,text to measure) or $fontwidth(text to measure using current style).


I do this internally, but why would you need the values exposed?


QUOTE(mazy @ Jul 29 2006, 16:33) *

i would like to be able to change only for example font, size or style, not everything ... does $font(,11,,) work like this? maybe you could add support for multiple $font functions with different arity, like $font(fontname), $font(fontname, style), $font(fontname, style, size). also $size and functions for quick bold / italics / underline would be great - maybe as $b() - or $b(text to be bold).


added. stuff like $font(,,bold,) should work now.
QUOTE

ability to disable / enable antialiasing or cleartype. some fonts work well only without it. this could be set in the configuration dialog


added (although I haven't tested it). add nocleartype to the option to disable cleartype.

QUOTE

when i change tracks (or during normal playback), when foobar is moving onto new song, there's registrable period of time when trackinfo thinks (probably properly), that there's no song playing - so it reacts to this (redraws itself) with the formatting having no song info available (which in my case means mostly that i do not output anything). this is distracting me *a lot*. could you find some workaround for this, please?


fixed.

QUOTE

extra feature would be to be able to 'measure' text's width (in pixels or % of available space), would that be possible? something like $fontwidth(fontname,style,size,text to measure) or $fontwidth(text to measure using current style).


I do this internally, but why would you need the values exposed?

New version can be found here
mil3s
Thanks for fixing the multiple fields bug so quickly biggrin.gif

EDIT: Your new feature $font(,,bold,) doesn't work though. Makes the text disappear.
Yotsuya
Wow thanks for the quick update and thank you for correcting most of the issues I previously mentioned. I installed your latest update and after a few minor code edits I have made the switch. Still still remains a few issues I'd like to mention.

1) With other components, we can use $rgb() with no parameters or double color escape code to reset the text color to the default. It was easy enough for me to change my $rgb() to $rgb(0,0,0) but otherwise existing code will not work. Would you perhaps consider re-implementing the configuration for the default text color and allow $rgb() or double color escape to reset the text to that color?

2) Bold and Italic on the default font is ignored. Also, $rgb(,,bold,) and $rgb(,,italic,) does not work as expected, instead it changes the text to some totally different font setting (is it filling in the blanks with something?)

3) $align() appears to be buggy, or I am not using it properly. If I use $align(right,) at the beginning of every line like this:

$align(right,)Text line one.$char(10)
$align(right,)Text line two.$char(10)

instead of seeing two lines right alligned, the lines are overlapped on top of each other. This can be corrected with $align(right,top) $align(right,center) $align(right,bottom) but that only fixes up to three lines of aligned text. After playing around a bit I discovered that the $align() is inherited from one line to another so I can replace the code with:

$align(right,)
Text line one.$char(10)
Text line two.$char(10)

which IMO is actually more efficient code, however with people migrating from the old $tab() system you may want to implement some code to allow for the first example.

There also appears to be something wrong with $align(center,). When using this on multi-line text like this:

Text line one.$char(10)
$align(center,)Text line two.$char(10)

the second line is indeed centered, however the text appears overlapped onto the first line instead of appearing on the second line as expected. I corrected this by using $align(center,bottom) but as stated before this approach will only help with up to three lines of aligned text.

You have corrected most of the major obsticals and I think that if you could atleast correct the first issue most legacy trackinfo code should migrate, requiring the end user to only to change their $tab() alignments o $align(). Again, keep up the good work!
takt
Is this version of trackinfo a branch or just a update in features?

Any links to it? Any requirements?
mazy
Yotsuya

1) the way $align works right now is, as you found out, like this:

text flows from top-left corner; when new $align is encountered, the reference point / alignment is changed according to it. with this system, you can't truly make lines with both left and right aligned text. you can, though put some text on the left (even on multiple lines) and then put different text on the right. these two texts do not interact though, so they can overlap etc (which may be handy in some cases and not in others).

i think that the logical extension to $align would be to allow inherit-vertical-position mode, when for example $align(right,) would put text to the right border, but stay on the same vertical position as the last text rendered. another would be to allow pixel adjustments to the point's position like this: $align(center-1,top) or $align(+10,20) etc. +/- sign would mean relative adjustment; you could also specify those keywords like center etc. with this system. it would be possible to do quite a few effects including any-size line spacing, pseudo text shadows etc. i think that the way this track info mod works, it opens possibility to even more things in the future, like placement of images wink.gif

with the current implementation you could do some interesting stuff though, like this:

IPB Image

2) that bold / italics stuff seems to be buggy (i.e. $font(,,bold,)), at least with respect to size field, which is either set to zero or some other value, not really what it was set before (so you got to specify size too: $font(,10,bold,)). also i'm not able to make anything else than bold work (italics, underline, nocleartype ...).

terrestrial, thank you for this quick update, i especially love that track info doesn't redraw in the middle of changing tracks, that's great smile.gif

1) could you please read what i posted in response to Yotsuya? there are still some things broken with the $font when omitting some parameters. plus only 'bold' works for me.

2) that size measuring - i would use it to detect if i can fit some text into the panel (for example when i show some, possibly long, text in one line only). if not, i could skip some parts or show it with smaller font (which is possible with your mod wink.gif )

3) as it is now, when text doesn't fit, it flows (wraps) to the next line. there are cases though, when there won't be space on the next line either - like when the word is wider than the width of the panel. i would like to be able to sometime somehow disable wrapping / clipping and show what fits.

4) somehow related to 3) and also to that $align +/- stuff mentioned in the response to Yotsuya. some fonts especially at bigger sizes have quite some space (vertically) around glyphs and it doesn't look right with regards to panel's borders. i would like to compensate for this by using for example $align(left,-3), but that would have to make sure the text as whole wouldn't get rejected as it's not starting inside the panel's boundaries (or is taller than panel's height).

5) this is much off the current scope of track info panel and you (or others) may disagree to go this way (which is fine by me), but it could be interesting to add settings for left / right / double click actions (so one could set it to different commands, not only to switch between playing / focused mode.

advanced possibility would be to define 'regions' in the formatting, either by $region(x,y,width,height,action) like $region(0,0,10,10,playback\cursor follows playback) or $region(text,action) like $region($ifgreater(%rating%,0,+,-),custom info\rate 1)$region($ifgreater(%rating%,1,+,-),custom info\rate 2) ... the latter example could make rating by simply clicking on corresponding symbol.

note: i somehow like that $font takes size parameter in pixels, as it allows much more accurate size setting for some 'pixel' ttf fonts.

QUOTE(takt @ Jul 31 2006, 10:20) *
Is this version of trackinfo a branch or just a update in features?

Any links to it? Any requirements?

i would say it's more of a branch, as it takes different approach to text positioning and other major issues. link has been posted by terrestrial, the author. it's here. it needs some later 0.9.x version of foobar.

there's also another work-in-progress track info project here, which is more focused on bug fixing (at the moment) the previous official track info panel.
Andrea
QUOTE(mazy @ Jul 31 2006, 11:11) *

i would say it's more of a branch, as it takes different approach to text positioning and other major issues. link has been posted by terrestrial, the author. it's here. it needs some later 0.9.x version of foobar.

there's also another work-in-progress track info project here, which is more focused on bug fixing (at the moment) the previous official track info panel.


Thanks for posting the links! It took me a while find them for foobar 0.9 smile.gif
terrestrial
Ok, new version with bug fixes and some additions.

mazy is correct about the way $align works, but I've also added in a "compatibility" mode that should achieve the same effect as the original.

QUOTE

with the current implementation you could do some interesting stuff though, like this:


interesting wink.gif although, it technically shouldn't overlap as the code is supposed to move things out of the way, but I like the idea so I'll have to add in the ability to do this.

QUOTE

it would be possible to do quite a few effects including any-size line spacing, pseudo text shadows etc.


any-size line spacing is already there but I haven't exposed the function. As for shadows, try adding "shadow" to the font options.

QUOTE

that size measuring - i would use it to detect if i can fit some text into the panel (for example when i show some, possibly long, text in one line only). if not, i could skip some parts or show it with smaller font (which is possible with your mod )


I eventually want to add different line ending styles, instead of just wrapping (including some sort of "fit" where the font sizes will be adjusted to fit the text). The idea of showing different text is interesting, though... I'll have to think about how best to implement this.

#4 is on the todo list already, and #5 is interesting... I like the idea of having "buttons" to preform actions, but it may take a while before I have the chance to add it in wink.gif

drbeachboy
I received this failure notice from FB2K_v0.9.3b4:

Failed to load DLL: foo_uie_trackinfo_mod.dll
Reason: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.

The last version (foo_uie_trackinfo_v0.8) has no problems loading. Was this new mod version created differently? Generally, I get this failure notice due to not having the proper library files. If so, can you let me know which library files are needed? Thank you.
mil3s
I know someone said that the font sizes where all wrong in the last version, and now you "fixed it". But they where correct in the old version. Now they are wrong. In columns ui and playlist dropdown my font is set to Tahoma 8, in trackinfo the font has to be set to 10 to be the same size as the rest of Foobar. In the version before this one I had the font size set to 8 witch was the same size as everything else.

Btw. Thanks for continuing the development on this component. Keep up the good work. smile.gif
pepoluan
@terrestrial: Now that you have your own thread biggrin.gif ... can you change the link on the first post? It still links to foo_uie_trackinfo.dll . I do think you have renamed your .dll to foo_uie_trackinfo_mod.dll, right?

Edit: Even better if you totally change the first posting like you're announcing a new plugin, e.g. the right download link, state the latest release date, version, etc.
mazy
terrestrial, thanks for fixes! that shadow stuff is nice hidden feature, i see you think a lot ahead of us smile.gif. i'm going to report few bugs though.

1) as for style, i can make bold, italics and nocleartype work. underline and strikeout not.

2) also there are some problems with $font interfering with color codes etc. examples:

C8C8C8$font(Charriot Deluxe,9,nocleartype,)artist - the $font resets color to default one. i would think it should stay at the last color set.

$font(Charriot Deluxe,9,nocleartype,)C8C8C8artist - that color code resets anything related to font, so "artist" shows with the default font and style (ignoring everything in the $font, nocleartype including).

imho as with $rgb() returing to default color, maybe $font() could set (return to) the default font too.
Yotsuya
Nice to see this component is continuing to evolve.

This last release is a considerable improvement and now legacy code appears to migrate with the exception of the alignments.

I think I need a little more practice with the $align() system though. Is there a way to have a line of text right justified without pushing the text to the top or bottom of the box, and without relying on the alignment of the line before it? I tried:
CODE
$align(left,)Text line one.$char(10)
$align(right,)Text line two.$char(10)

But both lines of text appear on the top line. I tried putting numerical values in the second parameter of $align() but that did not appear to make much dfference. Also, $align(right,) appears to break if it comes after an $align(center,). For example I was trying to create three columns of text:
CODE
$align(left,)one$align(center,)two$align(right,)three
but the second and third columns get grouped together.

As mil3s already indicated, font sizes appear to have reverted back to the "pixel" size instead of the "point" size you corrected in the last release.

I'd also like to second mazy's request to be able to pull the pixel length of a string of text, and also the height and width of the infobox if possible, I can see how it can be very useful with long song names. Using the $len() function does not really account for different width letters, especially when doublebyte characters are involved. I'm currently trying to write an infobox that will change font sizes to accomodate different lenghths of song names and this is what I came up with. I currently rely on static offsets I found with trial/error but it would be much nicer if I could use dynamic offsets computed from the panel and font sizes.. so I can change fonts or resize the panel without rewriting the code:

IPB Image

CODE
$ifgreater($len(%artist%%title%%album%%date%),45,$font(,12,Bold,),$font(,16,Bold,))
$align(left,)$rgb(233,233,233)$if(%artist%,%artist% $rgb(0,128,255)$char(47)$rgb(233,233,233) ,)$if2(%title%,)

$ifgreater($len(%artist%%title%%album%%date%),45,$char(10)$align(right,bottom),$align(right,))
$if($strcmp($left(%path%,7),http$char(58)$char(47)$char(47)),,
$ifgreater($len(%artist%%title%%album%%date%),82,$font(,9,,),$font(,,,))
$rgb(180,180,180)$if2(%album%,)$if(%date%, $rgb(0,128,255)$char(40)$rgb(180,180,180)%date%$rgb(0,128,255)$char(41),)
)


Edit: Also, bold still does not appear to work from either the default font or with $font().
terrestrial
QUOTE(drbeachboy @ Jul 31 2006, 10:53) *

I received this failure notice from FB2K_v0.9.3b4:

Failed to load DLL: foo_uie_trackinfo_mod.dll
Reason: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.

The last version (foo_uie_trackinfo_v0.8) has no problems loading. Was this new mod version created differently? Generally, I get this failure notice due to not having the proper library files. If so, can you let me know which library files are needed? Thank you.


it needs the C runtime library for vs .net 2005 (msvcr80.dll I think). Do you have this file in your system?

--------

The font sizes used to be pixel sizes, but now are point sizes. To convert between them you can use this formula: pixels = points*dpi/72 (where dpi is normally 92). Point size seems to be consistent with Columns UI and everything else, at least to me. Are you sure you have the latest version?

--------

The underline / strikeout have been added, and the font / color issues have been fixed. There may still be some glitches, and if so, please let me know wink.gif
Schinkentoni
Thank you very much for your development efforts.

But I get the same mistake as drbeachboy. I have msvr80.dll in my system32 folder.

One suggestion: the ability to autoscroll like in Winamp (at least in the 2.8 version I was using), not only on line ending
terrestrial
are you guys running the latest version of foobar (0.9x)?
Schinkentoni
the latest stable, yes (0.9.2)
mazy
i've been playing with the new version and found out some more hidden features wink.gif. i apologize in advance, as these are probably just proof-of-concept features which are not meant to be used by users at the moment. i've found about them looking at the binary (as i couldn't make $alignrelative work). interesting stuff though. behold:

IPB Image

edit: i've realized that this screenshot isn't 100% correct, #endshade# doesn't work atm, so #shade# changes background only of the current line (which in the case on the screenshots is rather long and spans over two "render lines").

as for other things, well the recent changes to the way $align works are a bit confusing to me. with the old (= overlapping blocks) version, it seemed more straightforward. i will post screenshots later.

also $alignrelative isn't working for me, i have even tried to use #align-rel# or #align-set# to no avail.

$rgb() seems to reset to black instead to the default text color.
drbeachboy
QUOTE(terrestrial @ Jul 31 2006, 16:26) *

are you guys running the latest version of foobar (0.9x)?

I am running the very latest (FB2K_v0.9.3b4). My work computer does not have the latest .Net installed, so I may not have the msvcr80.dll file installed. I am on my home computer at the moment. Tomorrow, I will copy that file from my home computer over to my work computer and see if that does the trick. Thank you for your quick reply.
mazy
ok, so here goes the 'align' post wink.gif. formatting:

CODE
text$char(10)
// first block
$align(left,)$rgb(200,50,50)left$char(10)l
$align(center,)$rgb(50,200,50)center$char(10)c
$align(right,)$rgb(50,50,200)right$char(10)r
// this has no effect to the second block
$align(,bottom)
// second block
$align(left,)$rgb(100,0,0)left
$align(right,)$rgb(0,0,100)right
$align(center,)$rgb(0,100,0)center
// third block
$align(left,bottom)$rgb(200,50,50)left
$align(right,bottom)$rgb(50,50,200)right
$align(center,bottom)$rgb(50,200,50)center

result:

IPB Image

explanation (?):

let's look at the first block. it's result is on the first line in the screenshot, rendered with light colors. you can see only dark-green "center" in there, as it got over the light one.

"left" got put after "text", as the latter was already there and "left" was not allowed to draw over it. then we have "center", which was correctly put in the center.

now "right" (the light one) is interesting. it's not on the right side as it should be, but rather at what seems to be right edge of the center column. strange. these "l", "c" and "r" letters are just new lines of the sub-blocks of the first block; they show more precisely where the alignment line is.

now the second block. that's the one resulting to words rendered with darker colors. as you can see, that $align(,bottom) has no effect to it and $align functions in the second block assume "top" for the missing vertical alignment parameter (which is fine by me, it wasn't said to be "relative" or anything like that).

they show in the left, right and center columns on the first line respectively. they do not overdraw the existing texts (as they are not allowed to) with the only exception being "center" - it seems that center of a center is again the same center wink.gif.

it gets interesting again for the last, third block. i've only changed the order in which i specify texts for corresponding columns. i put right in front of center - and the result is what one would expect in the other blocks too - right column has adjustment line on the right edge of the panel.
rouge
Can this be made into a seperate component from foo_uie_infopanel?

In case people want to use a mix of modified and unmodified info panels.

edit: This appears to be possible, but there is no difference in the layout names, so you wouldn't be able to tell which is which. And my old infopanels were automatically converted to the moded ones upon installation.
year98
Great works!

Some suggestions...somewhat irrelevant with your mod.

1. show foobar volume, playback order.
2. combine album art...
3. double-click behavior configure.

Is these possible? or shoud be just my dream...sad.gif
thuan
I second the configurable double click behavior.
terrestrial
QUOTE
I've been playing with the new version and found out some more hidden features


nice detective work wink.gif most of the "hidden" stuff is still untested/incomplete, so be careful, but there are some that are pretty much done.

------------

fixed the problem with alignrelative, and renamed to $alignrel
also fixed the $rgb() problem

fixed the alignment problem (caused by that center column). it should work now.

if you don't specify a parameter for $align (eg $align(left,)) the blank either default to top or left.

------

If will try to change it into a separate dll from foo_uie_trackinfo so that you can run both at the same time for the next version.

-----

QUOTE
Some suggestions...somewhat irrelevant with your mod.


I think I can do #1. #2 is low down on the todo list. #3 also, but first I want to fix the basic formatting stuff wink.gif

-------

I've uploaded a new version, with the aforementioned bug fixes + some new commands (including one to measure length). Please see the readme for more details.
year98
Oh! Can you do everything? I'll wait forerver...^^
Hamallainen
Thanks a lot for your work
CODE
$alignabs(X,Y,W,H,H,V)
%_width%
%_height%
$calcwidth(TEXT)
$calcheight(TEXT)

those are a great improvement smile.gif
Generalverdacht
just wanted to thank you (creator of new features), no time in the moment going to wacken festival soon. so trying to get into it next week.

seems really (!!!!) nice work to me.
mazy
terrestrial, i can confirm that $rgb() works and that center column alignment problem is gone! the new features summed by Hamallainen are great smile.gif.

now i have something new for us. picture:

IPB Image

first start with 3. using the new measurement features coupled with #SHADE#, one can make nice pixel-accurate trackbar. code:

CODE
$alignabs(0,0,%_width%,$mul(%_height%,2),,)#SHADE#
$alignabs($muldiv(%playback_time_seconds%,$sub(%_width%,10),
%length_seconds%),0,10,$mul(%_height%,2),,)#SHADE#

note: you may have to adjust font size to fit the trackbar into panel vertically (or make it span over the whole height). i could do that in the code, but that would have to do pixel<->point conversion and i was lazy to do that wink.gif.

let's move to 2a. it's $alignrel test, 2b has the first line in the code bellow uncommented:

CODE
//$alignrel(left,top)
<line1>
$char(10)
<line 2>
$alignrel(center,top)<line 2 center>
$alignrel(right,top)<line 2 right>
$char(10)<line3>
$alignrel(left,top)<line 3 left>

we can see in the first example, that until <line 3 left> it works as one would expect. now if we uncomment the first line with the $alignrel (which is set to default values), things get messy starting from <line 2 center>. my guess is that $alignrel doesn't work correctly with multiline blocks. it does as long as there's no $alignrel before, otherwise it takes that as reference point. i think this is a bug.

example no. 1, is extended one from my previous post. you can see there's no longer that center column alignment problem. there are some interesting observations to note, though.

in the top-left corner, there are two major multiline blocks. one has lines with "left", "l" and "longer left"; the other has 4 lines with one underscore character each. interesting is that the underscore on the second line is not directly alongside that "l" and similarly dark-red "left" to the light one on the first line.

my explanation is that this is rather good feature of multiline blocks. whenever blocks spans over multiple lines, the edge of its longest line (or rather the line with most major "adjustment point"), in this case the third line "longer left", affects neighbours of this block on its every line. it basically creates columns, but only affecting the lines that block spans over (that's why the 4. underscore is directly to the left panel's edge).

another feature demonstrated is the $alignabs. at first please note those two light-blue underscores on the right edge (second sub-block of 5. block in the code). these are part of multiline block positioned with $alignabs, so they do not "flow" with other text there and overwrite "right" and "r". i used the "shortcut" 2-parameter version of $alignabs, as that's basically version of $align without overwriting text check.

the full $alignabs(x,y,width,height,halign,valign) is demonstrated by the rectangles with "absolute" text. in this case, x, y, width and height define rectangle which is used as boundaries for following text, and halign plus valign control this text's positioning inside that rectangle. #SHADE# came handy in here, is it allowed for showing width of these rectangles.

you can see that $alignabs supports negative coordinates and also that it shows even if part of the rectangle is outside panel's boundaries. this is all good news smile.gif. i have one feature request though: it would be nice if $alignabs(x,y,,,halign,valign) - i.e. without width and/or height specified - substitutes these omitted parameters with values equal to that block's width / height.

there's another thing to mention regarding this example. only text blocks aligned with $align(,top) do not overwrite other text. you can see that capital letters "L", "C" and "R" overwrite "left", "center" and "right" respectively. all these blocks have "middle" vertical alignment.

code:

CODE
text$char(10)
// 1. block
$align(left,)$rgb(200,50,50)left$char(10)l$char(10)longer left
$align(center,)$rgb(50,200,50)center$char(10)c
$align(right,)$rgb(50,50,200)right$char(10)r
// has no effect on 2. block
$align(,bottom)
// 2. block
$align(left,)$rgb(100,0,0)left
$align(right,)$rgb(0,0,100)right
$align(center,)$rgb(0,100,0)center
// 3. block
$align(left,middle)$rgb(200,50,50)left
$align(right,middle)$rgb(50,50,200)right
$align(center,middle)$rgb(50,200,50)center
// 4. block
$align(left,middle)$rgb(200,50,50)L
$align(right,middle)$rgb(50,50,200)R
$align(center,middle)$rgb(50,200,50)C
// 5. block
$align(left,top)$rgb(255,100,100)_$char(10)_$char(10)_$char(10)_
$alignabs(right,top)$rgb(100,100,255)_$char(10)_
// 6. block
$alignabs(-30,80,70,16,center,middle)#SHADE#absolute
$alignabs(100,80,70,16,center,middle)#SHADE#absolute
$alignabs(140,80,70,16,center,middle)#SHADE#absolute
$alignabs(260,80,45,15,center,middle)#SHADE#absolute
// 7. block
$alignabs(100,96,200,16,,)"absolute" is
$calcwidth(absolute) x $calcheight(absolute) pixels

[edit] colors and some syntax. my computer went down while i was editing this post, and i wasn't able to get it running until now :/. i should buy new harddrive for my system ...
Yotsuya
Thank you terrestrial for your dedication, this component is evolving quickly. At this time all my issues have been resolved and I have happily migrated to your version of this panel. The only things I have left are feature requests:

1) I would like to be able to use $font() without any parameters to set the current font to the default font. And for that matter an $align() without parameters to reset the alignment to the upper left corner would probably be useful too.

2) Ability to export and import settings of a panel including "Font", "Colours", "Display options", and "Formatting string" to an external file would assist tremendously when redesigning layouts or sharing configurations.

3) Text that can be clicked on to start events such as URL's from online radio. This has been mentioned before and would obviously take quite a bit of work so I dont expect to see it anytime soon.

4) Defining a background bitmap or embedding graphic sources such as icons inline with text would be icing on the cake. When combined with request #3 this would provide a pleasant alternative to the default buttons toolbar (which I've heard has many problems under Win2k).

I would like to particularly thank you for providing the functions for analyzing pixel length of strings and the panel itself, when used properly these allow us to develop panels that dynamically resize the text based on the panel's size. I'd also like to thank you for resolving the $rgb()$font() conflict and $align() bugginess, the component is much more flexible.
terrestrial
QUOTE
first start with 3. using the new measurement features coupled with #SHADE#, one can make nice pixel-accurate trackbar. code:


nice! I didn't even think about that smile.gif I think I need to add the ability to add picture now wink.gif

QUOTE
we can see in the first example, that until <line 3 left> it works as one would expect. now if we uncomment the first line with the $alignrel (which is set to default values), things get messy starting from <line 2 center>. my guess is that $alignrel doesn't work correctly with multiline blocks. it does as long as there's no $alignrel before, otherwise it takes that as reference point. i think this is a bug.


this code

CODE

//$alignrel(left,top)
<line1>
$char(10)
<line 2>
$alignrel(center,top)<line 2 center>
$alignrel(right,top)<line 2 right>
$char(10)<line3>
$alignrel(left,top)<line 3 left>


get automatically converted to

CODE

//$alignrel(left,top)
$alignrel(left,top)<line1>
$alignset()$alignrel(left,top)
<line 2>
$alignrel(center,top)<line 2 center>
$alignrel(right,top)<line 2 right>
$char(10)<line3>
$alignrel(left,top)<line 3 left>


with the first line not commented out, the automatic conversion doesn't happen (it doesn't happen after the first $align), so if you change the subsequent $char(10)s to $alignset()$align(left,top) it should work.

QUOTE
my explanation is that this is rather good feature of multiline blocks. whenever blocks spans over multiple lines, the edge of its longest line (or rather the line with most major "adjustment point"), in this case the third line "longer left", affects neighbours of this block on its every line. it basically creates columns, but only affecting the lines that block spans over (that's why the 4. underscore is directly to the left panel's edge).


exactly right.. the new text should "flow" around the obstruction. It's useful when you have a small "box" of text that you want your main text to flow around.

QUOTE
it would be nice if $alignabs(x,y,,,halign,valign) - i.e. without width and/or height specified - substitutes these omitted parameters with values equal to that block's width / height.


do you mean substitute the total display width, height (%_width%, %_height%) or something else?

QUOTE
only text blocks aligned with $align(,top) do not overwrite other text.


correct also wink.gif block detection / avoidance for middle and bottom aren't written yet (eventually...)
FrDelefortrie
Another feature request: Can you create $font(NAME,SIZE,OPTIONS,COLOR) generator as you do with the color (e.g.: 000000)?, We just need a standart font box with as output the $font() syntax ready to cut'n'paste

At least could you update the ""color generator" to create color with the the new rgb (e.g.: $rgb() ) syntax?.

Thank you very much for your very good work.
Yotsuya
I stumbled upon a small inconsistency.

$align(left,)$repeat( ,4)text
$align(right,)text$repeat( ,4)

The right alignment will strip any spaces at the end of text, while the left alignment does not strip any spaces at the beginning of text. I would prefer if the right alignment would allow for spaces, but either way I think the functions should act similarly.
Yotsuya
I know a lot of people out there are using trackinfo code that uses $progress2() to create a stylized progress bar. Well I modified mine to auto-resize with the panel and thought I'd share the code. Change $rgb() and $char() values to suit your tastes, the 5th line is key:

CODE
$align(center,bottom)
$progress2(
%playback_time_seconds%,
%length_seconds%,
$sub($div(%_width%,$calcwidth($char(9679))),1),
$rgb(0,128,255)$char(9679),
$rgb(0,0,202)$char(9679)
)
terrestrial
QUOTE
1) I would like to be able to use $font() without any parameters to set the current font to the default font. And for that matter an $align() without parameters to reset the alignment to the upper left corner would probably be useful too.


added.

QUOTE
2) Ability to export and import settings of a panel including "Font", "Colours", "Display options", and "Formatting string" to an external file would assist tremendously when redesigning layouts or sharing configurations.


already on the todo list, but may take a while

QUOTE
3) Text that can be clicked on to start events such as URL's from online radio. This has been mentioned before and would obviously take quite a bit of work so I dont expect to see it anytime soon.


I should be able to do this after I add in images. I may have a version that can do images today, but buttons may take a couple of days.

QUOTE
Can you create $font(NAME,SIZE,OPTIONS,COLOR) generator as you do with the color (e.g.: 000000)?, We just need a standart font box with as output the $font() syntax ready to cut'n'paste


This should be doable.

QUOTE
At least could you update the ""color generator" to create color with the the new rgb (e.g.: $rgb() ) syntax?.


The old syntax should work fine (eg. 000000 = rgb(0,0,0) and both will be recognized).

QUOTE
The right alignment will strip any spaces at the end of text, while the left alignment does not strip any spaces at the beginning of text. I would prefer if the right alignment would allow for spaces, but either way I think the functions should act similarly.


spaces to the right of words are counted as insignificant because word breaks, etc are calculated from there, so I think it may be better to also strip out spaces from the beginning. You should be able to use non-breaking spaces (not sure what the char code for this is) to achieve what you want though.
FrDelefortrie
QUOTE(terrestrial @ Aug 1 2006, 20:41) *


QUOTE
At least could you update the ""color generator" to create color with the the new rgb (e.g.: $rgb() ) syntax?.


The old syntax should work fine (eg. 000000 = rgb(0,0,0) and both will be recognized).



I know but i just don't want to do the hexadecimal->decimal conversion to retrieve the "rgb" of the color. And I think it's more consistant with fb2k 0.9
Hamallainen
Hi,

I have a problem with the $align(H,V) fonction. If someone could confirm please. ( I use 0.9.3 beta4)

Here is the code i use, to explain:
CODE

$if(%_trackinfo_notrack%,
,
$align(left,top)$font(tahoma,16,,0-0-0)$repeat(7,12)
$align(center,top)$font(tahoma,16,,255-0-0)$repeat(8,12)
$align(right,top)$font(tahoma,16,,0-255-0)$repeat(9,12)

$align(left,middle)$font(tahoma,16,,0-0-255)$repeat(4,12)
$align(center,middle)$font(tahoma,16,,255-255-0)$repeat(5,12)
$align(right,middle)$font(tahoma,16,,0-255-255)$repeat(6,12)

$align(left,bottom)$font(tahoma,16,,255-0-255)$repeat(1,12)
$align(center,bottom)$font(tahoma,16,,128-128-255)$repeat(2,12)
$align(right,bottom)$font(tahoma,16,,255-128-128)$repeat(3,12)
)


and a screenshot:
IPB Image

It's seems $align(*,top) behave differently than $align(*,middle) and $align(*,bottom)
Well it seems $align(*,middle) and $align(*,bottom) overlap text if it's too long while $align(*,top) do not overlap but "discard" text. I don't know which one is the intended behaviour. I think both behaviour are interesting and that would be great if we could have access to both with for example $align(H,V) for no overlap and $aligno(H,V) for overlap.

thanks
Shakedown
This may be a stupid question, but I'm fairly new to foobar and I can't find it documented anywhere. But anyway, here goes nothin':

Is there a modifier that would make all of the text affected by the font statement display using capital characters?
Yotsuya
Shakedown I believe the function you are looking for is $upper(). This is the wrong thread and is not handled by $font(). Please refer to your C:\Program Files\foobar2000\titleformat_help.html

see mazy's post below.
mazy
QUOTE(Hamallainen @ Aug 2 2006, 00:22) *
It's seems $align(*,top) behave differently than $align(*,middle) and $align(*,bottom)
Well it seems $align(*,middle) and $align(*,bottom) overlap text if it's too long while $align(*,top) do not overlap but "discard" text. I don't know which one is the intended behaviour. I think both behaviour are interesting and that would be great if we could have access to both with for example $align(H,V) for no overlap and $aligno(H,V) for overlap.

yes, you're right. you could read my and terrestrial's posts as there's lot of information how this works, but i reckon that it's lots of information wink.gif.

in short - only $align(*,top) avoids to overwrite text and "flows" it. this is probably going to change, this is simply work-in-progress and there's only anti-overlapping code for the top scenario.

as for the other question you've asked - there's already way to output text without overlap checking. you can use $alignabs. it's more complex function which allows for positioning block of text anywhere you want, with the ability to specify it's box and vertical / horizontal alignment inside that box. the syntax is $alignabs(x,y,width,height,halign,valign). there's also shortcut version which is similar to $align - $alignabs(halign,valign).


Shakedown, Yotsuya is right, but there's also hidden feature in this plugin. you can use "uppercase" or "lowercase" directly in the $font statement, in the style parameter. example: $font(,,bold uppercase,)
Hamallainen
@ mazy
thanks for your explanations
mobyduck
Ok, my turn for a stupid question: how do I add a blank line? It looks like multiple $char(10) are ignored and treated as one. The same happens if the text I display contains carriage returns.

Note that I had the same problem with the "other" trackinfo plugin.

Regards.

Alessandro

[Edit]Using foobar v0.9.2 and foo_uie_trackinfo_mod v0.8 (1-AUG-2006)
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-2009 Invision Power Services, Inc.