Added speed support for mpc
This commit is contained in:
parent
9b918ce14b
commit
ed9f0462ac
@ -48,7 +48,7 @@ class MPCHCAPIPlayer(BasePlayer):
|
|||||||
self.__positionUpdate.set()
|
self.__positionUpdate.set()
|
||||||
|
|
||||||
def setSpeed(self, value):
|
def setSpeed(self, value):
|
||||||
pass
|
self._mpcApi.setSpeed(value)
|
||||||
|
|
||||||
def __dropIfNotSufficientVersion(self):
|
def __dropIfNotSufficientVersion(self):
|
||||||
self._mpcApi.askForVersion()
|
self._mpcApi.askForVersion()
|
||||||
@ -75,6 +75,8 @@ class MPCHCAPIPlayer(BasePlayer):
|
|||||||
self.__mpcVersion = self._mpcApi.version.split('.')
|
self.__mpcVersion = self._mpcApi.version.split('.')
|
||||||
if(self.__mpcVersion[0:3] == ['1', '6', '4']):
|
if(self.__mpcVersion[0:3] == ['1', '6', '4']):
|
||||||
self.__switchPauseCalls = True
|
self.__switchPauseCalls = True
|
||||||
|
if(self.__mpcVersion[0:3] >= ['1', '6', '5']):
|
||||||
|
self.speedSupported = True
|
||||||
if(filePath):
|
if(filePath):
|
||||||
self._mpcApi.openFile(filePath)
|
self._mpcApi.openFile(filePath)
|
||||||
|
|
||||||
@ -149,6 +151,9 @@ class MPCHCAPIPlayer(BasePlayer):
|
|||||||
self.__client.ui.showErrorMessage(err)
|
self.__client.ui.showErrorMessage(err)
|
||||||
self.__client.stop()
|
self.__client.stop()
|
||||||
|
|
||||||
|
def sendCustomCommand(self, cmd, val):
|
||||||
|
self._mpcApi.sendRawCommand(cmd, val)
|
||||||
|
|
||||||
class MpcHcApi:
|
class MpcHcApi:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.callbacks = self.__Callbacks()
|
self.callbacks = self.__Callbacks()
|
||||||
@ -208,6 +213,10 @@ class MpcHcApi:
|
|||||||
def seek(self, position):
|
def seek(self, position):
|
||||||
self.__listener.SendCommand(self.CMD_SETPOSITION, unicode(position))
|
self.__listener.SendCommand(self.CMD_SETPOSITION, unicode(position))
|
||||||
|
|
||||||
|
@waitForFileStateReady
|
||||||
|
def setSpeed(self, rate):
|
||||||
|
self.__listener.SendCommand(self.CMD_SETSPEED, unicode(rate))
|
||||||
|
|
||||||
def sendOsd(self, message, MsgPos=2, DurationMs=3000):
|
def sendOsd(self, message, MsgPos=2, DurationMs=3000):
|
||||||
class __OSDDATASTRUCT(ctypes.Structure):
|
class __OSDDATASTRUCT(ctypes.Structure):
|
||||||
_fields_ = [
|
_fields_ = [
|
||||||
@ -352,6 +361,7 @@ class MpcHcApi:
|
|||||||
CMD_PLAY = 0xA0000004
|
CMD_PLAY = 0xA0000004
|
||||||
CMD_PAUSE = 0xA0000005
|
CMD_PAUSE = 0xA0000005
|
||||||
CMD_GETVERSION = 0xA0003006
|
CMD_GETVERSION = 0xA0003006
|
||||||
|
CMD_SETSPEED = 0xA0004008
|
||||||
|
|
||||||
class __MPC_LOADSTATE:
|
class __MPC_LOADSTATE:
|
||||||
MLS_CLOSED = 0
|
MLS_CLOSED = 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user