Help - Search - Members - Calendar
Full Version: Can't get Track Display to show rating
Hydrogenaudio Forums > Hosted Forums > foobar2000 > 3rd Party Plugins - (fb2k)
oLjud
This are the code for "Track Display":

CODE

// Background
$drawrect(0,0,0,0,pencolor-null brushcolor-0-0-0)

// PerTrack
$alignabs(5,5,$sub(%_width%,5),15,left,top)$font(Calibri,11,,7-81-123)%title%
$alignabs(5,20,$sub(%_width%,5),15,left,top)$font(Calibri,10,bold,200-200-200)%artist%
$alignabs(5,35,$sub(%_width%,5),15,left,top)$font(Calibri,10,,80-80-80)[%date% - ]%album%

$if(%isplaying%,
    $puts(rating,$if2($meta($get(ratingField)),0))
    $button(5,53,0,0,16,16,/oljud\rating$get(rating).png,/oljud\rating1.png,TAG:SET:$get(ratingField):1,)
    $button(5,53,28,0,16,16,/oljud\rating\rating$get(rating).png,/oljud\rating2.png,TAG:SET:$get(ratingField):2,)
    $button(5,53,45,0,16,16,/oljud\rating\rating$get(rating).png,/oljud\rating3.png,TAG:SET:$get(ratingField):3,)
    $button(5,53,66,0,16,16,/oljud\rating\rating$get(rating).png,/oljud\rating4.png,TAG:SET:$get(ratingField):4,)
    $button(5,53,86,0,16,16,/oljud\rating\rating$get(rating).png,/oljud\rating5.png,TAG:SET:$get(ratingField):5,)
)


Why doesn't it work?
Idea to fix it?

Greeting Mikael
vigge
The rating images doesn't show up or what? Try printing $get(ratingField) and the result of $meta($get(ratingField)) to see if the problem lies there.
Keikonium
Do you have $get(ratingField) defined anywhere, I didn't see it.

Also, I don't think that TAG:SET:$get(ratingField) will work...

The TAG:SET function of the $button command will update a metafield of your song with the data it is told. So if your song has a metadata field called "ratingfield" then just use that.

If you are trying to write the ratings to the "rating" metadata field, then just use this:

TAG:SET:rating:0
TAG:SET:rating:1
TAG:SET:rating:2

etc.

Hopefully that makes sense.
oLjud

Fix it now!

CODE

// Background
$drawrect(0,0,0,0,pencolor-null brushcolor-0-0-0)

// PerTrack
// *** COVER IMAGE *** //
$imageabs2(180,180,,,,,-1,-1,/oljud\nocover.png,)
$imageabs2(180,180,,,,,-1,-1,$replace(%path%,%filename_ext%,)folder.jpg,NOKEEPASPECT)
//$imageabs2(180,180,,,,,0,0,/oljud\case.png,nokeepaspect)

$imageabs2(180,180,,,,,-1,179,/oljud\nocover.png,nokeepaspectROTATEFLIP-6)
$imageabs2(180,180,,,,,-1,179,$replace(%path%,%filename_ext%,)folder.jpg,nokeepaspectROTATEFLIP-6)
$imageabs2(180,180,,,,,-1,179,/oljud\case.png,nokeepaspectROTATEFLIP-6)
$imageabs2(180,180,,,,,-1,179,/oljud\reverse_overlay.png,nokeepaspect)

// PerTrack
$alignabs(10,195,$sub(%_width%,5),15,left,top)$font(Calibri,10,,7-81-123)%artist%
$alignabs(10,210,$sub(%_width%,5),15,left,top)$font(Calibri,10,bold,200-200-200)%title%
$alignabs(10,225,$sub(%_width%,5),15,left,top)$font(Calibri,10,,80-80-80)[%date% - ]%album%

$puts(r0,/oljud\rating0.png)
$puts(r1,/oljud\rating1.png)
$puts(r2,/oljud\rating2.png)
$puts(r3,/oljud\rating3.png)
$puts(r4,/oljud\rating4.png)
$puts(r5,/oljud\rating5.png)


$if(%RATING%,
    $ifgreater(%RATING%,5,$puts(rated,$get(r5)),
        $select(%RATING%,
        $puts(rated,$get(r1)),
        $puts(rated,$get(r2)),
        $puts(rated,$get(r3)),
        $puts(rated,$get(r4)),
        $puts(rated,$get(r5))
        )
    )
    ,
    $puts(rated,$get(r0))
)

$button(8,243,2,5,20,20,$get(rated),$get(r1),TAG:SET:RATING:1,TOOLTIP:"Rate Now Playing 1")
$button(8,243,22,5,20,20,$get(rated),$get(r2),TAG:SET:RATING:2,TOOLTIP:"Rate Now Playing 2")
$button(8,243,42,5,20,20,$get(rated),$get(r3),TAG:SET:RATING:3,TOOLTIP:"Rate Now Playing 3")
$button(8,243,62,5,20,20,$get(rated),$get(r4),TAG:SET:RATING:4,TOOLTIP:"Rate Now Playing 4")
$button(8,243,82,5,20,20,$get(rated),$get(r5),TAG:SET:RATING:5,TOOLTIP:"Rate Now Playing 5")



thanks for answers!!
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.