Commit 41ef32ad authored by Christophe Massiot's avatar Christophe Massiot

* ./plugins/macosx: rewrote the net panel for OS X

parent ecd31a4c
......@@ -4,6 +4,7 @@
HEAD
* ./plugins/macosx: rewrote the net panel for OS X
* ./plugins/qnx/vout_qnx.c: QNX compilation fix.
* ./plugins/spudec/spu_decoder.c: fixed a margin bug in the SPU renderer
which caused subtitles to appear slanted in odd width windows.
......
......@@ -41,8 +41,7 @@
openDiscTypeChanged = id;
openFile = id;
openNet = id;
openNetBroadcast = id;
openNetChannel = id;
openNetProtocol = id;
panelCancel = id;
panelOk = id;
};
......@@ -54,17 +53,10 @@
o_disc_panel = id;
o_disc_title = id;
o_disc_type = id;
o_net_channel_addr = id;
o_net_channel_checkbox = id;
o_net_channel_port = id;
o_net_channel_port_label = id;
o_net_channel_pstepper = id;
o_net_panel = id;
o_net_protocol = id;
o_net_server_addr = id;
o_net_server_addr_label = id;
o_net_server_baddr = id;
o_net_server_bcheckbox = id;
o_net_server_port = id;
o_net_server_port_label = id;
o_net_server_pstepper = id;
......
......@@ -2,7 +2,7 @@
* intf_controller.c: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: intf_controller.m,v 1.4.2.2 2002/06/02 12:17:23 massiot Exp $
* $Id: intf_controller.m,v 1.4.2.3 2002/06/02 22:32:46 massiot Exp $
*
* Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
......@@ -250,13 +250,18 @@
- (BOOL)validateMenuItem:(id)sender
{
NSMenuItem * o_item = (NSMenuItem *)sender;
int tag = [o_item tag];
if ( [o_item tag] == 12 || [o_item tag] == 13 )
if ( tag == 12 || tag == 13 )
{
if( !config_GetIntVariable( "network-channel" ) )
{
return NO;
}
if ( tag == 12 && !p_main->p_intf->p_sys->i_channel )
{
return NO;
}
}
return YES;
......
......@@ -2,7 +2,7 @@
* intf_open.h: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: intf_open.h,v 1.2 2002/05/06 22:59:46 massiot Exp $
* $Id: intf_open.h,v 1.2.2.1 2002/06/02 22:32:46 massiot Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
*
......@@ -41,15 +41,8 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class );
IBOutlet id o_net_panel;
IBOutlet id o_net_protocol;
IBOutlet id o_net_channel_addr;
IBOutlet id o_net_channel_checkbox;
IBOutlet id o_net_channel_port;
IBOutlet id o_net_channel_port_label;
IBOutlet id o_net_channel_pstepper;
IBOutlet id o_net_server_addr;
IBOutlet id o_net_server_addr_label;
IBOutlet id o_net_server_baddr;
IBOutlet id o_net_server_bcheckbox;
IBOutlet id o_net_server_port;
IBOutlet id o_net_server_port_label;
IBOutlet id o_net_server_pstepper;
......@@ -65,8 +58,7 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class );
- (IBAction)openFile:(id)sender;
- (IBAction)openNet:(id)sender;
- (IBAction)openNetBroadcast:(id)sender;
- (IBAction)openNetChannel:(id)sender;
- (IBAction)openNetProtocol:(id)sender;
- (IBAction)panelCancel:(id)sender;
- (IBAction)panelOk:(id)sender;
......
......@@ -2,7 +2,7 @@
* intf_open.c: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: intf_open.m,v 1.3 2002/05/23 22:18:55 jlj Exp $
* $Id: intf_open.m,v 1.3.2.1 2002/06/02 22:32:46 massiot Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
*
......@@ -139,18 +139,12 @@ static Intf_Open *o_open = nil;
- (void)awakeFromNib
{
[o_net_channel_pstepper setEnabled: FALSE];
[o_net_server_addr addItemWithObjectValue: @"vls"];
[o_net_server_addr selectItemAtIndex: 0];
[o_net_server_baddr setStringValue: @"138.195.159.255"];
[o_net_server_addr setEnabled: NSOffState];
[o_net_server_addr_label setStringValue: @"Address"];
[o_net_server_port setEnabled: NSOnState];
[o_net_server_port setIntValue: 1234];
[o_net_server_pstepper setEnabled: NSOnState];
[o_net_server_pstepper setIntValue: [o_net_server_port intValue]];
[o_net_channel_addr setStringValue: @"vlcs"];
[o_net_channel_port setIntValue: 6010];
[o_net_channel_pstepper setIntValue: [o_net_channel_port intValue]];
}
- (IBAction)openDisc:(id)sender
......@@ -242,89 +236,70 @@ static Intf_Open *o_open = nil;
if( i_result )
{
BOOL b_channel;
BOOL b_broadcast;
NSString *o_protocol;
int i_port = [o_net_server_port intValue];
NSString *o_addr = [o_net_server_addr stringValue];
o_protocol = [[o_net_protocol selectedCell] title];
b_channel = [o_net_channel_checkbox state] == NSOnState;
b_broadcast = [o_net_server_bcheckbox state] == NSOnState;
if( [o_protocol isEqualToString: @"TS"] )
if( [o_protocol isEqualToString: @"UDP"] )
{
o_protocol = @"udpstream";
[[Intf_VLCWrapper instance] openNet: @"" port: i_port];
}
else if( [o_protocol isEqualToString: @"RTP"] )
else if( [o_protocol isEqualToString: @"UDP - multicast"] )
{
o_protocol = @"rtp";
[[Intf_VLCWrapper instance] openNet: o_addr port: i_port];
}
if( b_channel )
else if( [o_protocol isEqualToString: @"Channel server"] )
{
NSString *o_channel_addr = [o_net_channel_addr stringValue];
int i_channel_port = [o_net_channel_port intValue];
[[Intf_VLCWrapper instance]
openNetChannel: o_channel_addr port: i_channel_port];
[[Intf_VLCWrapper instance] openNetChannel: o_addr port: i_port];
}
else
else if( [o_protocol isEqualToString: @"HTTP"] )
{
NSString *o_addr = [o_net_server_addr stringValue];
int i_port = [o_net_server_port intValue];
if( b_broadcast )
{
NSString *o_baddr = [o_net_server_baddr stringValue];
[[Intf_VLCWrapper instance]
openNet: o_protocol addr: o_addr
port: i_port baddr: o_baddr];
}
else
{
[[Intf_VLCWrapper instance]
openNet: o_protocol addr: o_addr
port: i_port baddr: nil];
}
}
[[Intf_VLCWrapper instance] openNetHTTP: o_addr];
}
}
}
- (IBAction)openNetBroadcast:(id)sender
{
BOOL b_broadcast;
b_broadcast = [o_net_server_bcheckbox state] == NSOnState;
[o_net_server_baddr setEnabled: b_broadcast];
}
- (IBAction)openNetChannel:(id)sender
- (IBAction)openNetProtocol:(id)sender
{
BOOL b_channel;
BOOL b_broadcast;
NSColor *o_color;
b_channel = [o_net_channel_checkbox state] == NSOnState;
b_broadcast = [o_net_server_bcheckbox state] == NSOnState;
o_color = b_channel ? [NSColor controlTextColor] :
[NSColor disabledControlTextColor];
NSString *o_protocol;
[o_net_channel_addr setEnabled: b_channel];
[o_net_channel_port setEnabled: b_channel];
[o_net_channel_port_label setTextColor: o_color];
[o_net_channel_pstepper setEnabled: b_channel];
o_protocol = [[o_net_protocol selectedCell] title];
o_color = !b_channel ? [NSColor controlTextColor] :
[NSColor disabledControlTextColor];
[o_net_server_addr setEnabled: !b_channel];
[o_net_server_addr_label setTextColor: o_color];
[o_net_server_port setEnabled: !b_channel];
[o_net_server_port_label setTextColor: o_color];
[o_net_server_pstepper setEnabled: !b_channel];
[o_net_server_bcheckbox setEnabled: !b_channel];
[o_net_server_baddr setEnabled: b_broadcast && !b_channel];
if( [o_protocol isEqualToString: @"UDP"] )
{
[o_net_server_addr setEnabled: NSOffState];
[o_net_server_port setEnabled: NSOnState];
[o_net_server_port setIntValue: 1234];
[o_net_server_pstepper setEnabled: NSOnState];
}
else if( [o_protocol isEqualToString: @"UDP - multicast"] )
{
[o_net_server_addr setEnabled: NSOnState];
[o_net_server_addr_label setStringValue: @"Mult. addr."];
[o_net_server_port setEnabled: NSOnState];
[o_net_server_port setIntValue: 1234];
[o_net_server_pstepper setEnabled: NSOnState];
}
else if( [o_protocol isEqualToString: @"Channel server"] )
{
[o_net_server_addr setEnabled: NSOnState];
[o_net_server_addr_label setStringValue: @"Server"];
[o_net_server_addr setStringValue: @"vlcs"];
[o_net_server_port setEnabled: NSOnState];
[o_net_server_port setIntValue: 6010];
[o_net_server_pstepper setEnabled: NSOnState];
}
else if( [o_protocol isEqualToString: @"HTTP"] )
{
[o_net_server_addr setEnabled: NSOnState];
[o_net_server_addr_label setStringValue: @"URL"];
[o_net_server_addr setStringValue: @"http://"];
[o_net_server_port setEnabled: NSOffState];
[o_net_server_pstepper setEnabled: NSOffState];
}
[o_net_server_pstepper setIntValue: [o_net_server_port intValue]];
}
- (IBAction)panelCancel:(id)sender
......
......@@ -2,7 +2,7 @@
* intf_vlc_wrapper.h: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: intf_vlc_wrapper.h,v 1.8.2.2 2002/06/02 12:17:23 massiot Exp $
* $Id: intf_vlc_wrapper.h,v 1.8.2.3 2002/06/02 22:32:46 massiot Exp $
*
* Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
......@@ -72,8 +72,9 @@
/* open file/disc/network */
- (void)openFiles:(NSArray*)o_files;
- (void)openDisc:(NSString*)o_type device:(NSString*)o_device title:(int)i_title chapter:(int)i_chapter;
- (void)openNet:(NSString*)o_protocol addr:(NSString*)o_addr port:(int)i_port baddr:(NSString*)o_baddr;
- (void)openNet:(NSString*)o_addr port:(int)i_port;
- (void)openNetChannel:(NSString*)o_addr port:(int)i_port;
- (void)openNetHTTP:(NSString*)o_addr;
/* menus management */
- (void)toggleProgram:(id)sender;
......
......@@ -2,7 +2,7 @@
* intf_vlc_wrapper.c: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: intf_vlc_wrapper.m,v 1.6.2.4 2002/06/02 12:17:23 massiot Exp $
* $Id: intf_vlc_wrapper.m,v 1.6.2.5 2002/06/02 22:32:46 massiot Exp $
*
* Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
......@@ -577,7 +577,7 @@ static Intf_VLCWrapper *o_intf = nil;
}
}
- (void)openNet:(NSString*)o_protocol addr:(NSString*)o_addr port:(int)i_port baddr:(NSString*)o_baddr
- (void)openNet:(NSString*)o_addr port:(int)i_port
{
NSString *o_source;
int i_end = p_main->p_playlist->i_size;
......@@ -588,18 +588,10 @@ static Intf_VLCWrapper *o_intf = nil;
p_input_bank->pp_input[0]->b_eof = 1;
}
config_PutIntVariable( "network_channel", 0 );
config_PutIntVariable( "network-channel", 0 );
if( o_baddr != nil )
{
o_source = [NSString stringWithFormat: @"%@://%@@:%i/%@",
o_protocol, o_addr, i_port, o_baddr];
}
else
{
o_source = [NSString stringWithFormat: @"%@://%@@:%i",
o_protocol, o_addr, i_port];
}
o_source = [NSString stringWithFormat: @"udpstream:@%@:%i",
o_addr, i_port];
if ( p_intf->p_sys->b_loop )
{
......@@ -626,15 +618,46 @@ static Intf_VLCWrapper *o_intf = nil;
p_input_bank->pp_input[0]->b_eof = 1;
}
config_PutIntVariable( "network_channel", 1 );
config_PutIntVariable( "network-channel", 1 );
if( p_main->p_channel == NULL )
{
network_ChannelCreate();
}
config_PutPszVariable( "channel_server", (char*)[o_addr lossyCString] );
config_PutIntVariable( "channel_port", i_port );
config_PutPszVariable( "channel-server", (char*)[o_addr lossyCString] );
config_PutIntVariable( "channel-port", i_port );
}
- (void)openNetHTTP:(NSString*)o_addr
{
NSString *o_source;
int i_end = p_main->p_playlist->i_size;
intf_thread_t * p_intf = p_main->p_intf;
if( p_input_bank->pp_input[0] != NULL )
{
p_input_bank->pp_input[0]->b_eof = 1;
}
config_PutIntVariable( "network-channel", 0 );
if ( p_intf->p_sys->b_loop )
{
intf_PlaylistDelete( p_main->p_playlist,
p_main->p_playlist->i_size - 1 );
}
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END,
[o_addr fileSystemRepresentation] );
intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
if ( p_intf->p_sys->b_loop )
{
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END,
"vlc:loop" );
}
}
- (void)toggleProgram:(id)sender
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment