HydrogenAudio

Hosted Forums => foobar2000 => General - (fb2k) => Topic started by: Squeller on 2006-07-25 13:23:31

Title: Another track info panel thread
Post by: Squeller on 2006-07-25 13:23:31
Thx foosion, I'll test it when I'm at home.

random.n, 2 comments:

1. When having complicated code (what lots may have) and having accidentally more than one "$line_end(ellipsize)" without a $char(10) between, we get cryptic chars. This problem existed before. EDIT: Not only duplicate $line_end cause the chars. I inserted just one and the appear. What I mean is: "EL" Did someone investigate this? EDIT2: Got it. the lineend code has to be at the beginning, no color codes or other lineend codes may be before it.

2. $line_end breaks the square brackets logic. [$line_end(ellipsize,block)%nonexistant%] shows a "?", [%nonexistant%] doesn't show anything.
Title: Another track info panel thread
Post by: random.n on 2006-07-25 20:22:53
As the way the thing works right now, $line_end only works properly when it's the first text that gets written after a new line. I can see the restriction of having $line_end at the beginning of the line being a little annoying, so I'll see if something can't be done about it. I think it'll be easy enough to simply take the last $line_end() appearing in a line as the one that gets used.

The way the square brackets work is that so long as what you put in the () part of $line_end() is valid (ie: $line_end(stabface) will fail), the whole square bracket will evaluate as true and display because the $function is treated the same a %field%. Even when I fix the beginning-of-the-line restriction (and thus, the apparant breakage), there still would be no difference in having [$line_end(scroll) %foo%] and $line_end(scroll) [%foo%]. As far as I can tell, this just the way foobar handles things when you combine square brackets, functions, and fields.

I think the proper way to accomplish what you're trying to do would be something like $if(%foo%,$line_end(scroll) %foo%).
Title: Another track info panel thread
Post by: Squeller on 2006-07-26 04:55:17
I think the proper way to accomplish what you're trying to do would be something like $if(%foo%,$line_end(scroll) %foo%).
I've changed most of my code to $if(,,) anyway.

BTW, sometimes the planel remains blank. I started my foobar 3 times, then text appeared. I can't see why this happens. I always get a blank panel if I start a second instance of fb2k with a trackinfo panel...
Title: Another track info panel thread
Post by: molnart on 2006-08-03 20:35:13
I just wanted to say a "Thankyou" for updating this component. It is exactly what i needed, a bugfix edition whithout eye-candy.

Quote
added the ability to ellipsize by letter (so it gets cut like "Metallica - Master of Pup...").

This would be an excellent function but doesn't seem to work here. Do i have to change something in the preferences ? (I didn't found anything)
Title: Another track info panel thread
Post by: random.n on 2006-08-04 04:38:21
As of present, it's only exposed through the command $line_end(ellipsize,letter), which must be the first thing placed on each line you want it. I'll probably work on this thing a bit more this weekend, as there are a few bugs I've found and some stuff I'd like to add, though don't expect anything like what trackinfo_mod can do - I'm still not practised enough with C++ to accomplish that yet.

...I don't suppose you'd like me to write a trackinfo plugin in Java, eh?
Title: Another track info panel thread
Post by: Squeller on 2006-08-04 09:32:45
Lots may use the trackinfo_mod because of the font stuff... Think about if it makes sense to go on developing this branch... Only thing I'm missing in the mod is the line end modes.
Title: Another track info panel thread
Post by: Yotsuya on 2006-08-04 20:32:10
Lots may use the trackinfo_mod because of the font stuff... Think about if it makes sense to go on developing this branch... Only thing I'm missing in the mod is the line end modes.


If the line end modes are really the only thing holding you back, you can create the elipsis mode with code like this (probably needs a bit of tweaking to convert pixel size to point size):

Code: [Select]
$left(
Place your existing code here.
,$div($sub(%_width%,$calcwidth($char(8230))),$calcwidth($char(34))))$char(8230)


The panel already auto-wraps text. The only thing really gone is the animated scroll but I'm sure if you got really inventive you could come up with using $substr(), $calcwidth(), %_width%, and %playback_time_seconds%.  Not to discourage your development, it's good to have options as different people have different needs. But if the end line modes are the only thing missing they can be accomadated for.

Edit: Sat down and refined the code, appears to work for me.
Title: Another track info panel thread
Post by: random.n on 2006-08-04 22:02:16
I've already thought about that; it's about more for personal education and use than real usefulness. That way when I start something from scratch that I really want, I won't completely bodge it up.
Title: Another track info panel thread
Post by: Squeller on 2006-08-07 08:09:57
Code: [Select]
$left(
Place your existing code here.
,$div($sub(%_width%,$calcwidth($char(8230))),$calcwidth($char(34))))$char(8230)

Thanks. I'll give it a try.
Title: Another track info panel thread
Post by: Squeller on 2006-08-07 14:46:37
The panel does not refresh itself to the current %_isplaying% mode when stopping. After stop playing a track it executes the code for %_isplaying%=true.
Title: Another track info panel thread
Post by: molnart on 2006-08-07 21:21:42
As of present, it's only exposed through the command $line_end(ellipsize,letter), which must be the first thing placed on each line you want it.


It would be good to make that behaviour default for all lines. And to fix the most annoying bug occuring when you try to scroll a long text. Currently these are the only things i'm missing in trackinfo

EDIT: One more thing. Is it possible to change the text encoding in the trackinfo panel somehow ?
Title: Another track info panel thread
Post by: mente on 2006-09-10 10:50:42
Sorry for silly question, but where I can download this plugin for 0.9.x?
Title: Another track info panel thread
Post by: Squeller on 2006-09-10 12:23:03
http://www.hydrogenaudio.org/forums/index....st&p=415116 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=46704&view=findpost&p=415116)