Probably unpause on file switch is fixed here
This commit is contained in:
parent
9c64b9a218
commit
e82e7d0f9a
@ -108,24 +108,23 @@ class MPCHCAPIPlayer(BasePlayer):
|
|||||||
return self._mpcApi.lastFilePosition
|
return self._mpcApi.lastFilePosition
|
||||||
|
|
||||||
def askForStatus(self):
|
def askForStatus(self):
|
||||||
try:
|
with self.__fileUpdate:
|
||||||
if(self.__preventAsking.wait(0)):
|
try:
|
||||||
position = self.__getPosition()
|
if(self.__preventAsking.wait(0)):
|
||||||
paused = self._mpcApi.isPaused()
|
position = self.__getPosition()
|
||||||
position = float(position)
|
paused = self._mpcApi.isPaused()
|
||||||
if(self.__fileUpdate.acquire(0)):
|
position = float(position)
|
||||||
self.__client.updatePlayerStatus(paused, position)
|
self.__client.updatePlayerStatus(paused, position)
|
||||||
self.__fileUpdate.release()
|
|
||||||
return
|
return
|
||||||
self.__echoGlobalStatus()
|
self.__echoGlobalStatus()
|
||||||
except MpcHcApi.PlayerNotReadyException:
|
except MpcHcApi.PlayerNotReadyException:
|
||||||
self.askForStatus()
|
self.askForStatus()
|
||||||
|
|
||||||
def __echoGlobalStatus(self):
|
def __echoGlobalStatus(self):
|
||||||
self.__client.updatePlayerStatus(self.__client.getGlobalPaused(), self.__client.getGlobalPosition())
|
self.__client.updatePlayerStatus(self.__client.getGlobalPaused(), self.__client.getGlobalPosition())
|
||||||
|
|
||||||
def __forcePause(self):
|
def __forcePause(self):
|
||||||
for _ in xrange(10):
|
for _ in xrange(30):
|
||||||
self.setPaused(True)
|
self.setPaused(True)
|
||||||
time.sleep(0.01)
|
time.sleep(0.01)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user