...
 
Commits (1)
  • Daksh Shah's avatar
    Issue 1 and 3 combined · de743a1c
    Daksh Shah authored
    * Currently it only works when video is played IN the mainWindow
    * [[VLCMain sharedInstance] mainWindow].titlebarAppearsTransparent = true; this lines makes the background of titleBar (white->transparent)
    * self.styleMask |= NSFullSizeContentViewWindowMask; is responsible to make the titleBar be inside the window than a seperate bar
    * Replaced [[VLCMain sharedInstance] mainWindow] by self in VLCMainWindow.m
    * [[[[self standardWindowButton:NSWindowCloseButton] superview] animator] setAlphaValue:1]; apparently does not work in VLCMainWindow to get the title to come back when playlist/ML is displayed. Instead of `self` [[VLCMain sharedInstance] mainWindow] solves the problem.... I am not sure why though. Can someone please explain?
    * Referred to https://github.com/etoile/EtoileUI/blob/master/Source/NSWindow%2BEtoile.m#L20 for the normal titleBar style
    * Now the controlsBar is shown in Playlist/ML view but hides during videoPlayback
    de743a1c
......@@ -63,6 +63,7 @@
- (void)setActive;
- (void)setNonActive;
- (void)setVoutWasUpdated:(VLCWindow *)voutWindow;
- (void)centerPanel; //Have to find a better alternative than to centering each time on resize/drag
- (void)setSeekable:(BOOL)seekable;
- (void)setVolumeLevel:(int)value;
......
......@@ -420,6 +420,7 @@ static NSString *kAssociatedFullscreenRect = @"VLCFullscreenAssociatedWindowRect
if (!NSMouseInRect([NSEvent mouseLocation], [self.window frame], NO)) {
[self fadeOut];
[self hideMouse];
[[[[[[VLCMain sharedInstance] mainWindow] standardWindowButton:NSWindowCloseButton] superview] animator] setAlphaValue:0];
}
_isCounting = NO;
}
......
......@@ -34,10 +34,12 @@
- (void)mouseDown:(NSEvent *)event
{
NSLog(@"mouseDown"); //Debug-Statement
NSWindow *window = [self window];
NSRect mouseLocationInWindow = {[event locationInWindow], {0,0}};
NSPoint originalMouseLocation = [window convertRectToScreen:mouseLocationInWindow].origin;
NSRect originalFrame = [window frame];
NSLog(@"%f",originalFrame.origin.x); //Debug-Statement
while (YES)
{
......
......@@ -92,6 +92,7 @@ typedef enum {
@property (readwrite) BOOL nonembedded;
@property (readonly) VLCFSPanelController* fspanel;
@property (readonly) VLCFSPanelController* draggablewvpanel;
- (void)changePlaylistState:(VLCPlaylistStateEvent)event;
......
......@@ -215,8 +215,9 @@ static const float f_min_window_height = 307.;
// Set that here as IB seems to be buggy
[self setContentMinSize:NSMakeSize(604., f_min_window_height)];
_fspanel = [[VLCFSPanelController alloc] init];
[_fspanel showWindow:self];
_draggablewvpanel = [[VLCFSPanelController alloc] init];
[_draggablewvpanel showWindow:self];
[[self draggablewvpanel] setVoutWasUpdated:self];
/* make sure we display the desired default appearance when VLC launches for the first time */
if (![defaults objectForKey:@"VLCFirstRun"]) {
......@@ -371,7 +372,7 @@ static const float f_min_window_height = 307.;
}
// 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)];
......@@ -389,7 +390,7 @@ static const float f_min_window_height = 307.;
[_splitView setHidden:NO];
if (self.nativeFullscreenMode && [self fullscreen]) {
[self showControlsBar];
[self.fspanel setNonActive];
// [self.fspanel setNonActive];
}
[self makeFirstResponder:_playlistScrollView];
......@@ -402,10 +403,10 @@ static const float f_min_window_height = 307.;
[_splitView setHidden:YES];
[self.videoView setHidden:NO];
if (self.nativeFullscreenMode && [self fullscreen]) {
[self hideControlsBar];
[self.fspanel setActive];
}
// if (self.nativeFullscreenMode && [self fullscreen]) {
// [self hideControlsBar];
// [self.fspanel setActive];
// }
if ([[self.videoView subviews] count] > 0)
[self makeFirstResponder: [[self.videoView subviews] firstObject]];
......@@ -415,7 +416,7 @@ static const float f_min_window_height = 307.;
{
// Beware, this code is really ugly
msg_Dbg(getIntf(), "toggle playlist from state: removed splitview %i, minimized view %i. Event %i", b_splitview_removed, b_minimized_view, event);
msg_Err(getIntf(), "toggle playlist from state: removed splitview %i, minimized view %i. Event %i", b_splitview_removed, b_minimized_view, event);
if (![self isVisible] && event == psUserMenuEvent) {
[self makeKeyAndOrderFront: nil];
return;
......@@ -473,7 +474,7 @@ static const float f_min_window_height = 307.;
}
}
msg_Dbg(getIntf(), "toggle playlist to state: removed splitview %i, minimized view %i", b_splitview_removed, b_minimized_view);
msg_Err(getIntf(), "toggle playlist to state: removed splitview %i, minimized view %i", b_splitview_removed, b_minimized_view);
}
- (IBAction)dropzoneButtonAction:(id)sender
......@@ -484,9 +485,19 @@ static const float f_min_window_height = 307.;
#pragma mark -
#pragma mark overwritten default functionality
- (void)windowDidMove:(NSNotification *)notification{
[[self draggablewvpanel] centerPanel];
msg_Err(getIntf(),"Heyyy, I am trying #2"); //Debug-Statement
NSLog(@"%f",[self frame].origin.x); //Debug-Statement
}
- (void)windowResizedOrMoved:(NSNotification *)notification
{
[self saveFrameUsingName:[self frameAutosaveName]];
// does not work for some reason :(
// [self saveFrameUsingName:[self frameAutosaveName]];
msg_Err(getIntf(),"Heyyy, I am trying #1");
NSLog(@"%f",[self frame].origin.x); //Debug-Statement
[[self draggablewvpanel] centerPanel];
}
- (void)applicationWillTerminate:(NSNotification *)notification
......@@ -570,7 +581,8 @@ static const float f_min_window_height = 307.;
- (void)updateTimeSlider
{
[self.controlsBar updateTimeSlider];
[self.fspanel updatePositionAndTime];
// [[[[VLCMain sharedInstance] voutProvider] fspanel] updatePositionAndTime];
[self.draggablewvpanel updatePositionAndTime];
[[[VLCMain sharedInstance] voutProvider] updateControlsBarsUsingBlock:^(VLCControlsBarCommon *controlsBar) {
[controlsBar updateTimeSlider];
......@@ -626,7 +638,9 @@ static const float f_min_window_height = 307.;
[o_window setTitle:aString];
}];
[self.fspanel setStreamTitle: aString];
// [[[[VLCMain sharedInstance] voutProvider] fspanel] setStreamTitle: aString];
[self.draggablewvpanel setStreamTitle: aString];
} else {
[self setTitle: _NS("VLC media player")];
[self setRepresentedURL: nil];
......@@ -658,8 +672,10 @@ static const float f_min_window_height = 307.;
}
[self updateTimeSlider];
if ([self.fspanel respondsToSelector:@selector(setSeekable:)])
[self.fspanel setSeekable: b_seekable];
if ([self.draggablewvpanel respondsToSelector:@selector(setSeekable:)])
[self.draggablewvpanel setSeekable: b_seekable];
// if ([ [ [[VLCMain sharedInstance] voutProvider] fspanel] respondsToSelector:@selector(setSeekable:) ])
// [[[[VLCMain sharedInstance] voutProvider] fspanel] setSeekable: b_seekable];
PL_LOCK;
if ([[[[VLCMain sharedInstance] playlist] model] currentRootType] != ROOT_TYPE_PLAYLIST ||
......@@ -676,7 +692,8 @@ static const float f_min_window_height = 307.;
- (void)setPause
{
[self.controlsBar setPause];
[self.fspanel setPause];
// [[[[VLCMain sharedInstance] voutProvider] fspanel] setPause];
[self.draggablewvpanel setPause];
[[[VLCMain sharedInstance] voutProvider] updateControlsBarsUsingBlock:^(VLCControlsBarCommon *controlsBar) {
[controlsBar setPause];
......@@ -686,7 +703,8 @@ static const float f_min_window_height = 307.;
- (void)setPlay
{
[self.controlsBar setPlay];
[self.fspanel setPlay];
[self.draggablewvpanel setPlay];
// [[[[VLCMain sharedInstance] voutProvider] fspanel] setPlay];
[[[VLCMain sharedInstance] voutProvider] updateControlsBarsUsingBlock:^(VLCControlsBarCommon *controlsBar) {
[controlsBar setPlay];
......@@ -696,7 +714,11 @@ static const float f_min_window_height = 307.;
- (void)updateVolumeSlider
{
[(VLCMainWindowControlsBar *)[self controlsBar] updateVolumeSlider];
[self.fspanel setVolumeLevel:[[VLCCoreInteraction sharedInstance] volume]];
// [self.fspanel setVolumeLevel:[[VLCCoreInteraction sharedInstance] volume]];
[self.draggablewvpanel setVolumeLevel:[[VLCCoreInteraction sharedInstance] volume]];
// msg_Err(getIntf(), "DAX WAS HERE #10 updateVolumeSlider");
// [[[[VLCMain sharedInstance] voutProvider] fspanel] setVolumeLevel:[[VLCCoreInteraction sharedInstance] volume] ];
}
#pragma mark -
......@@ -710,9 +732,18 @@ static const float f_min_window_height = 307.;
- (void)setVideoplayEnabled
{
NSLog(@"Hey there, check this out! :D");
BOOL b_videoPlayback = [[VLCMain sharedInstance] activeVideoPlayback];
//b_videoPlayback (here) is same as b_activeVideo (changePlaylistState)
if (!b_videoPlayback) {
msg_Err(getIntf(), "Going from VIDEO TO PLAY");//Debug-Statement
NSLog(@"Active Video: %hhd, setting Titled Window",b_videoPlayback);//Debug-Statement
self.styleMask = NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask
| NSMiniaturizableWindowMask;
[[[[[[VLCMain sharedInstance] mainWindow] standardWindowButton:NSWindowCloseButton] superview] animator] setAlphaValue:1];
[self showControlsBar];
if (!self.nonembedded && (!self.nativeFullscreenMode || (self.nativeFullscreenMode && !self.fullscreen)) && frameBeforePlayback.size.width > 0 && frameBeforePlayback.size.height > 0) {
// only resize back to minimum view of this is still desired final state
......@@ -726,7 +757,7 @@ static const float f_min_window_height = 307.;
}
}
frameBeforePlayback = NSMakeRect(0, 0, 0, 0);
// update fs button to reflect state for next startup
......@@ -740,15 +771,10 @@ static const float f_min_window_height = 307.;
// restore alpha value to 1 for the case that macosx-opaqueness is set to < 1
[self setAlphaValue:1.0];
}
if (self.nativeFullscreenMode) {
if ([self hasActiveVideo] && [self fullscreen] && b_videoPlayback) {
[self hideControlsBar];
[self.fspanel setActive];
} else {
[self showControlsBar];
[self.fspanel setNonActive];
}
else{
NSLog(@"Active Video: %hhd, setting FullSize Window",b_videoPlayback);//Debug-Statement
self.styleMask |= NSFullSizeContentViewWindowMask;
[self hideControlsBar];
}
}
......@@ -757,15 +783,7 @@ static const float f_min_window_height = 307.;
- (void)showFullscreenController
{
id currentWindow = [NSApp keyWindow];
if ([currentWindow respondsToSelector:@selector(hasActiveVideo)] && [currentWindow hasActiveVideo]) {
if ([currentWindow respondsToSelector:@selector(fullscreen)] && [currentWindow fullscreen] && ![[currentWindow videoView] isHidden]) {
if ([[VLCMain sharedInstance] activeVideoPlayback])
[self.fspanel fadeIn];
}
}
[self.draggablewvpanel setActive];
}
#pragma mark -
......@@ -798,6 +816,11 @@ static const float f_min_window_height = 307.;
- (void)mainSplitViewDidResizeSubviews:(id)object
{
// [[self draggablewvpanel] setVoutWasUpdated:self];
[[self draggablewvpanel] centerPanel];
msg_Err(getIntf(),"Heyyy, I am trying");
NSLog(@"%f",[self frame].origin.x); //Debug-Statement
f_lastLeftSplitViewWidth = [_splitViewLeft frame].size.width;
[[[VLCMain sharedInstance] mainMenu] updateSidebarMenuItem: ![_splitView isSubviewCollapsed:_splitViewLeft]];
}
......
......@@ -377,17 +377,17 @@
[super becomeKeyWindow];
// change fspanel state for the case when multiple windows are in fullscreen
if ([self hasActiveVideo] && [self fullscreen])
[[[[VLCMain sharedInstance] mainWindow] fspanel] setActive];
else
[[[[VLCMain sharedInstance] mainWindow] fspanel] setNonActive];
// if ([self hasActiveVideo] && [self fullscreen])
// [[[[VLCMain sharedInstance] mainWindow] fspanel] setActive];
// else
// [[[[VLCMain sharedInstance] mainWindow] fspanel] setNonActive];
}
- (void)resignKeyWindow
{
[super resignKeyWindow];
[[[[VLCMain sharedInstance] mainWindow] fspanel] setNonActive];
// [[[[VLCMain sharedInstance] mainWindow] fspanel] setNonActive];
}
-(NSArray*)customWindowsToEnterFullScreenForWindow:(NSWindow *)window
......@@ -472,11 +472,11 @@
[self setFullscreen: YES];
_inFullscreenTransition = NO;
if ([self hasActiveVideo]) {
[[[[VLCMain sharedInstance] mainWindow] fspanel] setVoutWasUpdated:self];
if (![_videoView isHidden])
[[[[VLCMain sharedInstance] mainWindow] fspanel] setActive];
}
// if ([self hasActiveVideo]) {
// [[[[VLCMain sharedInstance] mainWindow] fspanel] setVoutWasUpdated:self];
// if (![_videoView isHidden])
// [[[[VLCMain sharedInstance] mainWindow] fspanel] setActive];
// }
NSArray *subviews = [[self videoView] subviews];
NSUInteger count = [subviews count];
......@@ -503,7 +503,7 @@
}
[NSCursor setHiddenUntilMouseMoves: NO];
[[[[VLCMain sharedInstance] mainWindow] fspanel] setNonActive];
// [[[[VLCMain sharedInstance] mainWindow] fspanel] setNonActive];
if (![_videoView isHidden]) {
[self showControlsBar];
......@@ -685,8 +685,10 @@
[o_fullscreen_window setAcceptsMouseMovedEvents: YES];
/* tell the fspanel to move itself to front next time it's triggered */
[[[[VLCMain sharedInstance] mainWindow] fspanel] setVoutWasUpdated:o_fullscreen_window];
[[[[VLCMain sharedInstance] mainWindow] fspanel] setActive];
// [[[[VLCMain sharedInstance] mainWindow] fspanel] setVoutWasUpdated:o_fullscreen_window];
// [[[[VLCMain sharedInstance] mainWindow] fspanel] setActive];
[[[[VLCMain sharedInstance] mainWindow] draggablewvpanel] setVoutWasUpdated:o_fullscreen_window];
// [[[[VLCMain sharedInstance] mainWindow] draggablewvpanel] setActive];
if ([self isVisible])
[self orderOut: self];
......@@ -715,7 +717,7 @@
return;
}
[[[[VLCMain sharedInstance] mainWindow] fspanel] setNonActive];
// [[[[VLCMain sharedInstance] mainWindow] fspanel] setNonActive];
[[o_fullscreen_window screen] setNonFullscreenPresentationOptions];
if (o_fullscreen_anim1) {
......
......@@ -228,8 +228,11 @@
- (void)mouseMoved:(NSEvent *)o_event
{
NSPoint ml = [self convertPoint: [o_event locationInWindow] fromView: nil];
if ([self mouse: ml inRect: [self bounds]])
if ([self mouse: ml inRect: [self bounds]]){
[[[[[[VLCMain sharedInstance] mainWindow] standardWindowButton:NSWindowCloseButton] superview] animator] setAlphaValue:1];
[[VLCMain sharedInstance] mainWindow].titlebarAppearsTransparent = false;
[[VLCMain sharedInstance] showFullscreenController];
}
[super mouseMoved: o_event];
}
......