getmusicbee.com

Support => Developers' Area => MusicBee API => Topic started by: AvikB on March 02, 2017, 04:07:46 AM

Title: [SOLVED] Player_GetPlayState() does not reflect changes after Player_PlayPause()
Post by: AvikB on March 02, 2017, 04:07:46 AM
This is a very strange behavior. After calling
Code
Player_PlayPause()

i was trying to get the play state using:
Code
Player_GetPlayState()

But it seems Player_GetPlayState always returns the previous state.
Is there any way to get the play state after Player_PlayPause is called?
Title: Re: Player_GetPlayState() does not reflect changes after Player_PlayPause()
Post by: Steven on March 02, 2017, 07:26:49 AM
Player_PlayPause() is asynchronous so if Player_GetPlayState() is called immediately then it will return the old state
i guess i can change it to wait for the command to complete before returning
Title: Re: Player_GetPlayState() does not reflect changes after Player_PlayPause()
Post by: AvikB on March 02, 2017, 11:20:54 AM
Quote
i guess i can change it to wait for the command to complete before returning
That would be a good idea. Frankly i think Player_GetPlayState should return the current play state or maybe a new method like
Code
Player_GetCurrentPlayState()
would be really nice.

Title: Re: Player_GetPlayState() does not reflect changes after Player_PlayPause()
Post by: Steven on March 02, 2017, 06:59:58 PM
both the patch v3.0 and v3.1 beta are updated with this
Title: Re: Player_GetPlayState() does not reflect changes after Player_PlayPause()
Post by: AvikB on March 03, 2017, 01:41:10 AM
both the patch v3.0 and v3.1 beta are updated with this
Thanks. working as expected.