Help - Search - Members - Calendar
Full Version: image background for album/artist headers
Hydrogenaudio Forums > Hosted Forums > foobar2000 > 3rd Party Plugins - (fb2k)
macca
anyone know how I can change the album/artist headers on my SCPL so that an image is displayed in the background in stead of just a single coloured background?

thanks
macca
i changed my code for item display from this..

CODE
$if(%_selected%,$drawrect(0,0,0,0,brushcolor-SYSCOL-13 pencolor-null))
$if(%_focused%,$drawrect(0,0,0,0,brushcolor-null pencolor-SYSCOL-6))
$if(%_selected%,$textcolor(SYSCOL-9),$textcolor(SYSCOL-8))

$drawrect(0,0,%_width%,1,brushcolor-null pencolor-SYSCOL-6)

$padding(4,0)
$align(right,top)%title%
$align(left,top)$textcolor(80-80-80)%list_index%


to this..

CODE
$if(%_selected%,$drawrect(0,0,0,0,brushcolor-SYSCOL-13 pencolor-null))
$if(%_focused%,$drawrect(0,0,0,0,brushcolor-null pencolor-SYSCOL-6))
$if(%_selected%,$textcolor(SYSCOL-9),$textcolor(SYSCOL-8))

$imageabs(0,0,%foobar_profile_directory%\background images\image1.jpg, alpha-255)

$padding(4,0)
$align(right,top)%title%
$align(left,top)$textcolor(80-80-80)%list_index%


but it still doesn't work, any ideas?
Yotsuya
afaik $imageabs() only supports .png files have you tried using $imageabs2() ?

CODE
$imageabs2(%_width%,%_height%,,,,,,,
%foobar_profile_directory%\background images\image1.jpg
,nokeepaspect)
macca
i think im supposed to use this code in the group display rather than the item display, like so:

CODE
$imageabs2(%_width%,%_height%,,,,,,,%foobar_profile_directory%\background images\Image1.png,nokeepaspect)

$font(,10,bold glow-171-203-220 glowexpand-1,SYSCOL-15)
$alignabs(2,0,$sub(%_width%,4),$div(%_height%,2),left,top)%artist%:
$font(,8,bold,SYSCOL-15)
$alignabs(2,$div(%_height%,2),$sub(%_width%,4),$div(%_height%,2),left,top)%album%


(I changed the image to a .png file to make it easier)

this is the only instance that I see any sort of change to my playlist, but unfortunately its not he change I want. It seems to replace the normal rectangle with a transparent rectangle instead of my image.

(I should mention that I am not using panels UI as my active UI, but im using columns UI. however I have a SCPL on my columns UI, which I thought contained all the same functions as panels UI? im not sure if it isn't working because of this?)
Yotsuya
If you want to change the display of the headers and not the individual tracks, you will need to modify the code for "Group Display" not "Item Display". Are you sure the image exists? Try evaluating this in a Track Display panel:
$if($fileexists(
%foobar_profile_directory%\background images\Image1.png
,YES,NO)
macca
i tried the code in a track display panel, but it didnt display anything (either yes or no)

im pretty sure the file exists, because i created it in photoshop, and saved it to the folder 'background images' which i created in the foobar2000 directory. ie the image exists in:
C:\program files\foobar2000\background images\image1.png
Yotsuya
I do not know that components you may or may not be using, but %foobar_profile_directory% does not resolve to anything for me. Have you tried evaluating the code to your image path in a track info panel to ensure that it resolves to the actual path for your image? Put the following code in a Track Display panel and see if it shows the full path name to your image:

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

// PerSecond
%_foobar_profile_directory%\background images\Image1.png

You might have to try different code to reference your image file such as:

/background images\Image1.png
or
/..\background images\Image1.png

There have been many changes in the way pathnames are evaluated in PanelsUI/TrackDisplay/SCPL recently so I'm not quite sure which would be the best way to reference a relative path anymore but the way you are doing it does not work here.
macca
thanks i tried all of those codes in the track display and it displayed:

CODE
?\background images\Image1.png,


CODE
?/background images\Image1.png


and,

CODE
?/..\background images\Image1.png


respectively. does this mean that foobar doesn't recognize the function %_foobar_profile_directory%?
I found this on the panels UI wiki:

QUOTE
imagePath
Absolute or relative path to the image.
To use relative paths, use a slash ('/') as the first character. (e.g. "/path\to\image.jpg")
When using relative path, root is the foobar installation directory.


and also a link to this page:
http://wiki.hydrogenaudio.org/index.php?ti...000:Directories

after looking at this I tried entering:

CODE
%PROGRAMFILES%\foobar2000\background images\Image1.png


and similarly it displayed:

CODE
?\foobar2000\background images\Image1.png


so does this mean it doesn't recognise this function either?








macca
I used this code in my trackinfo panel...

CODE
$drawrect(0,0,0,0,pencolor-null brushcolor-SYSCOL-8)
$padding(2,4)$align(center,middle)$font(,13,glow-171-203-220,SYSCOL-8)
$if(%_trackinfo_notrack%,
    $if($fileexists($replace(%foobar_profile_directory%,Image1.png,folder.*)),
    Yes
,
    No
)
,
    %title%$char(10)
    $font(,9,bold,255-255-255)%artist%$char(10)
)


and it returned 'yes', meaning that foobar2000 is aware that the file exists, so there must be some other problem that means it isn't being displayed.

i'm not sure if it may have anything to do with the options in the $imageabs, or $imageabs2 function. perhaps i'm not using it exactly how it should be used?

Purple Monkey
I think your getting confused between Windows Environment variables and foobar's tags variables.

The main problem is that anything between %% will be parsed by foobar, so you need to use "C:\Program Files\". The code above returns true as it evaluates to "?", which is a wildcard matching any single length path.
macca
thanks for all the help lads, I got it working now. biggrin.gif
you're exactly right I was getting confused between the variables. wink.gif
this is the final code I used (that actually worked) in case anyone else wants to have an example:

CODE
$imageabs2(%_width%,%_height%,,,,,,,C:\program files\foobar2000\background images\Image1.png,nokeepaspect)

$font(,10,bold glow-171-203-220 glowexpand-1,SYSCOL-15)
$alignabs(2,0,$sub(%_width%,4),$div(%_height%,2),left,top)%artist%:
$font(,8,bold,SYSCOL-15)
$alignabs(2,$div(%_height%,2),$sub(%_width%,4),$div(%_height%,2),left,top)%album%


(with.png saved in C:\program files\foobar2000\background images\Image1.png)

this is how it looks now:

IPB Image

(just wanted to mess about with some fade effects)
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.