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 730509 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Track Info Panel with ability to change font

Reply #425
Using $align() functions are completely optional however they can be very useful. By default everything just kind of flows like a normal old text editor and if all you want to do is display some basic playback stats this is fine.

However the image functions require absolute positioning, so if you start integrating images and text it's only a matter of time before you start wanting to $alignabs()'ing some text to make sure it flows properly with your images.

$alignabs() functions become rather powerful when you combine them with %_width% and %_height% because then you can have your text automatically position itself reletive to the size of the panel. This lets you use the same code for both full screen and windowed foobar layouts without having to go back and adjust the code.



Code: [Select]
$button(10,10,0,0,0,0,icons\png\mp3.png,,,)
$imageabs(20,20,icons\png\mp3.png,)


This is interesting. I tried your code and it appears to work but not in the way I expected:

Why is the first $button() image overlayed on to of the second $imageabs() function? I expected the opposite to be true given the order in which the code is written. I even went back and commented out each line to ensure I was seeing what I thought I was seeing.

so... 1) is maybe your second image being hidden under the first 2) can anyone explain why $buttion() is overlayed on top of $imageabs()?

Track Info Panel with ability to change font

Reply #426
can anyone explain why $buttion() is overlayed on top of $imageabs()?


My guess would be so that button clicks can be 'understood', if you like. If the button was drawn under the image, then I'm guessing there would be problems with clicking on them..?

Track Info Panel with ability to change font

Reply #427
I also find it odd that the transparency of the $button() isnt allowing the $imageabs() to show through (notice the grey "shadow")

EDIT: If I rearrange the lines of code so that the "bottom" image is drawn before the "top" image, the transparency works fine. The shadow effect must have something to do with how the $button() forces it's way to the top layer.

Track Info Panel with ability to change font

Reply #428
I want to display the current playlist number of the track playing and the total tracks on the given playlist in trackinfo mod.  I tried %list_index%/%list_total% and %playlist_number%/%playlist_total%, but this component does not seem to recognize these fields.  What are the fields to do this?

Track Info Panel with ability to change font

Reply #429
Thanks for your reply Yotsuya!

Quote
so... 1) is maybe your second image being hidden under the first

well thanks, I was actually clever enough to check that  ... I can easily push around the button changing the x and y settings, the image just doesn't show up, no matter where (x,y) and no matter if the button is in the code or no button at all. So: is not a matter of (x,y) and no interference with the button.

Anyone any other idea why the image doesn't show up? (see my last post)

Quote
2) can anyone explain why $buttion() is overlayed on top of $imageabs()?

Once the image shoes up here, I will try and see if I can help with that

Quote
it's only a matter of time before you start wanting to $alignabs()'ing some text

Pretty sure you are right there. If I'd be faster to understand the syntax I would play with that already. But already having a problem with the image-function I prefer to go step by step and not mess up things too quick

Track Info Panel with ability to change font

Reply #430
I want to display the current playlist number of the track playing and the total tracks on the given playlist in trackinfo mod.  I tried %list_index%/%list_total% and %playlist_number%/%playlist_total%, but this component does not seem to recognize these fields.  What are the fields to do this?


I know of no way to pull the playlist index for the currently playing song from a context outside of the playlist, however I believe you should be able to pull the total number of items in the currently playing playlist with %cwb_playinglist_count%. This requires you install foo_cwb_hooks. Maybe you should consider stopping by the cwb_hooks thread and request something like a %cwb_playinglist_index%.

Track Info Panel with ability to change font

Reply #431

I want to display the current playlist number of the track playing and the total tracks on the given playlist in trackinfo mod.  I tried %list_index%/%list_total% and %playlist_number%/%playlist_total%, but this component does not seem to recognize these fields.  What are the fields to do this?


I know of no way to pull the playlist index for the currently playing song from a context outside of the playlist, however I believe you should be able to pull the total number of items in the currently playing playlist with %cwb_playinglist_count%. This requires you install foo_cwb_hooks. Maybe you should consider stopping by the cwb_hooks thread and request something like a %cwb_playinglist_index%.


Thanks, and I so posted.  Also, although I read in the change log that global variables were implemented, I am having a strange problem with accessing them.  I tried to access hotness, and although the panel recognizes the variable, it is showing strange values for the variable.  Is this a bug or is there some special way to access global variables?

Track Info Panel with ability to change font

Reply #432
I'd like to display %path% but if it's too long and doesn't have any spaces, it doesn't know how to wrap it. It also doesn't display anything after that. Is this a bug?

Track Info Panel with ability to change font

Reply #433
here's mine...
i took some of Russell777's Code (thx man), modified it a bit and added some gfx... still working on it though.


Track Info Panel with ability to change font

Reply #434
Woah. Looks kind of neat.

Track Info Panel with ability to change font

Reply #435
Is there any way to scrolling text?
I want to use this panel to show lyrics, but with a background image.

Track Info Panel with ability to change font

Reply #436
the $button() is not work if without foo_run.dll

who can tell me how to use the function

Track Info Panel with ability to change font

Reply #437
Having a few problems getting text on my panel to span multiple lines without the colour changing, kinda frustrating. Here is a screenshot: http://img137.imageshack.us/img137/8477/tr...nfoprob1rx3.jpg

Notice how the 2nd line of the track field has reverted to blue. I've tried changing the default colour, as well as placing several changes to FFFFFF in many places but it still doesn't stay that correct colour. It's strange because the artist field has the same

The code in question (I'll post the whole panel if anybody wants to see it):
Code: [Select]
$if(%tracknumber%,DA9363'['FFFFFF%tracknumber%DA9363']' )
FFFFFF$if(%title%,$replace(%title%,'(','DA9363('FFFFFF,')',DA9363')'FFFFFF),
$replace(%filename_ext%,'(','DA9363('FFFFFF,')',DA9363')'FFFFFF))$char(10)$char(10)

$if(%artist%,DA9363Artist: FFFFFF$replace(%artist%,
'(','DA9363('FFFFFF,')',DA9363')'FFFFFF))$char(10)
$if(%album%,DA9363Album: FFFFFF$replace(%album%,
'(','DA9363('FFFFFF,')',DA9363')'FFFFFF)FFFFFF
$if(%date%,DA9363'['FFFFFF%date%DA9363']'))$char(10)
DA9363Total plays: FFFFFF%play_count%$char(10)$char(10)


EDIT: Wierd, removing the date tag from the file (therefor not displaying it) fixes it. Looks like I've already got a solution (stick the date in a new $if(%album%).

 

Track Info Panel with ability to change font

Reply #438
A small suggestion for a bitrate indicator:



The Code (If interested):
Code: [Select]
$puts(xcoord,10)
$puts(ycoord,178)
$puts(color,250-250-250)
$puts(bita,$div($mul($add(%bitrate%,-64),30),192))
$ifgreater($get(bita),30,$puts(bita,30),)
$ifgreater(0,$get(bita),$puts(bita,0),)
$alignabs($add($get(xcoord),5),$add($get(ycoord),-5),600,50,,)
$font(Arial,10,bold,$get(color))
$repeat(.,$get(bita))
$font(,10,,)
$drawrect($add($get(xcoord),6),$add($get(ycoord),10),117,1,brushcolor-$get(color) pencolor-null)
$alignabs($add($get(xcoord),5),$add($get(ycoord),4),600,50,,)י
$alignabs($add($get(xcoord),44),$add($get(ycoord),4),600,50,,)י
$alignabs($add($get(xcoord),83),$add($get(ycoord),4),600,50,,)י
$alignabs($add($get(xcoord),122),$add($get(ycoord),4),600,50,,)י
$font(,8,,)
$alignabs($get(xcoord),$add($get(ycoord),12),600,50,,)64
$alignabs($add($get(xcoord),36),$add($get(ycoord),12),600,50,,)128
$alignabs($add($get(xcoord),75),$add($get(ycoord),12),600,50,,)192
$alignabs($add($get(xcoord),114),$add($get(ycoord),12),600,50,,)256  kb/s
$alignabs($add($get(xcoord),131),$get(ycoord),200,20,,)bitrate

cwb_hooks plugin is needed.



Track Info Panel with ability to change font

Reply #441
Hey unart that's a nice idea for a bitrate indicator. I took your idea and ran with it a bit:


Code: [Select]
// -- Bitrate Bar -- //

$puts(bitratebar.width,200)
$puts(bitratebar.offsetx,10)
$puts(bitratebar.offsety,20)
$puts(bitratebar.text,26)

// Frame
$drawrect($get(bitratebar.offsetx),$get(bitratebar.offsety),$get(bitratebar.width),1,pencolor-233-233-233)
$drawrect($get(bitratebar.offsetx),$sub($get(bitratebar.offsety),6),1,12,pencolor-233-233-233)
$drawrect($add($get(bitratebar.offsetx),$get(bitratebar.width)),$sub($get(bitratebar.offsety),6),1,12,pencolor-233-233-233)

// Tick Marks
$drawrect($add($get(bitratebar.offsetx),$muldiv(11.11,$get(bitratebar.width),100)),$get(bitratebar.offsety),1,6,pencolor-233-233-233)
$drawrect($add($get(bitratebar.offsetx),$muldiv(22.22,$get(bitratebar.width),100)),$get(bitratebar.offsety),1,6,pencolor-233-233-233)
$drawrect($add($get(bitratebar.offsetx),$muldiv(33.33,$get(bitratebar.width),100)),$get(bitratebar.offsety),1,6,pencolor-233-233-233)
$drawrect($add($get(bitratebar.offsetx),$muldiv(44.44,$get(bitratebar.width),100)),$get(bitratebar.offsety),1,6,pencolor-233-233-233)
$drawrect($add($get(bitratebar.offsetx),$muldiv(55.55,$get(bitratebar.width),100)),$get(bitratebar.offsety),1,6,pencolor-233-233-233)
$drawrect($add($get(bitratebar.offsetx),$muldiv(77.77,$get(bitratebar.width),100)),$get(bitratebar.offsety),1,6,pencolor-233-233-233)

// Labels
$font(tahoma,7,,233-233-233)
$alignabs($sub($get(bitratebar.offsetx),4),$get(bitratebar.text),%_width%,%_height%,,)32
$alignabs($sub($add($get(bitratebar.width),$get(bitratebar.offsetx)),8),$get(bitratebar.text),%_width%,%_height%,,)320
$alignabs($add($get(bitratebar.offsetx),$muldiv(11.11,$get(bitratebar.width),100),-6),$get(bitratebar.text),%_width%,%_height%,,)64
$alignabs($add($get(bitratebar.offsetx),$muldiv(22.22,$get(bitratebar.width),100),-6),$get(bitratebar.text),%_width%,%_height%,,)96
$alignabs($add($get(bitratebar.offsetx),$muldiv(33.33,$get(bitratebar.width),100),-6),$get(bitratebar.text),%_width%,%_height%,,)128
$alignabs($add($get(bitratebar.offsetx),$muldiv(44.44,$get(bitratebar.width),100),-6),$get(bitratebar.text),%_width%,%_height%,,)160
$alignabs($add($get(bitratebar.offsetx),$muldiv(55.55,$get(bitratebar.width),100),-6),$get(bitratebar.text),%_width%,%_height%,,)192
$alignabs($add($get(bitratebar.offsetx),$muldiv(77.77,$get(bitratebar.width),100),-6),$get(bitratebar.text),%_width%,%_height%,,)256

// Bar
$if(%isplaying%,
$drawrect($add($get(bitratebar.offsetx),1),$sub($get(bitratebar.offsety),6),$sub($get(bitratebar.width),1),6,brushcolor-$ifgreater(%bitrate%,320,166-202-240,$ifgreater(%bitrate%,32,10-36-106,128-128-128)) pencolor-null)
$ifgreater(%bitrate%,32,$ifgreater(%bitrate%,320,,
$drawrect($add($get(bitratebar.offsetx),1),$sub($get(bitratebar.offsety),6),$sub($muldiv($muldiv(100,$sub(%bitrate%,32),288),$get(bitratebar.width),100),1),6,brushcolor-0-128-255 pencolor-null)
),)
,)

The bar will change colors if the bitrate falls out of range of the indicator and is rather easy to resize. I marked most commonly used bitrates.

EDIT: Code Optimizations

Track Info Panel with ability to change font

Reply #442
Is there any way to get playback buttons to work without using foo_run? I have some text and I want to overlay an invisible button to do what the text says.



I've used this code to position the button over the 'Play' text (and yes it is positioned correctly as it works when I use foo_run), but it doesn't want to work.

Code: [Select]
$button(0,0,$get(start_pos),12,$get(play_w),20,,,Play,)
</signature>


Track Info Panel with ability to change font

Reply #444
I posted this b/4, but I still am not sure of the answer.  The changelog indicates that global variables work, but when I access them I get strange values.  Does anyone know if this is a bug, or is there a special method by which one must access global variables?

Track Info Panel with ability to change font

Reply #445
globals should work here (not yet in single column playlist). what strange values are you getting?

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

updated- new $button2 and support for main menu commands.

an example of how to use $button2:

Code: [Select]
$if(%isplaying%,
$if(%ispaused%,
$button2(0,0,0,0,100,16,
'resume',
'$font(,,glow-0-0-0,255-255-255)resume',
play,)
,
$button2(0,0,0,0,100,16,
'pause',
'$font(,,glow-0-0-0,255-255-255)pause',
pause,)
)
,
$button2(0,0,0,0,100,16,
'play',
'$font(,,glow-0-0-0,255-255-255)play',
play,)
)

Track Info Panel with ability to change font

Reply #446
globals should work here (not yet in single column playlist). what strange values are you getting?


I am trying to access the %hotness% variable defined in my global variables.  The value for hotness is showing correctly in my playlist as a number from 1-100 but when I access it in track info mod I am getting values like .0789, etc.  All values less than 1.

Track Info Panel with ability to change font

Reply #447
does it work in the original trackinfo?