Commit 30437c65 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: implemented options to disable Apple Remote and Media keys support

Disabling AR will work instantly, while mediakey require a restart to update the setting. To be fixed later on.
parent eb5d3ab1
{
IBClasses = (
{
CLASS = FirstResponder;
LANGUAGE = ObjC;
SUPERCLASS = NSObject;
},
{
CLASS = NSApplication;
LANGUAGE = ObjC;
SUPERCLASS = NSResponder;
},
{
CLASS = NSObject;
LANGUAGE = ObjC;
},
{
CLASS = VLCApplication;
LANGUAGE = ObjC;
SUPERCLASS = NSApplication;
},
{
CLASS = VLCHotkeyChangeWindow;
LANGUAGE = ObjC;
SUPERCLASS = NSWindow;
},
{
ACTIONS = {
buttonAction = id;
closePrefs = id;
resetAll = id;
savePrefs = id;
};
CLASS = VLCPrefs;
LANGUAGE = ObjC;
OUTLETS = {
"o_basicFull_matrix" = id;
"o_cancel_btn" = id;
"o_prefs_view" = id;
"o_prefs_window" = id;
"o_reset_btn" = id;
"o_save_btn" = id;
"o_title" = id;
"o_tree" = id;
};
SUPERCLASS = NSObject;
},
{
ACTIONS = {
audioSettingChanged = id;
buttonAction = id;
hotkeySettingChanged = id;
inputSettingChanged = id;
interfaceSettingChanged = id;
osdSettingChanged = id;
showFontPicker = id;
videoSettingChanged = id;
};
CLASS = VLCSimplePrefs;
LANGUAGE = ObjC;
OUTLETS = {
"o_audio_dolby_pop" = id;
"o_audio_dolby_txt" = id;
"o_audio_effects_box" = id;
"o_audio_enable_ckb" = id;
"o_audio_general_box" = id;
"o_audio_headphone_ckb" = id;
"o_audio_lang_fld" = id;
"o_audio_lang_txt" = id;
"o_audio_last_box" = id;
"o_audio_last_ckb" = id;
"o_audio_lastpwd_sfld" = id;
"o_audio_lastpwd_txt" = id;
"o_audio_lastuser_fld" = id;
"o_audio_lastuser_txt" = id;
"o_audio_norm_ckb" = id;
"o_audio_norm_fld" = id;
"o_audio_norm_stepper" = id;
"o_audio_spdif_ckb" = id;
"o_audio_view" = id;
"o_audio_visual_pop" = id;
"o_audio_visual_txt" = id;
"o_audio_vol_fld" = id;
"o_audio_vol_sld" = id;
"o_audio_vol_txt" = id;
"o_hotkeys_change_btn" = id;
"o_hotkeys_change_cancel_btn" = id;
"o_hotkeys_change_keys_lbl" = id;
"o_hotkeys_change_lbl" = id;
"o_hotkeys_change_ok_btn" = id;
"o_hotkeys_change_taken_lbl" = id;
"o_hotkeys_change_win" = id;
"o_hotkeys_clear_btn" = id;
"o_hotkeys_lbl" = id;
"o_hotkeys_listbox" = id;
"o_hotkeys_view" = id;
"o_input_avi_pop" = id;
"o_input_avi_txt" = id;
"o_input_cachelevel_custom_txt" = id;
"o_input_cachelevel_pop" = id;
"o_input_cachelevel_txt" = id;
"o_input_caching_box" = id;
"o_input_httpproxy_fld" = id;
"o_input_httpproxy_txt" = id;
"o_input_httpproxypwd_sfld" = id;
"o_input_httpproxypwd_txt" = id;
"o_input_mux_box" = id;
"o_input_net_box" = id;
"o_input_postproc_fld" = id;
"o_input_postproc_txt" = id;
"o_input_rtsp_ckb" = id;
"o_input_serverport_fld" = id;
"o_input_serverport_txt" = id;
"o_input_skipLoop_pop" = id;
"o_input_skipLoop_txt" = id;
"o_input_view" = id;
"o_intf_art_pop" = id;
"o_intf_art_txt" = id;
"o_intf_embedded_ckb" = id;
"o_intf_fspanel_ckb" = id;
"o_intf_lang_pop" = id;
"o_intf_lang_txt" = id;
"o_intf_network_box" = id;
"o_intf_view" = id;
"o_osd_encoding_pop" = id;
"o_osd_encoding_txt" = id;
"o_osd_font_box" = id;
"o_osd_font_btn" = id;
"o_osd_font_color_pop" = id;
"o_osd_font_color_txt" = id;
"o_osd_font_fld" = id;
"o_osd_font_size_pop" = id;
"o_osd_font_size_txt" = id;
"o_osd_font_txt" = id;
"o_osd_lang_box" = id;
"o_osd_lang_fld" = id;
"o_osd_lang_txt" = id;
"o_osd_osd_box" = id;
"o_osd_osd_ckb" = id;
"o_osd_view" = id;
"o_sprefs_basicFull_matrix" = id;
"o_sprefs_basic_box" = id;
"o_sprefs_cancel_btn" = id;
"o_sprefs_controls_box" = id;
"o_sprefs_reset_btn" = id;
"o_sprefs_save_btn" = id;
"o_sprefs_win" = id;
"o_video_black_ckb" = id;
"o_video_device_pop" = id;
"o_video_device_txt" = id;
"o_video_display_box" = id;
"o_video_enable_ckb" = id;
"o_video_fullscreen_ckb" = id;
"o_video_onTop_ckb" = id;
"o_video_output_pop" = id;
"o_video_output_txt" = id;
"o_video_skipFrames_ckb" = id;
"o_video_snap_box" = id;
"o_video_snap_folder_btn" = id;
"o_video_snap_folder_fld" = id;
"o_video_snap_folder_txt" = id;
"o_video_snap_format_pop" = id;
"o_video_snap_format_txt" = id;
"o_video_snap_prefix_fld" = id;
"o_video_snap_prefix_txt" = id;
"o_video_snap_seqnum_ckb" = id;
"o_video_view" = id;
};
SUPERCLASS = NSObject;
},
{
CLASS = VLCSimplePrefsWindow;
LANGUAGE = ObjC;
SUPERCLASS = NSWindow;
}
);
IBVersion = 1;
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>76 135 356 240 0 0 1280 778 </string>
<key>IBEditorPositions</key>
<dict>
<key>2311</key>
<string>345 426 590 230 0 0 1280 778 </string>
<key>2330</key>
<string>345 222 590 502 0 0 1280 778 </string>
<key>2440</key>
<string>345 307 590 389 0 0 1280 778 </string>
<key>2523</key>
<string>345 341 590 343 0 0 1280 778 </string>
<key>2562</key>
<string>345 266 590 444 0 0 1280 778 </string>
<key>2668</key>
<string>345 256 590 457 0 0 1280 778 </string>
</dict>
<key>IBFramework Version</key>
<string>489.0</string>
<key>IBLastKnownRelativeProjectPath</key>
<string>../../vlc.xcodeproj</string>
<key>IBOldestOS</key>
<integer>5</integer>
<key>IBOpenObjects</key>
<array>
<integer>2265</integer>
<integer>1530</integer>
<integer>2562</integer>
</array>
<key>IBSystem Version</key>
<string>9G55</string>
<key>targetFramework</key>
<string>IBCocoaFramework</string>
</dict>
</plist>
......@@ -357,6 +357,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;
......@@ -429,8 +430,10 @@ struct intf_sys_t
@interface VLCApplication : NSApplication
{
BOOL b_justJumped;
BOOL b_mediaKeySupport;
}
- (void)enableMediaKeySupport:(BOOL)b_value;
- (void)sendEvent: (NSEvent*)event;
- (void)resetJump;
......
......@@ -1012,6 +1012,7 @@ static NSString * VLCToolbarMediaControl = @"VLCToolbarMediaControl";
- (void)applicationDidBecomeActive:(NSNotification *)aNotification
{
if( !p_intf ) return;
if( config_GetInt( p_intf, "macosx-appleremote" ) == YES )
[o_remote startListening: self];
}
- (void)applicationDidResignActive:(NSNotification *)aNotification
......@@ -1494,6 +1495,11 @@ static unsigned int VLCModifiersToCocoa( unsigned int i_key )
return nil;
}
- (id)appleRemoteController
{
return o_remote;
}
#pragma mark -
#pragma mark Polling
......@@ -2848,8 +2854,20 @@ end:
@implementation VLCApplication
- (void)awakeFromNib
{
b_mediaKeySupport = config_GetInt( VLCIntf, "macosx-mediakeys" );
}
- (void)enableMediaKeySupport:(BOOL)b_value
{
b_mediaKeySupport = b_value;
}
- (void)sendEvent: (NSEvent*)event
{
if( b_mediaKeySupport )
{
if( [event type] == NSSystemDefined && [event subtype] == 8 )
{
int keyCode = (([event data1] & 0xFFFF0000) >> 16);
......@@ -2892,6 +2910,7 @@ end:
}
}
}
}
[super sendEvent: event];
}
......
/*****************************************************************************
* macosx.m: Mac OS X module for vlc
*****************************************************************************
* Copyright (C) 2001-2006 the VideoLAN team
* Copyright (C) 2001-2009 the VideoLAN team
* $Id$
*
* Authors: Colin Delacroix <colin@zoy.org>
......@@ -9,6 +9,7 @@
* Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
......@@ -87,6 +88,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 +109,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" )
......
......@@ -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;
......
/*****************************************************************************
* 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,8 @@
#import <vlc_interface.h>
#import <vlc_dialog.h>
#import "misc.h"
#import "intf.h"
#import "AppleRemote.h"
static NSString* VLCSPrefsToolbarIdentifier = @"Our Simple Preferences Toolbar Identifier";
static NSString* VLCIntfSettingToolbarIdentifier = @"Intf Settings Item Identifier";
......@@ -262,6 +264,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("Allow playback control with the Apple Remote")];
[o_intf_mediakeys_ckb setTitle: _NS("Allow playback control with the media keys")];
/* Subtitles and OSD */
[o_osd_encoding_txt setStringValue: _NS("Default Encoding")];
......@@ -413,6 +417,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 *
......@@ -734,6 +740,14 @@ 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]];
/* okay, let's save our changes to vlcrc */
i = config_SaveConfigFile( p_intf, "main" );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment