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: Programmatically trigger refresh of a panel's PERTRACK? (Read 1936 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Programmatically trigger refresh of a panel's PERTRACK?

Hi

I'm using columnsUI and panel stack splitter.  I'm trying to modify qwertz's excellent foonight config.

The cover art is drawn in one panel called Cover.  I'm using the biography panel component to automatically download artist/album art.

Here's the problem: when the album art isn't available, it takes ~5secs after I play the song for the biography component to download the art.  Since I display the album art in the splitter's PerTrack, the album art doesn't get shown until the next time I play the song.  Which kinda sucks since I may not play the same songs again for a while and in the mean time I'm looking at a lot of empty covers.

So I want to trigger redraw of the album art after 5secs or so of play.  I enabled the panel's per second.  I have a global variable cover.timer which I increment in per second.  when cover.time < 20 and cover.timer % 5 == 0 I do something.

I tried:

1) PANELSHOW:Cover:1;REFRESH
I don't really know what this does.  I'm hoping it triggers pertrack.  It doesn't work

2) redrawing the cover (by copying the relevant code from per track).  What this does is every 5 secs it draws the album cover that just got downloaded, but immediately reverts to what was drawn in pertrack, which shows a "no cover" cover if there was no cover present at the start.

This does work if I do step 2) unconditionally, that is, every second for the duration of play.  But that's rather wasteful.

I think I'm close.  Thanks in advance for any help.