Commit 6f54a530 authored by Felix Paul Kühne's avatar Felix Paul Kühne

* New Fullscreen controller panel

- basically written by Jerome Decoodt <djc at videolan dot org> aka DiDjCodt
plus
- various patches, coding-style fixes, etc. here and there
- integration to VLCControls
- automagic fading-in and -out when in fullscreen mode

TODO:
- get and use native graphics. These are currently being prepared by Simon Damkjaer Andersen, who already donated new playback mode icons (to be committed soon)
- implement the volume slider
- fix seeking with the time slider
- check for memory leaks
- further clean-up

ATTENTION:
for the moment, you need certain images from Jerome's patch to get this running. Put them to extras/MacOSX/Resources/ and it'll work. Otherwise, VLC won't crash, but only show strings.
parent 277e9ab5
......@@ -33,6 +33,7 @@
CLASS = VLCControls;
LANGUAGE = ObjC;
OUTLETS = {
"o_fs_panel" = id;
"o_main" = id;
"o_specificTime_cancel_btn" = id;
"o_specificTime_enter_fld" = id;
......@@ -98,6 +99,14 @@
};
SUPERCLASS = NSObject;
},
{CLASS = VLCFSPanel; LANGUAGE = ObjC; SUPERCLASS = NSWindow; },
{
ACTIONS = {faster = id; next = id; play = id; prev = id; slower = id; };
CLASS = VLCFSPanelView;
LANGUAGE = ObjC;
SUPERCLASS = NSView;
},
{CLASS = VLCFSTimeSlider; LANGUAGE = ObjC; SUPERCLASS = NSSlider; },
{
ACTIONS = {
createOutlineGroup = id;
......
......@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>361 41 478 430 0 0 1440 878 </string>
<string>443 64 478 430 0 0 1440 878 </string>
<key>IBEditorPositions</key>
<dict>
<key>1617</key>
......@@ -25,11 +25,12 @@
<array/>
<key>IBOpenObjects</key>
<array>
<integer>2416</integer>
<integer>29</integer>
<integer>21</integer>
<integer>2730</integer>
<integer>2197</integer>
<integer>2416</integer>
<integer>2730</integer>
<integer>29</integer>
<integer>2769</integer>
</array>
<key>IBSystem Version</key>
<string>8J135</string>
......
This diff is collapsed.
......@@ -42,6 +42,8 @@ SOURCES_macosx = \
sfilters.m \
embeddedwindow.h \
embeddedwindow.m \
fspanel.m \
fspanel.h \
update.h \
update.m \
$(NULL)
......
......@@ -23,6 +23,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#import "fspanel.h"
/*****************************************************************************
* VLCControls interface
*****************************************************************************/
......@@ -41,6 +43,8 @@
IBOutlet id o_specificTime_sec_lbl;
IBOutlet id o_specificTime_stepper;
IBOutlet id o_specificTime_mi;
VLCFSPanel *o_fs_panel;
}
- (IBAction)play:(id)sender;
......@@ -79,6 +83,8 @@
- (IBAction)goToSpecificTime:(id)sender;
- (id)getFSPanel;
@end
/*****************************************************************************
......
......@@ -32,6 +32,7 @@
#include <string.h>
#include "intf.h"
#include "fspanel.h"
#include "vout.h"
#include "open.h"
#include "controls.h"
......@@ -43,6 +44,13 @@
*****************************************************************************/
@implementation VLCControls
- (id)init
{
[super init];
o_fs_panel = [[VLCFSPanel alloc] init];
return self;
}
- (void)awakeFromNib
{
[o_specificTime_mi setTitle: _NS("Jump To Time")];
......@@ -670,6 +678,17 @@
}
}
- (id)getFSPanel
{
if( o_fs_panel )
return o_fs_panel;
else
{
msg_Err( VLCIntf, "FSPanel is nil" );
return NULL;
}
}
@end
@implementation VLCControls (NSMenuValidation)
......
......@@ -26,6 +26,7 @@
*****************************************************************************/
#include "intf.h"
#include "fspanel.h"
#include "vout.h"
#include "embeddedwindow.h"
......
/*****************************************************************************
* fspanel.h: MacOS X full screen panel
*****************************************************************************
* Copyright (C) 2006 the VideoLAN team
* $Id$
*
* Authors: Jrme Decoodt <djc at videolan dot org>
* Felix Khne <fkuehne at videolan dot org>
*
* 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.
*****************************************************************************/
@interface VLCFSPanel : NSWindow
{
NSTimer *fadeTimer,*hideAgainTimer;
NSPoint mouseClic;
BOOL b_fadeQueued;
BOOL b_keptVisible;
BOOL b_alreadyCounting;
int i_timeToKeepVisibleInSec;
}
- (id)initWithContentRect: (NSRect)contentRect
styleMask: (unsigned int)aStyle
backing: (NSBackingStoreType)bufferingType
defer: (BOOL)flag;
- (void)awakeFromNib;
- (BOOL)canBecomeKeyWindow;
- (void)dealloc;
- (void)setPlay;
- (void)setPause;
- (void)setStreamTitle:(NSString *)o_title;
- (void)setStreamPos:(float) f_pos setSeconds:(int)i_seconds;
- (void)focus:(NSTimer *)timer;
- (void)unfocus:(NSTimer *)timer;
- (void)mouseEntered:(NSEvent *)theEvent;
- (void)mouseExited:(NSEvent *)theEvent;
- (void)fadeIn;
- (void)fadeOut;
- (NSTimer *)fadeTimer;
- (void)setFadeTimer:(NSTimer *)timer;
- (void)autoHide;
- (void)keepVisible:(NSTimer *)timer;
- (void)mouseDown:(NSEvent *)theEvent;
- (void)mouseDragged:(NSEvent *)theEvent;
@end
@interface VLCFSPanelView : NSView
{
NSColor *fillColor;
NSButton *o_prev, *o_next, *o_slow, *o_fast, *o_play, *o_fullscreen;
NSTextField *o_textfield, *o_textPos;
NSSlider *o_time_slider;
}
- (id)initWithFrame:(NSRect)frameRect;
- (void)drawRect:(NSRect)rect;
- (void) setPlay;
- (void) setPause;
- (void) setStreamTitle: (NSString *)o_title;
- (void) setStreamPos:(float) f_pos setSeconds:(int)i_seconds;
- (IBAction)play:(id)sender;
- (IBAction)prev:(id)sender;
- (IBAction)next:(id)sender;
- (IBAction)faster:(id)sender;
- (IBAction)slower:(id)sender;
@end
@interface VLCFSTimeSlider : NSSlider
{}
void drawKnobInRect(NSRect knobRect);
void drawFrameInRect(NSRect frameRect);
- (void)drawRect:(NSRect)rect;
@end
This diff is collapsed.
......@@ -146,6 +146,7 @@ struct intf_sys_t
IBOutlet id o_msgs_btn_crashlog; /* messages open crashlog */
IBOutlet id o_info_window; /* Info panel */
IBOutlet id o_fs_panel; /* Full screen panel*/
/* main menu */
......
......@@ -32,21 +32,22 @@
#include <string.h>
#include <vlc_keys.h>
#include "intf.h"
#include "vout.h"
#include "prefs.h"
#include "playlist.h"
#include "controls.h"
#include "about.h"
#include "open.h"
#include "wizard.h"
#include "extended.h"
#include "bookmarks.h"
#include "sfilters.h"
#include "interaction.h"
#include "embeddedwindow.h"
#include "update.h"
#include "AppleRemote.h"
#import "intf.h"
#import "fspanel.h"
#import "vout.h"
#import "prefs.h"
#import "playlist.h"
#import "controls.h"
#import "about.h"
#import "open.h"
#import "wizard.h"
#import "extended.h"
#import "bookmarks.h"
#import "sfilters.h"
#import "interaction.h"
#import "embeddedwindow.h"
#import "update.h"
#import "AppleRemote.h"
/*****************************************************************************
* Local prototypes.
......@@ -479,6 +480,9 @@ static VLCMain *_o_sharedMainInstance = nil;
var_AddCallback( p_intf, "interaction", InteractCallback, self );
p_intf->b_interaction = VLC_TRUE;
// First we setup the blue selection box - another window that will be attached as a child window
// to this one, and will be moved by timers as needed.
nib_main_loaded = TRUE;
}
......@@ -1064,6 +1068,7 @@ static VLCMain *_o_sharedMainInstance = nil;
[o_timeslider setFloatValue: 0.0];
[o_timeslider setEnabled: b_seekable];
[o_timefield setStringValue: @"0:00:00"];
[[[self getControls] getFSPanel] setStreamPos: 0 setSeconds: 0];
[o_embedded_window setSeekable: b_seekable];
......@@ -1120,6 +1125,7 @@ static VLCMain *_o_sharedMainInstance = nil;
o_temp = [NSString stringWithCString:
p_playlist->status.p_item->p_input->psz_name];
[self setScrollField: o_temp stopAfter:-1];
[[[self getControls] getFSPanel] setStreamTitle: o_temp];
p_vout = vlc_object_find( p_intf->p_sys->p_input, VLC_OBJECT_VOUT,
FIND_PARENT );
......@@ -1166,6 +1172,7 @@ static VLCMain *_o_sharedMainInstance = nil;
(int) (i_seconds / 60 % 60),
(int) (i_seconds % 60)];
[o_timefield setStringValue: o_time];
[[[self getControls] getFSPanel] setStreamPos: pos.f_float setSeconds: i_seconds];
[o_embedded_window setTime: o_time position: f_updated];
}
......@@ -1389,6 +1396,7 @@ static VLCMain *_o_sharedMainInstance = nil;
{
if( i_status == PLAYING_S )
{
[[[self getControls] getFSPanel] setPause];
[o_btn_play setImage: o_img_pause];
[o_btn_play setAlternateImage: o_img_pause_pressed];
[o_btn_play setToolTip: _NS("Pause")];
......@@ -1398,6 +1406,7 @@ static VLCMain *_o_sharedMainInstance = nil;
}
else
{
[[[self getControls] getFSPanel] setPlay];
[o_btn_play setImage: o_img_play];
[o_btn_play setAlternateImage: o_img_play_pressed];
[o_btn_play setToolTip: _NS("Play")];
......@@ -1473,6 +1482,7 @@ static VLCMain *_o_sharedMainInstance = nil;
(int) (i_seconds / 60 % 60),
(int) (i_seconds % 60)];
[o_timefield setStringValue: o_time];
[[[self getControls] getFSPanel] setStreamPos: pos.f_float setSeconds: i_seconds];
[o_embedded_window setTime: o_time position: f_updated];
}
#undef p_input
......
......@@ -40,7 +40,9 @@
#include <vlc_keys.h>
#include "intf.h"
#include "fspanel.h"
#include "vout.h"
#import "controls.h"
/*****************************************************************************
* DeviceCallback: Callback triggered when the video-device variable is changed
......@@ -377,6 +379,10 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
var_Get( p_real_vout, "fullscreen", &val );
val.b_bool = !val.b_bool;
var_Set( p_real_vout, "fullscreen", val );
if( [self isFullscreen] )
[[[[VLCMain sharedInstance] getControls] getFSPanel] orderFront: self];
else
[[[[VLCMain sharedInstance] getControls] getFSPanel] orderOut: self];
}
- (BOOL)isFullscreen
......@@ -609,6 +615,8 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
val.b_bool = VLC_TRUE;
var_Set( p_vout, "mouse-moved", val );
}
if( [self isFullscreen] )
[[[[VLCMain sharedInstance] getControls] getFSPanel] fadeIn];
}
[super mouseMoved: o_event];
......@@ -943,7 +951,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
styleMask: NSBorderlessWindowMask
backing: NSBackingStoreBuffered
defer: YES screen: o_screen];
if( var_GetBool( p_real_vout, "macosx-black" ) )
if( b_black == VLC_TRUE )
{
......
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