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: Track Info Panel with ability to change font (Read 727607 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Track Info Panel with ability to change font

Reply #200
Something I've been working on:

Top Section:
Code: [Select]
$font(Tahoma,7,shadow,233-233-233)
// Background
$imageabs(,,images\backdrop.png,)
$imageabs(116,,images\backdrop.png,)
$imageabs(232,,images\backdrop.png,)
$imageabs(348,,images\backdrop.png,)

// Labels
$alignabs(9,,%_width%,%_height%,,)$rgb(233,233,233)$char(91)$rgb(140,186,236)Title$rgb(233,233,233)$char(93)$rgb():
$alignabs(5,10,%_width%,%_height%,,)$rgb(233,233,233)$char(91)$rgb(140,186,236)Artist$rgb(233,233,233)$char(93)$rgb():

$if($strcmp($left(%path%,7),http$char(58)$char(47)$char(47)),
$alignabs(17,20,%_width%,%_height%,,)$rgb(233,233,233)$char(91)$rgb(140,186,236)IP$rgb(233,233,233)$char(93)$rgb():
$alignabs(10,30,%_width%,%_height%,,)$rgb(233,233,233)$char(91)$rgb(140,186,236)Port$rgb(233,233,233)$char(93)$rgb():
,
$alignabs(,20,%_width%,%_height%,,)$rgb(233,233,233)$char(91)$rgb(140,186,236)Album$rgb(233,233,233)$char(93)$rgb():
$alignabs(4,30,%_width%,%_height%,,)$rgb(233,233,233)$char(91)$rgb(140,186,236)Track$rgb(233,233,233)$char(93)$rgb():
)

$alignabs($sub(%_width%,118),,%_width%,%_height%,,)$rgb(233,233,233)$char(91)$rgb(140,186,236)Codec$rgb(233,233,233)$char(93)$rgb():
$alignabs($sub(%_width%,130),10,%_width%,%_height%,,)$rgb(233,233,233)$char(91)$rgb(140,186,236)Channels$rgb(233,233,233)$char(93)$rgb():
$alignabs($sub(%_width%,119),20,%_width%,%_height%,,)$rgb(233,233,233)$char(91)$rgb(140,186,236)Bitrate$rgb(233,233,233)$char(93)$rgb():
$alignabs($sub(%_width%,127),30,%_width%,%_height%,,)$rgb(233,233,233)$char(91)$rgb(140,186,236)Samples$rgb(233,233,233)$char(93)$rgb():

// Data
$if(%isplaying%,
$alignabs(45,,%_width%,%_height%,,)[%title%]
$alignabs(45,10,%_width%,%_height%,,)[%artist%]

$alignabs($sub(%_width%,74),,%_width%,%_height%,,)$if2(%codec% ,)$if2($char(40)$caps($info(encoding))$char(41),)
$alignabs($sub(%_width%,74),10,%_width%,%_height%,,)$if2($if($info(mp3_stereo_mode),$caps($info(mp3_stereo_mode)),$info(channels)),)
$alignabs($sub(%_width%,74),20,%_width%,%_height%,,)$if2(%bitrate%kbps ,)$if($strcmp($upper($info(codec)),MP3),$if2($info(extrainfo),CBR),)
$alignabs($sub(%_width%,74),30,%_width%,%_height%,,)$if2($div(%samplerate%,1000)$ifequal($div($mod(%samplerate%,1000),100),0,,.$div($mod(%samplerate%,1000),100))KHz,)

$if($strcmp($left(%path%,7),http$char(58)$char(47)$char(47)),
$alignabs(45,20,%_width%,%_height%,,)$substr(%path%,8,$if2($add($strrchr($substr(%path%,8,$len(%path%)),:),6),$len(%path%)))
$alignabs(45,30,%_width%,%_height%,,)$if($strcmp($strchr(%path%,:),$strrchr(%path%,:)),$rgb(128,128,128)n/a,$substr(%path%,$add($strrchr(%path%,:),1),$sub($len(%path%),1)))

$alignabs($div($sub(%_width%,$calcwidth(%path%)),2),50,%_width%,%_height%,,)$if2(%url%,%path%)
,
$alignabs(45,20,%_width%,%_height%,,)[%album%][ $char(40)%date%$char(41)]
$alignabs(45,30,%_width%,%_height%,,)[$char(91)%cdid%$char(93) ][Track %tracknumber% of %totaltracks%]

$alignabs($div($sub(%_width%,$calcwidth(%filename_ext%)),2),50,%_width%,%_height%,,)%filename_ext%
)

,)

// Dividers
$font(,,normal,)
$puts(divider.half,$repeat(-,$div(%_width%,6)))
$puts(divider,$transition($get(divider.half),$rgb(10,36,106),$rgb(233,233,233))$transition($get(divider.half),$rgb(233,233,233),$rgb(10,36,106)))
$alignabs(2,40,%_width%,%_height%,,)$get(divider)
$alignabs(2,60,%_width%,%_height%,,)$get(divider)

//Overlay
$imageabs(0,0,images\black.top.left.png,)
$imageabs($sub(%_width%,50),0,images\black.top.right.png,)
Bottom Section:
Code: [Select]
$font(Tahoma,7,shadow,233-233-233)
// Background
// Background
$imageabs(,,images\backdrop.png,)
$imageabs(116,,images\backdrop.png,)
$imageabs(232,,images\backdrop.png,)
$imageabs(348,,images\backdrop.png,)

// Labels
$if($strcmp($left(%path%,7),http$char(58)$char(47)$char(47)),
,
$alignabs(25,$sub(%_height%,40),%_width%,%_height%,,)$rgb(233,233,233)$char(91)$rgb(140,186,236)Rating$rgb(233,233,233)$char(93)$rgb(233,233,233):
$alignabs($add($div(%_width%,2),20),$sub(%_height%,40),%_width%,%_height%,,)$rgb(233,233,233)$char(91)$rgb(140,186,236)Tags$rgb(233,233,233)$char(93)$rgb(233,233,233):
)

// Data
$if(%isplaying%,
$if($strcmp($left(%path%,7),http$char(58)$char(47)$char(47)),
,
$alignabs(85,$sub(%_height%,40),%_width%,%_height%,,)
$if(%rating%,$char(40)%rating%$char(41) $progress2(%rating%,10,10,$rgb()$char(9733) ,$rgb(128,128,128)$char(9734) )
,$rgb(128,128,128)~ Song Not Rated ~)

$alignabs($add($div(%_width%,2),60),$sub(%_height%,40),%_width%,%_height%,,)$if($strstr($info(tagtype),id3v1),$rgb(0,128,255)$char(10004)$rgb(233,233,233),$rgb(255,0,128)$char(10008)$rgb(128,128,128)) ID3v1
$alignabs($add($div(%_width%,2),110),$sub(%_height%,40),%_width%,%_height%,,)$if($strstr($info(tagtype),id3v2),$rgb(0,128,255)$char(10004)$rgb(233,233,233),$rgb(255,0,128)$char(10008)$rgb(128,128,128)) ID3v2
$alignabs($add($div(%_width%,2),160),$sub(%_height%,40),%_width%,%_height%,,)$if($strstr($info(tagtype),apev2),$rgb(0,128,255)$char(10004)$rgb(233,233,233),$rgb(255,0,128)$char(10008)$rgb(128,128,128)) APEv2
)
,)

// Progress Bar
$if($strcmp($left(%path%,7),http$char(58)$char(47)$char(47)),
,
$alignabs(2,$sub(%_height%,18),%_width%,%_height%,,)$if(%_isplaying%,Progress $rgb(128,128,128)$char(40)$rgb(233,233,233)$div($mul(%_time_elapsed_seconds%,100),%_time_total_seconds%)'%'$rgb(128,128,128)$char(41)$rgb(233,233,233):)
$alignabs($sub(%_width%,$add($calcwidth(%playback_time% $char(47) %length%),4)),$sub(%_height%,18),%_width%,%_height%,,)$if(%playback_time%,%playback_time%$if2($rgb(128,128,128) $char(47) $rgb(233-233-233)%length%,),)$char(10)
$alignabs(80,$sub(%_height%,18),%_width%,%_height%,,)$progress2(%playback_time_seconds%,%length_seconds%,$sub($div(%_width%,$calcwidth($char(9679))),30),$rgb(0,128,255)$char(9679),$rgb(10,36,106)$char(9679))

$puts(crosshair.x,$add($muldiv($muldiv(100,%playback_time_seconds%,%length_seconds%),$mul($calcwidth($char(9679)),$sub($div(%_width%,$calcwidth($char(9679))),30)),100),78))
$alignabs($get(crosshair.x),$sub(%_height%,18),%_width%,%_height%,,)$rgb(166,202,240)$char(9679)
$alignabs($sub($get(crosshair.x),5),$sub(%_height%,23),%_width%,%_height%,,)$rgb(166,202,240)$char(9700)
$alignabs($add($get(crosshair.x),5),$sub(%_height%,23),%_width%,%_height%,,)$rgb(166,202,240)$char(9701)
$alignabs($sub($get(crosshair.x),5),$sub(%_height%,13),%_width%,%_height%,,)$rgb(166,202,240)$char(9699)
$alignabs($add($get(crosshair.x),5),$sub(%_height%,13),%_width%,%_height%,,)$rgb(166,202,240)$char(9698)
)

// Dividers
$font(,,normal,)
//$puts(divider,$repeat(-,$div(%_width%,3)))
$puts(divider.half,$repeat(-,$div(%_width%,6)))
$puts(divider,$transition($get(divider.half),$rgb(10,36,106),$rgb(233,233,233))$transition($get(divider.half),$rgb(233,233,233),$rgb(10,36,106)))
$alignabs(2,$sub(%_height%,30),%_width%,%_height%,,)$get(divider)
$alignabs(2,$sub(%_height%,50),%_width%,%_height%,,)$get(divider)
$alignabs($div(%_width%,2),$sub(%_height%,40),%_width%,%_height%,,)$rgb(233,233,233)||

//Overlay
$imageabs(0,$sub(%_height%,100),images\black.bottom.left.png,)
$imageabs($sub(%_width%,50),$sub(%_height%,100),images\black.bottom.right.png,)
Images Used:
       
backdrop.png, black.top.left.png, black.top.right.png, black.bottom.left.png, black.bottom.right.png

Everything seems to be going according to plan however the center panel, which is just a standard specturm analyser panel, appears to pause for a split second when the other panels do their refresh every second.  Is this because I have many other trackinfo plugins running too? Is this because I'm developing this in a tab? Or am I simply beginning to overload the plugin? I've noticed that if I comment out the transition dividers the performance is a bit better.

EDIT: Cleaned up code, removed transition on dividers, significantly reduced resource consumption.
EDIT: Added transitions again and removed divider shadow. Also updated backdrop image to a smaller tiled version.

Track Info Panel with ability to change font

Reply #201
Looks interesting ...!!

- Can you post all of th images, please ??

Track Info Panel with ability to change font

Reply #202
All 5 images are linked above, just right click on them and save them with the names listed. The first one you'll have to left click first because it got thumbnailed.

Track Info Panel with ability to change font

Reply #203
Oh, god damm it !!

- I didnt realized there were 5 to see ... -I just "saw" 3 ...!!

THNX 4 illumination 

*EDIT *

- But they dont show up in Trackinfo ...!!
(I m sure about the directory)

That's sad to see, 'cause in them i was most iterested, since your code is going to crash my system if i dont "disable" it ...!! o0

Track Info Panel with ability to change font

Reply #204
wow I just noticed foobar is eating almost 300MB of ram when using my code... I better figure out wtf is going on and clean it up... I tweaked the code little but it's still running away with resources.  this also probably explains the poor performance from the spectrum analyser.

EDIT: After some experimenting there appears to be a problem using $transition(). Maybe the panel has trouble parsing all those color codes? I'll have to hammer away at it later and figure out what is going on.

EDIT: Updated code above, removed transitions and optimized some code, dropped it down to 60MB. Hopefully now it wont crash an average system :)

Track Info Panel with ability to change font

Reply #205
60mb is very acceptable imo
thats the bets i have been able to achieve without gutting my setup

Track Info Panel with ability to change font

Reply #206
really interesting this component  The font stuff is nice!
But I have to use old version because of the "scrolling" feature, to control fb with a remote.
Is it going to be implemented in near future?

Track Info Panel with ability to change font

Reply #207
...
But I have to use old version because of the "scrolling" feature, to control fb with a remote.
...

I dont know what you mean ...!! ->FB -> Remote -> SCROLL ...?? o0

Track Info Panel with ability to change font

Reply #208
Scrolling lines in trackinfo mod panel.
Whether it will be implemented in near future or not.
Need this for a info-panel with big fonts to be able to read whats track is actually selected when controlling fb with my remotecontrol.
Imagin you are in bed and your monitor is 5m in front of you....hehe
remote control -> trackinfopanel -> big letters -> scrolling
better?

Track Info Panel with ability to change font

Reply #209
@ Infernus:
So, if you mean scrolling horizontaly, perhaps u want THIS ...??

__________________________________________________________________________________________________

@terrestrial:

A Question:

The #LINEHEIGHT, n#-Stuff is not working inside the parameters of other $funktions, since it's comma seems to take influence to the surounding $funktion ...!!
So the following codes (for example) will occur errors:
Code: [Select]
$put(Title,
%title%#LINEHEIGHT,3#$char(10)%title%
)

$if(%title%
,%title%#LINEHEIGHT,3#$char(10)%title%
,)

----> Couldn't this #LINEHEIGHT, n# be converted into something like $lineheight(n) in one of the next versions ...??

Track Info Panel with ability to change font

Reply #210
here is what ive been workin on today, trying to get a pseudo-albumart panel inside of the trackinfo panel, so none of the text formatting and placement of stuff is completely done hence the crappy font colors to where u cant see them well lol:

Track Info Panel with ability to change font

Reply #211
peercortsa: did you discover a way to resize the images? or did you pre-size them to fit the panel?

Track Info Panel with ability to change font

Reply #212
Quote
Feature request: 1 second refresh also when not playing.


Reason: I'd like to display the system time. foo_cwb_hooks makes this possible, but the trackinfo panel does only refresh when playing.

Quote
Perhaps (improbable) it is not too late for some Ideas
- There is and has allways been a box to set the "minimum" height.
Please, could you add a field to set the minmium WIDTH ...?? (I neeeeeeeeeeeed !!)


Just curious, but why?

Quote
- Will it be possible to strech or jolt an image with the $imageabs-Function
(perhaps by setting an output-size e.g. $imageabs(X,Y,Direction,w,h,OPTIONS) ) ...??
---> Btw: Are there other "options" than "flow" for an image ...??


not quite yet. I will eventually add support for .jpgs and other file formats, and for resizing also.

Quote
I dont know: -Would it be more "resource-gentle" (need a new dictonary) when there would exist a $function to scroll text ...?


with the update time set a 1 second, there wouldn't be a significant difference

Quote
- Whats up with my previously postet idea to create something like $alignabs wich $char(10)s wouldnt have influnce to other $alignset()s ...?? -Is it still "in the race" ??


It's on the todo list  I've been more focused on cleaning up some bugs / rewriting some code up till now.

Quote
I'd personally like to pull in text from an external source so I can have a sort of wiki panel for artists.


hmmm.... something like $import(blah.txt)... interesting idea. I will add it to the todo list.

Quote
But I have to use old version because of the "scrolling" feature, to control fb with a remote.
Is it going to be implemented in near future?


sorry, no "native" scrolling any time soon. its towards the bottom of the todo list.

Quote
The #LINEHEIGHT, n#-Stuff is not working inside the parameters of other $funktions, since it's comma seems to take influence to the surounding $funktion ...!!


anything using # is "unofficial" and not finished yet. However, you can put it in single quotes (eg '#LINEHEIGHT,n#') to not mess up other functions.

************************************

I've uploaded a new version. Mostly some fixes and a rewrite of some code. Please let me know if the old bugs / crashes / glitches still show up with the new version.

Track Info Panel with ability to change font

Reply #213
I tried the new update and all seems well except I'm still having trouble with the transition.  To re-create this bug set up a vertical splitter with a spectrum analyser and trackinfo mod.  for trackinfo mod set the padding to 0 and use this code:
Code: [Select]
$font(Tahoma,7,shadow,233-233-233)
$puts(divider.half,$repeat(-,$div(%_width%,6)))
$puts(divider,$transition($get(divider.half),$rgb(10,36,106),$rgb(233,233,233))$transition($get(divider.half),$rgb(233,233,233),$rgb(10,36,106)))
$alignabs(2,$sub(%_height%,30),%_width%,%_height%,,)$get(divider)
$alignabs(2,$sub(%_height%,40),%_width%,%_height%,,)$get(divider)
$alignabs(2,$sub(%_height%,50),%_width%,%_height%,,)$get(divider)
$alignabs(2,$sub(%_height%,60),%_width%,%_height%,,)$get(divider)

If you enable update every second, you will notice that the spectrum analyser slightly pauses every second.  The pause increases more and more every time the $get(divider) is used and appears to be linked to the use of $transition(). If the update every second is disabled then the pauses go away.  Does this component have trouble parsing all the color codes generated by the $transition()? Is there a better approach I should use?

Track Info Panel with ability to change font

Reply #214
Using
Code: [Select]
$font(terminal,15,shadow,255-255-255)$char(219)
(even replacing shadow with normal) does nothing. This is essential for my progress bar code.  Any ideas?
err... i'm not using windows any more ;)

Track Info Panel with ability to change font

Reply #215
...Just Elliott, i would say that's the bug i've experienced. maybe related to locales / codepages and/or internal wide char conversions terrestrial is using. i can confirm this bug still being present in the latest version ...

others, simple progress bar made with $drawrect:

Code: [Select]
$padding(0,0)
$drawrect(,,,10,brushcolor-null pencolor-0-0-0)

$puts(progress,$muldiv(%playback_time_seconds%,$sub(%_width%,4),%length_seconds%))

$ifgreater($get(progress),0,
$padding(2,2)$drawrect(,,$get(progress),6,brushcolor-0-0-0 pencolor-null),)

and you can 'nest' $drawrect using $padding:

Code: [Select]
$drawrect(,,,,pencolor-0-0-0 alpha-80)
$padding(5,5)
$drawrect(,,,,pencolor-0-0-0 alpha-80)
$padding(5,5)
$drawrect(,,,,pencolor-0-0-0 alpha-80)

.

Track Info Panel with ability to change font

Reply #216
How come this plugin is now called "track info mod" in the layout treeview. This has messed up all my settings. I think this should be named as before only track info panel. In my opinion this is the official track info panel plugin. I always rename the dll without _mod at the end.

Track Info Panel with ability to change font

Reply #217
How come this plugin is now called "track info mod" in the layout treeview. This has messed up all my settings. I think this should be named as before only track info panel. In my opinion this is the official track info panel plugin. I always rename the dll without _mod at the end.
Because there's another trackinfo panel, the original one, which is still being maintained. This one is totally different, and not 100% compatible with the original trackinfo.

Please do not rename the .dll's yourself; it is named that way for a reason.

Not the least: The quickly progressing plugin updater utility for foobar2000.

Track Info Panel with ability to change font

Reply #218
I tried the new update and all seems well except I'm still having trouble with the transition.  To re-create this bug set up a vertical splitter with a spectrum analyser and trackinfo mod.  for trackinfo mod set the padding to 0 and use this code:
Code: [Select]
$font(Tahoma,7,shadow,233-233-233)
$puts(divider.half,$repeat(-,$div(%_width%,6)))
$puts(divider,$transition($get(divider.half),$rgb(10,36,106),$rgb(233,233,233))$transition($get(divider.half),$rgb(233,233,233),$rgb(10,36,106)))
$alignabs(2,$sub(%_height%,30),%_width%,%_height%,,)$get(divider)
$alignabs(2,$sub(%_height%,40),%_width%,%_height%,,)$get(divider)
$alignabs(2,$sub(%_height%,50),%_width%,%_height%,,)$get(divider)
$alignabs(2,$sub(%_height%,60),%_width%,%_height%,,)$get(divider)

If you enable update every second, you will notice that the spectrum analyser slightly pauses every second.  The pause increases more and more every time the $get(divider) is used and appears to be linked to the use of $transition(). If the update every second is disabled then the pauses go away.  Does this component have trouble parsing all the color codes generated by the $transition()? Is there a better approach I should use?

can you try removing the shadow from the font and see if it helps any?

Track Info Panel with ability to change font

Reply #219
removing the shadow definitely helps, thanks. i think i can live with this :)

EDIT: Updated above post with new code to remove the shadow and reinstate the transition.

Track Info Panel with ability to change font

Reply #220
I counted about ~380 color transitions (with a relatively narrow width), and with the shadow, that means 380 separate shadows to be drawn. Shadows are relatively more expensive to draw than plain text hence the excessive cpu usage.

I need to optimize things to draw one large shadow instead of 380 separate ones- which should be much faster I think.

Track Info Panel with ability to change font

Reply #221
@terrestrial:
I know its unofficial, YET ... but:
Code: [Select]
$put(Title,%title%(#LINEHEIGHT,5#)$char(10)%title% )
like you said to do, is not working as expected...!!
-->Though its not disturbing surrounding $funktions, but it shows up %title% only once, and swallows the rest comming after ...

I just wanted to report ...!! (hope, its becomming official, soon  )
However, THANX for the help with it !!
(and for the GREAT previous Improvements to this Component, of course ...!! -->[as a "thnx"-update  ] )

Track Info Panel with ability to change font

Reply #222
$font() is returning UNKNOWN FUNCTION now... I didn't do anything! Any help?

edit: fixed
err... i'm not using windows any more ;)

Track Info Panel with ability to change font

Reply #223
for some reason im getting this error..

Quote
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.


im reinstalled a couple times. right now i have foobar 9.3.1 with the latest Columns UI (0.1.3 beta 1v5). the only other things installed right now are the main plugins that come with foobar, infact this in a fresh install