]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/output.m
* OSX lowlevel work
[vlc] / modules / gui / macosx / output.m
index c0469c2c2fb2fa721f102378a1e08ede9b36ede0..c3214deaef71cedf23b3a5c64a50197c50336c53 100644 (file)
@@ -2,7 +2,7 @@
  * output.m: MacOS X Output Dialog
  *****************************************************************************
  * Copyright (C) 2002-2003 VideoLAN
- * $Id: output.m,v 1.17 2003/12/11 16:00:09 hartman Exp $
+ * $Id$
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net> 
  *          Christophe Massiot <massiot@via.ecp.fr>
 - (void)initStrings
 {
     NSArray *o_muxers = [NSArray arrayWithObjects: @"MPEG TS", @"MPEG PS", @"MPEG 1",
-        @"Ogg", @"AVI", @"ASF", @"MPEG 4", @"Quicktime", nil];
+        @"Ogg", @"AVI", @"ASF", @"MPEG 4", @"Quicktime", @"Raw", nil];
     NSArray *o_a_channels = [NSArray arrayWithObjects: @"1", @"2", @"4", @"6", nil];
     NSArray *o_a_bitrates = [NSArray arrayWithObjects: @"16", @"32", @"64", @"96",
         @"128", @"192", @"256", @"512", nil];
     NSArray *o_v_bitrates = [NSArray arrayWithObjects: @"16", @"32", @"64", @"96",
         @"128", @"192", @"256", @"384", @"512", @"768", @"1024", @"2048", @"3072", nil];
-    NSArray *o_a_codecs = [NSArray arrayWithObjects: @"mpga", @"mp3 ", @"a52 ", @"vorb", @"flac", @"spx ", nil];
+    NSArray *o_a_codecs = [NSArray arrayWithObjects: @"mpga", @"mp3 ", @"mp4a", @"a52 ", @"vorb", @"flac", @"spx ", nil];
     NSArray *o_v_codecs = [NSArray arrayWithObjects: @"mp1v", @"mp2v", @"mp4v", @"DIV1",
         @"DIV2", @"DIV3", @"H263", @"I263", @"WMV1", @"WMV2", @"MJPG", @"theo", nil];
     
     [o_btn_ok setTitle: _NS("OK")];
     
     [o_options_lbl setTitle: _NS("Output Options")];
-    [o_display setTitle: _NS("Screen")];
+    [o_display setTitle: _NS("Play locally")];
     [[o_method cellAtRow:0 column:0] setTitle: _NS("File")];
     [[o_method cellAtRow:1 column:0] setTitle: _NS("Stream")];
     [o_dump_chkbox setTitle: _NS("Dump raw input")];
     [o_btn_browse setTitle: _NS("Browse...")]; 
     [o_stream_address_lbl setStringValue: _NS("Address")];
     [o_stream_port_lbl setStringValue: _NS("Port")];
-    [o_stream_ttl_lbl setStringValue: _NS("TTL")];
-    [[o_stream_type itemAtIndex: 0] setTitle: _NS("HTTP")];
-    [[o_stream_type itemAtIndex: 1] setTitle: _NS("MMSH")];
-    [[o_stream_type itemAtIndex: 2] setTitle: _NS("UDP")];
-    [[o_stream_type itemAtIndex: 3] setTitle: _NS("RTP")];
+    [o_stream_ttl_lbl setStringValue: @"TTL"];
+    [[o_stream_type itemAtIndex: 0] setTitle: @"HTTP"];
+    [[o_stream_type itemAtIndex: 1] setTitle: @"MMSH"];
+    [[o_stream_type itemAtIndex: 2] setTitle: @"UDP"];
+    [[o_stream_type itemAtIndex: 3] setTitle: @"RTP"];
     [o_stream_type_lbl setStringValue: _NS("Type")];
     
     [o_mux_lbl setStringValue: _NS("Encapsulation Method")];
         [[o_mux_selector itemAtIndex: 5] setEnabled: YES]; // ASF
         [[o_mux_selector itemAtIndex: 6] setEnabled: YES]; // MPEG 4
         [[o_mux_selector itemAtIndex: 7] setEnabled: YES]; // QuickTime
+        [[o_mux_selector itemAtIndex: 8] setEnabled: YES]; // Raw
     }
     else if( [o_mode isEqualToString: _NS("Stream")] )
     {
         
         o_mode = [o_stream_type titleOfSelectedItem];
         
-        if( [o_mode isEqualToString: _NS("HTTP")] )
+        if( [o_mode isEqualToString: @"HTTP"] )
         {
             [o_stream_address setEnabled: YES];
             [o_stream_ttl setEnabled: NO];
             [[o_mux_selector itemAtIndex: 2] setEnabled: YES];
             [[o_mux_selector itemAtIndex: 3] setEnabled: YES];
             [[o_mux_selector itemAtIndex: 4] setEnabled: NO];
-            [[o_mux_selector itemAtIndex: 5] setEnabled: NO];
+            [[o_mux_selector itemAtIndex: 5] setEnabled: YES];
             [[o_mux_selector itemAtIndex: 6] setEnabled: NO];
             [[o_mux_selector itemAtIndex: 7] setEnabled: NO];
+            [[o_mux_selector itemAtIndex: 8] setEnabled: YES];
         }
-        else if( [o_mode isEqualToString: _NS("MMSH")] )
+        else if( [o_mode isEqualToString: @"MMSH"] )
         {
             [o_stream_address setEnabled: YES];
             [o_stream_ttl setEnabled: NO];
             [[o_mux_selector itemAtIndex: 5] setEnabled: YES];
             [[o_mux_selector itemAtIndex: 6] setEnabled: NO];
             [[o_mux_selector itemAtIndex: 7] setEnabled: NO];
+            [[o_mux_selector itemAtIndex: 8] setEnabled: NO];
         }
-        else if( [o_mode isEqualToString: _NS("UDP")] )
+        else if( [o_mode isEqualToString: @"UDP"] )
         {
             [o_stream_address setEnabled: YES];
             [o_stream_ttl setEnabled: YES];
             [[o_mux_selector itemAtIndex: 5] setEnabled: NO];
             [[o_mux_selector itemAtIndex: 6] setEnabled: NO];
             [[o_mux_selector itemAtIndex: 7] setEnabled: NO];
+            [[o_mux_selector itemAtIndex: 8] setEnabled: YES];
             [o_sap_chkbox setEnabled: YES];
             [o_slp_chkbox setEnabled: YES];
             [o_channel_name setEnabled: YES];
         }
-        else if( [o_mode isEqualToString: _NS("RTP")] )
+        else if( [o_mode isEqualToString: @"RTP"] )
         {
             [o_stream_address setEnabled: YES];
             [o_stream_ttl setEnabled: YES];
             [[o_mux_selector itemAtIndex: 5] setEnabled: NO];
             [[o_mux_selector itemAtIndex: 6] setEnabled: NO];
             [[o_mux_selector itemAtIndex: 7] setEnabled: NO];
+            [[o_mux_selector itemAtIndex: 8] setEnabled: YES];
         }
     }
     if( ![[o_mux_selector selectedItem] isEnabled] )
     o_mode = [[o_method selectedCell] title];
     o_mux = [o_mux_selector titleOfSelectedItem];
 
-    if ( [o_mux isEqualToString: _NS("AVI")] ) o_mux_string = @"avi";
-    else if ( [o_mux isEqualToString: _NS("Ogg")] ) o_mux_string = @"ogg";
-    else if ( [o_mux isEqualToString: _NS("MPEG PS")] ) o_mux_string = @"ps";
-    else if ( [o_mux isEqualToString: _NS("MPEG 4")] ) o_mux_string = @"mp4";
-    else if ( [o_mux isEqualToString: _NS("MPEG 1")] ) o_mux_string = @"mpeg1";
-    else if ( [o_mux isEqualToString: _NS("Quicktime")] ) o_mux_string = @"mov";
-    else if ( [o_mux isEqualToString: _NS("ASF")] ) o_mux_string = @"asf";
+    if ( [o_mux isEqualToString: @"AVI"] ) o_mux_string = @"avi";
+    else if ( [o_mux isEqualToString: @"Ogg"] ) o_mux_string = @"ogg";
+    else if ( [o_mux isEqualToString: @"MPEG PS"] ) o_mux_string = @"ps";
+    else if ( [o_mux isEqualToString: @"MPEG 4"] ) o_mux_string = @"mp4";
+    else if ( [o_mux isEqualToString: @"MPEG 1"] ) o_mux_string = @"mpeg1";
+    else if ( [o_mux isEqualToString: @"Quicktime"] ) o_mux_string = @"mov";
+    else if ( [o_mux isEqualToString: @"ASF"] ) o_mux_string = @"asf";
+    else if ( [o_mux isEqualToString: @"Raw"] ) o_mux_string = @"raw";
     else o_mux_string = @"ts";
 
     if( [o_mode isEqualToString: _NS("File")] )
         o_mode = [o_stream_type titleOfSelectedItem];
         o_announce = @"";
         
-        if ( [o_mode isEqualToString: _NS("HTTP")] )
+        if ( [o_mode isEqualToString: @"HTTP"] )
             o_mode = @"http";
-        else if ( [o_mode isEqualToString: _NS("MMSH")] )
+        else if ( [o_mode isEqualToString: @"MMSH"] )
         {
-            if ( [o_mux isEqualToString: _NS("ASF")] ) o_mux_string = @"asfh";
+            if ( [o_mux isEqualToString: @"ASF"] ) o_mux_string = @"asfh";
             o_mode = @"mmsh";
         }
-        else if ( [o_mode isEqualToString: _NS("UDP")] )
+        else if ( [o_mode isEqualToString: @"UDP"] )
         {
             o_mode = @"udp";
             if( [o_sap_chkbox state] == NSOnState )
             {
                 if ( ![[o_channel_name stringValue] isEqualToString: @""] )
-                    o_announce = [NSString stringWithFormat:@",sap=%@", [o_channel_name stringValue]];
+                    o_announce = [NSString stringWithFormat:@",sap,name=%@", 
+                        [o_channel_name stringValue]];
                 else
                     o_announce = @",sap";
             }
             if( [o_slp_chkbox state] == NSOnState )
             {
-                if ( ![[o_channel_name stringValue] isEqualToString: @""] )
-                    o_announce = [o_announce stringByAppendingFormat:@",slp=%@",
-                        [o_channel_name stringValue]];
+               if ( ![[o_channel_name stringValue] isEqualToString: @""] )
+                    o_announce = [o_announce stringByAppendingFormat:@
+                            "slp,name=%@",[o_channel_name stringValue]];
                 else
                     o_announce = [o_announce stringByAppendingString: @",slp"];
             }
         }
-        else if ( [o_mode isEqualToString: _NS("RTP")] )
+        else if ( [o_mode isEqualToString: @"RTP"] )
             o_mode = @"rtp";
             
         [o_mrl_string appendFormat:
 
 - (void)TTLChanged:(NSNotification *)o_notification
 {
-    intf_thread_t * p_intf = [NSApp getIntf];
+    intf_thread_t * p_intf = VLCIntf;
     config_PutInt( p_intf, "ttl", [o_stream_ttl intValue] );
 }
 
 {
     NSSavePanel *o_save_panel = [NSSavePanel savePanel];
     NSString *o_mux_string;
-    if ( [[o_mux_selector titleOfSelectedItem] isEqualToString: _NS("MPEG PS")] )
+    if ( [[o_mux_selector titleOfSelectedItem] isEqualToString: @"MPEG PS"] )
         o_mux_string = @"vob";
-    else if ( [[o_mux_selector titleOfSelectedItem] isEqualToString: _NS("MPEG 1")] )
+    else if ( [[o_mux_selector titleOfSelectedItem] isEqualToString: @"MPEG 1"] )
         o_mux_string = @"mpg";
-    else if ( [[o_mux_selector titleOfSelectedItem] isEqualToString: _NS("AVI")] )
+    else if ( [[o_mux_selector titleOfSelectedItem] isEqualToString: @"AVI"] )
         o_mux_string = @"avi";
-    else if ( [[o_mux_selector titleOfSelectedItem] isEqualToString: _NS("ASF")] )
+    else if ( [[o_mux_selector titleOfSelectedItem] isEqualToString: @"ASF"] )
         o_mux_string = @"asf";
-    else if ( [[o_mux_selector titleOfSelectedItem] isEqualToString: _NS("Ogg")] )
+    else if ( [[o_mux_selector titleOfSelectedItem] isEqualToString: @"Ogg"] )
         o_mux_string = @"ogm";
-    else if ( [[o_mux_selector titleOfSelectedItem] isEqualToString: _NS("MPEG 4")] )
+    else if ( [[o_mux_selector titleOfSelectedItem] isEqualToString: @"MPEG 4"] )
         o_mux_string = @"mp4";
-    else if ( [[o_mux_selector titleOfSelectedItem] isEqualToString: _NS("Quicktime")] )
+    else if ( [[o_mux_selector titleOfSelectedItem] isEqualToString: @"Quicktime"] )
         o_mux_string = @"mov";
+    else if ( [[o_mux_selector titleOfSelectedItem] isEqualToString: @"Raw"] )
+        o_mux_string = @"raw";
     else
         o_mux_string = @"ts";