Fixed #106
This commit is contained in:
parent
f3d1d76942
commit
e9fba696f7
@ -393,6 +393,7 @@ class MPCHCAPIPlayer(BasePlayer):
|
|||||||
|
|
||||||
@retry(MpcHcApi.PlayerNotReadyException, constants.MPC_MAX_RETRIES, constants.MPC_RETRY_WAIT_TIME, 1)
|
@retry(MpcHcApi.PlayerNotReadyException, constants.MPC_MAX_RETRIES, constants.MPC_RETRY_WAIT_TIME, 1)
|
||||||
def setPaused(self, value):
|
def setPaused(self, value):
|
||||||
|
if self._mpcApi.filePlaying:
|
||||||
if self.__switchPauseCalls:
|
if self.__switchPauseCalls:
|
||||||
value = not value
|
value = not value
|
||||||
if value:
|
if value:
|
||||||
@ -402,6 +403,7 @@ class MPCHCAPIPlayer(BasePlayer):
|
|||||||
|
|
||||||
@retry(MpcHcApi.PlayerNotReadyException, constants.MPC_MAX_RETRIES, constants.MPC_RETRY_WAIT_TIME, 1)
|
@retry(MpcHcApi.PlayerNotReadyException, constants.MPC_MAX_RETRIES, constants.MPC_RETRY_WAIT_TIME, 1)
|
||||||
def setPosition(self, value):
|
def setPosition(self, value):
|
||||||
|
if self._mpcApi.filePlaying:
|
||||||
self._mpcApi.seek(value)
|
self._mpcApi.seek(value)
|
||||||
|
|
||||||
def __getPosition(self):
|
def __getPosition(self):
|
||||||
@ -412,7 +414,7 @@ class MPCHCAPIPlayer(BasePlayer):
|
|||||||
|
|
||||||
@retry(MpcHcApi.PlayerNotReadyException, constants.MPC_MAX_RETRIES, constants.MPC_RETRY_WAIT_TIME, 1)
|
@retry(MpcHcApi.PlayerNotReadyException, constants.MPC_MAX_RETRIES, constants.MPC_RETRY_WAIT_TIME, 1)
|
||||||
def askForStatus(self):
|
def askForStatus(self):
|
||||||
if(self.__preventAsking.wait(0) and self.__fileUpdate.acquire(0)):
|
if(self.__preventAsking.wait(0) and self.__fileUpdate.acquire(0) and self._mpcApi.filePlaying):
|
||||||
self.__fileUpdate.release()
|
self.__fileUpdate.release()
|
||||||
position = self.__getPosition()
|
position = self.__getPosition()
|
||||||
paused = self._mpcApi.isPaused()
|
paused = self._mpcApi.isPaused()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user