Commit 27be3b6e authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: move VLCFSPanel from VLCControls to VLCMainWindow since its the only...

macosx: move VLCFSPanel from VLCControls to VLCMainWindow since its the only class which should know about it
parent 8c2eb7b4
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#import "PXSourceList.h" #import "PXSourceList.h"
#import <vlc_input.h> #import <vlc_input.h>
#import "misc.h" #import "misc.h"
#import "fspanel.h"
#ifndef MAC_OS_X_VERSION_10_6 #ifndef MAC_OS_X_VERSION_10_6
@protocol NSAnimationDelegate <NSObject> @end @protocol NSAnimationDelegate <NSObject> @end
...@@ -68,6 +69,8 @@ ...@@ -68,6 +69,8 @@
IBOutlet id o_dropzone_btn; IBOutlet id o_dropzone_btn;
IBOutlet id o_dropzone_lbl; IBOutlet id o_dropzone_lbl;
IBOutlet VLCFSPanel *o_fspanel;
BOOL b_dark_interface; BOOL b_dark_interface;
BOOL b_video_playback_enabled; BOOL b_video_playback_enabled;
int i_lastShownVolume; int i_lastShownVolume;
......
...@@ -57,7 +57,10 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -57,7 +57,10 @@ static VLCMainWindow *_o_sharedInstance = nil;
return _o_sharedInstance; return _o_sharedInstance;
} }
else else
{
o_fspanel = [[VLCFSPanel alloc] init];
_o_sharedInstance = [super init]; _o_sharedInstance = [super init];
}
return _o_sharedInstance; return _o_sharedInstance;
} }
...@@ -534,7 +537,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -534,7 +537,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
o_time = [NSString stringWithUTF8String: secstotimestr( psz_time, (time.i_time / 1000000) )]; o_time = [NSString stringWithUTF8String: secstotimestr( psz_time, (time.i_time / 1000000) )];
[o_time_fld setStringValue: o_time]; [o_time_fld setStringValue: o_time];
[[[[VLCMain sharedInstance] controls] fspanel] setStreamPos: f_updated andTime: o_time]; [o_fspanel setStreamPos: f_updated andTime: o_time];
vlc_object_release( p_input ); vlc_object_release( p_input );
} }
[self drawFancyGradientEffectForTimeSlider]; [self drawFancyGradientEffectForTimeSlider];
...@@ -616,7 +619,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -616,7 +619,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_time_fld setStringValue: o_time]; [o_time_fld setStringValue: o_time];
[o_time_fld setNeedsDisplay:YES]; [o_time_fld setNeedsDisplay:YES];
// [[[[VLCMain sharedInstance] controls] fspanel] setStreamPos: f_updated andTime: o_time]; [o_fspanel setStreamPos: f_updated andTime: o_time];
vlc_object_release( p_input ); vlc_object_release( p_input );
} }
else else
...@@ -643,7 +646,8 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -643,7 +646,8 @@ static VLCMainWindow *_o_sharedInstance = nil;
int i_volume_step = 0; int i_volume_step = 0;
i_volume_step = config_GetInt( VLCIntf->p_libvlc, "volume-step" ); i_volume_step = config_GetInt( VLCIntf->p_libvlc, "volume-step" );
[o_volume_sld setFloatValue: (float)i_lastShownVolume / i_volume_step]; [o_volume_sld setFloatValue: (float)i_lastShownVolume / i_volume_step];
// [[[[VLCMain sharedInstance] controls] fspanel] setVolumeLevel: (float)i_lastShownVolume / i_volume_step]; if ([o_fspanel respondsToSelector:@selector(setVolumeLevel:)])
[o_fspanel setVolumeLevel: (float)i_lastShownVolume / i_volume_step];
} }
} }
...@@ -695,7 +699,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -695,7 +699,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
} }
[self setTitle: aString]; [self setTitle: aString];
[[[[VLCMain sharedInstance] controls] fspanel] setStreamTitle: aString]; [o_fspanel setStreamTitle: aString];
} }
else else
{ {
...@@ -758,7 +762,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -758,7 +762,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_time_sld setEnabled: b_seekable]; [o_time_sld setEnabled: b_seekable];
[self updateTimeSlider]; [self updateTimeSlider];
[[[[VLCMain sharedInstance] controls] fspanel] setSeekable: b_seekable]; [o_fspanel setSeekable: b_seekable];
PL_LOCK; PL_LOCK;
if (playlist_CurrentSize( p_playlist ) >= 1) if (playlist_CurrentSize( p_playlist ) >= 1)
...@@ -773,6 +777,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -773,6 +777,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_play_btn setImage: o_pause_img]; [o_play_btn setImage: o_pause_img];
[o_play_btn setAlternateImage: o_pause_pressed_img]; [o_play_btn setAlternateImage: o_pause_pressed_img];
[o_play_btn setToolTip: _NS("Pause")]; [o_play_btn setToolTip: _NS("Pause")];
[o_fspanel setPause];
} }
- (void)setPlay - (void)setPlay
...@@ -780,6 +785,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -780,6 +785,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_play_btn setImage: o_play_img]; [o_play_btn setImage: o_play_img];
[o_play_btn setAlternateImage: o_play_pressed_img]; [o_play_btn setAlternateImage: o_play_pressed_img];
[o_play_btn setToolTip: _NS("Play")]; [o_play_btn setToolTip: _NS("Play")];
[o_fspanel setPlay];
} }
- (void)drawFancyGradientEffectForTimeSlider - (void)drawFancyGradientEffectForTimeSlider
...@@ -1027,12 +1033,12 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -1027,12 +1033,12 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_fullscreen_window setAcceptsMouseMovedEvents: TRUE]; [o_fullscreen_window setAcceptsMouseMovedEvents: TRUE];
/* tell the fspanel to move itself to front next time it's triggered */ /* tell the fspanel to move itself to front next time it's triggered */
[[[[VLCMain sharedInstance] controls] fspanel] setVoutWasUpdated: (int)[[o_fullscreen_window screen] displayID]]; [o_fspanel setVoutWasUpdated: (int)[[o_fullscreen_window screen] displayID]];
if([self isVisible]) if([self isVisible])
[super orderOut: self]; [super orderOut: self];
[[[[VLCMain sharedInstance] controls] fspanel] setActive: nil]; [o_fspanel setActive: nil];
b_fullscreen = YES; b_fullscreen = YES;
[self unlockFullscreenAnimation]; [self unlockFullscreenAnimation];
...@@ -1076,7 +1082,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -1076,7 +1082,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
CGDisplayFade( token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES ); CGDisplayFade( token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES );
} }
[[[[VLCMain sharedInstance] controls] fspanel] setNonActive: nil]; [o_fspanel setNonActive: nil];
SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar); SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar);
/* Will release the lock */ /* Will release the lock */
...@@ -1098,7 +1104,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -1098,7 +1104,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[self setAlphaValue: 0.0]; [self setAlphaValue: 0.0];
[self orderFront: self]; [self orderFront: self];
[[[[VLCMain sharedInstance] controls] fspanel] setNonActive: nil]; [o_fspanel setNonActive: nil];
SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar); SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar);
if (o_fullscreen_anim1) if (o_fullscreen_anim1)
......
...@@ -24,8 +24,6 @@ ...@@ -24,8 +24,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#import "fspanel.h"
/***************************************************************************** /*****************************************************************************
* VLCControls interface * VLCControls interface
*****************************************************************************/ *****************************************************************************/
...@@ -41,8 +39,6 @@ ...@@ -41,8 +39,6 @@
IBOutlet id o_specificTime_sec_lbl; IBOutlet id o_specificTime_sec_lbl;
IBOutlet id o_specificTime_stepper; IBOutlet id o_specificTime_stepper;
IBOutlet id o_specificTime_mi; IBOutlet id o_specificTime_mi;
IBOutlet VLCFSPanel *o_fs_panel;
} }
- (IBAction)play:(id)sender; - (IBAction)play:(id)sender;
- (IBAction)stop:(id)sender; - (IBAction)stop:(id)sender;
...@@ -73,7 +69,5 @@ ...@@ -73,7 +69,5 @@
- (void)scrollWheel: (NSEvent *)theEvent; - (void)scrollWheel: (NSEvent *)theEvent;
- (IBAction)goToSpecificTime:(id)sender; - (IBAction)goToSpecificTime:(id)sender;
- (id)fspanel;
@end @end
...@@ -46,13 +46,6 @@ ...@@ -46,13 +46,6 @@
*****************************************************************************/ *****************************************************************************/
@implementation VLCControls @implementation VLCControls
- (id)init
{
[super init];
o_fs_panel = [[VLCFSPanel alloc] init];
return self;
}
- (void)awakeFromNib - (void)awakeFromNib
{ {
[o_specificTime_mi setTitle: _NS("Jump To Time")]; [o_specificTime_mi setTitle: _NS("Jump To Time")];
...@@ -268,17 +261,6 @@ ...@@ -268,17 +261,6 @@
} }
} }
- (id)fspanel
{
if( o_fs_panel )
return o_fs_panel;
else
{
msg_Err( VLCIntf, "FSPanel is nil" );
return NULL;
}
}
- (void)scrollWheel:(NSEvent *)theEvent - (void)scrollWheel:(NSEvent *)theEvent
{ {
intf_thread_t * p_intf = VLCIntf; intf_thread_t * p_intf = VLCIntf;
......
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
#import "intf.h" #import "intf.h"
#import "MainMenu.h" #import "MainMenu.h"
#import "MainWindow.h" #import "MainWindow.h"
#import "fspanel.h"
#import "vout.h" #import "vout.h"
#import "prefs.h" #import "prefs.h"
#import "playlist.h" #import "playlist.h"
...@@ -362,7 +361,7 @@ static int ShowController( vlc_object_t *p_this, const char *psz_variable, ...@@ -362,7 +361,7 @@ static int ShowController( vlc_object_t *p_this, const char *psz_variable,
intf_thread_t * p_intf = VLCIntf; intf_thread_t * p_intf = VLCIntf;
if( p_intf && p_intf->p_sys ) if( p_intf && p_intf->p_sys )
{ {
NSLog( @"fixme! we should implement ShowController here" ); // [[[VLCMain sharedInstance] fspanel] makeKeyAndOrderFront: nil];
} }
return VLC_SUCCESS; return VLC_SUCCESS;
} }
...@@ -507,8 +506,6 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -507,8 +506,6 @@ static VLCMain *_o_sharedMainInstance = nil;
o_msg_lock = [[NSLock alloc] init]; o_msg_lock = [[NSLock alloc] init];
o_msg_arr = [[NSMutableArray arrayWithCapacity: 600] retain]; o_msg_arr = [[NSMutableArray arrayWithCapacity: 600] retain];
/* subscribe to LibVLC's debug messages as early as possible (for us) */
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(libvlcMessageReceived:) name: @"VLCCoreMessageReceived" object: nil];
o_open = [[VLCOpen alloc] init]; o_open = [[VLCOpen alloc] init];
//o_embedded_list = [[VLCEmbeddedList alloc] init]; //o_embedded_list = [[VLCEmbeddedList alloc] init];
...@@ -1308,7 +1305,6 @@ unsigned int CocoaKeyToVLC( unichar i_key ) ...@@ -1308,7 +1305,6 @@ unsigned int CocoaKeyToVLC( unichar i_key )
int state = var_GetInteger( p_input, "state" ); int state = var_GetInteger( p_input, "state" );
if( state == PLAYING_S ) if( state == PLAYING_S )
{ {
[[[self controls] fspanel] setPause];
[[self mainMenu] setPause]; [[self mainMenu] setPause];
[o_mainwindow setPause]; [o_mainwindow setPause];
} }
...@@ -1316,7 +1312,6 @@ unsigned int CocoaKeyToVLC( unichar i_key ) ...@@ -1316,7 +1312,6 @@ unsigned int CocoaKeyToVLC( unichar i_key )
{ {
if (state == END_S) if (state == END_S)
[o_mainmenu setSubmenusEnabled: FALSE]; [o_mainmenu setSubmenusEnabled: FALSE];
[[[self controls] fspanel] setPlay];
[[self mainMenu] setPlay]; [[self mainMenu] setPlay];
[o_mainwindow setPlay]; [o_mainwindow setPlay];
} }
......
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