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

Track Info Panel with ability to change font

Reply #1125
the code is
$if($strcmp($left(%path%,7),http$char(58)$char(47)$char(47)),

so I tried
$if($strcmp($left(%path%,7),*.asx$char(58)$char(47)$char(47)),

but It won't work :(
I see nothing at all.

The code I pasted earlier would check to see if the file path started with http:// which is the case for the majority of online streams. The code you tried does not make any sense. Put %path% in a track display panel and post what it resolves to.

You may be able to get away with something like this if you specifically want to test for ASX files:
Code: [Select]
$if($strcmp($lower($replace(%filename_ext%,%filename%,)),.asx),
TRUE
,
FALSE
)



ozstrike: You either need to put that // PerSecond header at the very top of your code, or you will need to markup your entire code with different headers like // Global and // PerTrack.

John Doe: The code you pasted looks rather old. I would suggest recoding the text using $alignabs() instead of $char(10) so you can better control the flow of text. Also it looks like you probably want to separate all those $puts() into a // Global section, the general track info into a // PerTrack section. I tried to do a quick edit on your code but control based color codes do not copy well and foobar kept crashing on me while using your code.

Track Info Panel with ability to change font

Reply #1126
Thanks Yotsuya. I'll try changing the code!


JD

Track Info Panel with ability to change font

Reply #1127
I'm guessing if I put the //Persecond at the top of the code, then it will use more ram/cpu than if I do it the other way?

Track Info Panel with ability to change font

Reply #1128
correct. And buttons won't work (they have to be in the // PerTrack section)
elevatorladylevitateme

Track Info Panel with ability to change font

Reply #1129
the code is
$if($strcmp($left(%path%,7),http$char(58)$char(47)$char(47)),

so I tried
$if($strcmp($left(%path%,7),*.asx$char(58)$char(47)$char(47)),

but It won't work
I see nothing at all.

The code I pasted earlier would check to see if the file path started with http:// which is the case for the majority of online streams. The code you tried does not make any sense. Put %path% in a track display panel and post what it resolves to.

You may be able to get away with something like this if you specifically want to test for ASX files:
Code: [Select]
$if($strcmp($lower($replace(%filename_ext%,%filename%,)),.asx),
TRUE
,
FALSE
)




thank you, this is what I'm looking for.

Track Info Panel with ability to change font

Reply #1130
hmm just one little thing I notice:
the Length: %Playback_time% / %length% minutes doesn't dissepear when I listen to a .ASX

So I see this:

(code_
$if($strcmp($lower($replace(%filename_ext%,%filename%,)),.asx),
$alignabs(2,5,%_width%,15,,)RADIO STREAM!!!
$alignabs(2,20,%_width%,15,,)Genre: [%genre%]
$alignabs(2,35,%_width%,15,,)Bitrate: [%bitrate% kbps]

output:
Radio Stream!!
Genre
Bitrate
Do not want, but it's there --> %Playback_time% / %length%



When I add // PerSecond above the Paused thing, the paused doesn't work.

When I add // PerSecond between Paused and the $if($strcmp($lower($replace(%filename_ext%,%filename%,)),.asx),
the .asx scipt doesn't work, I just see what I want to see with normal mp3's.

I hope it's clear and someone knows what to do




Code: [Select]
// Paused
$alignabs(2,110,%_width%,15,,)
$if(%_ispaused%,0000FF'Status: Paused')


$if($strcmp($lower($replace(%filename_ext%,%filename%,)),.asx),
$alignabs(2,5,%_width%,15,,)RADIO STREAM!!!
$alignabs(2,20,%_width%,15,,)Genre: [%genre%]
$alignabs(2,35,%_width%,15,,)Bitrate: [%bitrate% kbps]

,

// PerSecond
$alignabs(2,95,%_width%,15,,)[Length: %Playback_time% / %length% minutes])


// PerTrack
$if(%_trackinfo_notrack%,
$alignabs(2,5,%_width%,15,,)No track,
$alignabs(2,5,%_width%,15,,)Artist: [%artist%]
$alignabs(2,20,%_width%,15,,)Title: [%title%]
$alignabs(2,35,%_width%,15,,)Album: [%album%]     [Track: #%Tracknumber%]
$alignabs(2,50,%_width%,15,,)Date: [%date%]
$alignabs(2,65,%_width%,15,,)Genre: [%genre%]
$alignabs(2,80,%_width%,15,,)Bitrate: [%bitrate% kbps]

// Play Counter
$alignabs(350,5,%_width%,15,,)
$if($strcmp(%play_counter%,?),
Playing song for first time,
$if($strcmp(%play_counter%,1),
Song played %play_counter% time,
Song played %play_counter% times)

// Last played
$puts(lp_year,$substr(%last_played%,1,4))
$puts(lp_month,$substr(%last_played%,6,7))
$puts(lp_day,$substr(%last_played%,9,10))
$puts(lp_hour,$substr(%last_played%,12,13))
$puts(lp_min,$substr(%last_played%,15,16))
$puts(lp_sec,$substr(%last_played%,18,19))

$alignabs(350,20,%_width%,15,,)
$if($strcmp(%play_counter%,?),
Playing song for first time,
$if($strcmp(%play_counter%,1),
on,
Last on)

$if(%last_played%, $get(lp_day)-$get(lp_month)-$get(lp_year)' at '$get(lp_hour):$get(lp_min) )
AM / PM)

))


)

Track Info Panel with ability to change font

Reply #1131
Hello. I have a tab panel but want to hide the tabs and then cycle through the tabs from buttons in a trackinfo_mod panel. I use this code that i found a couple of  pages back in this tread

Code: [Select]
// PerTrack
$puts(offset.button.x,$div(%_width%,6))
$puts(offset.button.y,$sub(%_height%,32))

$button($sub($get(offset.button.x),50),$get(offset.button.y),0,0,0,0,/images\blandat\prev.png,/images\blandat\prevh.png,'View/Tabbed Panel Stack mod/Select tab/Panel #0 Cycle Backward',),

$puts(offset.button.x,$div(%_width%,1))
$puts(offset.button.y,$sub(%_height%,32))

$button($sub($get(offset.button.x),50),$get(offset.button.y),0,0,0,0,/images\blandat\next.png,/images\blandat\nexth.png,'View/Tabbed Panel Stack mod/Select tab/Panel #0 Cycle Forward',),


My problem is that it doesn't happen aything when i click on my buttons, they are placed exactly where I want them and the hover image works, but can't cycle through the tabs with them! I think it's the "#" that messes it up?

It works if I just put the name of a tab inside the single quotes (f.e. 'lyrics') but I want next and previous buttons!

Track Info Panel with ability to change font

Reply #1132
sylla: sorry the # character makes that previous code not work. to my knowledge there is no existing solution to make a button to cycle  forward or backward through tabs in foo_uie_tabs. However, if you migrate to PanelsUI you can create buttons that change a PVAR and then use that PVAR to $select() between $panel() configurations and accomplish pretty much the same thing.

EDIT: I suppose you could stack a button that would set a pvar, and then use that pvar with $select() on the main button and choose which tab to switch to.

Track Info Panel with ability to change font

Reply #1133
sylla: sorry the # character makes that previous code not work. to my knowledge there is no existing solution to make a button to cycle  forward or backward through tabs in foo_uie_tabs. However, if you migrate to PanelsUI you can create buttons that change a PVAR and then use that PVAR to $select() between $panel() configurations and accomplish pretty much the same thing.

EDIT: I suppose you could stack a button that would set a pvar, and then use that pvar with $select() on the main button and choose which tab to switch to.


That's too bad  I have no plan on migrating to PanelsUI, too advanced for me I think. I can get it to go to the next panel i i create a button in a button panel, but the button panel is so ugly, is there any way to change the background of such a a panel?

edit: isn't it possible to replace the # in the code to the $char() that is for # ? maybe a real noob question, I have configured my foobar simply on copying codes from the web and then trial and error

Track Info Panel with ability to change font

Reply #1134
edit: isn't it possible to replace the # in the code to the $char() that is for # ? maybe a real noob question, I have configured my foobar simply on copying codes from the web and then trial and error :P
I explored this issue with some others awhile back and the $char() trick did not appear to work. However you might be able to do something like this with stacked buttons and pvars (sorry I no longer keep foo_uie_tabs around to test):

Code: [Select]
$puts(numtabs,5)

$button2(10,10,0,0,20,20,,,PVAR:SET:tab.index:
$ifgreater($getpvar(tab.index),$sub($get(numtabs),2),0,$add($getpvar(tab.index),1))
,)

$button2(10,10,0,0,20,20,'$imageabs2(20,20,,,,,,,next.png,)','$imageabs2(20,20,,,,,,,next_hover.png,)',
$select($add($getpvar(tab.index),1),
NAME OF TAB 2
,
NAME OF TAB 3
,
NAME OF TAB 4
,
NAME OF TAB 5
,
NAME OF TAB 1
)
,TOOLTIP:"Cycle Forward")

Track Info Panel with ability to change font

Reply #1135
edit: isn't it possible to replace the # in the code to the $char() that is for # ? maybe a real noob question, I have configured my foobar simply on copying codes from the web and then trial and error
I explored this issue with some others awhile back and the $char() trick did not appear to work. However you might be able to do something like this with stacked buttons and pvars (sorry I no longer keep foo_uie_tabs around to test):

Code: [Select]
$puts(numtabs,5)

$button2(10,10,0,0,20,20,,,PVAR:SET:tab.index:
$ifgreater($getpvar(tab.index),$sub($get(numtabs),2),0,$add($getpvar(tab.index),1))
,)

$button2(10,10,0,0,20,20,'$imageabs2(20,20,,,,,,,next.png,)','$imageabs2(20,20,,,,,,,next_hover.png,)',
$select($add($getpvar(tab.index),1),
NAME OF TAB 2
,
NAME OF TAB 3
,
NAME OF TAB 4
,
NAME OF TAB 5
,
NAME OF TAB 1
)
,TOOLTIP:"Cycle Forward")

I am trying to do what sylla is trying as well.  This might be my status as noob coming through, but is it at all possible to have a command that mimics keystrokes (and then set the buttons as these hotkeys)

EDIT:  for anyone who may be interested, i solved the "toggle button" problem.  Its a little cumbersome and tedious, but this is how i did it:

1.  in columns ui, create a panel stack.
2.  depending on where you want the toggle button to be, create horizontal or vertical splitters inside the toggle button.  i.e. i wanted mine on the left, so i created a horizontal splitter.
3.  put a track info mod under each splitter and put them in identical spots with identical sizes.  i.e. i wanted mine on the left, so i put them first, locked, and resized them.  (and of course put what you want to be toggled to the other side of them)
4.  rename the splitters (must be done through right-clicking on the visual representation of the tabs) to whatever you want, and use those in the button command.  So it's not really a "toggle button" you are just putting a button in the same spot within each panel, and each button leads to a different panel.
5.  hide the tabs, and you're all set!  (you can even set the background to the default grey, and get rid of borders for a really clean look)

Track Info Panel with ability to change font

Reply #1136

Srry for this stupid question, its mentioned in the first sentence of this thread...

Its working fine now

When im playing a song, i use 'now playing' mode. When i stop, i have to manually change to 'follow cursor' mode (because, when nothing is playing, i prefer 'follow cursor' mode)

Is there any way by doing this automatically? So when i stop playing, it will switch automatically to 'follow cursor' mode?

terrestrial had a good solution for this some posts back.  create a second track display panel, and keep one in each mode.  Then use an $if(%isplaying%...) to switch between them.
Code: [Select]
Ex.
$if(%isplaying%,
$panel(TDplaying,Track Display....)
,
$panel(TDstopped,Track Display....)
)

Can u explain this a bit more in detail 

Track Info Panel with ability to change font

Reply #1137
Having some problems with this and the old trackinfo component. I've tried putting both into my components folder several times and every time I get a message either that a dependency has not been met, the component is not configured properly, or that it isn't a valid Win32 application. I haven't used foobar before so I haven't had it working on a previous version or much less have never had a previous version of foobar...

Keep in mind I'm very new to foobar and am still trying to get the hang of it, and also am not good with programming and code.

Thanks for any help!


Track Info Panel with ability to change font

Reply #1139
Yea you're right. I actually figured it out just a little bit ago. So stupid to have overlooked that bit! Thanks for the newb-guidance, though. Foobar wil definitely take some getting used to but the audiophile in me is loving it!

Track Info Panel with ability to change font

Reply #1140
Got a problem with this component.

(...)

In both modes I have the problem that I get text overlays on switching to next or previous or any other song.



Solution:

Thanks to Yotsuya
Quote
John Doe: The code you pasted looks rather old. I would suggest recoding the text using $alignabs() instead of $char(10) so you can better control the flow of text. Also it looks like you probably want to separate all those $puts() into a // Global section, the general track info into a // PerTrack section. I tried to do a quick edit on your code but control based color codes do not copy well and foobar kept crashing on me while using your code.

I seperated my code in the two categories // Global and //PerTrack. That solved the problem completely. I didn't change the char(10) because that would just be to much hassle.


JD

Track Info Panel with ability to change font

Reply #1141
Hey. I took this code from brumais winter config. What I want to do is to make a button2 command on the artist (I want it to search on last.fm for the artist when I click on it).  But when I try to change it, the alignment messes up. Could anybody help me with this?

Code: [Select]
 $puts(artistimg,$replace(%path%,%filename_ext%,'..\artist.*'))
$puts(defaultimg,'/components\default.png')

$puts(infoHeight,125)
$puts(coverdim,$ifgreater($sub(%_height%,$get(infoHeight)),$sub(%_width%,20),$sub(%_width%,20),$sub(%_height%,$get(infoHeight))))

$puts(infoPos,
$ifgreater(
$add($get(coverdim), 30),
$add($get(coverdim),$get(infoHeight)),
$add($get(coverdim),$get(infoHeight)),
$add($get(coverdim), 30)
))

$puts(leftmargin,$div($sub(%_width%,$get(coverdim)),2))

$if($fileexists($get(coverimg)),
$puts(imgsrc,$get(coverimg)),
$if($fileexists($get(artistimg)),
$puts(imgsrc,$get(artistimg)),
$puts(imgsrc,$get(defaultimg))))

$drawrect(,,,,pencolor-null brushcolor-255-255-255)


$imageabs2($get(coverdim),$get(coverdim),0,0,$get(coverdim),$get(coverdim),$get(leftmargin),1,$get(imgsrc),NOKEEPASPECT)
$imageabs2($get(coverdim),$get(coverdim),0,0,$get(coverdim),$get(coverdim),$get(leftmargin),1,/images\brumal-winter\glare.png,NOKEEPASPECT ALPHA-50)
$imageabs2($get(coverdim),$get(coverdim),0,0,$get(coverdim),$get(coverdim),$get(leftmargin),$add($get(coverdim),2),$get(imgsrc),NOKEEPASPECT ALPHA-80 ROTATEFLIP-6)
$imageabs2($get(coverdim),$get(coverdim),0,0,$get(coverdim),$get(coverdim),$get(leftmargin),$add($get(coverdim),2),/images\brumal-winter\white-reflection.png,NOKEEPASPECT )
$drawrect($get(leftmargin),1,$get(coverdim),$get(coverdim),brushcolor-null pencolor-0-0-0)


// center info
$font(corbel,16,bold,76-68-62)
$alignabs(0,$get(infoPos),%_width%,%_height%,center,)$upper(%artist%)
//$alignabs($get(leftmargin),$add($get(coverdim),40),$get(switcherWidth),20,left,)
$font(corbel,12,bold,123-10-12)
$char(10)
%title%
$char(10)
//$alignabs($get(leftmargin),$add($get(coverdim),60),$get(switcherWidth),20,left,)
//$alignabs($get(leftmargin),$sub(%_height%,42),$sub(%_width%,10),30,right,)
$if($and($strcmp(%album%,%title%),$strstr(%genre%,Classical)),


// classical works with only one track (album and title are the same)
$font(corbel,11,bold,99-104-107)
$if(%performer%,
$left(%performer%,$sub($strstr(%performer%,'feat'),3)),
[%date%])
$char(10)
//$alignabs($get(leftmargin),$add($get(coverdim),80),$get(switcherWidth),20,left,)
$font(corbel,11,bold,99-104-107)
[%date%],

// normal display
$font(corbel,11,bold,99-104-107)
$if(%album%,%album%,Inget Album)
$char(10)
//$alignabs($get(leftmargin),$add($get(coverdim),$calcheight(%title%),60),$get(switcherWidth),20,left,)
$font(corbel,11,bold,99-104-107)
$if(%performer%,
$left(%performer%,$sub($strstr(%performer%,'feat'),3)),
[%genre%])
$char(10)
[%date%])
)
 

I think it's under "//centerinfo" what I want to change.

Thanks in advance, and sorry for my perhaps noob question

Track Info Panel with ability to change font

Reply #1142
Hello!

I am using foobar for 3 weeks now and got enthusiastic with it and especially with trackinfo_mod...
This is what i came up with after few hours:






Code: [Select]
// PerSecond


////PLAYING TIME
$if(
%Playback_time%,
$alignabs(0,$sub(%_height%,39),%_width%,15,,)$font(,8,glow-0-0-0 glowexpand-1,183-207-255) Length:$font(,10,bold glow-0-0-0 glowexpand-1,183-207-255) %Playback_time% / %length% $font(,8,glow-0-0-0 glowexpand-1,183-207-255)minutes
)

////

////PROGRESS BAR(INNER)
$if(
$strcmp(%playback_time_seconds%,0),
,
$drawrect(5,$sub(%_height%,18),$muldiv(%playback_time_seconds%,$sub(%_width%,17),%length_seconds%),5,pencolor-0-0-25  brushcolor-$muldiv(%_time_elapsed_seconds%,221,%_time_total_seconds%)-114-$sub(255,$muldiv(%_time_elapsed_seconds%,255,%_time_total_seconds%)))

$drawrect($add($muldiv(%playback_time_seconds%,$sub(%_width%,17),%length_seconds%),5),$sub(%_height%,18),1,10,pencolor-68-105-171 brushcolor-null)

$if(%Playback_time%,
$puts(progress,$muldiv(%_time_elapsed_seconds%,1000,%_time_total_seconds%))
$alignabs($sub($muldiv(%playback_time_seconds%,$sub(%_width%,17),%length_seconds%),4),$sub(%_height%,11),%_width%,15,,)
$font(,6,glow-0-0-0 glowexpand-1 ,183-207-255)
$if(
%_time_total%,
$ifgreater(10,$get(progress),'  0.'$right($get(progress),1),
$ifgreater(100,$get(progress),  $left($get(progress),1)'.'$right($get(progress),1),
$ifgreater(1000,$get(progress),$left($get(progress),2)'.'$right($get(progress),1),
$ifequal(1000,$get(progress),'100',))))'%')
)

)
////



// PerTrack



////PROGRESS BAR(OUTER)
$drawrect(4,$sub(%_height%,19),$sub(%_width%,15),7,brushcolor-null pencolor-68-105-171)
////


$if(
%_trackinfo_notrack%
,$alignset() $alignrel(left,top)$font(,8,glow-0-0-0 glowexpand-1,183-207-255) No track,

////ARTIST
$alignrel(left,top)$font(,8,glow-0-0-0 glowexpand-1,183-207-255) Artist:$iflonger(%artist%,40,$font(,8,bold glow-0-0-0 glowexpand-1,183-207-255)[    %artist%],$font(,10,bold glow-0-0-0 glowexpand-1,183-207-255)[   %artist%])
////


//// PLAY COUNTER
$alignrel(right,top)

$if(
$strcmp(%play_counter%,?),
$font(,8,glow-0-0-0 glowexpand-1,183-207-255)Playing song for first time ,
$if(
$strcmp(%play_counter%,1),
$font(,8,glow-0-0-0 glowexpand-1,183-207-255)Song played %play_counter% time ,
$font(,8,glow-0-0-0 glowexpand-1,183-207-255)Song played %play_counter% times
)
)
////


////TRACK
$alignset() $alignrel(left,top)$font(,8,glow-0-0-0 glowexpand-1,183-207-255) Track:$font(,10,bold glow-0-0-0 glowexpand-1,183-207-255)$iflonger(%title%,40,$font(,8,bold glow-0-0-0 glowexpand-1,183-207-255)[    #%Tracknumber% - ][%title%],$font(,10,bold glow-0-0-0 glowexpand-1,183-207-255)[   #%Tracknumber% - ][%title%])
////


//// LAST PLAYED
$puts(lp_year
,$substr(%last_played%,1,4))
$puts(lp_month
,$substr(%last_played%,6,7))
$puts(lp_day
,$substr(%last_played%,9,10))
$puts(lp_hour
,$substr(%last_played%,12,13))
$puts(lp_min
,$substr(%last_played%,15,16))
$puts(lp_sec
,$substr(%last_played%,18,19))


$alignrel(right,top)$font(,8,glow-0-0-0 glowexpand-1,183-207-255)
$if(
$strcmp(%play_counter%,?),
,
$if(
$strcmp(%play_counter%,1),
on,
Last on
)


$if(
%last_played%,
$get(lp_day)-$get(lp_month)-$get(lp_year)' at '$get(lp_hour):$get(lp_min) )
)
////


////ALBUM
$alignset() $alignrel(left,top)$font(,8,glow-0-0-0 glowexpand-1,183-207-255) Album:$iflonger(%album%,40,$font(,8,bold glow-0-0-0 glowexpand-1,183-207-255)[   %album%],$font(,10,bold glow-0-0-0 glowexpand-1,183-207-255)[  %album%])$font(,8,bold glow-0-0-0 glowexpand-1,183-207-255)  ['['%date%']']
////


////GAIN INFO
$puts(gain,
$if2($replace(%__replaygain_track_gain%,' ',),'N/A') / $if2($replace(%__replaygain_album_gain%,' ',),'N/A')
)

$alignabs($sub(%_width%,$calcwidth($get(gain))),$sub(%_height%,52),%_width%,15,,)$font(,8,glow-0-0-0 glowexpand-1,183-207-255)$get(gain)

////DECODER INFO
$puts(decoderinfo,
%codec%',' $if3($info(MP3_STEREO_MODE),%channels%) @
$puts(ratio,
$muldiv($info(bitrate),1000,
$div($mul($info(samplerate),$info(bitspersample),$info(channels)),1000)))
$if($info(bitrate),
$if($info(bitspersample),
$if($and(
$strcmp($info(codec),'WavPack'),
$not($strstr($info(codec_profile),'lossless'))),
$info(bitrate)'kb/s',
$ifgreater(100,$get(ratio),$left($get(ratio),1)'.'$right($get(ratio),1),
$ifgreater(1000,$get(ratio),$left($get(ratio),2)'.'$right($get(ratio),1),
$ifequal(1000,$get(ratio),'100.0',)))'% '),
[%codec_profile%',' ]$info(bitrate)'kb/s '))
)

$alignabs($sub(%_width%,$calcwidth($get(decoderinfo))),$sub(%_height%,37),%_width%,15,,)$font(,8,glow-0-0-0 glowexpand-1,183-207-255)$get(decoderinfo)
////


)


//// PAUSED
$alignabs($sub($div(%_width%,2),30),$sub(%_height%,37),%_width%,15,,)$font(,10,bold glow-0-0-0 glowexpand-1,255-179-0)$if(%_ispaused%,'Paused',)
////


- Auto changing font size on long artist/track/album names
- Colorchanging progressbar, depending on...progress ;-)
- progress percentage moving with progressbar
- etc...


What do you think?
Any advice on cleaning up the code?

Track Info Panel with ability to change font

Reply #1143
Feature Request

Would it be possible to implement a function to read text/nfo files? It'd be really nice because then we could have artist biographies etc.

Track Info Panel with ability to change font

Reply #1144
What happened to the plugin?

Track Info Panel with ability to change font

Reply #1145
 from the previous page:

@Author: Please fix the bug of the editor window: If you click apply, the cursor moves to the start position
This component is no longer being developed; you need to "upgrade" to the new component panels_ui, which has the same functionality as track_info_mod when columns_ui is the interface selected (and sports a much improved editing window ).
elevatorladylevitateme

Track Info Panel with ability to change font

Reply #1146
Download link is broke. Anyone have it and can host it somewhere?

Track Info Panel with ability to change font

Reply #1147

see the post immediately above yours.
elevatorladylevitateme

Track Info Panel with ability to change font

Reply #1148
Heh dident see that. Anyway does anyone just have the "old" one?

Track Info Panel with ability to change font

Reply #1149
no. the component maintainer does not appreciate back versions floating around.
elevatorladylevitateme