Changeset b60815ca26a806295facb9d47bc0657ed39eb9b2

Show
Ignore:
Timestamp:
06/03/02 00:32:46 (6 years ago)
Author:
Christophe Massiot <massiot@videolan.org>
git-committer:
Christophe Massiot <massiot@videolan.org> 1023057166 +0000
git-parent:

[5cfee5890e9e555105e4dcaae36980ef87943aac]

git-author:
Christophe Massiot <massiot@videolan.org> 1023057166 +0000
Message:
  • ./plugins/macosx: rewrote the net panel for OS X
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ChangeLog

    r695669c rb60815c  
    3737Not released yet 
    3838 
     39  * ./plugins/macosx: rewrote the net panel for OS X 
    3940  * ./plugins/spudec/spu_decoder.c: fixed a margin bug in the SPU renderer 
    4041    which caused subtitles to appear slanted in odd width windows. 
  • extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib

    r9b21679 rb60815c  
    4242                openFile = id;  
    4343                openNet = id;  
    44                 openNetBroadcast = id;  
    45                 openNetChannel = id;  
     44                openNetProtocol = id;  
    4645                panelCancel = id;  
    4746                panelOk = id;  
     
    5554                o_disc_title = id;  
    5655                o_disc_type = id;  
    57                 o_net_channel_addr = id;  
    58                 o_net_channel_checkbox = id;  
    59                 o_net_channel_port = id;  
    60                 o_net_channel_port_label = id;  
    61                 o_net_channel_pstepper = id;  
    6256                o_net_panel = id;  
    6357                o_net_protocol = id;  
    6458                o_net_server_addr = id;  
    6559                o_net_server_addr_label = id;  
    66                 o_net_server_baddr = id;  
    67                 o_net_server_bcheckbox = id;  
    6860                o_net_server_port = id;  
    6961                o_net_server_port_label = id;  
  • plugins/macosx/intf_controller.m

    r9b21679 rb60815c  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: intf_controller.m,v 1.7 2002/06/02 12:16:31 massiot Exp $ 
     5 * $Id: intf_controller.m,v 1.8 2002/06/02 22:31:52 massiot Exp $ 
    66 * 
    77 * Authors: Florian G. Pflug <fgp@phlo.org> 
     
    249249{ 
    250250    NSMenuItem * o_item = (NSMenuItem *)sender; 
    251  
    252     if ( [o_item tag] == 12 || [o_item tag] == 13 ) 
     251    int tag = [o_item tag]; 
     252 
     253    if ( tag == 12 || tag == 13 ) 
    253254    { 
    254255        if( !config_GetIntVariable( "network-channel" ) ) 
     
    256257            return NO; 
    257258        } 
     259        if ( tag == 12 && !p_main->p_intf->p_sys->i_channel ) 
     260        { 
     261            return NO; 
     262        } 
    258263    } 
    259264         
  • plugins/macosx/intf_open.h

    r3a361d2 rb60815c  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: intf_open.h,v 1.2 2002/05/06 22:59:46 massiot Exp $ 
     5 * $Id: intf_open.h,v 1.3 2002/06/02 22:31:52 massiot Exp $ 
    66 * 
    77 * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>  
     
    4242    IBOutlet id o_net_panel; 
    4343    IBOutlet id o_net_protocol; 
    44     IBOutlet id o_net_channel_addr; 
    45     IBOutlet id o_net_channel_checkbox; 
    46     IBOutlet id o_net_channel_port; 
    47     IBOutlet id o_net_channel_port_label; 
    48     IBOutlet id o_net_channel_pstepper; 
    4944    IBOutlet id o_net_server_addr; 
    5045    IBOutlet id o_net_server_addr_label; 
    51     IBOutlet id o_net_server_baddr; 
    52     IBOutlet id o_net_server_bcheckbox; 
    5346    IBOutlet id o_net_server_port; 
    5447    IBOutlet id o_net_server_port_label; 
     
    6659 
    6760- (IBAction)openNet:(id)sender; 
    68 - (IBAction)openNetBroadcast:(id)sender; 
    69 - (IBAction)openNetChannel:(id)sender; 
     61- (IBAction)openNetProtocol:(id)sender; 
    7062 
    7163- (IBAction)panelCancel:(id)sender; 
  • plugins/macosx/intf_open.m

    r54e1790 rb60815c  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: intf_open.m,v 1.3 2002/05/23 22:18:55 jlj Exp $ 
     5 * $Id: intf_open.m,v 1.4 2002/06/02 22:31:52 massiot Exp $ 
    66 * 
    77 * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>  
     
    140140- (void)awakeFromNib 
    141141{ 
    142     [o_net_channel_pstepper setEnabled: FALSE]; 
    143      
    144     [o_net_server_addr addItemWithObjectValue: @"vls"]; 
    145     [o_net_server_addr selectItemAtIndex: 0]; 
    146      
    147     [o_net_server_baddr setStringValue: @"138.195.159.255"]; 
     142    [o_net_server_addr setEnabled: NSOffState]; 
     143    [o_net_server_addr_label setStringValue: @"Address"]; 
     144    [o_net_server_port setEnabled: NSOnState]; 
    148145    [o_net_server_port setIntValue: 1234]; 
     146    [o_net_server_pstepper setEnabled: NSOnState]; 
    149147    [o_net_server_pstepper setIntValue: [o_net_server_port intValue]]; 
    150  
    151     [o_net_channel_addr setStringValue: @"vlcs"]; 
    152     [o_net_channel_port setIntValue: 6010]; 
    153     [o_net_channel_pstepper setIntValue: [o_net_channel_port intValue]]; 
    154148} 
    155149 
     
    243237    if( i_result ) 
    244238    { 
    245         BOOL b_channel; 
    246         BOOL b_broadcast; 
    247239        NSString *o_protocol; 
     240        int i_port = [o_net_server_port intValue]; 
     241        NSString *o_addr = [o_net_server_addr stringValue]; 
    248242 
    249243        o_protocol = [[o_net_protocol selectedCell] title]; 
    250         b_channel = [o_net_channel_checkbox state] == NSOnState; 
    251         b_broadcast = [o_net_server_bcheckbox state] == NSOnState; 
    252  
    253         if( [o_protocol isEqualToString: @"TS"] ) 
    254         { 
    255             o_protocol = @"udpstream"; 
    256         } 
    257         else if( [o_protocol isEqualToString: @"RTP"] )  
    258         { 
    259             o_protocol = @"rtp"; 
    260         } 
    261  
    262         if( b_channel ) 
    263         { 
    264             NSString *o_channel_addr = [o_net_channel_addr stringValue]; 
    265             int i_channel_port = [o_net_channel_port intValue]; 
    266  
    267             [[Intf_VLCWrapper instance] 
    268                 openNetChannel: o_channel_addr port: i_channel_port]; 
    269         } 
    270         else 
    271         { 
    272             NSString *o_addr = [o_net_server_addr stringValue]; 
    273             int i_port = [o_net_server_port intValue]; 
    274  
    275             if( b_broadcast ) 
    276             { 
    277                 NSString *o_baddr = [o_net_server_baddr stringValue]; 
    278  
    279                 [[Intf_VLCWrapper instance] 
    280                     openNet: o_protocol addr: o_addr 
    281                         port: i_port baddr: o_baddr];  
    282             } 
    283             else 
    284             { 
    285                 [[Intf_VLCWrapper instance] 
    286                     openNet: o_protocol addr: o_addr 
    287                         port: i_port baddr: nil]; 
    288             }  
    289         }  
    290     } 
    291 
    292  
    293 - (IBAction)openNetBroadcast:(id)sender 
    294 
    295     BOOL b_broadcast; 
    296      
    297     b_broadcast = [o_net_server_bcheckbox state] == NSOnState; 
    298     [o_net_server_baddr setEnabled: b_broadcast]; 
    299 
    300  
    301 - (IBAction)openNetChannel:(id)sender 
    302 
    303     BOOL b_channel; 
    304     BOOL b_broadcast; 
    305     NSColor *o_color; 
    306      
    307     b_channel = [o_net_channel_checkbox state] == NSOnState; 
    308     b_broadcast = [o_net_server_bcheckbox state] == NSOnState; 
    309      
    310     o_color = b_channel ? [NSColor controlTextColor] :  
    311         [NSColor disabledControlTextColor]; 
    312  
    313     [o_net_channel_addr setEnabled: b_channel]; 
    314     [o_net_channel_port setEnabled: b_channel]; 
    315     [o_net_channel_port_label setTextColor: o_color]; 
    316     [o_net_channel_pstepper setEnabled: b_channel]; 
    317      
    318     o_color = !b_channel ? [NSColor controlTextColor] :  
    319         [NSColor disabledControlTextColor];     
    320          
    321     [o_net_server_addr setEnabled: !b_channel]; 
    322     [o_net_server_addr_label setTextColor: o_color]; 
    323     [o_net_server_port setEnabled: !b_channel]; 
    324     [o_net_server_port_label setTextColor: o_color]; 
    325     [o_net_server_pstepper setEnabled: !b_channel]; 
    326     [o_net_server_bcheckbox setEnabled: !b_channel]; 
    327     [o_net_server_baddr setEnabled: b_broadcast && !b_channel]; 
     244 
     245        if( [o_protocol isEqualToString: @"UDP"] ) 
     246        { 
     247            [[Intf_VLCWrapper instance] openNet: @"" port: i_port];  
     248        } 
     249        else if( [o_protocol isEqualToString: @"UDP - multicast"] )  
     250        { 
     251            [[Intf_VLCWrapper instance] openNet: o_addr port: i_port];  
     252        } 
     253        else if( [o_protocol isEqualToString: @"Channel server"] )  
     254        { 
     255            [[Intf_VLCWrapper instance] openNetChannel: o_addr port: i_port];  
     256        } 
     257        else if( [o_protocol isEqualToString: @"HTTP"] )  
     258        { 
     259            [[Intf_VLCWrapper instance] openNetHTTP: o_addr];  
     260        } 
     261    } 
     262
     263 
     264- (IBAction)openNetProtocol:(id)sender 
     265
     266    NSString *o_protocol; 
     267 
     268    o_protocol = [[o_net_protocol selectedCell] title]; 
     269     
     270    if( [o_protocol isEqualToString: @"UDP"] ) 
     271    { 
     272        [o_net_server_addr setEnabled: NSOffState]; 
     273        [o_net_server_port setEnabled: NSOnState]; 
     274        [o_net_server_port setIntValue: 1234]; 
     275        [o_net_server_pstepper setEnabled: NSOnState]; 
     276    } 
     277    else if( [o_protocol isEqualToString: @"UDP - multicast"] )  
     278    { 
     279        [o_net_server_addr setEnabled: NSOnState]; 
     280        [o_net_server_addr_label setStringValue: @"Mult. addr."]; 
     281        [o_net_server_port setEnabled: NSOnState]; 
     282        [o_net_server_port setIntValue: 1234]; 
     283        [o_net_server_pstepper setEnabled: NSOnState]; 
     284    } 
     285    else if( [o_protocol isEqualToString: @"Channel server"] )  
     286    { 
     287        [o_net_server_addr setEnabled: NSOnState]; 
     288        [o_net_server_addr_label setStringValue: @"Server"]; 
     289        [o_net_server_addr setStringValue: @"vlcs"]; 
     290        [o_net_server_port setEnabled: NSOnState]; 
     291        [o_net_server_port setIntValue: 6010]; 
     292        [o_net_server_pstepper setEnabled: NSOnState]; 
     293    } 
     294    else if( [o_protocol isEqualToString: @"HTTP"] )  
     295    { 
     296        [o_net_server_addr setEnabled: NSOnState]; 
     297        [o_net_server_addr_label setStringValue: @"URL"]; 
     298        [o_net_server_addr setStringValue: @"http://"]; 
     299        [o_net_server_port setEnabled: NSOffState]; 
     300        [o_net_server_pstepper setEnabled: NSOffState]; 
     301    } 
     302    [o_net_server_pstepper setIntValue: [o_net_server_port intValue]]; 
    328303} 
    329304 
  • plugins/macosx/intf_vlc_wrapper.h

    r9b21679 rb60815c  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: intf_vlc_wrapper.h,v 1.10 2002/06/02 12:16:31 massiot Exp $ 
     5 * $Id: intf_vlc_wrapper.h,v 1.11 2002/06/02 22:31:52 massiot Exp $ 
    66 * 
    77 * Authors: Florian G. Pflug <fgp@phlo.org> 
     
    7373- (void)openFiles:(NSArray*)o_files; 
    7474- (void)openDisc:(NSString*)o_type device:(NSString*)o_device title:(int)i_title chapter:(int)i_chapter; 
    75 - (void)openNet:(NSString*)o_protocol addr:(NSString*)o_addr port:(int)i_port baddr:(NSString*)o_baddr
     75- (void)openNet:(NSString*)o_addr port:(int)i_port
    7676- (void)openNetChannel:(NSString*)o_addr port:(int)i_port; 
     77- (void)openNetHTTP:(NSString*)o_addr; 
    7778 
    7879/* menus management */ 
  • plugins/macosx/intf_vlc_wrapper.m

    r9b21679 rb60815c  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: intf_vlc_wrapper.m,v 1.11 2002/06/02 12:16:31 massiot Exp $ 
     5 * $Id: intf_vlc_wrapper.m,v 1.12 2002/06/02 22:31:52 massiot Exp $ 
    66 * 
    77 * Authors: Florian G. Pflug <fgp@phlo.org> 
     
    579579} 
    580580 
    581 - (void)openNet:(NSString*)o_protocol addr:(NSString*)o_addr port:(int)i_port baddr:(NSString*)o_baddr 
     581- (void)openNet:(NSString*)o_addr port:(int)i_port 
    582582{ 
    583583    NSString *o_source; 
     
    590590    } 
    591591 
    592     config_PutIntVariable( "network_channel", 0 ); 
    593  
    594     if( o_baddr != nil ) 
    595     { 
    596         o_source = [NSString stringWithFormat: @"%@://%@@:%i/%@", 
    597                         o_protocol, o_addr, i_port, o_baddr]; 
    598     } 
    599     else 
    600     { 
    601         o_source = [NSString stringWithFormat: @"%@://%@@:%i", 
    602                         o_protocol, o_addr, i_port]; 
    603     } 
     592    config_PutIntVariable( "network-channel", 0 ); 
     593 
     594    o_source = [NSString stringWithFormat: @"udpstream:@%@:%i", 
     595                o_addr, i_port]; 
    604596 
    605597    if ( p_intf->p_sys->b_loop ) 
     
    628620    } 
    629621 
    630     config_PutIntVariable( "network_channel", 1 ); 
     622    config_PutIntVariable( "network-channel", 1 ); 
    631623 
    632624    if( p_main->p_channel == NULL ) 
     
    635627    } 
    636628 
    637     config_PutPszVariable( "channel_server", (char*)[o_addr lossyCString] ); 
    638     config_PutIntVariable( "channel_port", i_port );  
     629    config_PutPszVariable( "channel-server", (char*)[o_addr lossyCString] ); 
     630    config_PutIntVariable( "channel-port", i_port );  
     631
     632 
     633- (void)openNetHTTP:(NSString*)o_addr 
     634
     635    NSString *o_source; 
     636    int i_end = p_main->p_playlist->i_size; 
     637    intf_thread_t * p_intf = p_main->p_intf; 
     638 
     639    if( p_input_bank->pp_input[0] != NULL ) 
     640    { 
     641        p_input_bank->pp_input[0]->b_eof = 1; 
     642    } 
     643 
     644    config_PutIntVariable( "network-channel", 0 ); 
     645 
     646    if ( p_intf->p_sys->b_loop ) 
     647    { 
     648        intf_PlaylistDelete( p_main->p_playlist, 
     649                             p_main->p_playlist->i_size - 1 ); 
     650    } 
     651 
     652    intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, 
     653                      [o_addr fileSystemRepresentation] ); 
     654 
     655    intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 ); 
     656 
     657    if ( p_intf->p_sys->b_loop ) 
     658    { 
     659        intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END,  
     660                          "vlc:loop" ); 
     661    } 
    639662} 
    640663