OSD support for mplayer
MPC-API client additional arguments
This commit is contained in:
parent
e9e7e31de6
commit
9c3fcb0dc2
@ -12,6 +12,7 @@ if __name__ == '__main__':
|
|||||||
args = utils.get_configuration()
|
args = utils.get_configuration()
|
||||||
if(args.mpc_path == None):
|
if(args.mpc_path == None):
|
||||||
sys.exit("You must supply mpc-path on first run")
|
sys.exit("You must supply mpc-path on first run")
|
||||||
|
args.args.extend(['/open', '/new'])
|
||||||
manager = client.Manager(args.host, args.port, args.name, lambda m: mpc_using_api.run_mpc(m, args.mpc_path, args.file, args.args))
|
manager = client.Manager(args.host, args.port, args.name, lambda m: mpc_using_api.run_mpc(m, args.mpc_path, args.file, args.args))
|
||||||
thread.start_new_thread(utils.stdin_thread, (manager,))
|
thread.start_new_thread(utils.stdin_thread, (manager,))
|
||||||
manager.start()
|
manager.start()
|
||||||
|
|||||||
@ -72,6 +72,8 @@ class MplayerProtocol(LineProcessProtocol):
|
|||||||
def send_get_property(self, name):
|
def send_get_property(self, name):
|
||||||
self.writeLines('%s %s' % ('get_property', name))
|
self.writeLines('%s %s' % ('get_property', name))
|
||||||
|
|
||||||
|
def display_message(self, message):
|
||||||
|
self.writeLines('%s %s' % ('osd_show_text', message))
|
||||||
|
|
||||||
def send_get_filename(self):
|
def send_get_filename(self):
|
||||||
self.send_get_property('filename')
|
self.send_get_property('filename')
|
||||||
@ -128,7 +130,6 @@ def run_mplayer(manager, mplayer_path, args):
|
|||||||
|
|
||||||
args = list(args)
|
args = list(args)
|
||||||
args.insert(0, mplayer_path)
|
args.insert(0, mplayer_path)
|
||||||
|
|
||||||
process_protocol = MplayerProtocol(manager)
|
process_protocol = MplayerProtocol(manager)
|
||||||
reactor.spawnProcess(process_protocol, exec_path, args=args, env=None)
|
reactor.spawnProcess(process_protocol, exec_path, args=args, env=None)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user