Added openFile(filePath) method for players.
This commit is contained in:
parent
1afe3b074b
commit
53266f9b3d
@ -46,6 +46,13 @@ class BasePlayer(object):
|
||||
def setSpeed(self, value):
|
||||
raise NotImplementedError()
|
||||
|
||||
'''
|
||||
@type filePath: string
|
||||
'''
|
||||
def openFile(self, filePath):
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
'''
|
||||
@return: list of strings
|
||||
'''
|
||||
|
||||
@ -383,7 +383,10 @@ class MPCHCAPIPlayer(BasePlayer):
|
||||
if(self.__mpcVersion[0:3] >= ['1', '6', '5']):
|
||||
self.speedSupported = True
|
||||
if(filePath):
|
||||
self._mpcApi.openFile(filePath)
|
||||
self.openFile(filePath)
|
||||
|
||||
def openFile(self, filePath):
|
||||
self._mpcApi.openFile(filePath)
|
||||
|
||||
def displayMessage(self, message, duration = (constants.OSD_DURATION*1000)):
|
||||
self._mpcApi.sendOsd(message, constants.MPC_OSD_POSITION, duration)
|
||||
|
||||
@ -82,6 +82,11 @@ class MplayerPlayer(BasePlayer):
|
||||
def setSpeed(self, value):
|
||||
self._setProperty('speed', "{:.2f}".format(value))
|
||||
|
||||
def openFile(self, filePath):
|
||||
pass
|
||||
#Notification about new file opened must be added first.
|
||||
#self._setProperty('loadfile', "{}".format(filePath))
|
||||
|
||||
def setPosition(self, value):
|
||||
self._position = value
|
||||
self._setProperty('time_pos', "{}".format(value))
|
||||
|
||||
@ -95,6 +95,9 @@ class VlcPlayer(BasePlayer):
|
||||
self._paused = value
|
||||
self._listener.sendLine('set-playstate: {}'.format("paused" if value else "playing"))
|
||||
|
||||
def openFile(self, filePath):
|
||||
self._listener.sendLine('load-file: {}'.format(filePath))
|
||||
|
||||
def _getFileInfo(self):
|
||||
self._listener.sendLine("get-duration")
|
||||
self._listener.sendLine("get-filepath")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user