Hi,
I'm trying my hand developing a little manual BPM program using the MCWS (REST web service).
I have a "Next" button that calls the Playback/Next method:
http://localhost:52199/MCWS/v1/Playback/Next?Zone=-1&ZoneType=IDThen within that same button Click even I immediately call the current Info method:
http://localhost:52199/MCWS/v1/Playback/Info?Zone=-1So that I can populate the BPM and song title on my app form.
But what happens is the second call to Playback/Info always returns the song that was playing previously, in other words the song I'm hearing after the Next method doesnt get queried back with the Info call.
Now here's the weird part, if I make my Click even wait 500 millisends between making the Next call and doing the Info call. Everything works fine, the Next (current) song gets queried as current.
Here is a sample of the pseudo code (all the calls to the web service are synchronous inline calls (no asynch Http GET is being done), in VB: My question is why do I need to have my Thread sleep 500 milliseconds after a Next to get the Info to return the real current song?
Pseudocode:Begin Click event:Call Next:http://localhost:52199/MCWS/v1/Playback/Next?Zone=-1&ZoneType=IDSleep:System.Threading.Thread.Sleep(500)
Call Info:http://localhost:52199/MCWS/v1/Playback/Info?Zone=-1Good results (BUT when I comment out the Sleep(500) then Info always returns the "previous" song, not the current.)Move the data to the UI.
End Click event:I'm OK with doing it this way but I'd rather not introduce an intentional delay when the music I'm hearing has already gone to "Next", I think the Info call at that point should return the currently playing song.
Thanks for any help
Rick