Allow players to have custom open dialogs (e.g. for XBMC)

This commit is contained in:
Et0h 2014-11-30 12:01:33 +00:00
parent d9dfffefbb
commit 30b28afa14
5 changed files with 14 additions and 1 deletions

View File

@ -82,7 +82,13 @@ class BasePlayer(object):
@staticmethod
def getExpandedPath(path):
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):

View File

@ -306,6 +306,7 @@ class MpcHcApi:
class MPCHCAPIPlayer(BasePlayer):
speedSupported = False
customOpenDialog = False
def __init__(self, client):
from twisted.internet import reactor

View File

@ -9,6 +9,7 @@ import os
class MplayerPlayer(BasePlayer):
speedSupported = True
customOpenDialog = False
RE_ANSWER = re.compile(constants.MPLAYER_ANSWER_REGEX)
POSITION_QUERY = 'time_pos'
OSD_QUERY = 'osd_show_text'

View File

@ -13,6 +13,7 @@ from syncplay.messages import getMessage
class VlcPlayer(BasePlayer):
speedSupported = True
customOpenDialog = False
RE_ANSWER = re.compile(constants.VLC_ANSWER_REGEX)
SLAVE_ARGS = constants.VLC_SLAVE_ARGS
if not sys.platform.startswith('darwin'):

View File

@ -341,6 +341,10 @@ class MainWindow(QtGui.QMainWindow):
settings.endGroup()
def browseMediapath(self):
if self._syncplayClient._player.customOpenDialog == True:
self._syncplayClient._player.openCustomOpenDialog()
return
self.loadMediaBrowseSettings()
options = QtGui.QFileDialog.Options()
if os.path.isdir(self.mediadirectory):