OSD support for mplayer

MPC-API client additional arguments
This commit is contained in:
Uriziel 2012-06-27 11:52:39 +02:00
parent e9e7e31de6
commit 9c3fcb0dc2
2 changed files with 4 additions and 2 deletions

View File

@ -12,6 +12,7 @@ if __name__ == '__main__':
args = utils.get_configuration()
if(args.mpc_path == None):
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))
thread.start_new_thread(utils.stdin_thread, (manager,))
manager.start()

View File

@ -72,6 +72,8 @@ class MplayerProtocol(LineProcessProtocol):
def send_get_property(self, 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):
self.send_get_property('filename')
@ -128,7 +130,6 @@ def run_mplayer(manager, mplayer_path, args):
args = list(args)
args.insert(0, mplayer_path)
process_protocol = MplayerProtocol(manager)
reactor.spawnProcess(process_protocol, exec_path, args=args, env=None)