Page 2 of 2

Re: THC Jukebox workaround

Posted: Fri Sep 24, 2010 2:51 pm
by RaiderRed
Yes, that's the forum topic, and on the third page is a link to Incoronado's personal web page. He didn't upload the revised .hbx file and he hasn't logged into the forums in two years, so I don't know if he is still around. I'll try PM him, but if anyone has the updated version of the .hbx I sure could use it. Thanks.

Re: THC Jukebox workaround

Posted: Fri Sep 24, 2010 4:23 pm
by Steve Horn
There is a comment in the VBScript about increasing a SLEEP value to alleviate the problem of double playing. I found it only partially successful though. Have not had a chance to pursue it further. Probably will get into it after winter sets in and the double play begins to irritate me to my threshold of tolerance.

Re: THC Jukebox workaround

Posted: Sat Sep 25, 2010 8:49 pm
by markd
I think I fixed this- I'll poke around the code and see if I can find it. (building a cider press right now ;-)

Re: THC Jukebox workaround

Posted: Sun Sep 26, 2010 4:54 pm
by markd
Ok, I can see that my sleep value is at 200, which I think is the beginning default. I can't remember exactly what I did to fix it though... attached is my file, doing a compare is going to yield a lot of diffs though, as I modified it quite a bit to add multi-zone and a few other things.

Re: THC Jukebox workaround

Posted: Sun Sep 26, 2010 6:34 pm
by Steve Horn
I have my Sleep value at 1000 and it still periodically will double play. And when it does, it does it a lot, not sporadically. Don't know the root cause and haven't spent enough time with it to find out yet.
fwiw,

Re: THC Jukebox workaround

Posted: Mon Sep 27, 2010 4:39 am
by Richard Naninck
You shouldn't need more than a Sleep 100. When data is stored in a property it takes time to do so. If your next scripting line would be a GetpropertyValue (either from a called function or whatever), you need a Sleep 100 to let the SetPropertyValue settle before the next Get can be performed. If you don't use the sleep, you may end up with the old value that was in the property before the Set was done. That could explain the double queue (or whatever). The code has become messy and difficult to read and because mine is linked to Meedio, I can't test this.
I understand that you have a problem where a song/track is queued or played twice in a row. Is that THE problem?

Re: THC Jukebox workaround

Posted: Mon Sep 27, 2010 9:32 am
by Steve Horn
Richard, thanks for the explanation. Will chg the SLEEP back, since it didn't seem to help anyway. Yes, the issue is a double play of the song listed once in the playlist. Does not occur consistently, i.e. cannot be reliably reproduced... at least by me. Usually pressing the "Play" control/button will advance the playlist selection/highlight and the next song in the playlist queue will play.... twice.

Re: THC Jukebox workaround

Posted: Mon Sep 27, 2010 10:05 am
by Richard Naninck
So it just plays twice while it is not queued twice?
Is there a property with the queued tracks? Can you read in the properties history when it got queued twice (in time).
Maybe the selection itself queues it twice. So pressing the play button queues the track and then setting the display selection in the alphalist will trigger the second one. If that is the case, you need to start using the double click option instead of the alphalists single click option.
If the above makes sense, I could probably point you in the right direction since I have seen this problem before, but worked around it a long time ago in my own script.

Re: THC Jukebox workaround

Posted: Mon Sep 27, 2010 12:22 pm
by Richard Naninck
In PlaySelectedSong the first thing that happens is a GetPropertyValue. In almost all cases this Sub is called just after the same property is set. Hence the Sleep to create what I described in my previous post. Why not call the PlaySelectedSong along with the correct data like Call PlaySelectedSong(strTrack) or something like that.

In the Case "Play Selected Song": PlaySelectedSong you could do Case "Play Selected Song": PlaySelectedSong(0)

Then Sub PlaySelectedSong would look something like:

Sub PlaySelectedSong(strTrack)
If strTrack = 0 Then
If Trim(GetPropertyValue ("Jukebox" & ZoneString & ".Jukebox - Playing Song")) <> "" Then
bla bla
End If
End If

In case strTrack is 0 (called from the Case above, you do a GetPropertyValue, but when the Sub is called from the script itself, it already has the correct data. You could delete most of the Sleeps and it may help. If any, the code would be much cleaner...

Re: THC Jukebox workaround

Posted: Mon Sep 27, 2010 12:45 pm
by Steve Horn
Way too much info for this time of year. I'm very rusty on the code involved and until I can spend some time getting up to speed with it - after the weather turn crappy here - I'll store your info away. I was hoping you wouldn't spend any time on it in light of the non-urgency. I should have known better. But maybe someone else (markd?) with the same issues can investigate before I get back into it.
Thanks!