From 213ad5d6c41f32cf9086fa377cd6d6df1236bb76 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 4 Jun 2013 22:12:23 +0200 Subject: osx: improve Media Keys support This commit addresses some issues with the users had with the previous implementation in commit c39efb9. Here's the changes: * Use Quartz Event Taps to remove Media Key events mpv handles from the global OS X queue. This prevents conflicts with iTunes. I did this on the main thread since it is mostly idling. It's the playloop thread that actually does all the work so there is no danger of blocking the event tap callback. * Introduce `--no-media-keys` switch so that users can disable all of mpv's media key handling at runtime (some prefer iTunes for example). * Use mpv's bindings so that users can customize what the media keys do via input.conf. Current bindings are: MK_PLAY cycle pause MK_PREV playlist_prev MK_NEXT playlist_next An additional benefit of this implementation is that it is completly handled by the `macosx_events` file instead of `macosx_application` making the project organization more straightforward. --- core/defaultopts.c | 1 + 1 file changed, 1 insertion(+) (limited to 'core/defaultopts.c') diff --git a/core/defaultopts.c b/core/defaultopts.c index a8a6b26930..a03370bed6 100644 --- a/core/defaultopts.c +++ b/core/defaultopts.c @@ -110,6 +110,7 @@ void set_default_mplayer_options(struct MPOpts *opts) .use_lircc = 1, #ifdef CONFIG_COCOA .use_ar = 1, + .use_media_keys = 1, #endif .default_bindings = 1, } -- cgit v1.2.3