Mplayer updated to new ver
This commit is contained in:
parent
aba2117344
commit
d09ff50216
@ -1,7 +1,7 @@
|
||||
#coding:utf8
|
||||
from syncplay import client
|
||||
from syncplay.players import mplayer
|
||||
|
||||
from syncplay import ui
|
||||
from syncplay import utils
|
||||
|
||||
def prepareArguments():
|
||||
@ -9,10 +9,29 @@ def prepareArguments():
|
||||
args.prepareClientConfiguration()
|
||||
return args.getClientConfiguration()
|
||||
|
||||
if __name__ == '__main__':
|
||||
args = prepareArguments()
|
||||
args.args.extend(('-slave', '-msglevel', 'all=1:global=4'))
|
||||
if(args.file): args.args.extend((args.file,))
|
||||
manager = client.SyncplayClientManager(args.name, lambda m: mplayer.run_mplayer(m, 'mplayer', args.args))
|
||||
manager.start(args.host, args.port)
|
||||
class SyncplayMplayer:
|
||||
def runClient(self):
|
||||
self._prepareArguments()
|
||||
# self.interface = ui.getUi(graphical = not self.args.no_gui)
|
||||
self.interface = ui.getUi(graphical = False) #TODO: add gui
|
||||
self._promptForMissingArguments()
|
||||
self.args._args.extend(('-slave', '-msglevel', 'all=1:global=4'))
|
||||
if(self.args.file): self.args.args.extend((self.args.file,))
|
||||
syncplayClient = client.SyncplayClientManager(self.args.name, lambda m: mplayer.run_mplayer(m, 'mplayer', self.args._args), self.interface, self.args.debug)
|
||||
self.interface.addClient(syncplayClient)
|
||||
syncplayClient.start(self.args.host, self.args.port)
|
||||
def _prepareArguments(self):
|
||||
self.argsGetter = utils.ConfigurationGetter()
|
||||
self.argsGetter.prepareClientConfiguration()
|
||||
self.args = self.argsGetter.getClientConfiguration()
|
||||
|
||||
def _promptForMissingArguments(self):
|
||||
if (self.args.host == None):
|
||||
self.args.host = self.interface.promptFor(promptName = "Hostname", message = "You must supply hostname on the first run, it's easier trough command line arguments.")
|
||||
if (self.args.name == None):
|
||||
self.args.name = self.interface.promptFor(promptName = "Username", message = "You must supply username on the first run, it's easier trough command line arguments.")
|
||||
self.argsGetter.saveValuesIntoConfigFile()
|
||||
|
||||
if __name__ == '__main__':
|
||||
SyncplayMplayer().runClient()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user