]> git.sesse.net Git - vlc/commitdiff
MacOS X port :
authorChristophe Massiot <massiot@videolan.org>
Sun, 5 Jan 2003 16:23:57 +0000 (16:23 +0000)
committerChristophe Massiot <massiot@videolan.org>
Sun, 5 Jan 2003 16:23:57 +0000 (16:23 +0000)
* Fixed a segfault in the "Close Window" code,
* Fullscreen state is now retained between files,
* Preferences items now feature LONGTEXT tooltips (maybe we should wrap them ?).

include/vlc_threads.h
modules/gui/macosx/controls.m
modules/gui/macosx/intf.h
modules/gui/macosx/intf.m
modules/gui/macosx/prefs.m
modules/gui/macosx/vout.m

index 4c908e218db678214fc146304f2100b36259ccab..882131e8c4d43c472fa60556eda63eb990e4a487 100644 (file)
@@ -3,7 +3,7 @@
  * This header provides portable declarations for mutexes & conditions
  *****************************************************************************
  * Copyright (C) 1999, 2002 VideoLAN
- * $Id: vlc_threads.h,v 1.19 2002/12/30 17:36:01 gbazin Exp $
+ * $Id: vlc_threads.h,v 1.20 2003/01/05 16:23:57 massiot Exp $
  *
  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
  *          Samuel Hocevar <sam@via.ecp.fr>
@@ -73,8 +73,8 @@
 /* Thread priorities */
 #ifdef SYS_DARWIN
 #   define VLC_THREAD_PRIORITY_LOW 31
-#   define VLC_THREAD_PRIORITY_INPUT 37
-#   define VLC_THREAD_PRIORITY_AUDIO 38
+#   define VLC_THREAD_PRIORITY_INPUT 35
+#   define VLC_THREAD_PRIORITY_AUDIO 36
 #   define VLC_THREAD_PRIORITY_VIDEO 31
 #   define VLC_THREAD_PRIORITY_OUTPUT 31
 
index 0fcc0707dedcff2e02346763cba4dc7b002bbeed..e5696115bf3e18771e4c7210e130c1bce01b6936 100644 (file)
@@ -2,7 +2,7 @@
  * controls.m: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: controls.m,v 1.5 2003/01/04 04:11:08 jlj Exp $
+ * $Id: controls.m,v 1.6 2003/01/05 16:23:57 massiot Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
 
     playlist_Stop( p_playlist );
     vlc_object_release( p_playlist );
+    p_intf->p_sys->b_stopping = 1;
 }
 
 - (IBAction)faster:(id)sender
index 2e5ede84eec1f726238b338ce628a206d15d1a8c..06e34a2dc9881eb7f730931b9371f9c129fabc8d 100644 (file)
@@ -2,7 +2,7 @@
  * intf.h: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: intf.h,v 1.10 2003/01/05 01:55:07 massiot Exp $
+ * $Id: intf.h,v 1.11 2003/01/05 16:23:57 massiot Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -58,6 +58,7 @@ struct intf_sys_t
     /* special actions */
     vlc_bool_t b_loop;
     vlc_bool_t b_playing;
+    vlc_bool_t b_stopping;
     vlc_bool_t b_mute;
 
     /* menus handlers */
index aa27bdeaf905f5fc02932499f7e32fb1f7a3e8e3..d5fb1f66d4ee2930d4ac045ff1656df5642fb1e4 100644 (file)
@@ -2,7 +2,7 @@
  * intf.m: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: intf.m,v 1.18 2003/01/05 01:55:07 massiot Exp $
+ * $Id: intf.m,v 1.19 2003/01/05 16:23:57 massiot Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -305,17 +305,8 @@ static void Run( intf_thread_t *p_intf )
         }
         else if( p_intf->p_sys->p_input->b_dead )
         {
-            vout_thread_t * p_vout = vlc_object_find( p_intf, VLC_OBJECT_VOUT,
-                                                      FIND_ANYWHERE );
             vlc_object_release( p_intf->p_sys->p_input );
             p_intf->p_sys->p_input = NULL;
-
-            if ( p_vout != NULL )
-            {
-                vlc_object_detach( p_vout );
-                vlc_object_release( p_vout );
-                vout_Destroy( p_vout );
-            }
         }
 
         if( p_intf->p_sys->p_input != NULL )
@@ -386,6 +377,20 @@ static void Run( intf_thread_t *p_intf )
             [self displayTime];
             [self manageMode];
             p_intf->p_sys->b_playing = 0;
+
+            if ( p_intf->p_sys->b_stopping )
+            {
+                vout_thread_t * p_vout = vlc_object_find( p_intf, VLC_OBJECT_VOUT,
+                                                          FIND_ANYWHERE );
+
+                if ( p_vout != NULL )
+                {
+                    vlc_object_detach( p_vout );
+                    vlc_object_release( p_vout );
+                    vout_Destroy( p_vout );
+                }
+                p_intf->p_sys->b_stopping = 0;
+            }
         }
 
         /* update the log window */
index e5cac7dd0aaf8656b2e8cdaa961b44d39ea0b623..4e3201d77967825197ed52fe9a3fbb87e0a9e4b7 100644 (file)
@@ -2,7 +2,7 @@
  * prefs.m: MacOS X plugin for vlc
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: prefs.m,v 1.5 2002/12/30 23:45:21 massiot Exp $
+ * $Id: prefs.m,v 1.6 2003/01/05 16:23:57 massiot Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net> 
  *
         [o_view addSubview: [o_text_field autorelease]]; \
     }
 
-#define INPUT_FIELD( ctype, cname, label, w, msg, param ) \
+#define INPUT_FIELD( ctype, cname, label, w, msg, param, tip ) \
     { \
         s_rc.size.height = 25; \
         s_rc.size.width = w; \
         [o_text_field setAlignment: NSRightTextAlignment]; \
         CONTROL_CONFIG( o_text_field, o_module_name, ctype, cname ); \
         [o_text_field msg: param]; \
+        [o_text_field setToolTip: [NSApp localizedString: tip]]; \
         [o_view addSubview: [o_text_field autorelease]]; \
         [[NSNotificationCenter defaultCenter] addObserver: self \
             selector: @selector(configChanged:) \
         s_rc.origin.x = X_ORIGIN; \
     }
 
-#define INPUT_FIELD_INTEGER( name, label, w, param ) \
-    INPUT_FIELD( CONFIG_ITEM_INTEGER, name, label, w, setIntValue, param )
-#define INPUT_FIELD_FLOAT( name, label, w, param ) \
-    INPUT_FIELD( CONFIG_ITEM_FLOAT, name, label, w, setFloatValue, param )
-#define INPUT_FIELD_STRING( name, label, w, param ) \
-    INPUT_FIELD( CONFIG_ITEM_STRING, name, label, w, setStringValue, param )
+#define INPUT_FIELD_INTEGER( name, label, w, param, tip ) \
+    INPUT_FIELD( CONFIG_ITEM_INTEGER, name, label, w, setIntValue, param, tip )
+#define INPUT_FIELD_FLOAT( name, label, w, param, tip ) \
+    INPUT_FIELD( CONFIG_ITEM_FLOAT, name, label, w, setFloatValue, param, tip )
+#define INPUT_FIELD_STRING( name, label, w, param, tip ) \
+    INPUT_FIELD( CONFIG_ITEM_STRING, name, label, w, setStringValue, param, tip )
 
     if( p_item ) do
     {
             [o_modules setTag: i_module_tag++];
             [o_modules setTarget: self];
             [o_modules setAction: @selector(moduleSelected:)];
+            [o_modules setToolTip: [NSApp localizedString: p_item->psz_longtext]];
             [o_cview addSubview: [o_modules autorelease]]; 
 
             MODULE_BUTTON( o_btn_configure, _NS("Configure"), 
                                   p_item->psz_value : "";
 
                 INPUT_FIELD_STRING( p_item->psz_name, p_item->psz_text, 150,
-                                    [NSString stringWithCString: psz_value] );
+                                    [NSString stringWithCString: psz_value],
+                                    p_item->psz_longtext );
             }
             else
             {
                 o_combo_box = [[VLCComboBox alloc] initWithFrame: s_rc];
                 CONTROL_CONFIG( o_combo_box, o_module_name, 
                                 CONFIG_ITEM_STRING, p_item->psz_name );
+                [o_combo_box setToolTip:
+                    [NSApp localizedString: p_item->psz_longtext]];
                 [o_view addSubview: [o_combo_box autorelease]];
                 [[NSNotificationCenter defaultCenter] addObserver: self
                     selector: @selector(configChanged:)
         case CONFIG_ITEM_INTEGER:
         {
             INPUT_FIELD_INTEGER( p_item->psz_name, p_item->psz_text, 70, 
-                                 p_item->i_value );
+                                 p_item->i_value, p_item->psz_longtext );
         }
         break;
 
         case CONFIG_ITEM_FLOAT:
         {
             INPUT_FIELD_FLOAT( p_item->psz_name, p_item->psz_text, 70,
-                               p_item->f_value );
+                               p_item->f_value, p_item->psz_longtext );
         }
         break;
 
             [o_btn_bool setButtonType: NSSwitchButton];
             [o_btn_bool setIntValue: p_item->i_value];
             [o_btn_bool setTitle: 
-                  [NSApp localizedString: p_item->psz_text]];
+                [NSApp localizedString: p_item->psz_text]];
+            [o_btn_bool setToolTip:
+                [NSApp localizedString: p_item->psz_longtext]];
             [o_btn_bool setTarget: self];
             [o_btn_bool setAction: @selector(configChanged:)];
             CONTROL_CONFIG( o_btn_bool, o_module_name, 
index b10634c8045e4eb2aef78a20b35429b9d867b19a..59777a723de70808b4e9d36af44508963851008f 100644 (file)
@@ -2,7 +2,7 @@
  * vout.m: MacOS X video output plugin
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: vout.m,v 1.10 2003/01/05 01:55:07 massiot Exp $
+ * $Id: vout.m,v 1.11 2003/01/05 16:23:57 massiot Exp $
  *
  * Authors: Colin Delacroix <colin@zoy.org>
  *          Florian G. Pflug <fgp@phlo.org>
@@ -547,6 +547,7 @@ static int CoToggleFullscreen( vout_thread_t *p_vout )
             EndFullScreen ( p_vout->p_sys->p_fullscreen_state, NULL );
         p_vout->p_sys->p_fullscreen_state = NULL;
     }
+    config_PutInt( p_vout, "fullscreen", p_vout->b_fullscreen );
 
     if( CoCreateWindow( p_vout ) )
     {
@@ -874,6 +875,7 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
 
     playlist_Stop( p_playlist );
     vlc_object_release( p_playlist );
+    p_intf->p_sys->b_stopping = 1;
 
     /* The window will be closed by the intf later. */
     return NO;