]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/wizard.m
* added RTP uni-/multicast to the wizard
[vlc] / modules / gui / macosx / wizard.m
index b9d9e7aefd2c2e0fa060d02ef79061ebaacbfb33..72763d2842049a84e8649bd6cf01dd5558d449e2 100644 (file)
@@ -134,11 +134,11 @@ static VLCWizard *_o_sharedInstance = nil;
         _NS("DivX third version (useable with MPEG TS, MPEG1, ASF and OGG)"), \
         @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG", @"NO", @"NO", @"NO", \
         @"NO", @"NO", nil];
-    o_h263 = [NSArray arrayWithObjects: @"H.263", @"H263", \
+    o_h263 = [NSArray arrayWithObjects: @"H.263", @"h263", \
         _NS("H263 is a video codec optimized for videoconference " \
         "(low rates, useable with MPEG TS)"), @"MUX_TS", @"NO", @"NO", @"NO", \
         @"NO", @"NO", @"NO", @"NO", @"NO", nil];
-    o_h264 = [NSArray arrayWithObjects: @"H.264", @"H264", \
+    o_h264 = [NSArray arrayWithObjects: @"H.264", @"h264", \
         _NS("H264 is a new video codec (useable with MPEG TS and MP4)"), \
         @"MUX_TS", @"MUX_MP4", @"NO", @"NO", @"NO", @"NO", @"NO", @"NO", \
         @"NO", nil];
@@ -252,7 +252,8 @@ static VLCWizard *_o_sharedInstance = nil;
     NSArray * o_mms;
     NSArray * o_udp_uni;
     NSArray * o_udp_multi;
-    NSArray * o_rtp;
+    NSArray * o_rtp_uni;
+    NSArray * o_rtp_multi;
     o_http = [NSArray arrayWithObjects: @"http", @"HTTP", _NS("Enter the local " \
         "addresses you want to listen to. Do not enter anything if you want to " \
         "listen to all adresses or if you don't understand. This is generally " \
@@ -279,11 +280,18 @@ static VLCWizard *_o_sharedInstance = nil;
         "to a dynamic group of computers on a multicast-enabled network. This " \
         "is the most efficient method to stream to several computers, but it " \
         "does not work over Internet."), nil];
-    o_rtp = [NSArray arrayWithObjects: @"rtp", @"RTP", _NS("Enter the " \
+    o_rtp_uni = [NSArray arrayWithObjects: @"rtp", @"RTP-Unicast", _NS("Enter the " \
         "address of the computer to stream to.") , _NS("Use this to stream " \
         "to a single computer."), nil];
+    o_rtp_multi = [NSArray arrayWithObjects: @"rtp", @"RTP-Multicast", _NS("Enter " \
+        "the multicast address to stream to in this field. This must be an IP " \
+        "address between 224.0.0.0 and 239.255.255.255. For a private use, " \
+        "enter an address beginning with 239.255."), _NS("Use this to stream " \
+        "to a dynamic group of computers on a multicast-enabled network. This " \
+        "is the most efficient method to stream to several computers, but it " \
+        "does not work over Internet."), nil];
     o_strmgMthds = [[NSArray alloc] initWithObjects: o_http, o_mms, \
-        o_udp_uni, o_udp_multi, o_rtp, nil];
+        o_udp_uni, o_udp_multi, o_rtp_uni, o_rtp_multi, nil];
 }
 
 - (void)showWizard
@@ -426,6 +434,8 @@ static VLCWizard *_o_sharedInstance = nil;
     [o_t6_btn_mrInfo_ttl setTitle: _NS("More Info")];
     [o_t6_ckb_sap setTitle: _NS("SAP Announce")];
     [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")];
 
     /* page seven ("Transcode 2") */
     [o_t7_title setStringValue: _NS("Additional transcode options")];
@@ -433,6 +443,8 @@ static VLCWizard *_o_sharedInstance = nil;
                               "additional parameters for your transcoding.")];
     [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_btn_mrInfo_local setTitle: _NS("More Info")];
 
     /* page eight ("Summary") */
     [o_t8_txt_text setStringValue: _NS("This page lists all your selections. " \
@@ -603,10 +615,11 @@ static VLCWizard *_o_sharedInstance = nil;
         [self rebuildCodecMenus];
         
         /* check which streaming method is selected and store it */
-        NSString *o_mode;
-        o_mode = [[o_t3_matrix_stmgMhd selectedCell] title];
-        if( [o_mode isEqualToString: @"HTTP"] )
+        int mode;
+        mode = [[o_t3_matrix_stmgMhd selectedCell] tag];
+        if( mode == 0 )
         {
+            /* HTTP Streaming */
             [o_userSelections setObject:@"0" forKey:@"stmgMhd"];
 
             /* disable all codecs which don't support MPEG PS, MPEG TS, MPEG 1,
@@ -614,8 +627,9 @@ static VLCWizard *_o_sharedInstance = nil;
             [o_t4_pop_audioCodec removeItemWithTitle:@"Uncompressed, integer"];
             [o_t4_pop_audioCodec removeItemWithTitle:@"Uncompressed, floating"];
             
-        } else if ([o_mode isEqualToString: @"MMS"])
+        } else if ( mode == 1 )
         {
+            /* MMS Streaming */
             [o_userSelections setObject:@"1" forKey:@"stmgMhd"];
             
             /* disable all codecs which don't support ASF / ASFH */
@@ -633,12 +647,10 @@ static VLCWizard *_o_sharedInstance = nil;
             [o_t4_pop_videoCodec removeItemWithTitle:@"MJPEG"];
             [o_t4_pop_videoCodec removeItemWithTitle:@"Theora"];
         } else {
-            if( [o_mode isEqualToString: _NS("UDP Unicast")] )
-            {
-                [o_userSelections setObject:@"2" forKey:@"stmgMhd"];
-            } else {
-                [o_userSelections setObject:@"3" forKey:@"stmgMhd"];
-            }
+            /* RTP/UDP Unicast/Multicast Streaming */
+            
+            [o_userSelections setObject: [[NSNumber numberWithInt: mode] \
+                stringValue] forKey:@"stmgMhd"];
             
             /* disable all codecs which don't support MPEG-TS */
             [o_t4_pop_audioCodec removeItemWithTitle:@"Vorbis"];
@@ -987,7 +999,8 @@ static VLCWizard *_o_sharedInstance = nil;
             [[o_t5_matrix_encap cellAtRow:10 column:0] setEnabled:NO];
             [o_t5_matrix_encap selectCellAtRow:0 column:0];
         }
-        if ([o_userSelections objectForKey:@"stmgMhd"] == @"1")
+
+        if ( [o_userSelections objectForKey:@"stmgMhd"] == @"1" )
         {
             /* if MMS is the streaming protocol, only ASFH is available */
             [[o_t5_matrix_encap cellAtRow:0 column:0] setEnabled:NO];
@@ -1003,7 +1016,7 @@ static VLCWizard *_o_sharedInstance = nil;
             [[o_t5_matrix_encap cellAtRow:10 column:0] setEnabled:YES];
             [o_t5_matrix_encap selectCellAtRow:10 column:0];
         }
-        else if ([o_userSelections objectForKey:@"stmgMhd"] == @"0")
+        else if ( [o_userSelections objectForKey:@"stmgMhd"] == @"0" )
         {
             /* if HTTP is the streaming protocol, disable all unsupported
              * encap-formats, but don't touch the other ones selected above */
@@ -1013,9 +1026,9 @@ static VLCWizard *_o_sharedInstance = nil;
             [[o_t5_matrix_encap cellAtRow:9 column:0] setEnabled:NO];
             [[o_t5_matrix_encap cellAtRow:10 column:0] setEnabled:NO];
         }
-        else if ([o_userSelections objectForKey:@"stmgMhd"] >= @"2")
+        else if ( [[o_userSelections objectForKey:@"stmgMhd"] intValue] >= 2 )
         {
-            /* if UDP is the streaming protocol, only MPEG-TS is available */
+            /* if UDP/RTP is the streaming protocol, only MPEG-TS is available */
             [[o_t5_matrix_encap cellAtRow:0 column:0] setEnabled:NO];
             [[o_t5_matrix_encap cellAtRow:2 column:0] setEnabled:NO];
             [[o_t5_matrix_encap cellAtRow:3 column:0] setEnabled:NO];
@@ -1215,12 +1228,40 @@ static VLCWizard *_o_sharedInstance = nil;
         [o_t8_fld_partExtract setStringValue: _NS("no")];
     }
 
+    if ([[o_userSelections objectForKey:@"trnscdVideo"] isEqualToString:@"YES"])
+    {
+        [o_t8_fld_trnscdVideo setStringValue: [[[[[_NS("yes") \
+            stringByAppendingString:@": "] stringByAppendingString: \
+            [[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey: \
+            @"trnscdVideoCodec"] intValue]] objectAtIndex:0]] \
+            stringByAppendingString:@" @ "] stringByAppendingString: \
+            [o_userSelections objectForKey:@"trnscdVideoBitrate"]] \
+            stringByAppendingString:@" kb/s"]];
+    }
+    else
+    {
+        [o_t8_fld_trnscdVideo setStringValue: _NS("no")];
+    }
+    if ([[o_userSelections objectForKey:@"trnscdAudio"] isEqualToString:@"YES"])
+    {
+        [o_t8_fld_trnscdAudio setStringValue: [[[[[_NS("yes") \
+        stringByAppendingString:@": "] stringByAppendingString: \
+        [[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey: \
+        @"trnscdAudioCodec"] intValue]] objectAtIndex:0]] \
+        stringByAppendingString:@" @ "] stringByAppendingString: \
+        [o_userSelections objectForKey:@"trnscdAudioBitrate"]] \
+        stringByAppendingString:@" kb/s"]];
+    }
+    else
+    {
+        [o_t8_fld_trnscdAudio setStringValue: _NS("no")];
+    }
+
+
     if ([[o_userSelections objectForKey:@"trnscdOrStrmg"] isEqualToString:@"strmg"])
     {
-        /* we are streaming; no transcoding allowed atm */
+        /* we are streaming and perhaps also transcoding */
         [o_t8_fld_saveFileTo setStringValue: @"-"];
-        [o_t8_fld_trnscdAudio setStringValue: @"-"];
-        [o_t8_fld_trnscdVideo setStringValue: @"-"];
         [o_t8_fld_strmgMthd setStringValue: [[o_strmgMthds objectAtIndex: \
             [[o_userSelections objectForKey:@"stmgMhd"] intValue]] \
             objectAtIndex:1]];
@@ -1239,30 +1280,6 @@ static VLCWizard *_o_sharedInstance = nil;
         [o_t8_fld_destination setStringValue: @"-"];
         [o_t8_fld_ttl setStringValue: @"-"];
         [o_t8_fld_sap setStringValue: @"-"];
-        if ([[o_userSelections objectForKey:@"trnscdVideo"] isEqualToString:@"YES"])
-        {
-            [o_t8_fld_trnscdVideo setStringValue: [[[[[_NS("yes") \
-                stringByAppendingString:@": "] stringByAppendingString: \
-                [[o_videoCodecs objectAtIndex:[[o_userSelections objectForKey: \
-                @"trnscdVideoCodec"] intValue]] objectAtIndex:0]] \
-                stringByAppendingString:@" @ "] stringByAppendingString: \
-                [o_userSelections objectForKey:@"trnscdVideoBitrate"]] \
-                stringByAppendingString:@" kb/s"]];
-        }else{
-            [o_t8_fld_trnscdVideo setStringValue: _NS("no")];
-        }
-        if ([[o_userSelections objectForKey:@"trnscdAudio"] isEqualToString:@"YES"])
-        {
-            [o_t8_fld_trnscdAudio setStringValue: [[[[[_NS("yes") \
-            stringByAppendingString:@": "] stringByAppendingString: \
-            [[o_audioCodecs objectAtIndex:[[o_userSelections objectForKey: \
-            @"trnscdAudioCodec"] intValue]] objectAtIndex:0]] \
-            stringByAppendingString:@" @ "] stringByAppendingString: \
-            [o_userSelections objectForKey:@"trnscdAudioBitrate"]] \
-            stringByAppendingString:@" kb/s"]];
-        }else{
-            [o_t8_fld_trnscdAudio setStringValue: _NS("no")];
-        }
         [o_t8_fld_saveFileTo setStringValue: [o_userSelections objectForKey: \
             @"trnscdFilePath"]];
     }
@@ -1526,9 +1543,25 @@ static VLCWizard *_o_sharedInstance = nil;
 {
     /* change the captions of o_t3_txt_destInfo according to the chosen
      * streaming method */
-    NSNumber * o_mode;
-    o_mode = [[NSNumber alloc] initWithInt:[[o_t3_matrix_stmgMhd selectedCell] tag]];
-    if( [o_mode intValue] == 0 )
+    int mode;
+    mode = [[o_t3_matrix_stmgMhd selectedCell] tag];
+    if( mode == 0 )
+    {
+        /* HTTP */
+        [o_t3_txt_destInfo setStringValue: [[o_strmgMthds objectAtIndex:0] \
+            objectAtIndex:2]];
+        [o_t3_txt_strgMthdInfo setStringValue: [[o_strmgMthds objectAtIndex:0] \
+            objectAtIndex:3]];
+    }
+    else if( mode == 1 )
+    {
+        /* MMS */
+        [o_t3_txt_destInfo setStringValue: [[o_strmgMthds objectAtIndex:1] \
+            objectAtIndex:2]];
+        [o_t3_txt_strgMthdInfo setStringValue: [[o_strmgMthds objectAtIndex:1] \
+            objectAtIndex:3]];
+    }
+    else if( mode == 2 )
     {
         /* UDP-Unicast */
         [o_t3_txt_destInfo setStringValue: [[o_strmgMthds objectAtIndex:2] \
@@ -1536,7 +1569,7 @@ static VLCWizard *_o_sharedInstance = nil;
         [o_t3_txt_strgMthdInfo setStringValue: [[o_strmgMthds objectAtIndex:2] \
         objectAtIndex:3]];
     }
-    else if ( [o_mode intValue] == 1 )
+    else if( mode == 3 )
     {
         /* UDP-Multicast */
         [o_t3_txt_destInfo setStringValue: [[o_strmgMthds objectAtIndex:3] \
@@ -1544,31 +1577,22 @@ static VLCWizard *_o_sharedInstance = nil;
         [o_t3_txt_strgMthdInfo setStringValue: [[o_strmgMthds objectAtIndex:3] \
         objectAtIndex:3]];
     }
-    else if( [o_mode intValue] == 2 )
+    else if( mode == 4 )
     {
-        /* HTTP */
-        [o_t3_txt_destInfo setStringValue: [[o_strmgMthds objectAtIndex:0] \
-            objectAtIndex:2]];
-        [o_t3_txt_strgMthdInfo setStringValue: [[o_strmgMthds objectAtIndex:0] \
-            objectAtIndex:3]];
-    }
-    else if( [o_mode intValue] == 3 )
-    {
-        /* MMS */
-        [o_t3_txt_destInfo setStringValue: [[o_strmgMthds objectAtIndex:1] \
+        /* RTP-Unicast */
+        [o_t3_txt_destInfo setStringValue: [[o_strmgMthds objectAtIndex:4] \
             objectAtIndex:2]];
-        [o_t3_txt_strgMthdInfo setStringValue: [[o_strmgMthds objectAtIndex:1] \
+        [o_t3_txt_strgMthdInfo setStringValue: [[o_strmgMthds objectAtIndex:4] \
             objectAtIndex:3]];
     }
-    else if( [o_mode intValue] == 4 )
+    else if( mode == 5 )
     {
-        /* RTP */
-        [o_t3_txt_destInfo setStringValue: [[o_strmgMthds objectAtIndex:4] \
+        /* RTP-Multicast */
+        [o_t3_txt_destInfo setStringValue: [[o_strmgMthds objectAtIndex:5] \
             objectAtIndex:2]];
-        [o_t3_txt_strgMthdInfo setStringValue: [[o_strmgMthds objectAtIndex:4] \
-            objectAtIndex:3]];
+        [o_t3_txt_strgMthdInfo setStringValue: [[o_strmgMthds objectAtIndex:5] \
+        objectAtIndex:3]];
     }
-    [o_mode release];
 }
 
 - (IBAction)t4_AudCdcChanged:(id)sender