[vlc-devel] commit: implemented the Visualiser and Video Output module settings ( Felix Paul Kühne )

git version control git at videolan.org
Mon Mar 24 22:04:42 CET 2008


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Mon Mar 24 12:33:13 2008 +0100| [8679868f312aef7645ed56706b7886fe7e06d283]

implemented the Visualiser and Video Output module settings

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8679868f312aef7645ed56706b7886fe7e06d283
---

 .../English.lproj/Preferences.nib/info.nib         |    5 +-
 .../English.lproj/Preferences.nib/keyedobjects.nib |  Bin 88632 -> 88929 bytes
 modules/gui/macosx/simple_prefs.m                  |   84 ++++++++++++++++----
 3 files changed, 70 insertions(+), 19 deletions(-)

diff --git a/extras/package/macosx/Resources/English.lproj/Preferences.nib/info.nib b/extras/package/macosx/Resources/English.lproj/Preferences.nib/info.nib
index f2e5866..42d8625 100644
--- a/extras/package/macosx/Resources/English.lproj/Preferences.nib/info.nib
+++ b/extras/package/macosx/Resources/English.lproj/Preferences.nib/info.nib
@@ -10,13 +10,14 @@
 	<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>
diff --git a/extras/package/macosx/Resources/English.lproj/Preferences.nib/keyedobjects.nib b/extras/package/macosx/Resources/English.lproj/Preferences.nib/keyedobjects.nib
index c082cf3..4028e90 100644
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
diff --git a/modules/gui/macosx/simple_prefs.m b/modules/gui/macosx/simple_prefs.m
index 0ebbfc5..729c749 100644
--- a/modules/gui/macosx/simple_prefs.m
+++ b/modules/gui/macosx/simple_prefs.m
@@ -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] );




More information about the vlc-devel mailing list