]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/controls.m
Merge branch 1.0-bugfix
[vlc] / modules / gui / macosx / controls.m
index aa06beb8e34c36d4a8c0266ea79ec38b5886921e..ef16ff5d6a7b0ad9bd98d528752ebe56286892ee 100644 (file)
@@ -50,6 +50,7 @@
 {
     [super init];
     o_fs_panel = [[VLCFSPanel alloc] init];
+    b_lockAspectRatio = YES;
     return self;
 }
 
     return [[o_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 )
     {