...
 
Commits (8)
......@@ -91,6 +91,9 @@
1CCC89052078A3D500E5626F /* TextfieldPanel.xib in Sources */ = {isa = PBXBuildFile; fileRef = 6B8224151E4D2A9000833BE1 /* TextfieldPanel.xib */; };
1CCC89062078A3D500E5626F /* TimeSelectionPanel.xib in Sources */ = {isa = PBXBuildFile; fileRef = 6B8224161E4D2A9000833BE1 /* TimeSelectionPanel.xib */; };
1CFE8D591EA0D42A00E94451 /* VLCErrorWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1CFE8D581EA0D42A00E94451 /* VLCErrorWindowController.m */; };
524D376B21106CCC008FEE22 /* VLCDraggablePanelView.m in Sources */ = {isa = PBXBuildFile; fileRef = 524D376A21106CCC008FEE22 /* VLCDraggablePanelView.m */; };
524D376E21149546008FEE22 /* VLCDraggablePanelController.m in Sources */ = {isa = PBXBuildFile; fileRef = 524D376D21149546008FEE22 /* VLCDraggablePanelController.m */; };
529BE1402130140A0005F3A4 /* DPCommon.m in Sources */ = {isa = PBXBuildFile; fileRef = 529BE13F2130140A0005F3A4 /* DPCommon.m */; };
6B0292E61F43256300A50082 /* VLCBottomBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B0292E51F43256300A50082 /* VLCBottomBarView.m */; };
6B0AB0F01F1AC8B3003A1B4E /* VLCSlider.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B0AB0ED1F1AC8B3003A1B4E /* VLCSlider.m */; };
6B0AB0F11F1AC8B3003A1B4E /* VLCSliderCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B0AB0EF1F1AC8B3003A1B4E /* VLCSliderCell.m */; };
......@@ -163,6 +166,12 @@
1CFE8D561EA0D3D300E94451 /* ErrorPanel.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ErrorPanel.xib; sourceTree = "<group>"; };
1CFE8D571EA0D42A00E94451 /* VLCErrorWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCErrorWindowController.h; sourceTree = "<group>"; };
1CFE8D581EA0D42A00E94451 /* VLCErrorWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCErrorWindowController.m; sourceTree = "<group>"; };
524D376921106CCC008FEE22 /* VLCDraggablePanelView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCDraggablePanelView.h; sourceTree = "<group>"; };
524D376A21106CCC008FEE22 /* VLCDraggablePanelView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCDraggablePanelView.m; sourceTree = "<group>"; };
524D376C21149546008FEE22 /* VLCDraggablePanelController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCDraggablePanelController.h; sourceTree = "<group>"; };
524D376D21149546008FEE22 /* VLCDraggablePanelController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCDraggablePanelController.m; sourceTree = "<group>"; };
529BE13E2130140A0005F3A4 /* DPCommon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DPCommon.h; sourceTree = "<group>"; };
529BE13F2130140A0005F3A4 /* DPCommon.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DPCommon.m; sourceTree = "<group>"; };
5CCED71014C0D4A90057F8D1 /* VLCExtensionsDialogProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCExtensionsDialogProvider.h; sourceTree = "<group>"; };
5CCED71114C0D4A90057F8D1 /* VLCExtensionsDialogProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCExtensionsDialogProvider.m; sourceTree = "<group>"; };
5CCED71214C0D4A90057F8D1 /* VLCExtensionsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCExtensionsManager.h; sourceTree = "<group>"; };
......@@ -1040,6 +1049,12 @@
6BCB590A1DA247CD009BCA66 /* VLCFSPanelController.m */,
1CAEBBFF1E1EC0A400A99E49 /* VLCFSPanelDraggableView.h */,
1CAEBC001E1EC0A400A99E49 /* VLCFSPanelDraggableView.m */,
524D376921106CCC008FEE22 /* VLCDraggablePanelView.h */,
524D376A21106CCC008FEE22 /* VLCDraggablePanelView.m */,
524D376C21149546008FEE22 /* VLCDraggablePanelController.h */,
524D376D21149546008FEE22 /* VLCDraggablePanelController.m */,
529BE13E2130140A0005F3A4 /* DPCommon.h */,
529BE13F2130140A0005F3A4 /* DPCommon.m */,
);
name = "Fullscreen Controller";
sourceTree = "<group>";
......@@ -1534,6 +1549,7 @@
1CCC88FB2078A3D500E5626F /* Help.xib in Sources */,
1CCC88FC2078A3D500E5626F /* LogMessageWindow.xib in Sources */,
1CCC88FD2078A3D500E5626F /* Open.xib in Sources */,
529BE1402130140A0005F3A4 /* DPCommon.m in Sources */,
1CCC88FE2078A3D500E5626F /* PlaylistAccessoryView.xib in Sources */,
1CCC88FF2078A3D500E5626F /* PlaylistMenu.xib in Sources */,
1CCC89002078A3D500E5626F /* PopupPanel.xib in Sources */,
......@@ -1560,6 +1576,7 @@
1C3113EF1E508C7600D4DD76 /* VLCRendererDiscovery.m in Sources */,
1C3113F11E508C7600D4DD76 /* VLCRendererItem.m in Sources */,
1C3113F31E508C7600D4DD76 /* VLCRendererMenuController.m in Sources */,
524D376E21149546008FEE22 /* VLCDraggablePanelController.m in Sources */,
6B4D50931E7979CB004479B5 /* VLCSimplePrefsWindow.m in Sources */,
1C31138E1E508C6900D4DD76 /* VLCAboutWindowController.m in Sources */,
1C3113901E508C6900D4DD76 /* VLCHelpWindowController.m in Sources */,
......@@ -1609,6 +1626,7 @@
1C3113D51E508C6900D4DD76 /* VLCTextfieldPanelController.m in Sources */,
1C3113D71E508C6900D4DD76 /* VLCPopupPanelController.m in Sources */,
1C3113D91E508C6900D4DD76 /* VLCSimplePrefsController.m in Sources */,
524D376B21106CCC008FEE22 /* VLCDraggablePanelView.m in Sources */,
6B2EFC601F2819F700F3C0EA /* VLCVolumeSlider.m in Sources */,
7D2E0EDB20CD204D0033A221 /* VLCWindow.m in Sources */,
1C3113DB1E508C6900D4DD76 /* VLCStringUtility.m in Sources */,
......
//
// DPCommon.h
// Pseudo-VLC
//
// Created by Daksh Shah on 24/08/18.
//
#import <Foundation/Foundation.h>
@interface DPCommon : NSObject
- (IBAction)play:(id)sender;
@end
//
// DPCommon.m
// Pseudo-VLC
//
// Created by Daksh Shah on 24/08/18.
//
#import "DPCommon.h"
#import "VLCCoreInteraction.h"
#import "CompatibilityFixes.h"
#import "VLCMain.h"
#import <vlc_aout.h>
@implementation DPCommon
- (IBAction)play:(id)sender {
[[VLCCoreInteraction sharedInstance] playOrPause];
}
//#pragma mark -
//#pragma mark Control Actions
//
//- (IBAction)togglePlayPause:(id)sender
//{
// [[VLCCoreInteraction sharedInstance] playOrPause];
//}
//
//- (IBAction)jumpForward:(id)sender
//{
// static NSTimeInterval last_event = 0;
// if (([NSDate timeIntervalSinceReferenceDate] - last_event) > 0.16) {
// /* We just skipped 4 "continuous" events, otherwise we are too fast */
// [[VLCCoreInteraction sharedInstance] forwardExtraShort];
// last_event = [NSDate timeIntervalSinceReferenceDate];
// }
//}
//
//- (IBAction)jumpBackward:(id)sender
//{
// static NSTimeInterval last_event = 0;
// if (([NSDate timeIntervalSinceReferenceDate] - last_event) > 0.16) {
// /* We just skipped 4 "continuous" events, otherwise we are too fast */
// [[VLCCoreInteraction sharedInstance] backwardExtraShort];
// last_event = [NSDate timeIntervalSinceReferenceDate];
// }
//}
//
//- (IBAction)gotoPrevious:(id)sender
//{
// [[VLCCoreInteraction sharedInstance] previous];
//}
//
//- (IBAction)gotoNext:(id)sender
//{
// [[VLCCoreInteraction sharedInstance] next];
//}
//
//- (IBAction)toggleFullscreen:(id)sender
//{
// [[VLCCoreInteraction sharedInstance] toggleFullscreen];
//}
//
//- (IBAction)timeSliderUpdate:(id)sender
//{
// switch([[NSApp currentEvent] type]) {
// case NSLeftMouseUp:
// /* Ignore mouse up, as this is a continuous slider and
// * when the user does a single click to a position on the slider,
// * the action is called twice, once for the mouse down and once
// * for the mouse up event. This results in two short seeks one
// * after another to the same position, which results in weird
// * audio quirks.
// */
// return;
// case NSLeftMouseDown:
// case NSLeftMouseDragged:
// break;
//
// default:
// return;
// }
// input_thread_t *p_input;
// p_input = pl_CurrentInput(getIntf());
//
// if (p_input) {
// vlc_value_t pos;
// pos.f_float = [_timeSlider floatValue] / 10000.;
// var_Set(p_input, "position", pos);
// vlc_object_release(p_input);
// }
// [[[VLCMain sharedInstance] mainWindow] updateTimeSlider];
//}
//
//- (IBAction)volumeSliderUpdate:(id)sender
//{
// [[VLCCoreInteraction sharedInstance] setVolume:[sender intValue]];
//}
//
//#pragma mark -
//#pragma mark Metadata and state updates
//
//- (void)setPlay
//{
// [_playPauseButton setState:NSOffState];
// [_playPauseButton setToolTip: _NS("Play")];
//}
//
//- (void)setPause
//{
// [_playPauseButton setState:NSOnState];
// [_playPauseButton setToolTip: _NS("Pause")];
//}
//
//- (void)setStreamTitle:(NSString *)title
//{
// [_mediaTitle setStringValue:title];
//}
//
//- (void)fixTitleBar
//{
// //Issue-3, the titleBar should be shown/hidden only for the respective window of FSPanel...
// _associatedVoutWindow.styleMask = NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask
// | NSMiniaturizableWindowMask;
// // [self showTitleBar];
// //[_associatedVoutWindow showControlsBar]; //It apparently does not have showControlsBar, because it is a NSWindow... would have to figure out a way to hide/show it
//}
//
//-(void)unFixTitleBar
//{
// _associatedVoutWindow.styleMask |= NSFullSizeContentViewWindowMask;
//}
//
//- (void)hideTitleBar
//{
// [[[[_associatedVoutWindow standardWindowButton:NSWindowCloseButton] superview] animator] setAlphaValue:0];
//}
//
//- (void)updatePositionAndTime
//{
// input_thread_t *p_input = pl_CurrentInput(getIntf());
//
// /* If nothing is playing, reset times and slider */
// if (!p_input) {
// [_timeSlider setFloatValue:0.0];
// [_elapsedTime setStringValue:@""];
// [_remainingOrTotalTime setHidden:YES];
// return;
// }
//
// vlc_value_t pos;
// char psz_time[MSTRTIME_MAX_SIZE];
//
// var_Get(p_input, "position", &pos);
// float f_updated = 10000. * pos.f_float;
// [_timeSlider setFloatValue:f_updated];
//
//
// int64_t t = var_GetInteger(p_input, "time");
// mtime_t dur = input_item_GetDuration(input_GetItem(p_input));
//
// /* Update total duration (right field) */
// if (dur <= 0) {
// [_remainingOrTotalTime setHidden:YES];
// } else {
// [_remainingOrTotalTime setHidden:NO];
//
// NSString *totalTime;
//
// if ([_remainingOrTotalTime timeRemaining]) {
// mtime_t remaining = 0;
// if (dur > t)
// remaining = dur - t;
// totalTime = [NSString stringWithFormat:@"-%s", secstotimestr(psz_time, (int)(remaining / CLOCK_FREQ))];
// } else {
// totalTime = toNSStr(secstotimestr(psz_time, (int)(dur / 1000000)));
// }
// [_remainingOrTotalTime setStringValue:totalTime];
// }
//
// /* Update current position (left field) */
// NSString *playbackPosition = toNSStr(secstotimestr(psz_time, (int)(t / CLOCK_FREQ)));
//
// [_elapsedTime setStringValue:playbackPosition];
// vlc_object_release(p_input);
//}
//
//- (void)setSeekable:(BOOL)seekable
//{
// [_timeSlider setEnabled:seekable];
// [_forwardButton setEnabled:seekable];
// [_backwardButton setEnabled:seekable];
//}
//
//- (void)setVolumeLevel:(int)value
//{
// [_volumeSlider setIntValue:value];
// [_volumeSlider setToolTip: [NSString stringWithFormat:_NS("Volume: %i %%"), (value*200)/AOUT_VOLUME_MAX]];
//}
@end
......@@ -97,7 +97,10 @@ libmacosx_plugin_la_SOURCES = \
gui/macosx/VLCSliderCell.h gui/macosx/VLCSliderCell.m \
gui/macosx/VLCVolumeSlider.h gui/macosx/VLCVolumeSlider.m \
gui/macosx/VLCVolumeSliderCell.h gui/macosx/VLCVolumeSliderCell.m \
gui/macosx/VLCWrappableTextField.h gui/macosx/VLCWrappableTextField.m
gui/macosx/VLCWrappableTextField.h gui/macosx/VLCWrappableTextField.m \
gui/macosx/VLCDraggablePanelView.h gui/macosx/VLCDraggablePanelView.m \
gui/macosx/VLCDraggablePanelController.h gui/macosx/VLCDraggablePanelController.m \
gui/macosx/DPCommon.h gui/macosx/DPCommon.m
# User interface compilation
......
#import <Cocoa/Cocoa.h>
#import "VLCWindow.h"
#import "VLCDefaultValueSlider.h"
#import "VLCTimeField.h"
@interface VLCDraggablePanelController : NSObject
@property (readwrite, weak) NSTimer *hideTimer;
@property IBOutlet NSView *controlsView;
@property IBOutlet NSButton *playPauseButton;
@property IBOutlet NSButton *forwardButton;
@property IBOutlet NSButton *backwardButton;
@property IBOutlet NSButton *nextButton;
@property IBOutlet NSButton *previousButton;
@property IBOutlet NSButton *fullscreenButton;
@property IBOutlet NSTextField *mediaTitle;
@property IBOutlet VLCTimeField *elapsedTime;
@property IBOutlet VLCTimeField *remainingOrTotalTime;
@property IBOutlet NSSlider *timeSlider;
@property IBOutlet VLCDefaultValueSlider *volumeSlider;
@property (assign) IBOutlet NSLayoutConstraint *heightMaxConstraint;
- (IBAction)togglePlayPause:(id)sender;
- (IBAction)jumpForward:(id)sender;
- (IBAction)jumpBackward:(id)sender;
- (IBAction)gotoPrevious:(id)sender;
- (IBAction)gotoNext:(id)sender;
- (IBAction)toggleFullscreen:(id)sender;
- (IBAction)timeSliderUpdate:(id)sender;
- (IBAction)volumeSliderUpdate:(id)sender;
- (void)fadeIn;
- (void)fadeOut;
- (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;
- (void)updatePositionAndTime;
- (void)setStreamTitle:(NSString *)title;
- (void)setPlay;
- (void)setPause;
// Constrain frame to window. Used by VLCFSPanelDraggableView.
- (NSRect)contrainFrameToAssociatedVoutWindow:(NSRect)frame;
@end
This diff is collapsed.
//
// testViewTwo.h
// Pseudo-VLC
//
// Created by Daksh Shah on 31/07/18.
//
#import <Cocoa/Cocoa.h>
@interface VLCDraggablePanelView : NSView
@property(readonly) BOOL mouseDownCanMoveWindow;
@property(readwrite) NSPoint lastDragLocation;
@end
//
// testViewTwo.m
// Pseudo-VLC
//
// Created by Daksh Shah on 31/07/18.
//
#import "VLCDraggablePanelView.h"
#import "VLCDraggablePanelController.h"
@implementation VLCDraggablePanelView
- (BOOL)mouseDownCanMoveWindow
{
return NO;
}
- (void)drawRect:(NSRect)dirtyRect {
[super drawRect:dirtyRect];
CGContextRef context = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
CGContextSetRGBFillColor(context, 1, 1, 1, 0.6);
CGContextFillRect(context, NSRectToCGRect(dirtyRect));
}
- (BOOL) acceptsFirstMouse:(NSEvent *)theEvent
{
return YES;
}
- (void)mouseDown:(NSEvent *)theEvent
{
NSLog(@"mouseDown"); //Debug-Statement
_lastDragLocation = [theEvent locationInWindow];
}
- (void)mouseDragged:(NSEvent *)theEvent
{
NSLog(@"mouseDragged"); //Debug-Statement
NSPoint newDragLocation = [[self superview] convertPoint:[theEvent locationInWindow] fromView:nil];
NSPoint thisOrigin = [self frame].origin;
thisOrigin.x += (-self.lastDragLocation.x + newDragLocation.x);
thisOrigin.y += (-self.lastDragLocation.y + newDragLocation.y);
[self setFrameOrigin:thisOrigin];
self.lastDragLocation = newDragLocation;
}
@end
......@@ -63,6 +63,10 @@
- (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)fixTitleBar;
- (void)unFixTitleBar;
- (void)setSeekable:(BOOL)seekable;
- (void)setVolumeLevel:(int)value;
......
......@@ -233,6 +233,25 @@ static NSString *kAssociatedFullscreenRect = @"VLCFullscreenAssociatedWindowRect
[_mediaTitle setStringValue:title];
}
- (void)fixTitleBar
{
//Issue-3, the titleBar should be shown/hidden only for the respective window of FSPanel...
_associatedVoutWindow.styleMask = NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask
| NSMiniaturizableWindowMask;
// [self showTitleBar];
//[_associatedVoutWindow showControlsBar]; //It apparently does not have showControlsBar, because it is a NSWindow... would have to figure out a way to hide/show it
}
-(void)unFixTitleBar
{
_associatedVoutWindow.styleMask |= NSFullSizeContentViewWindowMask;
}
- (void)hideTitleBar
{
[[[[_associatedVoutWindow standardWindowButton:NSWindowCloseButton] superview] animator] setAlphaValue:0];
}
- (void)updatePositionAndTime
{
input_thread_t *p_input = pl_CurrentInput(getIntf());
......@@ -322,13 +341,13 @@ static NSString *kAssociatedFullscreenRect = @"VLCFullscreenAssociatedWindowRect
- (void)centerPanel
{
NSRect windowFrame = [self.window frame];
windowFrame = [self contrainFrameToAssociatedVoutWindow:windowFrame];
/* Calculate coordinates for centered position */
NSRect limitFrame = _associatedVoutWindow.frame;
windowFrame.origin.x = (limitFrame.size.width - windowFrame.size.width) / 2 + limitFrame.origin.x;
windowFrame.origin.y = (limitFrame.size.height / 5) - windowFrame.size.height + limitFrame.origin.y;
windowFrame = [self contrainFrameToAssociatedVoutWindow:windowFrame];
[self.window setFrame:windowFrame display:YES animate:NO];
}
......@@ -420,6 +439,11 @@ static NSString *kAssociatedFullscreenRect = @"VLCFullscreenAssociatedWindowRect
if (!NSMouseInRect([NSEvent mouseLocation], [self.window frame], NO)) {
[self fadeOut];
[self hideMouse];
//Issue-3 //maybe not the right way to go about it. Why hide titleBars for all vout windows? and maybe this should not be a part of draggablepanel at all
[[[VLCMain sharedInstance] voutProvider] updateDraggablePanelsUsingBlock:^(VLCFSPanelController *draggablepanel) {
[draggablepanel hideTitleBar];
}];
}
_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)
{
......
This diff is collapsed.
......@@ -26,6 +26,7 @@
#import <vlc_vout_window.h>
#import "VLCKeyboardBacklightControl.h"
#import "VLCFSPanelController.h"
@class VLCControlsBarCommon;
@class VLCVideoWindowCommon;
......@@ -42,6 +43,7 @@
- (void)setFullscreen:(int)i_full forWindow:(vout_window_t *)p_wnd withAnimation:(BOOL)b_animation;
- (void)updateControlsBarsUsingBlock:(void (^)(VLCControlsBarCommon *controlsBar))block;
- (void)updateDraggablePanelsUsingBlock: (void (^)(VLCFSPanelController *draggablepanel))block;
- (void)updateWindowsUsingBlock:(void (^)(VLCVideoWindowCommon *o_window))windowUpdater;
- (void)updateWindowLevelForHelperWindows:(NSInteger)i_level;
......
......@@ -368,6 +368,9 @@ void WindowClose(vout_window_t *p_wnd)
[voutView setVoutThread:(vout_thread_t *)p_wnd->obj.parent];
[newVideoWindow setHasActiveVideo: YES];
// newVideoWindow.styleMask |= NSFullSizeContentViewWindowMask;//would this be the right place for it? //Issue-3
[newVideoWindow hideControlsBar];
[voutWindows setObject:newVideoWindow forKey:[NSValue valueWithPointer:p_wnd]];
[[VLCMain sharedInstance] setActiveVideoPlayback: YES];
......@@ -560,6 +563,18 @@ void WindowClose(vout_window_t *p_wnd)
}];
}
- (void)updateDraggablePanelsUsingBlock: (void (^)(VLCFSPanelController *draggablepanel))block
{
[voutWindows enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
if ([obj respondsToSelector:@selector(draggablepanel)]) {
VLCFSPanelController *o_draggablepanel = [obj draggablepanel];
if (o_draggablepanel && block)
block(o_draggablepanel);
}
}];
}
- (void)updateWindowsUsingBlock:(void (^)(VLCVideoWindowCommon *o_window))windowUpdater
{
[voutWindows enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
......
......@@ -24,6 +24,7 @@
#import <Cocoa/Cocoa.h>
#import "VLCWindow.h"
#import "VLCFSPanelController.h"
@class VLCVoutView;
......@@ -47,6 +48,7 @@ static const float f_min_video_height = 70.0;
@property (readonly) BOOL windowShouldExitFullscreenWhenFinished;
@property (readwrite, assign) NSRect previousSavedFrame;
@property (nonatomic, readwrite, assign) NSSize nativeVideoSize;
@property (readonly) VLCFSPanelController* draggablepanel;
- (void)setWindowLevel:(NSInteger)i_state;
- (void)resizeWindow;
......
......@@ -80,6 +80,12 @@
- (void)awakeFromNib
{
_draggablepanel = [[VLCFSPanelController alloc] init];
[_draggablepanel showWindow:self];
[[self draggablepanel] setVoutWasUpdated:self];
// [self.draggablepanel setActive]; //doubtful
NSLog(@"AWAKEFROMNIB in VLCVideoWindowCommon"); //Debug-Statement
BOOL b_nativeFullscreenMode = var_InheritBool(getIntf(), "macosx-nativefullscreenmode");
if (b_nativeFullscreenMode) {
......@@ -377,17 +383,22 @@
[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];
//I am not sure what this means... earlier there was just one fspanel...
//removing it for now, as it is creating an error: when video is played in a separate Vout window then the controller on ML/Playlist window becomes active when the Vout window becomes keyWindow
// NSLog(@"becomeKeyWindow and activeVideo %hhd", [self hasActiveVideo]);
// if ([self hasActiveVideo])
// [[[[VLCMain sharedInstance] mainWindow] draggablepanel] setActive];
// else
// [[[[VLCMain sharedInstance] mainWindow] draggablepanel] setNonActive];
}
- (void)resignKeyWindow
{
[super resignKeyWindow];
[[[[VLCMain sharedInstance] mainWindow] fspanel] setNonActive];
//This file is for all the video windows right? Then how do I know whether mainWindow has resigned as KeyWindow or is it some other vout window? because, I will have to set Not Active that particular window's draggablepanel. Right?
[[[[VLCMain sharedInstance] mainWindow] draggablepanel] setNonActive];
}
-(NSArray*)customWindowsToEnterFullScreenForWindow:(NSWindow *)window
......@@ -472,11 +483,12 @@
[self setFullscreen: YES];
_inFullscreenTransition = NO;
if ([self hasActiveVideo]) {
[[[[VLCMain sharedInstance] mainWindow] fspanel] setVoutWasUpdated:self];
if (![_videoView isHidden])
[[[[VLCMain sharedInstance] mainWindow] fspanel] setActive];
}
//Would I need to do something here? #check
// 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,11 +515,6 @@
}
[NSCursor setHiddenUntilMouseMoves: NO];
[[[[VLCMain sharedInstance] mainWindow] fspanel] setNonActive];
if (![_videoView isHidden]) {
[self showControlsBar];
}
[self setMovableByWindowBackground: YES];
}
......@@ -684,9 +691,7 @@
[o_fullscreen_window makeKeyWindow];
[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] draggablepanel] setVoutWasUpdated:o_fullscreen_window]; //fix
if ([self isVisible])
[self orderOut: self];
......@@ -715,7 +720,6 @@
return;
}
[[[[VLCMain sharedInstance] mainWindow] fspanel] setNonActive];
[[o_fullscreen_window screen] setNonFullscreenPresentationOptions];
if (o_fullscreen_anim1) {
......
......@@ -228,8 +228,13 @@
- (void)mouseMoved:(NSEvent *)o_event
{
NSPoint ml = [self convertPoint: [o_event locationInWindow] fromView: nil];
if ([self mouse: ml inRect: [self bounds]])
[[VLCMain sharedInstance] showFullscreenController];
if ([self mouse: ml inRect: [self bounds]]){
// NSLog(@"VLCVoutView mouseMoved");//Debug-Statement
//It is triggered only in the Video Playing windows, not Playlist view, which is perfect
[[[[((VLCVideoWindowCommon*)self.window) standardWindowButton:NSWindowCloseButton] superview] animator] setAlphaValue:1]; //Issue-3
[[((VLCVideoWindowCommon*)self.window) draggablepanel] fadeIn];//setActive instead of fadeIn?
}
[super mouseMoved: o_event];
}
......