]> git.sesse.net Git - vlc/commitdiff
implemented the Visualiser and Video Output module settings
authorFelix Paul Kühne <fkuehne@videolan.org>
Mon, 24 Mar 2008 11:33:13 +0000 (12:33 +0100)
committerFelix Paul Kühne <fkuehne@videolan.org>
Mon, 24 Mar 2008 21:04:48 +0000 (22:04 +0100)
extras/package/macosx/Resources/English.lproj/Preferences.nib/info.nib
extras/package/macosx/Resources/English.lproj/Preferences.nib/keyedobjects.nib
modules/gui/macosx/simple_prefs.m

index f2e5866406224906930b79c0fc88d1400bc9a866..42d86259f7b2481bbeaa7f9776969b07f8f97667 100644 (file)
        <integer>5</integer>
        <key>IBOpenObjects</key>
        <array>
+               <integer>2668</integer>
                <integer>2562</integer>
                <integer>2410</integer>
                <integer>2440</integer>
+               <integer>2311</integer>
                <integer>2523</integer>
+               <integer>2330</integer>
                <integer>2678</integer>
-               <integer>2668</integer>
-               <integer>2311</integer>
        </array>
        <key>IBSystem Version</key>
        <string>9C31</string>
index c082cf372502a29fd8f3c067f6795fefd468142c..4028e9080ea733c682e12fec58d9b02deb5cc91d 100644 (file)
Binary files a/extras/package/macosx/Resources/English.lproj/Preferences.nib/keyedobjects.nib and b/extras/package/macosx/Resources/English.lproj/Preferences.nib/keyedobjects.nib differ
index 0ebbfc5ef3c9b802d4c17174eb98ea639e3c4b17..729c7493f9e34338ad29ca2d0a43ac0acbf2ef63 100644 (file)
@@ -294,7 +294,7 @@ static VLCSimplePrefs *_o_sharedInstance = nil;
     [o_video_enable_ckb setTitle: _NS("Enable Video")];
     [o_video_fullscreen_ckb setTitle: _NS("Fullscreen")];
     [o_video_onTop_ckb setTitle: _NS("Always on top")];
-    [o_video_output_txt setStringValue: _NS("Display device")];
+    [o_video_output_txt setStringValue: _NS("Output module")];
     [o_video_skipFrames_ckb setTitle: _NS("Skip frames")];
     [o_video_snap_box setTitle: _NS("Video snapshots")];
     [o_video_snap_folder_btn setTitle: _NS("Browse...")];
@@ -307,6 +307,8 @@ static VLCSimplePrefs *_o_sharedInstance = nil;
 - (void)resetControls
 {
     module_config_t *p_item;
+    vlc_list_t *p_list;
+    module_t *p_parser;
     int i, y = 0;
     char *psz_tmp;
 
@@ -323,19 +325,41 @@ static VLCSimplePrefs *_o_sharedInstance = nil;
     if( p_item->value.i < [object numberOfItems] ) \
         [object selectItemAtIndex: p_item->value.i]; \
     else \
-        [object selectItemAtIndex: 0]
+        [object selectItemAtIndex: 0]; \
+    [object setToolTip: _NS( p_item->psz_longtext )]
 
     #define SetupStringList( object, name ) \
-        [object removeAllItems]; \
-        y = 0; \
-        p_item = config_FindConfig( VLC_OBJECT(p_intf), name ); \
-        for( i = 0; p_item->ppsz_list[i] != nil; i++ ) \
+    [object removeAllItems]; \
+    y = 0; \
+    p_item = config_FindConfig( VLC_OBJECT(p_intf), name ); \
+    for( i = 0; p_item->ppsz_list[i] != nil; i++ ) \
+    { \
+        [object addItemWithTitle: _NS( p_item->ppsz_list_text[i] )]; \
+        if( p_item->value.psz && !strcmp( p_item->value.psz, p_item->ppsz_list[i] ) ) \
+            y = i; \
+    } \
+    [object selectItemAtIndex: y]; \
+    [object setToolTip: _NS( p_item->psz_longtext )]
+    
+    #define SetupModuleList( object, name ) \
+    p_item = config_FindConfig( VLC_OBJECT(p_intf), name ); \
+    p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE ); \
+    [object removeAllItems]; \
+    [object addItemWithTitle: _NS("Default")]; \
+    for( int i_index = 0; i_index < p_list->i_count; i_index++ ) \
+    { \
+        p_parser = (module_t *)p_list->p_values[i_index].p_object ; \
+        \
+        if( module_IsCapable( p_parser, p_item->psz_type ) ) \
         { \
-            [object addItemWithTitle: _NS( p_item->ppsz_list_text[i] )]; \
-            if( p_item->value.psz && !strcmp( p_item->value.psz, p_item->ppsz_list[i] ) ) \
-                y = i; \
+            [object addItemWithTitle: [NSString stringWithUTF8String: module_GetLongName( p_parser )]]; \
+            \
+            if( p_item->value.psz && !strcmp( p_item->value.psz, module_GetObjName( p_parser ) ) ) \
+                [object selectItem: [object lastItem]]; \
         } \
-        [object selectItemAtIndex: y]
+    } \
+    vlc_list_release( p_list ); \
+    [object setToolTip: _NS(p_item->psz_longtext)]
 
     /**********************
      * interface settings *
@@ -366,10 +390,9 @@ static VLCSimplePrefs *_o_sharedInstance = nil;
     if( psz_tmp )
         [o_audio_norm_ckb setState: (int)strstr( psz_tmp, "normvol" )];
     [o_audio_norm_fld setFloatValue: config_GetFloat( p_intf, "norm-max-level" )];
-    
-    // visualizer
-    msg_Warn( p_intf, "visualizer not implemented!" );
-    
+
+    SetupModuleList( o_audio_visual_pop, "audio-visual" );
+
     /* Last.FM is optional */
     if( module_Exists( p_intf, "audioscrobbler" ) )
     {
@@ -391,7 +414,10 @@ static VLCSimplePrefs *_o_sharedInstance = nil;
     [o_video_skipFrames_ckb setState: config_GetInt( p_intf, "skip-frames" )];
     [o_video_black_ckb setState: config_GetInt( p_intf, "macosx-black" )];
 
-    msg_Warn( p_intf, "vout module and display device selectors not implemented!" );
+    SetupModuleList( o_video_output_pop, "vout" );
+
+    msg_Warn( p_intf, "display device selector not implemented!" );
+    [o_video_device_pop removeAllItems];
 
     if( config_GetPsz( p_intf, "snapshot-path" ) != NULL )
         [o_video_snap_folder_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "snapshot-path" )]];
@@ -578,6 +604,8 @@ static VLCSimplePrefs *_o_sharedInstance = nil;
 - (void)saveChangedSettings
 {
     module_config_t *p_item;
+    vlc_list_t *p_list;
+    module_t *p_parser;
     char *psz_tmp;
     int i;
     
@@ -595,6 +623,27 @@ static VLCSimplePrefs *_o_sharedInstance = nil;
     else \
         config_PutPsz( p_intf, name, strdup( [[VLCMain sharedInstance] delocalizeString: [object stringValue]] ) )
 
+#define SaveModuleList( object, name ) \
+    p_item = config_FindConfig( VLC_OBJECT(p_intf), name ); \
+    \
+    p_list = vlc_list_find( VLCIntf, VLC_OBJECT_MODULE, FIND_ANYWHERE ); \
+    for( int i_module_index = 0; i_module_index < p_list->i_count; i_module_index++ ) \
+    { \
+        p_parser = (module_t *)p_list->p_values[i_module_index].p_object; \
+        \
+        if( p_item->i_type == CONFIG_ITEM_MODULE && module_IsCapable( p_parser, p_item->psz_type ) ) \
+        { \
+            if( [[[object selectedItem] title] isEqualToString: _NS( module_GetLongName( p_parser ) )] ) \
+            { \
+                config_PutPsz( p_intf, name, strdup( module_GetObjName( p_parser ))); \
+                break; \
+            } \
+        } \
+    } \
+    vlc_list_release( p_list ); \
+    if( [[[object selectedItem] title] isEqualToString: _NS( "Default" )] ) \
+        config_PutPsz( p_intf, name, "Default" )
+
     /**********************
      * interface settings *
      **********************/
@@ -652,7 +701,7 @@ static VLCSimplePrefs *_o_sharedInstance = nil;
         }
         config_PutFloat( p_intf, "norm-max-level", [o_audio_norm_fld floatValue] );
 
-        msg_Warn( p_intf, "visualizer not implemented!" );
+        SaveModuleList( o_audio_visual_pop, "audio-visual" );
 
         /* Last.FM is optional */
         if( module_Exists( p_intf, "audioscrobbler" ) )
@@ -690,7 +739,8 @@ static VLCSimplePrefs *_o_sharedInstance = nil;
         config_PutInt( p_intf, "skip-frames", [o_video_skipFrames_ckb state] );
         config_PutInt( p_intf, "macosx-black", [o_video_black_ckb state] );
 
-        msg_Warn( p_intf, "vout module and display device selectors not implemented!" );
+        SaveModuleList( o_video_output_pop, "vout" );
+        msg_Warn( p_intf, "display device selector not implemented!" );
 
         config_PutPsz( p_intf, "snapshot-path", [[o_video_snap_folder_fld stringValue] UTF8String] );
         config_PutPsz( p_intf, "snapshot-prefix", [[o_video_snap_prefix_fld stringValue] UTF8String] );