IBOutlet id o_specificTime_mi;
VLCFSPanel *o_fs_panel;
+ BOOL b_lockAspectRatio;
}
- (void)controlTintChanged;
- (id)voutView;
+- (BOOL)aspectRatioIsLocked;
- (IBAction)play:(id)sender;
- (IBAction)stop:(id)sender;
- (IBAction)telxTransparent:(id)sender;
- (IBAction)telxNavLink:(id)sender;
+- (IBAction)lockVideosAspectRatio:(id)sender;
- (IBAction)addSubtitleFile:(id)sender;
- (BOOL)keyEvent:(NSEvent *)o_event;
{
[super init];
o_fs_panel = [[VLCFSPanel alloc] init];
+ b_lockAspectRatio = YES;
return self;
}
return [[voutView retain] autorelease];
}
+- (BOOL)aspectRatioIsLocked
+{
+ return b_lockAspectRatio;
+}
+
- (IBAction)stop:(id)sender
{
intf_thread_t * p_intf = VLCIntf;
}
}
+- (IBAction)lockVideosAspectRatio:(id)sender
+{
+ if( [sender state] == NSOffState )
+ [sender setState: NSOnState];
+ else
+ [sender setState: NSOffState];
+
+ b_lockAspectRatio = !b_lockAspectRatio;
+}
+
- (IBAction)addSubtitleFile:(id)sender
{
NSInteger i_returnValue = 0;
if( input_AddSubtitle( p_input, [[[openPanel filenames] objectAtIndex: i] UTF8String], TRUE ) )
msg_Warn( VLCIntf, "unable to load subtitles from '%s'",
[[[openPanel filenames] objectAtIndex: i] UTF8String] );
- i++;
}
}
}
/* make (un)sensitive */
[o_parent setEnabled: ( val_list.p_list->i_count > 1 )];
+ /* Aspect Ratio */
+ if( [[o_parent title] isEqualToString: _NS("Aspect-ratio")] == YES )
+ {
+ NSMenuItem *o_lmi_tmp2;
+ o_lmi_tmp2 = [o_menu addItemWithTitle: _NS("Lock Aspect Ratio") action: @selector(lockVideosAspectRatio:) keyEquivalent: @""];
+ [o_lmi_tmp2 setTarget: self];
+ [o_lmi_tmp2 setEnabled: YES];
+ [o_lmi_tmp2 setState: b_lockAspectRatio];
+ [o_parent setEnabled: YES];
+ [o_menu addItem: [NSMenuItem separatorItem]];
+ }
+
/* special case for the subtitles items */
if( [[o_parent title] isEqualToString: _NS("Subtitles Track")] == YES )
{
if( videoRatio.height == 0. || videoRatio.width == 0. )
return proposedFrameSize;
- NSRect viewRect = [o_view convertRect:[o_view bounds] toView: nil];
- NSRect contentRect = [self contentRectForFrameRect:[self frame]];
- float marginy = viewRect.origin.y + [self frame].size.height - contentRect.size.height;
- float marginx = contentRect.size.width - viewRect.size.width;
- proposedFrameSize.height = (proposedFrameSize.width - marginx) * videoRatio.height / videoRatio.width + marginy;
+ if( [[[VLCMain sharedInstance] controls] aspectRatioIsLocked] )
+ {
+ NSRect viewRect = [o_view convertRect:[o_view bounds] toView: nil];
+ NSRect contentRect = [self contentRectForFrameRect:[self frame]];
+ float marginy = viewRect.origin.y + [self frame].size.height - contentRect.size.height;
+ float marginx = contentRect.size.width - viewRect.size.width;
+ proposedFrameSize.height = (proposedFrameSize.width - marginx) * videoRatio.height / videoRatio.width + marginy;
+ }
return proposedFrameSize;
}