Commit f41e6533 authored by Daksh Shah's avatar Daksh Shah

Working cleaner

parent 62ec62cb
...@@ -399,8 +399,8 @@ static NSString *kAssociatedFullscreenRect = @"VLCFullscreenAssociatedWindowRect ...@@ -399,8 +399,8 @@ static NSString *kAssociatedFullscreenRect = @"VLCFullscreenAssociatedWindowRect
return; return;
/* Get timeout and make sure it is not lower than 1 second */ /* Get timeout and make sure it is not lower than 1 second */
long long _timeToKeepVisibleInSec = MAX(var_CreateGetInteger(getIntf(), "mouse-hide-timeout") / 1000, 1);
long long _timeToKeepVisibleInSec = MAX(var_CreateGetInteger(getIntf(), "mouse-hide-timeout") / 1000, 1);
_hideTimer = [NSTimer scheduledTimerWithTimeInterval:_timeToKeepVisibleInSec _hideTimer = [NSTimer scheduledTimerWithTimeInterval:_timeToKeepVisibleInSec
target:self target:self
selector:@selector(autohideCallback:) selector:@selector(autohideCallback:)
......
...@@ -1286,6 +1286,7 @@ ...@@ -1286,6 +1286,7 @@
- (IBAction)showLicense:(id)sender - (IBAction)showLicense:(id)sender
{ {
[[VLCMain sharedInstance] showFullscreenController];
if (!_aboutWindowController) if (!_aboutWindowController)
_aboutWindowController = [[VLCAboutWindowController alloc] init]; _aboutWindowController = [[VLCAboutWindowController alloc] init];
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
@class VLCDetachedVideoWindow; @class VLCDetachedVideoWindow;
@class VLCMainWindowControlsBar; @class VLCMainWindowControlsBar;
@class VLCFSPanelController;
@class VLCVoutView; @class VLCVoutView;
@class PXSourceList; @class PXSourceList;
...@@ -92,6 +93,7 @@ typedef enum { ...@@ -92,6 +93,7 @@ typedef enum {
@property (readwrite) BOOL nonembedded; @property (readwrite) BOOL nonembedded;
@property (readonly) VLCFSPanelController* fspanel; @property (readonly) VLCFSPanelController* fspanel;
//@property (readonly) VLCFSPanelController* draggablewvpanel;
- (void)changePlaylistState:(VLCPlaylistStateEvent)event; - (void)changePlaylistState:(VLCPlaylistStateEvent)event;
......
...@@ -215,8 +215,12 @@ static const float f_min_window_height = 307.; ...@@ -215,8 +215,12 @@ static const float f_min_window_height = 307.;
// Set that here as IB seems to be buggy // Set that here as IB seems to be buggy
[self setContentMinSize:NSMakeSize(604., f_min_window_height)]; [self setContentMinSize:NSMakeSize(604., f_min_window_height)];
_fspanel = [[VLCFSPanelController alloc] init]; // _fspanel = [[VLCFSPanelController alloc] init];
[_fspanel showWindow:self]; // [_fspanel showWindow:self];
// MAYBE HAVE A LOOK
// _draggablewvpanel = [[VLCFSPanelController alloc] init];
// [_draggablewvpanel showWindow:self];
/* make sure we display the desired default appearance when VLC launches for the first time */ /* make sure we display the desired default appearance when VLC launches for the first time */
if (![defaults objectForKey:@"VLCFirstRun"]) { if (![defaults objectForKey:@"VLCFirstRun"]) {
...@@ -371,7 +375,7 @@ static const float f_min_window_height = 307.; ...@@ -371,7 +375,7 @@ static const float f_min_window_height = 307.;
} }
// Show split view and hide the video view // Show split view and hide the video view
- (void)makeSplitViewVisible - (void)makeSplitViewVisible//making the playlist view visible
{ {
[self setContentMinSize: NSMakeSize(604., f_min_window_height)]; [self setContentMinSize: NSMakeSize(604., f_min_window_height)];
...@@ -389,7 +393,8 @@ static const float f_min_window_height = 307.; ...@@ -389,7 +393,8 @@ static const float f_min_window_height = 307.;
[_splitView setHidden:NO]; [_splitView setHidden:NO];
if (self.nativeFullscreenMode && [self fullscreen]) { if (self.nativeFullscreenMode && [self fullscreen]) {
[self showControlsBar]; [self showControlsBar];
[self.fspanel setNonActive]; [self showFullscreenController];
// [self.fspanel setNonActive];
} }
[self makeFirstResponder:_playlistScrollView]; [self makeFirstResponder:_playlistScrollView];
...@@ -402,10 +407,10 @@ static const float f_min_window_height = 307.; ...@@ -402,10 +407,10 @@ static const float f_min_window_height = 307.;
[_splitView setHidden:YES]; [_splitView setHidden:YES];
[self.videoView setHidden:NO]; [self.videoView setHidden:NO];
if (self.nativeFullscreenMode && [self fullscreen]) { // if (self.nativeFullscreenMode && [self fullscreen]) {
[self hideControlsBar]; // [self hideControlsBar];
[self.fspanel setActive]; // [self.fspanel setActive];
} // }
if ([[self.videoView subviews] count] > 0) if ([[self.videoView subviews] count] > 0)
[self makeFirstResponder: [[self.videoView subviews] firstObject]]; [self makeFirstResponder: [[self.videoView subviews] firstObject]];
...@@ -470,6 +475,7 @@ static const float f_min_window_height = 307.; ...@@ -470,6 +475,7 @@ static const float f_min_window_height = 307.;
[_playlistScrollView setHidden: NO]; [_playlistScrollView setHidden: NO];
[self.videoView setHidden: YES]; [self.videoView setHidden: YES];
[self showControlsBar]; [self showControlsBar];
[self showFullscreenController];
} }
} }
...@@ -570,7 +576,11 @@ static const float f_min_window_height = 307.; ...@@ -570,7 +576,11 @@ static const float f_min_window_height = 307.;
- (void)updateTimeSlider - (void)updateTimeSlider
{ {
[self.controlsBar updateTimeSlider]; [self.controlsBar updateTimeSlider];
[self.fspanel updatePositionAndTime]; // [self.fspanel updatePositionAndTime];
// msg_Err(getIntf(), "DAX WAS HERE #5 updateTimeSlider");
// [[[[VLCMain sharedInstance] voutProvider] fspanel] updatePositionAndTime];
// [self.draggablewvpanel updatePositionAndTime];
[self.draggableVideoController updatePositionAndTime];
[[[VLCMain sharedInstance] voutProvider] updateControlsBarsUsingBlock:^(VLCControlsBarCommon *controlsBar) { [[[VLCMain sharedInstance] voutProvider] updateControlsBarsUsingBlock:^(VLCControlsBarCommon *controlsBar) {
[controlsBar updateTimeSlider]; [controlsBar updateTimeSlider];
...@@ -626,7 +636,12 @@ static const float f_min_window_height = 307.; ...@@ -626,7 +636,12 @@ static const float f_min_window_height = 307.;
[o_window setTitle:aString]; [o_window setTitle:aString];
}]; }];
[self.fspanel setStreamTitle: aString]; // [self.fspanel setStreamTitle: aString];
// msg_Err(getIntf(), "DAX WAS HERE #6 setStreamTitle");
// [[[[VLCMain sharedInstance] voutProvider] fspanel] setStreamTitle: aString];
// [self.draggablewvpanel setStreamTitle: aString];
[self.draggableVideoController setStreamTitle: aString];
} else { } else {
[self setTitle: _NS("VLC media player")]; [self setTitle: _NS("VLC media player")];
[self setRepresentedURL: nil]; [self setRepresentedURL: nil];
...@@ -658,8 +673,18 @@ static const float f_min_window_height = 307.; ...@@ -658,8 +673,18 @@ static const float f_min_window_height = 307.;
} }
[self updateTimeSlider]; [self updateTimeSlider];
if ([self.fspanel respondsToSelector:@selector(setSeekable:)]) // if ([self.fspanel respondsToSelector:@selector(setSeekable:)])
[self.fspanel setSeekable: b_seekable]; // [self.fspanel setSeekable: b_seekable];
// if ([self.draggablewvpanel respondsToSelector:@selector(setSeekable:)])
// [self.draggablewvpanel setSeekable: b_seekable];
if ([self.draggableVideoController respondsToSelector:@selector(setSeekable:)])
[self.draggableVideoController setSeekable: b_seekable];
// msg_Err(getIntf(), "DAX WAS HERE #7 setSeekable");
// if ([ [ [[VLCMain sharedInstance] voutProvider] fspanel] respondsToSelector:@selector(setSeekable:) ])
// [[[[VLCMain sharedInstance] voutProvider] fspanel] setSeekable: b_seekable];
PL_LOCK; PL_LOCK;
if ([[[[VLCMain sharedInstance] playlist] model] currentRootType] != ROOT_TYPE_PLAYLIST || if ([[[[VLCMain sharedInstance] playlist] model] currentRootType] != ROOT_TYPE_PLAYLIST ||
...@@ -676,7 +701,12 @@ static const float f_min_window_height = 307.; ...@@ -676,7 +701,12 @@ static const float f_min_window_height = 307.;
- (void)setPause - (void)setPause
{ {
[self.controlsBar setPause]; [self.controlsBar setPause];
[self.fspanel setPause]; // [self.fspanel setPause];
// msg_Err(getIntf(), "DAX WAS HERE #8");
// [[[[VLCMain sharedInstance] voutProvider] fspanel] setPause];
// [self.draggablewvpanel setPause];
[self.draggableVideoController setPause];
[[[VLCMain sharedInstance] voutProvider] updateControlsBarsUsingBlock:^(VLCControlsBarCommon *controlsBar) { [[[VLCMain sharedInstance] voutProvider] updateControlsBarsUsingBlock:^(VLCControlsBarCommon *controlsBar) {
[controlsBar setPause]; [controlsBar setPause];
...@@ -686,7 +716,14 @@ static const float f_min_window_height = 307.; ...@@ -686,7 +716,14 @@ static const float f_min_window_height = 307.;
- (void)setPlay - (void)setPlay
{ {
[self.controlsBar setPlay]; [self.controlsBar setPlay];
[self.fspanel setPlay];
// [self.draggablewvpanel setPlay];
[self.draggableVideoController setPlay];
// [self.fspanel setPlay];
// [[[[VLCMain sharedInstance] voutProvider] fspanel] setPlay];
// msg_Err(getIntf(), "DAX WAS HERE #9");
[[[VLCMain sharedInstance] voutProvider] updateControlsBarsUsingBlock:^(VLCControlsBarCommon *controlsBar) { [[[VLCMain sharedInstance] voutProvider] updateControlsBarsUsingBlock:^(VLCControlsBarCommon *controlsBar) {
[controlsBar setPlay]; [controlsBar setPlay];
...@@ -696,7 +733,14 @@ static const float f_min_window_height = 307.; ...@@ -696,7 +733,14 @@ static const float f_min_window_height = 307.;
- (void)updateVolumeSlider - (void)updateVolumeSlider
{ {
[(VLCMainWindowControlsBar *)[self controlsBar] updateVolumeSlider]; [(VLCMainWindowControlsBar *)[self controlsBar] updateVolumeSlider];
[self.fspanel setVolumeLevel:[[VLCCoreInteraction sharedInstance] volume]]; // [self.fspanel setVolumeLevel:[[VLCCoreInteraction sharedInstance] volume]];
// [self.draggablewvpanel setVolumeLevel:[[VLCCoreInteraction sharedInstance] volume]];
[self.draggableVideoController setVolumeLevel:[[VLCCoreInteraction sharedInstance] volume]];
// msg_Err(getIntf(), "DAX WAS HERE #10 updateVolumeSlider");
// [[[[VLCMain sharedInstance] voutProvider] fspanel] setVolumeLevel:[[VLCCoreInteraction sharedInstance] volume] ];
} }
#pragma mark - #pragma mark -
...@@ -741,15 +785,16 @@ static const float f_min_window_height = 307.; ...@@ -741,15 +785,16 @@ static const float f_min_window_height = 307.;
[self setAlphaValue:1.0]; [self setAlphaValue:1.0];
} }
if (self.nativeFullscreenMode) { // if (self.nativeFullscreenMode) {
if ([self hasActiveVideo] && [self fullscreen] && b_videoPlayback) { // if ([self hasActiveVideo] && [self fullscreen] && b_videoPlayback) {
[self hideControlsBar]; // [self hideControlsBar];
[self.fspanel setActive]; // [self.fspanel setActive];
} else { // } else {
[self showControlsBar]; // [self showControlsBar];
[self.fspanel setNonActive]; // [self.fspanel setNonActive];
} // }
} // }
} }
#pragma mark - #pragma mark -
...@@ -761,8 +806,14 @@ static const float f_min_window_height = 307.; ...@@ -761,8 +806,14 @@ static const float f_min_window_height = 307.;
if ([currentWindow respondsToSelector:@selector(hasActiveVideo)] && [currentWindow hasActiveVideo]) { if ([currentWindow respondsToSelector:@selector(hasActiveVideo)] && [currentWindow hasActiveVideo]) {
if ([currentWindow respondsToSelector:@selector(fullscreen)] && [currentWindow fullscreen] && ![[currentWindow videoView] isHidden]) { if ([currentWindow respondsToSelector:@selector(fullscreen)] && [currentWindow fullscreen] && ![[currentWindow videoView] isHidden]) {
if ([[VLCMain sharedInstance] activeVideoPlayback]) // if ([[VLCMain sharedInstance] activeVideoPlayback])
[self.fspanel fadeIn]; // [self.showDraggableVideoController];
if ([[VLCMain sharedInstance] activeVideoPlayback])
[self showFullscreenController];
// if ([[VLCMain sharedInstance] activeVideoPlayback])
// [self.fspanel fadeIn];
} }
} }
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
#import <vlc_vout_window.h> #import <vlc_vout_window.h>
#import "VLCKeyboardBacklightControl.h" #import "VLCKeyboardBacklightControl.h"
#import "VLCFSPanelController.h"
@class VLCControlsBarCommon; @class VLCControlsBarCommon;
@class VLCVideoWindowCommon; @class VLCVideoWindowCommon;
@class VLCVoutView; @class VLCVoutView;
...@@ -34,6 +36,7 @@ ...@@ -34,6 +36,7 @@
@interface VLCVideoOutputProvider : NSObject @interface VLCVideoOutputProvider : NSObject
@property (readonly, nonatomic) NSInteger currentStatusWindowLevel; @property (readonly, nonatomic) NSInteger currentStatusWindowLevel;
@property (readonly) VLCFSPanelController* fspanel;
- (VLCVoutView *)setupVoutForWindow:(vout_window_t *)p_wnd withProposedVideoViewPosition:(NSRect)videoViewPosition; - (VLCVoutView *)setupVoutForWindow:(vout_window_t *)p_wnd withProposedVideoViewPosition:(NSRect)videoViewPosition;
- (void)removeVoutForDisplay:(NSValue *)o_key; - (void)removeVoutForDisplay:(NSValue *)o_key;
......
...@@ -311,6 +311,8 @@ void WindowClose(vout_window_t *p_wnd) ...@@ -311,6 +311,8 @@ void WindowClose(vout_window_t *p_wnd)
voutView = [newVideoWindow videoView]; voutView = [newVideoWindow videoView];
mainWindowHasVideo = YES; mainWindowHasVideo = YES;
isEmbedded = YES; isEmbedded = YES;
// _fspanel = [[VLCFSPanelController alloc] init];
// [_fspanel showWindow:self];
} else { } else {
// setup detached window with controls // setup detached window with controls
NSWindowController *o_controller = [[NSWindowController alloc] initWithWindowNibName:@"DetachedVideoWindow"]; NSWindowController *o_controller = [[NSWindowController alloc] initWithWindowNibName:@"DetachedVideoWindow"];
...@@ -325,6 +327,8 @@ void WindowClose(vout_window_t *p_wnd) ...@@ -325,6 +327,8 @@ void WindowClose(vout_window_t *p_wnd)
[newVideoWindow setLevel:NSNormalWindowLevel]; [newVideoWindow setLevel:NSNormalWindowLevel];
voutView = [newVideoWindow videoView]; voutView = [newVideoWindow videoView];
isEmbedded = NO; isEmbedded = NO;
// _fspanel = [[VLCFSPanelController alloc] init];
// [_fspanel showWindow:self];
} }
} }
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
@class VLCControlsBarCommon; @class VLCControlsBarCommon;
@class VLCFSPanelController;
static const float f_min_video_height = 70.0; static const float f_min_video_height = 70.0;
/***************************************************************************** /*****************************************************************************
...@@ -43,6 +45,7 @@ static const float f_min_video_height = 70.0; ...@@ -43,6 +45,7 @@ static const float f_min_video_height = 70.0;
@property (nonatomic, weak) IBOutlet VLCVoutView* videoView; @property (nonatomic, weak) IBOutlet VLCVoutView* videoView;
@property (nonatomic, weak) IBOutlet VLCControlsBarCommon* controlsBar; @property (nonatomic, weak) IBOutlet VLCControlsBarCommon* controlsBar;
@property (nonatomic, weak) IBOutlet VLCFSPanelController* draggableVideoController; //not sure why is it an IBOutlet, but so is controlsBar
@property (readonly) BOOL inFullscreenTransition; @property (readonly) BOOL inFullscreenTransition;
@property (readonly) BOOL windowShouldExitFullscreenWhenFinished; @property (readonly) BOOL windowShouldExitFullscreenWhenFinished;
@property (readwrite, assign) NSRect previousSavedFrame; @property (readwrite, assign) NSRect previousSavedFrame;
......
...@@ -372,6 +372,16 @@ ...@@ -372,6 +372,16 @@
self.videoViewBottomConstraint.priority = 999; self.videoViewBottomConstraint.priority = 999;
} }
- (void) hideDraggableVideoController
{
[self.draggableVideoController fadeOut];
}
- (void) showDraggableVideoController
{
[self.draggableVideoController fadeIn];
}
- (void)becomeKeyWindow - (void)becomeKeyWindow
{ {
[super becomeKeyWindow]; [super becomeKeyWindow];
...@@ -458,6 +468,7 @@ ...@@ -458,6 +468,7 @@
if (![_videoView isHidden]) { if (![_videoView isHidden]) {
[self hideControlsBar]; [self hideControlsBar];
[self hideDraggableVideoController];
} }
[self setMovableByWindowBackground: NO]; [self setMovableByWindowBackground: NO];
...@@ -507,6 +518,7 @@ ...@@ -507,6 +518,7 @@
if (![_videoView isHidden]) { if (![_videoView isHidden]) {
[self showControlsBar]; [self showControlsBar];
[self showDraggableVideoController];
} }
[self setMovableByWindowBackground: YES]; [self setMovableByWindowBackground: YES];
......
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