Allow players to have custom open dialogs (e.g. for XBMC)
This commit is contained in:
parent
d9dfffefbb
commit
30b28afa14
@ -83,6 +83,12 @@ class BasePlayer(object):
|
|||||||
def getExpandedPath(path):
|
def getExpandedPath(path):
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
'''
|
||||||
|
Opens a custom media browse dialog, and then changes to that media if appropriate
|
||||||
|
'''
|
||||||
|
@staticmethod
|
||||||
|
def openCustomOpenDialog(self):
|
||||||
|
raise NotImplementedError()
|
||||||
|
|
||||||
class DummyPlayer(BasePlayer):
|
class DummyPlayer(BasePlayer):
|
||||||
|
|
||||||
|
|||||||
@ -306,6 +306,7 @@ class MpcHcApi:
|
|||||||
|
|
||||||
class MPCHCAPIPlayer(BasePlayer):
|
class MPCHCAPIPlayer(BasePlayer):
|
||||||
speedSupported = False
|
speedSupported = False
|
||||||
|
customOpenDialog = False
|
||||||
|
|
||||||
def __init__(self, client):
|
def __init__(self, client):
|
||||||
from twisted.internet import reactor
|
from twisted.internet import reactor
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import os
|
|||||||
|
|
||||||
class MplayerPlayer(BasePlayer):
|
class MplayerPlayer(BasePlayer):
|
||||||
speedSupported = True
|
speedSupported = True
|
||||||
|
customOpenDialog = False
|
||||||
RE_ANSWER = re.compile(constants.MPLAYER_ANSWER_REGEX)
|
RE_ANSWER = re.compile(constants.MPLAYER_ANSWER_REGEX)
|
||||||
POSITION_QUERY = 'time_pos'
|
POSITION_QUERY = 'time_pos'
|
||||||
OSD_QUERY = 'osd_show_text'
|
OSD_QUERY = 'osd_show_text'
|
||||||
|
|||||||
@ -13,6 +13,7 @@ from syncplay.messages import getMessage
|
|||||||
|
|
||||||
class VlcPlayer(BasePlayer):
|
class VlcPlayer(BasePlayer):
|
||||||
speedSupported = True
|
speedSupported = True
|
||||||
|
customOpenDialog = False
|
||||||
RE_ANSWER = re.compile(constants.VLC_ANSWER_REGEX)
|
RE_ANSWER = re.compile(constants.VLC_ANSWER_REGEX)
|
||||||
SLAVE_ARGS = constants.VLC_SLAVE_ARGS
|
SLAVE_ARGS = constants.VLC_SLAVE_ARGS
|
||||||
if not sys.platform.startswith('darwin'):
|
if not sys.platform.startswith('darwin'):
|
||||||
|
|||||||
@ -341,6 +341,10 @@ class MainWindow(QtGui.QMainWindow):
|
|||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
|
|
||||||
def browseMediapath(self):
|
def browseMediapath(self):
|
||||||
|
if self._syncplayClient._player.customOpenDialog == True:
|
||||||
|
self._syncplayClient._player.openCustomOpenDialog()
|
||||||
|
return
|
||||||
|
|
||||||
self.loadMediaBrowseSettings()
|
self.loadMediaBrowseSettings()
|
||||||
options = QtGui.QFileDialog.Options()
|
options = QtGui.QFileDialog.Options()
|
||||||
if os.path.isdir(self.mediadirectory):
|
if os.path.isdir(self.mediadirectory):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user