* restored old deinterlace menu. The on the fly code does not work as long
authorDerk-Jan Hartman <hartman@videolan.org>
Mon, 10 Feb 2003 00:16:51 +0000 (00:16 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Mon, 10 Feb 2003 00:16:51 +0000 (00:16 +0000)
  as the vout.m issue exists. but this is better then the current 'dummy'
  code we have.

modules/gui/macosx/controls.m

index 00aa465..48af1e2 100644 (file)
@@ -2,7 +2,7 @@
  * controls.m: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: controls.m,v 1.25 2003/02/09 01:50:35 massiot Exp $
+ * $Id: controls.m,v 1.26 2003/02/10 00:16:51 hartman Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
 
 - (IBAction)deinterlace:(id)sender
 {
-
+    intf_thread_t * p_intf = [NSApp getIntf];
+    BOOL bEnable = [sender state] == NSOffState;
+    
+    if( bEnable )
+    {
+        config_PutPsz( p_intf, "filter", "deinterlace" );
+       config_PutPsz( p_intf, "deinterlace-mode",
+                    [[sender title] lossyCString] );   Ê
+    }
+    else
+    {
+        config_PutPsz( p_intf, "filter", NULL );
+    }
 }
 
 - (IBAction)toggleProgram:(id)sender
     }
     else if( o_menu != nil && 
              [[o_menu title] isEqualToString: _NS("Deinterlace")] )
-    { 
-
+    {
+        char * psz_filter = config_GetPsz( p_intf, "filter" ); Ê
+        
+        if( psz_filter != NULL )       Ê
+        {      Ê
+            free( psz_filter );        Ê
+            
+            psz_filter = config_GetPsz( p_intf, "deinterlace-mode" );  Ê
+        }      Ê
+        Ê      Ê
+        if( psz_filter != NULL )       Ê
+        {      Ê
+            if( strcmp( psz_filter, [[o_mi title] lossyCString] ) == 0 )       Ê
+            {  Ê
+                [o_mi setState: NSOnState];    Ê
+            }  Ê
+            else       Ê
+            {  Ê
+                [o_mi setState: NSOffState];   Ê
+            }  Ê
+            
+            free( psz_filter );        Ê
+        }      Ê
+        else   Ê
+        {      Ê
+            [o_mi setState: NSOffState];       Ê
+        }
     } 
 
     if( p_playlist != NULL )