]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/intf.m
* ALL: first development version of a GUI for the SubPicture Filters (refs #350)
[vlc] / modules / gui / macosx / intf.m
index 650437603cbd44dc78371151d69c6de646114c74..649e5cf1a2dd9806e192777b5849e7b8d961805c 100644 (file)
@@ -41,6 +41,7 @@
 #include "wizard.h"
 #include "extended.h"
 #include "bookmarks.h"
+#include "sfilters.h"
 /*#include "update.h"*/
 
 /*****************************************************************************
@@ -301,8 +302,9 @@ static VLCMain *_o_sharedMainInstance = nil;
     o_prefs = nil;
     o_open = [[VLCOpen alloc] init];
     o_wizard = [[VLCWizard alloc] init];
-    o_extended = [[VLCExtended alloc] init];
+    o_extended = nil;
     o_bookmarks = [[VLCBookmarks alloc] init];
+    o_sfilters = nil;
     /*o_update = [[VLCUpdate alloc] init];*/
 
     i_lastShownVolume = -1;
@@ -352,22 +354,22 @@ static VLCMain *_o_sharedMainInstance = nil;
     i_key = config_GetInt( p_intf, "key-next" );
     [o_mi_next setKeyEquivalent: [NSString stringWithFormat:@"%C", VLCKeyToCocoa( i_key )]];
     [o_mi_next setKeyEquivalentModifierMask: VLCModifiersToCocoa(i_key)];
-    i_key = config_GetInt( p_intf, "key-jump+10sec" );
+    i_key = config_GetInt( p_intf, "key-jump+short" );
     [o_mi_fwd setKeyEquivalent: [NSString stringWithFormat:@"%C", VLCKeyToCocoa( i_key )]];
     [o_mi_fwd setKeyEquivalentModifierMask: VLCModifiersToCocoa(i_key)];
-    i_key = config_GetInt( p_intf, "key-jump-10sec" );
+    i_key = config_GetInt( p_intf, "key-jump-short" );
     [o_mi_bwd setKeyEquivalent: [NSString stringWithFormat:@"%C", VLCKeyToCocoa( i_key )]];
     [o_mi_bwd setKeyEquivalentModifierMask: VLCModifiersToCocoa(i_key)];
-    i_key = config_GetInt( p_intf, "key-jump+1min" );
+    i_key = config_GetInt( p_intf, "key-jump+medium" );
     [o_mi_fwd1m setKeyEquivalent: [NSString stringWithFormat:@"%C", VLCKeyToCocoa( i_key )]];
     [o_mi_fwd1m setKeyEquivalentModifierMask: VLCModifiersToCocoa(i_key)];
-    i_key = config_GetInt( p_intf, "key-jump-1min" );
+    i_key = config_GetInt( p_intf, "key-jump-medium" );
     [o_mi_bwd1m setKeyEquivalent: [NSString stringWithFormat:@"%C", VLCKeyToCocoa( i_key )]];
     [o_mi_bwd1m setKeyEquivalentModifierMask: VLCModifiersToCocoa(i_key)];
-    i_key = config_GetInt( p_intf, "key-jump+5min" );
+    i_key = config_GetInt( p_intf, "key-jump+long" );
     [o_mi_fwd5m setKeyEquivalent: [NSString stringWithFormat:@"%C", VLCKeyToCocoa( i_key )]];
     [o_mi_fwd5m setKeyEquivalentModifierMask: VLCModifiersToCocoa(i_key)];
-    i_key = config_GetInt( p_intf, "key-jump-5min" );
+    i_key = config_GetInt( p_intf, "key-jump-long" );
     [o_mi_bwd5m setKeyEquivalent: [NSString stringWithFormat:@"%C", VLCKeyToCocoa( i_key )]];
     [o_mi_bwd5m setKeyEquivalentModifierMask: VLCModifiersToCocoa(i_key)];
     i_key = config_GetInt( p_intf, "key-vol-up" );
@@ -432,17 +434,6 @@ static VLCMain *_o_sharedMainInstance = nil;
     nib_main_loaded = TRUE;
 }
 
-- (void)dealloc
-{
-    [o_about release];
-    [o_prefs release];
-    [o_open release];
-    [o_extended release];
-    [o_bookmarks release];
-    
-    [super dealloc];
-}
-
 - (void)initStrings
 {
     [o_window setTitle: _NS("VLC - Controller")];
@@ -1376,6 +1367,32 @@ static VLCMain *_o_sharedMainInstance = nil;
     }
     msleep( 500000 );
 
+    /* save the prefs if they were changed in the extended panel */
+    if (o_extended && [o_extended getConfigChanged])
+    {
+        [o_extended savePrefs];
+    }
+
+    /* release some other objects here, because it isn't sure whether dealloc
+     * will be called later on -- FK (10/6/05) */
+    if( nib_about_loaded && o_about )
+        [o_about release];
+    
+    if( nib_open_loaded && o_open )
+        [o_open release];
+    
+    if( nib_extended_loaded && o_extended )
+    {
+        [o_extended collapsAll];
+        [o_extended release];
+    }
+    
+    if( nib_bookmarks_loaded && o_bookmarks )
+        [o_bookmarks release];
+
+    if( nib_wizard_loaded && o_wizard )
+        [o_wizard release];
+
     if( o_img_pause_pressed != nil )
     {
         [o_img_pause_pressed release];
@@ -1495,6 +1512,10 @@ static VLCMain *_o_sharedMainInstance = nil;
 
 - (IBAction)showExtended:(id)sender
 {
+    if ( o_extended == nil )
+    {
+        o_extended = [[VLCExtended alloc] init];
+    }
     if (!nib_extended_loaded)
     {
         nib_extended_loaded = [NSBundle loadNibNamed:@"Extended" owner:self];
@@ -1505,12 +1526,29 @@ static VLCMain *_o_sharedMainInstance = nil;
     }
 }
 
+- (IBAction)showSFilters:(id)sender
+{
+    if ( o_sfilters == nil )
+    {
+        o_sfilters = [[VLCsFilters alloc] init];
+    }
+    if (!nib_sfilters_loaded)
+    {
+        nib_sfilters_loaded = [NSBundle loadNibNamed:@"SFilters" owner:self];
+        [o_sfilters initStrings];
+        [o_sfilters showAsPanel];
+    } else {
+        [o_sfilters showAsPanel];
+    }
+}
+
 - (IBAction)showBookmarks:(id)sender
 {
     /* we need the wizard-nib for the bookmarks's extract functionality */
     if (!nib_wizard_loaded)
     {
         nib_wizard_loaded = [NSBundle loadNibNamed:@"Wizard" owner:self];
+        [o_wizard initStrings];
     }
     
     if (!nib_bookmarks_loaded)