Hello everyone. I'm hoping someone here can help me with this, because this seems to be the place for help with this kind of stuff... I'm not sure though. Anyway:
You know Last.fm? If you don't, it's this site that does a bunch of fun stuff, but ignore that if you want. When a song has played more than half of its length, or 4 minutes (whichever comes first (basically, for all songs longer than 8 minutes, it's after 4 minutes instead of half)), I want a little icon to be displayed. When that hasn't happened, I want another icon to be displayed. I ALSO want a little counter thing, which shows how long it'll be before it changes icon. (for those of you using Last.fm - how long it'll be until it "scrobbles". I say "scrobbles" because it doesn't really mean it has scrobbled it, but that it should have) but I want it to disappear when it has reached 0. I'd also like it if it ignored all this, and displayed the same icon as the one it displays before a song has reached half/4 minutes, when the track doesn't have id3 info on Artist AND Title OR is shorter than 30 seconds.
I don't know if I'm a total noob, or if what I'm trying to do is complicated (probably a combination of both) - but in either case, it should be possible, and hopefully you people here can help me.
What I have so far:
$alignrel(left,middle)$ifgreater($div(%length_seconds%,2),240,
$ifgreater(%playback_time_seconds%,240,
$imageabs(4,0,/images\Last_fm_Player-liten.png,-),
$imageabs(4,0,/images\Last_fm_Player-inactive-liten.png,-)),
$ifgreater(%playback_time_seconds%,$div(%length_seconds%,2),
$imageabs(4,0,/images\Last_fm_Player-liten.png,-),
$imageabs(4,0,/images\Last_fm_Player-inactive-liten.png,-)))
$if(%isplaying%,$alignrel(left,middle)$font(Trebuchet MS,6,-,240-0-0)
$ifgreater($div(%length_seconds%,2),240,
-$sub(240,%playback_time_seconds%),
-$sub($div(%length_seconds%,2),%playback_time_seconds%)))
(please forgive me for not being an uber 1337 h4x0r and writing it up in some super fancy way... feel free to fix that yourself if you want to, but it works, so I don't mind)
What it does:
- displays the icon when half of the song/4 minutes has passed, otherwise displays the other icon
- has a semi-working counter. Only "semi" because when it has passed 0, it becomes "--#".
What I want help with:
- making the counter display MM:SS instead of only seconds.
- making it hide the counter when half the song/4 minutes has passed.
- making it hide the counter if the song's id3 tag doesn't have info on Artist AND Track.
- making it hide the counter if the song's shorter than 30 seconds.
- making it only display the "inactive" icon if the song's id3 tag doesn't have info on Artist and Track.
- making it only display the "inactive" icon if the song's shorter than 30 seconds.
I sort of know which commands I want to use, but that's basically it... so if someone could help me with it (/do it for me ) that would be great. Sex, 1000 internets etc.
(I'm using the latest stable version of foobar, ColumnsUI but with the Track Display thing included with PanelsUI. Shouldn't matter, but I figured it's always best to include that stuff)