mirror of
https://github.com/mpv-player/mpv
synced 2025-03-21 18:57:35 +00:00
cocoa: allow to disable apple remote at compile time
Actually doesn't remove the related flags so that one can still pass the option with the option doing nothing.
This commit is contained in:
parent
a0acb6eaa7
commit
49b6fa8779
@ -35,12 +35,16 @@
|
|||||||
#include "osdep/macosx_compat.h"
|
#include "osdep/macosx_compat.h"
|
||||||
#import "osdep/macosx_events_objc.h"
|
#import "osdep/macosx_events_objc.h"
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
@interface EventsResponder ()
|
@interface EventsResponder ()
|
||||||
{
|
{
|
||||||
struct input_ctx *_inputContext;
|
struct input_ctx *_inputContext;
|
||||||
NSCondition *_input_ready;
|
NSCondition *_input_ready;
|
||||||
CFMachPortRef _mk_tap_port;
|
CFMachPortRef _mk_tap_port;
|
||||||
|
#if HAVE_APPLE_REMOTE
|
||||||
HIDRemote *_remote;
|
HIDRemote *_remote;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)handleMediaKey:(NSEvent *)event;
|
- (BOOL)handleMediaKey:(NSEvent *)event;
|
||||||
@ -270,6 +274,8 @@ void cocoa_set_input_context(struct input_ctx *input_context)
|
|||||||
|
|
||||||
- (void)startAppleRemote
|
- (void)startAppleRemote
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#if HAVE_APPLE_REMOTE
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
self->_remote = [[HIDRemote alloc] init];
|
self->_remote = [[HIDRemote alloc] init];
|
||||||
if (self->_remote) {
|
if (self->_remote) {
|
||||||
@ -277,14 +283,17 @@ void cocoa_set_input_context(struct input_ctx *input_context)
|
|||||||
[self->_remote startRemoteControl:kHIDRemoteModeExclusiveAuto];
|
[self->_remote startRemoteControl:kHIDRemoteModeExclusiveAuto];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
- (void)stopAppleRemote
|
- (void)stopAppleRemote
|
||||||
{
|
{
|
||||||
|
#if HAVE_APPLE_REMOTE
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
[self->_remote stopRemoteControl];
|
[self->_remote stopRemoteControl];
|
||||||
[self->_remote release];
|
[self->_remote release];
|
||||||
});
|
});
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
- (void)restartMediaKeys
|
- (void)restartMediaKeys
|
||||||
{
|
{
|
||||||
|
5
wscript
5
wscript
@ -755,6 +755,11 @@ standalone_features = [
|
|||||||
'deps': [ 'cocoa' ],
|
'deps': [ 'cocoa' ],
|
||||||
'deps_neg': [ 'libmpv-shared', 'libmpv-static' ],
|
'deps_neg': [ 'libmpv-shared', 'libmpv-static' ],
|
||||||
'func': check_true
|
'func': check_true
|
||||||
|
}, {
|
||||||
|
'name': '--apple-remote',
|
||||||
|
'desc': 'Apple Remote support',
|
||||||
|
'deps': [ 'cocoa' ],
|
||||||
|
'func': check_true
|
||||||
}, {
|
}, {
|
||||||
'name': '--macosx-bundle',
|
'name': '--macosx-bundle',
|
||||||
'desc': 'compilation of a Mac OS X Application bundle',
|
'desc': 'compilation of a Mac OS X Application bundle',
|
||||||
|
@ -382,7 +382,7 @@ def build(ctx):
|
|||||||
( timer_c ),
|
( timer_c ),
|
||||||
( "osdep/threads.c" ),
|
( "osdep/threads.c" ),
|
||||||
|
|
||||||
( "osdep/ar/HIDRemote.m", "cocoa" ),
|
( "osdep/ar/HIDRemote.m", "apple-remote" ),
|
||||||
( "osdep/macosx_application.m", "cocoa-application" ),
|
( "osdep/macosx_application.m", "cocoa-application" ),
|
||||||
( "osdep/macosx_events.m", "cocoa" ),
|
( "osdep/macosx_events.m", "cocoa" ),
|
||||||
( "osdep/semaphore_osx.c" ),
|
( "osdep/semaphore_osx.c" ),
|
||||||
|
Loading…
Reference in New Issue
Block a user