Help - Search - Members - Calendar
Full Version: please help with some code
Hydrogenaudio Forums > Hosted Forums > foobar2000 > 3rd Party Plugins - (fb2k)
macca
hi,

in this image..

http://img130.imageshack.us/img130/7307/untitledun0.jpg

..I have selected to 'use titleformatting for playlist title in panel', and you can see I have used the code:

$playlistname(%title%)

to try and return the title of the playlist as the title displayed at the top of the SCPL, however when i clicked 'apply' and saved it, the playlist names in the switcher, changed to 'unknown function' as you can see.

I suspect that i might need to change something else in order for this to work, maybe to specify the playlist title as a variable or something along these lines?

please if anyone can help me to sort out this code, or tell me what else i need to change, It will be greatly appreciated,

thanks alot, macca smile.gif
Yotsuya
$playlistname() is a special function only available under PanelsUI/TrackDisplay/SCPL. I'm not entirely sure what it is you are trying to do but if you just want a list of playlists in that upper left box change your code to:
CODE
%title%

If you are trying to do some special functions based on what is playing or active n the main playlist you can use %cwb_playinglist% or %cwb_activelist% respectively.

See also foo_cwb_hooks
macca
hi yotsuya,

the default code in this box was already '%title%', before i changed it. the reason i changed it is because all I am trying to do is display the name of the selected playlist as the caption for the SCPL, rather than having SCPL as the caption.

I have panels UI installed and track info mod too, but I have used columns UI as the active UI, because i dont know how to mess around with panels in the preferences menu under Panels UI, as you can with the columns UI.

do you know of an equivalent way of doing this in column UI, since that function is only for panels UI?

thanks alot for your reply
Yotsuya
I suggest that instead of mucking about with the playlist switcher panel, place a track display panel on a vertical splitter with SCPL. Resize The Track display to the size of a caption and use %cwb_activelist% for the code of the Track Display

You might also want to consider using foo_uie_playlists_dropdown in place of the caption.
macca
yeh thanks that a really good idea,
have you got another link where i can download the plugin? the link on that page didnt work.

thanks

also that dropdown plugin looks quite good, but i will have the playlist switcher minimised so that a single row of text can fit there, and then just use my mouse wheel to scroll between playlists.

EDIT: this is the default code for the track info panel:

CODE
$drawrect(0,0,0,0,pencolor-null brushcolor-SYSCOL-15)
$padding(2,4)$align(center,middle)$font(,13,,SYSCOL-8)
$if(%_trackinfo_notrack%,
    No track
,
    %title%$char(10)
    $font(,9,bold,SYSCOL-8)%artist%$char(10)
)


i have copied the cwb .dll into my componentsfolder and this is the code i tried..

CODE
$drawrect(0,0,0,0,pencolor-null brushcolor-SYSCOL-15)
$padding(2,4)$align(center,middle)$font(,13,,SYSCOL-8)
%cwb_activelist%


this code works but only when there is a track playing. if there is no track playing, and i select a certain playlist it will say '?' as the title, but as soon as a track is playing the title will appear.

How can I change this code so that %cwb_activelist% is returned as the title regardless of whether or not a track is playing or not?

thanks:)
Yotsuya
You are right %cwb_activelist% only works when a track is playing. However since you switched to Track Display you can use $playlistname() instead. (are we going in circles?)

Both the mirrors on the first post for playlist dropdown work for me, sorry I do not have another mirror but if you persist in having problems PM me and I'll toss it on rapidshare for you.

I personally think playlist dropdown is a better approach, I use it myself. This way you can click on the "header" and switch to other playlists.
macca
QUOTE(Yotsuya @ Apr 11 2007, 03:45) *

You are right %cwb_activelist% only works when a track is playing. However since you switched to Track Display you can use $playlistname() instead. (are we going in circles?)

Both the mirrors on the first post for playlist dropdown work for me, sorry I do not have another mirror but if you persist in having problems PM me and I'll toss it on rapidshare for you.

I personally think playlist dropdown is a better approach, I use it myself. This way you can click on the "header" and switch to other playlists.


lol hi yotsuya that dropdown panel is really quite good Ive been using it for a bit now, it saves some space anyway.

just one thing: is it not possible to configure fonts, colours etc on here like you would on track info mod? eg. glowblur, glowexpand and so forth? or is it only configurable via the clickable options?

i think if I could do that, I would definately continue using it.

also, are you saying that the track info panel can be used to display the playlist title afterall by using $playlistname()? just in case i do decide to use this, would i simply need to replace the %cwb_activelist% (from above code), with $playlistname(), and will this work, for when a track is not playing?smile.gif

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

ok that worked for the track info panel, but it only displays the name of the playlist that was selected when i made the changes, if i click onto another, it doesnt change, im not sure what needs to go between the brackets? also with this function if i resize the the track info panel by clicking and dragging, then it gives the correct playlist title..... strange

thanks again
Yotsuya
You can customize the look of playlists dropdown from:
File> Preferences> Display> Playlists Dropdown> "Display" Tab
However functions like $font() are only available under PanelsUI/TrackDisplay/SCPL.

As you saw, replacing %cwb_activelist% with $playlistname() should work, and I do not think $playlistname() currently takes any parameters. If the display is not updating properly you might need to place the code under a // PerSecond refresh header. It appears to work here using this code:
CODE
// Background
$drawrect(0,0,0,0,brushcolor-255-255-255 pencolor-null)

// PerSecond
$playlistname()
macca
Hi yotsuya, that works like a treat, thanks alot for taking some time to help me! this is how my foobar looks now:

http://img66.imageshack.us/img66/135/fb2kqy7.jpg

its not as spectacular as others UI's that are posted on here, but i think its fairly basic, and i like it. I'm probably still going to tweak it some more and get it just right; one step at a time though.

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

Also, i'm thinking of getting rid of the playlist switcher, and using this tabs plugin iv'e been looking at, so that one tab has track info mod and album art on a vertical splitter, and underneath on another tab I have a complete playlist switcher or music database, or something like this, all in that left hand column.

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

anyway,
thanks,
Macca
sylla
Yotsuyas code didn't work for me, but I got it to work the way macca wanted it to work just by using the code macca posted

CODE
$drawrect(0,0,0,0,pencolor-null brushcolor-SYSCOL-15)
$padding(2,4)$align(center,middle)$font(,13,,SYSCOL-8)
%cwb_activelist%


and then just change the track display to 'follow cursor' instead.

Just posting if anybody else got the same problem.
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-2008 Invision Power Services, Inc.