]> git.sesse.net Git - vlc/commitdiff
* Add some options to the subtitle selection dialog. (relative size, encoding, and...
authorBenjamin Pracht <bigben@videolan.org>
Mon, 30 Aug 2004 20:57:08 +0000 (20:57 +0000)
committerBenjamin Pracht <bigben@videolan.org>
Mon, 30 Aug 2004 20:57:08 +0000 (20:57 +0000)
extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib
extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib
extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib
modules/gui/macosx/open.h
modules/gui/macosx/open.m

index fea1a6b03512f0197dd2584aa5f5f785c699c90c..a5fed4d252cdc610ed554fcbe7efc46899be812b 100644 (file)
                 "o_file_btn_browse" = id; 
                 "o_file_path" = id; 
                 "o_file_stream" = id; 
+                "o_file_sub_align_lbl" = id; 
+                "o_file_sub_align_pop" = id; 
                 "o_file_sub_btn_browse" = id; 
                 "o_file_sub_btn_settings" = id; 
                 "o_file_sub_ckbox" = id; 
                 "o_file_sub_delay" = id; 
                 "o_file_sub_delay_lbl" = id; 
                 "o_file_sub_delay_stp" = id; 
+                "o_file_sub_encoding_lbl" = id; 
+                "o_file_sub_encoding_pop" = id; 
                 "o_file_sub_fps" = id; 
                 "o_file_sub_fps_lbl" = id; 
                 "o_file_sub_fps_stp" = id; 
                 "o_file_sub_override" = id; 
                 "o_file_sub_path" = id; 
                 "o_file_sub_sheet" = id; 
+                "o_file_sub_size_lbl" = id; 
+                "o_file_sub_size_pop" = id; 
                 "o_mrl" = id; 
                 "o_mrl_lbl" = id; 
                 "o_net_http_url" = id; 
index 5bbcdf47f4bc00d3ca151bbd4504712571f33b8c..bd9e17d8ca46ac5d683bd29154b7fd59f6980029 100644 (file)
@@ -3,7 +3,7 @@
 <plist version="1.0">
 <dict>
        <key>IBDocumentLocation</key>
-       <string>799 152 505 517 0 0 1280 1002 </string>
+       <string>396 229 505 517 0 0 1024 746 </string>
        <key>IBEditorPositions</key>
        <dict>
                <key>1617</key>
@@ -22,6 +22,7 @@
        <key>IBOpenObjects</key>
        <array>
                <integer>29</integer>
+               <integer>1263</integer>
                <integer>21</integer>
        </array>
        <key>IBSystem Version</key>
index 521ca29e57b4cd97138362d07c010f584744bec6..69577977b43fe81e970750567fddd2822071f794 100644 (file)
Binary files a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib and b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib differ
index 16ad025b5e93e08803a9a5d912be8e63ca67c816..3a1f3957b981fd888044e9656a7eda5e3d04e035 100644 (file)
@@ -82,12 +82,19 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class );
     IBOutlet id o_file_sub_fps;
     IBOutlet id o_file_sub_fps_lbl;
     IBOutlet id o_file_sub_fps_stp;
+    IBOutlet id o_file_sub_encoding_pop;
+    IBOutlet id o_file_sub_encoding_lbl;
+    IBOutlet id o_file_sub_size_pop;
+    IBOutlet id o_file_sub_size_lbl;
+    IBOutlet id o_file_sub_align_pop;
+    IBOutlet id o_file_sub_align_lbl;
     IBOutlet id o_file_sub_ok_btn;
-    
+
     IBOutlet id o_output_ckbox;
     IBOutlet id o_sout_options;
 }
 
+- (void)setSubPanel;
 - (void)openTarget:(int)i_type;
 - (void)tabView:(NSTabView *)o_tv didSelectTabViewItem:(NSTabViewItem *)o_tvi;
 
index fbbced1c0365e1e1a636f4724f8ffa64db559094..37967082c62efe7ff841612415a2308dd14cbf15 100644 (file)
@@ -7,6 +7,7 @@
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net> 
  *          Christophe Massiot <massiot@via.ecp.fr>
  *          Derk-Jan Hartman <thedj@users.sourceforge.net>
+ *          Benjamin Pracht <bigben at videolan dot org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -168,16 +169,9 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class )
     [o_net_udp_port setIntValue: config_GetInt( p_intf, "server-port" )];
     [o_net_udp_port_stp setIntValue: config_GetInt( p_intf, "server-port" )];
 
-    [o_file_sub_ckbox setTitle: _NS("Load subtitles file:")];
-    [o_file_sub_btn_settings setTitle: _NS("Settings...")];
-    [o_file_sub_btn_browse setTitle: _NS("Browse...")];
-    [o_file_sub_override setTitle: _NS("Override")];
-    [o_file_sub_delay_lbl setStringValue: _NS("delay")];
-    [o_file_sub_delay_stp setEnabled: NO];
-    [o_file_sub_fps_lbl setStringValue: _NS("fps")];
-    [o_file_sub_fps_stp setEnabled: NO];
-    [o_file_sub_ok_btn setStringValue: _NS("OK")];
-    
+    [self setSubPanel];
+
+
     [[NSNotificationCenter defaultCenter] addObserver: self
         selector: @selector(openFilePathChanged:)
         name: NSControlTextDidChangeNotification
@@ -218,6 +212,74 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class )
         object: o_net_http_url];
 }
 
+- (void)setSubPanel
+{
+    intf_thread_t * p_intf = VLCIntf;
+    int i_index;
+    module_config_t * p_item;
+
+    [o_file_sub_ckbox setTitle: _NS("Load subtitles file:")];
+    [o_file_sub_btn_settings setTitle: _NS("Settings...")];
+    [o_file_sub_btn_browse setTitle: _NS("Browse...")];
+    [o_file_sub_override setTitle: _NS("Override")];
+    [o_file_sub_delay_lbl setStringValue: _NS("delay")];
+    [o_file_sub_delay_stp setEnabled: NO];
+    [o_file_sub_fps_lbl setStringValue: _NS("fps")];
+    [o_file_sub_fps_stp setEnabled: NO];
+    [o_file_sub_encoding_lbl setStringValue: _NS("Subtitles text encoding")];
+    [o_file_sub_encoding_pop removeAllItems];
+    [o_file_sub_size_lbl setStringValue: _NS("Font size")];
+    [o_file_sub_size_pop removeAllItems];
+    [o_file_sub_align_lbl setStringValue: _NS("Subtitles justification")];
+    [o_file_sub_align_pop removeAllItems];
+    [o_file_sub_ok_btn setStringValue: _NS("OK")];
+
+    p_item = config_FindConfig( VLC_OBJECT(p_intf), "subsdec-encoding" );
+
+    if( p_item )
+    {
+        for( i_index = 0; p_item->ppsz_list && p_item->ppsz_list[i_index];
+             i_index++ )
+        {
+            [o_file_sub_encoding_pop addItemWithTitle:
+                [NSString stringWithCString:
+                p_item->ppsz_list[i_index]]];
+        }
+        [o_file_sub_encoding_pop selectItemWithTitle:
+                [NSString stringWithCString:
+                p_item->psz_value]];
+    }
+
+    p_item = config_FindConfig( VLC_OBJECT(p_intf), "subsdec-align" );
+
+    if ( p_item )
+    {
+        for ( i_index = 0; i_index < p_item->i_list; i_index++ )
+        {
+            [o_file_sub_align_pop addItemWithTitle:
+                [NSString stringWithUTF8String:
+                p_item->ppsz_list_text[i_index]]];
+        }
+        [o_file_sub_align_pop selectItemAtIndex: p_item->i_value];
+    }
+
+    p_item = config_FindConfig( VLC_OBJECT(p_intf), "freetype-rel-fontsize" );
+
+    if ( p_item )
+    {
+        for ( i_index = 0; i_index < p_item->i_list; i_index++ )
+        {
+            [o_file_sub_size_pop addItemWithTitle:
+                [NSString stringWithUTF8String:
+                p_item->ppsz_list_text[i_index]]];
+            if ( p_item->i_value == p_item->pi_list[i_index] )
+            {
+                [o_file_sub_size_pop selectItemAtIndex: i_index];
+            }
+        }
+    }
+}
+
 - (void)openTarget:(int)i_type
 {
     int i_result;
@@ -237,12 +299,31 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class )
         o_dic = [NSMutableDictionary dictionaryWithObject: [o_mrl stringValue] forKey: @"ITEM_URL"];
         if( [o_file_sub_ckbox state] == NSOnState )
         {
+            intf_thread_t * p_intf = VLCIntf;
+            module_config_t * p_item;
+
             [o_options addObject: [NSString stringWithFormat: @"sub-file=%s", [[o_file_sub_path stringValue] fileSystemRepresentation]]];
             if( [o_file_sub_override state] == NSOnState )
             {
                 [o_options addObject: [NSString stringWithFormat: @"sub-delay=%i", (int)( [o_file_sub_delay intValue] * 10 )]];
                 [o_options addObject: [NSString stringWithFormat: @"sub-fps=%f", [o_file_sub_fps floatValue]]];
             }
+            [o_options addObject: [NSString stringWithFormat:
+                    @"subsdec-encoding=%@",
+                    [o_file_sub_encoding_pop titleOfSelectedItem]]];
+            [o_options addObject: [NSString stringWithFormat:
+                    @"subsdec-align=%i",
+                    [o_file_sub_align_pop indexOfSelectedItem]]];
+
+            p_item = config_FindConfig( VLC_OBJECT(p_intf),
+                                            "freetype-rel-fontsize" );
+
+            if ( p_item )
+            {
+                [o_options addObject: [NSString stringWithFormat:
+                    @"freetype-rel-fontsize=%i",
+                    p_item->pi_list[[o_file_sub_size_pop indexOfSelectedItem]]]];
+            }
         }
         if( [o_output_ckbox state] == NSOnState )
         {