Commit 0eaddd99 authored by David Fuhrmann's avatar David Fuhrmann

macosx: Move input-related code to own class

parent d3b385e2
/*****************************************************************************
* InputManager.h: MacOS X interface module
*****************************************************************************
* Copyright (C) 2015 VLC authors and VideoLAN
* $Id$
*
* 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
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#import <Cocoa/Cocoa.h>
#include <vlc_common.h>
#import <vlc_interface.h>
#import <IOKit/pwr_mgt/IOPMLib.h> /* for sleep prevention */
@class VLCMain;
@interface InputManager : NSObject
{
intf_thread_t *p_intf;
VLCMain *o_main;
input_thread_t *p_current_input;
dispatch_queue_t informInputChangedQueue;
/* sleep management */
IOPMAssertionID systemSleepAssertionID;
IOPMAssertionID userActivityAssertionID;
/* iTunes/Spotify play/pause support */
BOOL b_has_itunes_paused;
BOOL b_has_spotify_paused;
NSTimer *o_itunes_play_timer;
}
- (id)initWithMain:(VLCMain *)o_mainObj;
- (void)inputThreadChanged;
- (void)playbackStatusUpdated;
- (void)resumeItunesPlayback:(id)sender;
- (BOOL)hasInput;
@end
This diff is collapsed.
...@@ -38,7 +38,8 @@ libmacosx_plugin_la_SOURCES = \ ...@@ -38,7 +38,8 @@ libmacosx_plugin_la_SOURCES = \
ExtensionsManager.h ExtensionsManager.m \ ExtensionsManager.h ExtensionsManager.m \
eyetv.h eyetv.m \ eyetv.h eyetv.m \
fspanel.h fspanel.m \ fspanel.h fspanel.m \
intf.m intf.h \ intf.h intf.m \
InputManager.h InputManager.m \
iTunes.h \ iTunes.h \
KeyboardBacklight.h KeyboardBacklight.m \ KeyboardBacklight.h KeyboardBacklight.m \
macosx.m \ macosx.m \
......
...@@ -44,8 +44,6 @@ ...@@ -44,8 +44,6 @@
#import "VLCVoutWindowController.h" #import "VLCVoutWindowController.h"
#import "StringUtility.h" #import "StringUtility.h"
#import <IOKit/pwr_mgt/IOPMLib.h> /* for sleep prevention */
/***************************************************************************** /*****************************************************************************
* Local prototypes. * Local prototypes.
*****************************************************************************/ *****************************************************************************/
...@@ -63,22 +61,24 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification"; ...@@ -63,22 +61,24 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
* VLCMain interface * VLCMain interface
*****************************************************************************/ *****************************************************************************/
@class AppleRemote; @class AppleRemote;
@class VLCInfo;
@class VLCControls; @class VLCControls;
@class VLCMainMenu;
@class VLCPlaylist; @class VLCPlaylist;
@class InputManager;
@interface VLCMain : NSObject <NSWindowDelegate, NSApplicationDelegate> @interface VLCMain : NSObject <NSWindowDelegate, NSApplicationDelegate>
{ {
intf_thread_t *p_intf; /* The main intf object */ intf_thread_t *p_intf; /* The main intf object */
input_thread_t *p_current_input;
BOOL launched; /* finishedLaunching */ BOOL launched; /* finishedLaunching */
int items_at_launch; /* items in playlist after launch */ int items_at_launch; /* items in playlist after launch */
id o_mainmenu; /* VLCMainMenu */ VLCMainMenu *o_mainmenu; /* VLCMainMenu */
id o_prefs; /* VLCPrefs */ id o_prefs; /* VLCPrefs */
id o_sprefs; /* VLCSimplePrefs */ id o_sprefs; /* VLCSimplePrefs */
id o_open; /* VLCOpen */ id o_open; /* VLCOpen */
id o_wizard; /* VLCWizard */ id o_wizard; /* VLCWizard */
id o_coredialogs; /* VLCCoreDialogProvider */ id o_coredialogs; /* VLCCoreDialogProvider */
id o_info; /* VLCInformation */ VLCInfo *o_info; /* VLCInformation */
id o_eyetv; /* VLCEyeTVController */ id o_eyetv; /* VLCEyeTVController */
id o_bookmarks; /* VLCBookmarks */ id o_bookmarks; /* VLCBookmarks */
id o_coreinteraction; /* VLCCoreInteraction */ id o_coreinteraction; /* VLCCoreInteraction */
...@@ -111,18 +111,9 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification"; ...@@ -111,18 +111,9 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
NSArray *o_usedHotkeys; NSArray *o_usedHotkeys;
/* sleep management */
IOPMAssertionID systemSleepAssertionID;
IOPMAssertionID userActivityAssertionID;
VLCVoutWindowController *o_vout_controller; VLCVoutWindowController *o_vout_controller;
/* iTunes/Spotify play/pause support */ InputManager *o_input_manager;
BOOL b_has_itunes_paused;
BOOL b_has_spotify_paused;
NSTimer *o_itunes_play_timer;
dispatch_queue_t informInputChangedQueue;
} }
@property (readonly) VLCVoutWindowController* voutController; @property (readonly) VLCVoutWindowController* voutController;
...@@ -133,15 +124,15 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification"; ...@@ -133,15 +124,15 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
- (intf_thread_t *)intf; - (intf_thread_t *)intf;
- (void)setIntf:(intf_thread_t *)p_mainintf; - (void)setIntf:(intf_thread_t *)p_mainintf;
- (id)mainMenu; - (VLCMainMenu *)mainMenu;
- (VLCMainWindow *)mainWindow; - (VLCMainWindow *)mainWindow;
- (id)controls; - (id)controls;
- (id)bookmarks; - (id)bookmarks;
- (id)open; - (id)open;
- (id)simplePreferences; - (id)simplePreferences;
- (id)preferences; - (id)preferences;
- (id)playlist; - (VLCPlaylist *)playlist;
- (id)info; - (VLCInfo *)info;
- (id)wizard; - (id)wizard;
- (id)coreDialogProvider; - (id)coreDialogProvider;
- (id)eyeTVController; - (id)eyeTVController;
...@@ -152,16 +143,12 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification"; ...@@ -152,16 +143,12 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
- (void)updateCurrentlyUsedHotkeys; - (void)updateCurrentlyUsedHotkeys;
- (BOOL)hasDefinedShortcutKey:(NSEvent *)o_event force:(BOOL)b_force; - (BOOL)hasDefinedShortcutKey:(NSEvent *)o_event force:(BOOL)b_force;
- (void)inputThreadChanged;
- (void)plItemUpdated; - (void)plItemUpdated;
- (void)playbackStatusUpdated;
- (void)sendDistributedNotificationWithUpdatedPlaybackStatus;
- (void)playbackModeUpdated; - (void)playbackModeUpdated;
- (void)updateVolume; - (void)updateVolume;
- (void)updatePlaybackPosition; - (void)updatePlaybackPosition;
- (void)updateName; - (void)updateName;
- (void)updateRecordState: (BOOL)b_value; - (void)updateRecordState: (BOOL)b_value;
- (void)updateMetaAndInfo;
- (void)updateMainMenu; - (void)updateMainMenu;
- (void)updateMainWindow; - (void)updateMainWindow;
- (void)showMainWindow; - (void)showMainWindow;
......
This diff is collapsed.
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