Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
47649fbf
Commit
47649fbf
authored
Jul 17, 2009
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: backported the new options to disable Apple Remote and Media Keys support
parent
d7bd6ae3
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
98 additions
and
38 deletions
+98
-38
modules/gui/macosx/intf.h
modules/gui/macosx/intf.h
+4
-1
modules/gui/macosx/intf.m
modules/gui/macosx/intf.m
+60
-34
modules/gui/macosx/macosx.m
modules/gui/macosx/macosx.m
+11
-0
modules/gui/macosx/simple_prefs.h
modules/gui/macosx/simple_prefs.h
+3
-1
modules/gui/macosx/simple_prefs.m
modules/gui/macosx/simple_prefs.m
+20
-2
No files found.
modules/gui/macosx/intf.h
View file @
47649fbf
...
...
@@ -353,6 +353,7 @@ struct intf_sys_t
-
(
id
)
controllerWindow
;
-
(
id
)
voutMenu
;
-
(
id
)
eyeTVController
;
-
(
id
)
appleRemoteController
;
-
(
void
)
applicationWillTerminate
:(
NSNotification
*
)
notification
;
-
(
NSString
*
)
localizedString
:(
const
char
*
)
psz
;
-
(
char
*
)
delocalizeString
:(
NSString
*
)
psz
;
...
...
@@ -424,9 +425,11 @@ struct intf_sys_t
@interface
VLCApplication
:
NSApplication
{
BOOL
b_justJumped
;
BOOL
b_mediaKeySupport
;
}
-
(
void
)
sendEvent
:
(
NSEvent
*
)
event
;
-
(
void
)
coreChangedMediaKeySupportSetting
:
(
NSNotification
*
)
o_notification
;
//- (void)sendEvent: (NSEvent*)event;
-
(
void
)
resetJump
;
@end
modules/gui/macosx/intf.m
View file @
47649fbf
...
...
@@ -1479,6 +1479,11 @@ static unsigned int VLCModifiersToCocoa( unsigned int i_key )
return
nil
;
}
-
(
id
)
appleRemoteController
{
return
o_remote
;
}
#pragma mark -
#pragma mark Polling
...
...
@@ -2818,8 +2823,28 @@ end:
@implementation
VLCApplication
-
(
void
)
awakeFromNib
{
b_mediaKeySupport
=
config_GetInt
(
VLCIntf
,
"macosx-mediakeys"
);
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
coreChangedMediaKeySupportSetting
:
)
name
:
@"VLCMediaKeySupportSettingChanged"
object
:
nil
];
}
-
(
void
)
dealloc
{
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
];
[
super
dealloc
];
}
-
(
void
)
coreChangedMediaKeySupportSetting
:
(
NSNotification
*
)
o_notification
{
b_mediaKeySupport
=
config_GetInt
(
VLCIntf
,
"macosx-mediakeys"
);
}
/*
- (void)sendEvent: (NSEvent*)event
{
if( b_mediaKeySupport )
{
if( [event type] == NSSystemDefined && [event subtype] == 8 )
{
int keyCode = (([event data1] & 0xFFFF0000) >> 16);
...
...
@@ -2862,8 +2887,9 @@ end:
}
}
}
}
[super sendEvent: event];
}
}
*/
-
(
void
)
resetJump
{
...
...
modules/gui/macosx/macosx.m
View file @
47649fbf
...
...
@@ -87,6 +87,13 @@ void CloseVideoGL ( vlc_object_t * );
#define EQ_KEEP_LONGTEXT N_("By default, VLC keeps the last equalizer settings before " \
"termination. This feature can be disabled here.")
#define USE_APPLE_REMOTE_TEXT N_("Allow playback control with the Apple Remote")
#define USE_APPLE_REMOTE_LONGTEXT N_("By default, VLC can be remotely controlled with the Apple Remote.")
#define USE_MEDIAKEYS_TEXT N_("Allow playback control with the media keys")
#define USE_MEDIAKEYS_LONGTEXT N_("By default, VLC can be controlled using the media keys on modern Apple " \
"keyboards.")
vlc_module_begin ()
set_description( N_("Mac OS X interface") )
set_capability( "interface", 200 )
...
...
@@ -101,6 +108,10 @@ vlc_module_begin ()
false )
add_bool( "macosx-fspanel", 1, NULL, FSPANEL_TEXT, FSPANEL_LONGTEXT,
false )
add_bool( "macosx-appleremote", 1, NULL, USE_APPLE_REMOTE_TEXT, USE_APPLE_REMOTE_LONGTEXT,
false )
add_bool( "macosx-mediakeys", 1, NULL, USE_MEDIAKEYS_TEXT, USE_MEDIAKEYS_LONGTEXT,
false )
add_submodule ()
set_description( "Mac OS X OpenGL" )
...
...
modules/gui/macosx/simple_prefs.h
View file @
47649fbf
/*****************************************************************************
* simple_prefs.h: Simple Preferences for Mac OS X
*****************************************************************************
* Copyright (C) 2008 the VideoLAN team
* Copyright (C) 2008
-2009
the VideoLAN team
* $Id$
*
* Authors: Felix Paul Kühne <fkuehne at videolan dot org>
...
...
@@ -89,6 +89,8 @@
IBOutlet
id
o_intf_art_txt
;
IBOutlet
id
o_intf_embedded_ckb
;
IBOutlet
id
o_intf_fspanel_ckb
;
IBOutlet
id
o_intf_appleremote_ckb
;
IBOutlet
id
o_intf_mediakeys_ckb
;
IBOutlet
id
o_intf_lang_pop
;
IBOutlet
id
o_intf_lang_txt
;
IBOutlet
id
o_intf_network_box
;
...
...
modules/gui/macosx/simple_prefs.m
View file @
47649fbf
/*****************************************************************************
* simple_prefs.m: Simple Preferences for Mac OS X
*****************************************************************************
* Copyright (C) 2008 the VideoLAN team
* Copyright (C) 2008
-2009
the VideoLAN team
* $Id$
*
* Authors: Felix Paul Kühne <fkuehne at videolan dot org>
...
...
@@ -27,6 +27,7 @@
#import <vlc_interface.h>
#import <vlc_dialog.h>
#import "misc.h"
#import "AppleRemote.h"
static
NSString
*
VLCSPrefsToolbarIdentifier
=
@"Our Simple Preferences Toolbar Identifier"
;
static
NSString
*
VLCIntfSettingToolbarIdentifier
=
@"Intf Settings Item Identifier"
;
...
...
@@ -262,6 +263,8 @@ create_toolbar_item( NSString * o_itemIdent, NSString * o_name, NSString * o_des
[
o_intf_fspanel_ckb
setTitle
:
_NS
(
"Show Fullscreen Controller"
)];
[
o_intf_lang_txt
setStringValue
:
_NS
(
"Language"
)];
[
o_intf_network_box
setTitle
:
_NS
(
"Privacy / Network Interaction"
)];
[
o_intf_appleremote_ckb
setTitle
:
_NS
(
"Control playback with the Apple Remote"
)];
[
o_intf_mediakeys_ckb
setTitle
:
_NS
(
"Control playback with media keys"
)];
/* Subtitles and OSD */
[
o_osd_encoding_txt
setStringValue
:
_NS
(
"Default Encoding"
)];
...
...
@@ -413,6 +416,8 @@ create_toolbar_item( NSString * o_itemIdent, NSString * o_name, NSString * o_des
[
o_intf_fspanel_ckb
setState
:
config_GetInt
(
p_intf
,
"macosx-fspanel"
)];
[
o_intf_embedded_ckb
setState
:
config_GetInt
(
p_intf
,
"embedded-video"
)];
[
o_intf_appleremote_ckb
setState
:
config_GetInt
(
p_intf
,
"macosx-appleremote"
)];
[
o_intf_mediakeys_ckb
setState
:
config_GetInt
(
p_intf
,
"macosx-mediakeys"
)];
/******************
* audio settings *
...
...
@@ -610,6 +615,7 @@ create_toolbar_item( NSString * o_itemIdent, NSString * o_name, NSString * o_des
-
(
void
)
showSimplePrefs
{
NSAutoreleasePool
*
o_pool
=
[[
NSAutoreleasePool
alloc
]
init
];
/* we want to show the interface settings, if no category was chosen */
if
(
[[
o_sprefs_win
toolbar
]
selectedItemIdentifier
]
==
nil
)
{
...
...
@@ -621,6 +627,7 @@ create_toolbar_item( NSString * o_itemIdent, NSString * o_name, NSString * o_des
[
o_sprefs_win
center
];
[
o_sprefs_win
makeKeyAndOrderFront
:
self
];
[
o_pool
release
];
}
-
(
IBAction
)
buttonAction
:(
id
)
sender
...
...
@@ -732,6 +739,17 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
config_PutInt
(
p_intf
,
"macosx-fspanel"
,
[
o_intf_fspanel_ckb
state
]
);
config_PutInt
(
p_intf
,
"embedded-video"
,
[
o_intf_embedded_ckb
state
]
);
config_PutInt
(
p_intf
,
"macosx-appleremote"
,
[
o_intf_appleremote_ckb
state
]
);
config_PutInt
(
p_intf
,
"macosx-mediakeys"
,
[
o_intf_mediakeys_ckb
state
]
);
/* activate stuff without restart */
if
(
[
o_intf_appleremote_ckb
state
]
==
YES
)
[[[
VLCMain
sharedInstance
]
appleRemoteController
]
startListening
:
[
VLCMain
sharedInstance
]];
else
[[[
VLCMain
sharedInstance
]
appleRemoteController
]
stopListening
:
[
VLCMain
sharedInstance
]];
//[[NSNotificationCenter defaultCenter] postNotificationName: @"VLCMediaKeySupportSettingChanged"
// object: nil
// userInfo: nil];
/* okay, let's save our changes to vlcrc */
i
=
config_SaveConfigFile
(
p_intf
,
"main"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment