]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/wizard.m
Input access locking, part 3 (final).
[vlc] / modules / gui / macosx / wizard.m
index c2f3845f758bcad8fc0000244789ef86ead607e6..3e3663602c59e72b89380678e7222aa77d1d7b20 100644 (file)
@@ -444,6 +444,7 @@ static VLCWizard *_o_sharedInstance = nil;
     [o_t6_btn_mrInfo_sap setTitle: _NS("More Info")];
     [o_t6_ckb_local setTitle: _NS("Local playback")];
     [o_t6_btn_mrInfo_local setTitle: _NS("More Info")];
+    [o_t6_ckb_soverlay setTitle: _NS("Add Subtitles to transcoded video")];
 
     /* page seven ("Transcode 2") */
     [o_t7_title setStringValue: _NS("Additional transcode options")];
@@ -452,6 +453,11 @@ static VLCWizard *_o_sharedInstance = nil;
     [o_t7_txt_saveFileTo setStringValue: _NS("Select the file to save to")];
     [o_t7_btn_chooseFile setTitle: _NS("Choose...")];
     [o_t7_ckb_local setTitle: _NS("Local playback")];
+    [o_t7_ckb_soverlay setTitle: _NS("Add Subtitles to transcoded video")];
+    [o_t7_ckb_soverlay setToolTip: _NS("Adds available subtitles directly to " \
+                                       "the video. These cannot be disabled " \
+                                       "by the receiving user as they become " \
+                                       "part of the image.")];
     [o_t7_btn_mrInfo_local setTitle: _NS("More Info")];
 
     /* page eight ("Summary") */
@@ -476,6 +482,8 @@ static VLCWizard *_o_sharedInstance = nil;
         stringByAppendingString: @":"]];
     [o_t8_txt_trnscdVideo setStringValue: [_NS("Transcode video") \
         stringByAppendingString: @":"]];
+    [o_t8_txt_soverlay setStringValue: [_NS("Include subtitles") \
+        stringByAppendingString: @":"]];
     [o_t8_txt_local setStringValue: [_NS("Local playback") \
         stringByAppendingString: @":"]];
 }
@@ -589,8 +597,10 @@ static VLCWizard *_o_sharedInstance = nil;
 
                     if( p_item->i_children <= 0 )
                     {
+                        char *psz_uri = input_item_GetURI( p_item->p_input );
                         [tempArray addObject: [NSString stringWithUTF8String:
-                        p_item->p_input->psz_uri]];
+                        psz_uri]];
+                        free( psz_uri );
                         stop = NO;
                     }
                     else
@@ -1143,6 +1153,11 @@ static VLCWizard *_o_sharedInstance = nil;
             [o_userSelections setObject:@"NO" forKey:@"localPb"];
         }
         
+        /* include subtitles? */
+        [o_userSelections setObject: 
+            [[NSNumber numberWithInt:[o_t6_ckb_soverlay state]] stringValue]
+                             forKey: @"soverlay"];
+        
         /* go to "Summary" */
         [self showSummary];
     }
@@ -1267,6 +1282,11 @@ static VLCWizard *_o_sharedInstance = nil;
                     [o_t7_fld_filePath stringValue]] forKey: @"trnscdFilePath"];
             }
 
+            /* include subtitles ? */
+            [o_userSelections setObject: 
+                [[NSNumber numberWithInt:[o_t7_ckb_soverlay state]] stringValue]
+                                 forKey: @"soverlay"];
+            
             /* go to "Summary" */
             [self showSummary];
         }
@@ -1314,7 +1334,7 @@ static VLCWizard *_o_sharedInstance = nil;
                 UTF8String] );
 
             playlist_AddInput( p_playlist, p_input, PLAYLIST_STOP, 
-                       PLAYLIST_END, VLC_TRUE );
+                       PLAYLIST_END, VLC_TRUE, VLC_FALSE );
 
             if( x == 0 )
             {
@@ -1405,6 +1425,12 @@ static VLCWizard *_o_sharedInstance = nil;
     {
         [o_t8_fld_trnscdVideo setStringValue: _NS("no")];
     }
+    
+    if ([[o_userSelections objectForKey:@"soverlay"] isEqualToString:@"1"])
+        [o_t8_fld_soverlay setStringValue: _NS("yes")];
+    else
+        [o_t8_fld_soverlay setStringValue: _NS("no")];
+    
     if ([[o_userSelections objectForKey:@"trnscdAudio"] isEqualToString:@"YES"])
     {
         [o_t8_fld_trnscdAudio setStringValue: [NSString stringWithFormat:
@@ -1418,7 +1444,6 @@ static VLCWizard *_o_sharedInstance = nil;
         [o_t8_fld_trnscdAudio setStringValue: _NS("no")];
     }
 
-
     if ([[o_userSelections objectForKey:@"trnscdOrStrmg"] isEqualToString:@"strmg"])
     {
         /* we are streaming and perhaps also transcoding */
@@ -1493,7 +1518,7 @@ static VLCWizard *_o_sharedInstance = nil;
                 [o_trnscdCmd appendString: @"}:"];
             }
         }
-    
+            
         /* check whether the user requested local playback. if yes, prepare the
          * string, if not, let it empty */
         if ([[o_userSelections objectForKey:@"localPb"] isEqualToString:@"YES"])
@@ -1572,6 +1597,10 @@ static VLCWizard *_o_sharedInstance = nil;
         {
             [o_opts_string appendString: @"\"}"];
         }
+        
+        /* add subtitles to the video if desired */
+        [o_opts_string appendFormat: @":sout-transcode-soverlay=%@", 
+                [o_userSelections objectForKey:@"soverlay"]];
 
         [tempArray addObject: o_opts_string];