Commit 0050c530 authored by Stéphane Borel's avatar Stéphane Borel

* --chennels puts gtk/gnome in multi-channel network mode.

* the network window of the interface reports the values of the environment
 variables.

* channels mode excludes vls configuration

* the vlc does not try to bind vls.via.ecp.fr by default when you select
 channels mode.
parent 332312e7
...@@ -644,7 +644,7 @@ create_intf_window (void) ...@@ -644,7 +644,7 @@ create_intf_window (void)
gtk_widget_show (label_network); gtk_widget_show (label_network);
gtk_box_pack_start (GTK_BOX (network_channel_box), label_network, TRUE, FALSE, 5); gtk_box_pack_start (GTK_BOX (network_channel_box), label_network, TRUE, FALSE, 5);
network_channel_spinbutton_adj = gtk_adjustment_new (1, 0, 100, 1, 10, 10); network_channel_spinbutton_adj = gtk_adjustment_new (0, 0, 100, 1, 10, 10);
network_channel_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (network_channel_spinbutton_adj), 1, 0); network_channel_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (network_channel_spinbutton_adj), 1, 0);
gtk_widget_ref (network_channel_spinbutton); gtk_widget_ref (network_channel_spinbutton);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "network_channel_spinbutton", network_channel_spinbutton, gtk_object_set_data_full (GTK_OBJECT (intf_window), "network_channel_spinbutton", network_channel_spinbutton,
...@@ -1382,8 +1382,8 @@ create_intf_network (void) ...@@ -1382,8 +1382,8 @@ create_intf_network (void)
GtkWidget *network_http; GtkWidget *network_http;
GtkWidget *frame4; GtkWidget *frame4;
GtkWidget *table2; GtkWidget *table2;
GtkWidget *label17; GtkWidget *network_server_label;
GtkWidget *label18; GtkWidget *network_port_label;
GtkObject *network_port_adj; GtkObject *network_port_adj;
GtkWidget *network_port; GtkWidget *network_port;
GtkWidget *network_broadcast_check; GtkWidget *network_broadcast_check;
...@@ -1396,7 +1396,7 @@ create_intf_network (void) ...@@ -1396,7 +1396,7 @@ create_intf_network (void)
GtkWidget *network_channel_check; GtkWidget *network_channel_check;
GtkWidget *network_channel_combo; GtkWidget *network_channel_combo;
GtkWidget *network_channel; GtkWidget *network_channel;
GtkWidget *channel_port; GtkWidget *network_channel_port_label;
GtkObject *network_channel_port_adj; GtkObject *network_channel_port_adj;
GtkWidget *network_channel_port; GtkWidget *network_channel_port;
GtkWidget *hbuttonbox1; GtkWidget *hbuttonbox1;
...@@ -1478,25 +1478,25 @@ create_intf_network (void) ...@@ -1478,25 +1478,25 @@ create_intf_network (void)
gtk_table_set_row_spacings (GTK_TABLE (table2), 5); gtk_table_set_row_spacings (GTK_TABLE (table2), 5);
gtk_table_set_col_spacings (GTK_TABLE (table2), 5); gtk_table_set_col_spacings (GTK_TABLE (table2), 5);
label17 = gtk_label_new (_("Address")); network_server_label = gtk_label_new (_("Address"));
gtk_widget_ref (label17); gtk_widget_ref (network_server_label);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "label17", label17, gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_server_label", network_server_label,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label17); gtk_widget_show (network_server_label);
gtk_table_attach (GTK_TABLE (table2), label17, 0, 1, 0, 1, gtk_table_attach (GTK_TABLE (table2), network_server_label, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0); (GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label17), 0, 0.5); gtk_misc_set_alignment (GTK_MISC (network_server_label), 0, 0.5);
label18 = gtk_label_new (_("Port")); network_port_label = gtk_label_new (_("Port"));
gtk_widget_ref (label18); gtk_widget_ref (network_port_label);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "label18", label18, gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_port_label", network_port_label,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label18); gtk_widget_show (network_port_label);
gtk_table_attach (GTK_TABLE (table2), label18, 0, 1, 1, 2, gtk_table_attach (GTK_TABLE (table2), network_port_label, 0, 1, 1, 2,
(GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0); (GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label18), 0, 0.5); gtk_misc_set_alignment (GTK_MISC (network_port_label), 0, 0.5);
network_port_adj = gtk_adjustment_new (1234, 1024, 65535, 1, 10, 10); network_port_adj = gtk_adjustment_new (1234, 1024, 65535, 1, 10, 10);
network_port = gtk_spin_button_new (GTK_ADJUSTMENT (network_port_adj), 1, 0); network_port = gtk_spin_button_new (GTK_ADJUSTMENT (network_port_adj), 1, 0);
...@@ -1588,12 +1588,12 @@ create_intf_network (void) ...@@ -1588,12 +1588,12 @@ create_intf_network (void)
gtk_widget_show (network_channel); gtk_widget_show (network_channel);
gtk_entry_set_text (GTK_ENTRY (network_channel), _("138.195.143.120")); gtk_entry_set_text (GTK_ENTRY (network_channel), _("138.195.143.120"));
channel_port = gtk_label_new (_("port:")); network_channel_port_label = gtk_label_new (_("port:"));
gtk_widget_ref (channel_port); gtk_widget_ref (network_channel_port_label);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "channel_port", channel_port, gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_channel_port_label", network_channel_port_label,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (channel_port); gtk_widget_show (network_channel_port_label);
gtk_box_pack_start (GTK_BOX (hbox4), channel_port, FALSE, FALSE, 5); gtk_box_pack_start (GTK_BOX (hbox4), network_channel_port_label, FALSE, FALSE, 5);
network_channel_port_adj = gtk_adjustment_new (6010, 1024, 65535, 1, 10, 10); network_channel_port_adj = gtk_adjustment_new (6010, 1024, 65535, 1, 10, 10);
network_channel_port = gtk_spin_button_new (GTK_ADJUSTMENT (network_channel_port_adj), 1, 0); network_channel_port = gtk_spin_button_new (GTK_ADJUSTMENT (network_channel_port_adj), 1, 0);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk_callbacks.c : Callbacks for the Gtk+ plugin. * gtk_callbacks.c : Callbacks for the Gtk+ plugin.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_callbacks.c,v 1.25 2001/11/12 04:12:37 sam Exp $ * $Id: gtk_callbacks.c,v 1.26 2001/11/16 00:29:52 stef Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -336,7 +336,7 @@ void GtkChannelGo( GtkButton * button, gpointer user_data ) ...@@ -336,7 +336,7 @@ void GtkChannelGo( GtkButton * button, gpointer user_data )
vlc_mutex_unlock( &p_intf->change_lock ); vlc_mutex_unlock( &p_intf->change_lock );
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY ); // input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk_display.c: Gtk+ tools for main interface * gtk_display.c: Gtk+ tools for main interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: gtk_display.c,v 1.6 2001/08/09 08:20:26 sam Exp $ * $Id: gtk_display.c,v 1.7 2001/11/16 00:29:52 stef Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -204,10 +204,21 @@ gint GtkModeManage( intf_thread_t * p_intf ) ...@@ -204,10 +204,21 @@ gint GtkModeManage( intf_thread_t * p_intf )
} }
else else
{ {
if( main_GetIntVariable( INPUT_NETWORK_CHANNEL_VAR,
INPUT_NETWORK_CHANNEL_DEFAULT ) )
{
gtk_widget_show( GTK_WIDGET( p_network_box ) );
p_channel = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "network_channel_box" ) );
gtk_widget_show( GTK_WIDGET( p_channel ) );
}
else
{
//intf_WarnMsg( 2, "intf info: default to file method" ); //intf_WarnMsg( 2, "intf info: default to file method" );
/* default mode */ /* default mode */
p_label = gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_window ), p_label = gtk_object_get_data(
"label_status" ); GTK_OBJECT( p_intf->p_sys->p_window ), "label_status" );
gtk_label_set_text( GTK_LABEL( p_label ), "" ); gtk_label_set_text( GTK_LABEL( p_label ), "" );
gtk_widget_show( GTK_WIDGET( p_file_box ) ); gtk_widget_show( GTK_WIDGET( p_file_box ) );
...@@ -226,6 +237,7 @@ gint GtkModeManage( intf_thread_t * p_intf ) ...@@ -226,6 +237,7 @@ gint GtkModeManage( intf_thread_t * p_intf )
gtk_widget_set_sensitive( GETWIDGET(p_popup,"popup_subpictures"), gtk_widget_set_sensitive( GETWIDGET(p_popup,"popup_subpictures"),
FALSE ); FALSE );
} }
}
/* set control items */ /* set control items */
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_back"), FALSE ); gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_back"), FALSE );
......
...@@ -741,7 +741,7 @@ create_intf_window (void) ...@@ -741,7 +741,7 @@ create_intf_window (void)
gtk_widget_show (channel_label); gtk_widget_show (channel_label);
gtk_box_pack_start (GTK_BOX (network_channel_box), channel_label, FALSE, FALSE, 5); gtk_box_pack_start (GTK_BOX (network_channel_box), channel_label, FALSE, FALSE, 5);
network_channel_spinbutton_adj = gtk_adjustment_new (1, 0, 100, 1, 10, 10); network_channel_spinbutton_adj = gtk_adjustment_new (0, 0, 100, 1, 10, 10);
network_channel_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (network_channel_spinbutton_adj), 1, 0); network_channel_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (network_channel_spinbutton_adj), 1, 0);
gtk_widget_ref (network_channel_spinbutton); gtk_widget_ref (network_channel_spinbutton);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "network_channel_spinbutton", network_channel_spinbutton, gtk_object_set_data_full (GTK_OBJECT (intf_window), "network_channel_spinbutton", network_channel_spinbutton,
...@@ -1594,8 +1594,8 @@ create_intf_network (void) ...@@ -1594,8 +1594,8 @@ create_intf_network (void)
GtkWidget *table2; GtkWidget *table2;
GtkObject *network_port_adj; GtkObject *network_port_adj;
GtkWidget *network_port; GtkWidget *network_port;
GtkWidget *label24; GtkWidget *network_port_label;
GtkWidget *label25; GtkWidget *network_server_label;
GtkWidget *network_broadcast_check; GtkWidget *network_broadcast_check;
GtkWidget *network_broadcast_combo; GtkWidget *network_broadcast_combo;
GtkWidget *network_broadcast; GtkWidget *network_broadcast;
...@@ -1607,7 +1607,7 @@ create_intf_network (void) ...@@ -1607,7 +1607,7 @@ create_intf_network (void)
GtkWidget *network_channel_check; GtkWidget *network_channel_check;
GtkWidget *network_channel_combo; GtkWidget *network_channel_combo;
GtkWidget *network_channel; GtkWidget *network_channel;
GtkWidget *channel_port; GtkWidget *network_channel_port_label;
GtkObject *network_channel_port_adj; GtkObject *network_channel_port_adj;
GtkWidget *network_channel_port; GtkWidget *network_channel_port;
GtkWidget *hbox4; GtkWidget *hbox4;
...@@ -1707,25 +1707,25 @@ create_intf_network (void) ...@@ -1707,25 +1707,25 @@ create_intf_network (void)
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0); (GtkAttachOptions) (0), 0, 0);
label24 = gtk_label_new (_("Port")); network_port_label = gtk_label_new (_("Port"));
gtk_widget_ref (label24); gtk_widget_ref (network_port_label);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "label24", label24, gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_port_label", network_port_label,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label24); gtk_widget_show (network_port_label);
gtk_table_attach (GTK_TABLE (table2), label24, 0, 1, 1, 2, gtk_table_attach (GTK_TABLE (table2), network_port_label, 0, 1, 1, 2,
(GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0); (GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label24), 0, 0.5); gtk_misc_set_alignment (GTK_MISC (network_port_label), 0, 0.5);
label25 = gtk_label_new (_("Address")); network_server_label = gtk_label_new (_("Address"));
gtk_widget_ref (label25); gtk_widget_ref (network_server_label);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "label25", label25, gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_server_label", network_server_label,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label25); gtk_widget_show (network_server_label);
gtk_table_attach (GTK_TABLE (table2), label25, 0, 1, 0, 1, gtk_table_attach (GTK_TABLE (table2), network_server_label, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0); (GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label25), 0, 0.5); gtk_misc_set_alignment (GTK_MISC (network_server_label), 0, 0.5);
network_broadcast_check = gtk_check_button_new_with_label (_("Broadcast")); network_broadcast_check = gtk_check_button_new_with_label (_("Broadcast"));
gtk_widget_ref (network_broadcast_check); gtk_widget_ref (network_broadcast_check);
...@@ -1809,12 +1809,12 @@ create_intf_network (void) ...@@ -1809,12 +1809,12 @@ create_intf_network (void)
gtk_widget_show (network_channel); gtk_widget_show (network_channel);
gtk_entry_set_text (GTK_ENTRY (network_channel), _("138.195.143.120")); gtk_entry_set_text (GTK_ENTRY (network_channel), _("138.195.143.120"));
channel_port = gtk_label_new (_("port:")); network_channel_port_label = gtk_label_new (_("port:"));
gtk_widget_ref (channel_port); gtk_widget_ref (network_channel_port_label);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "channel_port", channel_port, gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_channel_port_label", network_channel_port_label,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (channel_port); gtk_widget_show (network_channel_port_label);
gtk_box_pack_start (GTK_BOX (hbox14), channel_port, FALSE, FALSE, 5); gtk_box_pack_start (GTK_BOX (hbox14), network_channel_port_label, FALSE, FALSE, 5);
network_channel_port_adj = gtk_adjustment_new (6010, 1024, 100, 1, 10, 10); network_channel_port_adj = gtk_adjustment_new (6010, 1024, 100, 1, 10, 10);
network_channel_port = gtk_spin_button_new (GTK_ADJUSTMENT (network_channel_port_adj), 1, 0); network_channel_port = gtk_spin_button_new (GTK_ADJUSTMENT (network_channel_port_adj), 1, 0);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk_open.c : functions to handle file/disc/network open widgets. * gtk_open.c : functions to handle file/disc/network open widgets.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_open.c,v 1.7 2001/10/10 14:25:15 sam Exp $ * $Id: gtk_open.c,v 1.8 2001/11/16 00:29:52 stef Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -268,6 +268,41 @@ gboolean GtkNetworkOpenShow( GtkWidget *widget, ...@@ -268,6 +268,41 @@ gboolean GtkNetworkOpenShow( GtkWidget *widget,
p_intf->p_sys->p_network = create_intf_network(); p_intf->p_sys->p_network = create_intf_network();
gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_network ), gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_network ),
"p_intf", p_intf ); "p_intf", p_intf );
gtk_entry_set_text( GTK_ENTRY( gtk_object_get_data(
GTK_OBJECT( p_intf->p_sys->p_network ), "network_server" ) ),
main_GetPszVariable( INPUT_SERVER_VAR,
INPUT_SERVER_DEFAULT ) );
gtk_spin_button_set_value( GTK_SPIN_BUTTON( gtk_object_get_data(
GTK_OBJECT( p_intf->p_sys->p_network ), "network_port" ) ),
main_GetIntVariable( INPUT_PORT_VAR,
INPUT_PORT_DEFAULT ) );
gtk_entry_set_text( GTK_ENTRY( gtk_object_get_data(
GTK_OBJECT( p_intf->p_sys->p_network ), "network_broadcast" ) ),
main_GetPszVariable( INPUT_BCAST_ADDR_VAR,
INPUT_BCAST_ADDR_DEFAULT ) );
gtk_entry_set_text( GTK_ENTRY( gtk_object_get_data(
GTK_OBJECT( p_intf->p_sys->p_network ), "network_channel" ) ),
main_GetPszVariable( INPUT_CHANNEL_SERVER_VAR,
INPUT_CHANNEL_SERVER_DEFAULT ) );
gtk_spin_button_set_value( GTK_SPIN_BUTTON( gtk_object_get_data(
GTK_OBJECT( p_intf->p_sys->p_network ), "network_channel_port" ) ),
main_GetIntVariable( INPUT_CHANNEL_PORT_VAR,
INPUT_CHANNEL_PORT_DEFAULT ) );
gtk_toggle_button_set_active( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_network ), "network_channel_check" ),
main_GetIntVariable( INPUT_NETWORK_CHANNEL_VAR,
INPUT_NETWORK_CHANNEL_DEFAULT ) );
gtk_toggle_button_set_active( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_network ), "network_broadcast_check" ),
main_GetIntVariable( INPUT_BROADCAST_VAR,
INPUT_BROADCAST_DEFAULT ) );
} }
gtk_widget_show( p_intf->p_sys->p_network ); gtk_widget_show( p_intf->p_sys->p_network );
...@@ -291,6 +326,12 @@ void GtkNetworkOpenOk( GtkButton *button, gpointer user_data ) ...@@ -291,6 +326,12 @@ void GtkNetworkOpenOk( GtkButton *button, gpointer user_data )
psz_server = gtk_entry_get_text( GTK_ENTRY( lookup_widget( psz_server = gtk_entry_get_text( GTK_ENTRY( lookup_widget(
GTK_WIDGET(button), "network_server" ) ) ); GTK_WIDGET(button), "network_server" ) ) );
/* select added item */
if( p_intf->p_input != NULL )
{
p_intf->p_input->b_eof = 1;
}
/* Check which protocol was activated */ /* Check which protocol was activated */
if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button), if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button),
"network_ts" ) )->active ) "network_ts" ) )->active )
...@@ -308,7 +349,38 @@ void GtkNetworkOpenOk( GtkButton *button, gpointer user_data ) ...@@ -308,7 +349,38 @@ void GtkNetworkOpenOk( GtkButton *button, gpointer user_data )
return; return;
} }
/* Get the port number and make sure it will not overflow 5 characters */ /* Manage channel server */
b_channel = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(
lookup_widget( GTK_WIDGET(button), "network_channel_check" ) ) );
main_PutIntVariable( INPUT_NETWORK_CHANNEL_VAR, b_channel );
if( b_channel )
{
char * psz_channel;
unsigned int i_channel_port;
if( p_main->p_channel == NULL )
{
network_ChannelCreate();
}
psz_channel = gtk_entry_get_text( GTK_ENTRY( lookup_widget(
GTK_WIDGET(button), "network_channel" ) ) );
i_channel_port = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON(
lookup_widget( GTK_WIDGET(button), "network_channel_port" ) ) );
main_PutPszVariable( INPUT_CHANNEL_SERVER_VAR, psz_channel );
if( i_channel_port < 65536 )
{
main_PutIntVariable( INPUT_CHANNEL_PORT_VAR, i_channel_port );
}
p_intf->p_sys->b_playing = 1;
}
else
{
/* Get the port number and make sure it will not
* overflow 5 characters */
i_port = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( i_port = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON(
lookup_widget( GTK_WIDGET(button), "network_port" ) ) ); lookup_widget( GTK_WIDGET(button), "network_port" ) ) );
if( i_port > 65535 ) if( i_port > 65535 )
...@@ -353,33 +425,8 @@ void GtkNetworkOpenOk( GtkButton *button, gpointer user_data ) ...@@ -353,33 +425,8 @@ void GtkNetworkOpenOk( GtkButton *button, gpointer user_data )
} }
/* Build source name and add it to playlist */ /* Build source name and add it to playlist */
sprintf( psz_source, "%s://%s:%i", psz_protocol, psz_server, i_port ); sprintf( psz_source, "%s://%s:%i",
} psz_protocol, psz_server, i_port );
/* Manage channel server */
b_channel = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(
lookup_widget( GTK_WIDGET(button), "network_channel_check" ) ) );
main_PutIntVariable( INPUT_NETWORK_CHANNEL_VAR, b_channel );
if( b_channel )
{
char * psz_channel;
unsigned int i_channel_port;
if( p_main->p_channel == NULL )
{
network_ChannelCreate();
}
psz_channel = gtk_entry_get_text( GTK_ENTRY( lookup_widget(
GTK_WIDGET(button), "network_channel" ) ) );
i_channel_port = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON(
lookup_widget( GTK_WIDGET(button), "network_channel_port" ) ) );
main_PutPszVariable( INPUT_CHANNEL_SERVER_VAR, psz_channel );
if( i_channel_port < 65536 )
{
main_PutIntVariable( INPUT_CHANNEL_PORT_VAR, i_channel_port );
}
} }
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, psz_source ); intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, psz_source );
...@@ -391,13 +438,8 @@ void GtkNetworkOpenOk( GtkButton *button, gpointer user_data ) ...@@ -391,13 +438,8 @@ void GtkNetworkOpenOk( GtkButton *button, gpointer user_data )
/* update the display */ /* update the display */
GtkRebuildCList( p_playlist_clist, p_main->p_playlist ); GtkRebuildCList( p_playlist_clist, p_main->p_playlist );
/* select added item */
if( p_intf->p_input != NULL )
{
p_intf->p_input->b_eof = 1;
}
intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 ); intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
}
} }
void GtkNetworkOpenCancel( GtkButton * button, gpointer user_data) void GtkNetworkOpenCancel( GtkButton * button, gpointer user_data)
...@@ -427,21 +469,49 @@ void GtkNetworkOpenChannel( GtkToggleButton * togglebutton, ...@@ -427,21 +469,49 @@ void GtkNetworkOpenChannel( GtkToggleButton * togglebutton,
gpointer user_data ) gpointer user_data )
{ {
GtkWidget * p_network; GtkWidget * p_network;
boolean_t b_channel;
boolean_t b_broadcast;
p_network = gtk_widget_get_toplevel( GTK_WIDGET (togglebutton) ); p_network = gtk_widget_get_toplevel( GTK_WIDGET (togglebutton) );
b_channel = gtk_toggle_button_get_active( togglebutton );
b_broadcast = gtk_toggle_button_get_active( gtk_object_get_data(
GTK_OBJECT( p_network ), "network_broadcast_check" ) );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_network ), gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_network ),
"network_channel_combo" ), "network_channel_combo" ), b_channel ) ;
gtk_toggle_button_get_active( togglebutton ) );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_network ), gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_network ),
"network_channel" ), "network_channel" ), b_channel );
gtk_toggle_button_get_active( togglebutton ) );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_network ), gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_network ),
"network_channel_port" ), "network_channel_port" ), b_channel );
gtk_toggle_button_get_active( togglebutton ) );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_network ),
"network_channel_port_label" ), b_channel );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_network ),
"network_server_combo" ), ! b_channel );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_network ),
"network_server_label" ), ! b_channel );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_network ),
"network_server" ), ! b_channel );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_network ),
"network_port_label" ), ! b_channel );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_network ),
"network_port" ), ! b_channel );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_network ),
"network_broadcast_check" ), ! b_channel );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_network ),
"network_broadcast_combo" ), b_broadcast && ! b_channel );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_network ),
"network_broadcast" ), b_broadcast && ! b_channel );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf_gnome.c: Gnome interface * intf_gnome.c: Gnome interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_gnome.c,v 1.4 2001/10/04 00:50:24 sam Exp $ * $Id: intf_gnome.c,v 1.5 2001/11/16 00:29:52 stef Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -145,6 +145,7 @@ static int intf_Open( intf_thread_t *p_intf ) ...@@ -145,6 +145,7 @@ static int intf_Open( intf_thread_t *p_intf )
} }
/* Initialize Gnome thread */ /* Initialize Gnome thread */
p_intf->p_sys->b_playing = 1;
p_intf->p_sys->b_popup_changed = 0; p_intf->p_sys->b_popup_changed = 0;
p_intf->p_sys->b_window_changed = 0; p_intf->p_sys->b_window_changed = 0;
p_intf->p_sys->b_playlist_changed = 0; p_intf->p_sys->b_playlist_changed = 0;
...@@ -325,6 +326,7 @@ static gint GnomeManage( gpointer p_data ) ...@@ -325,6 +326,7 @@ static gint GnomeManage( gpointer p_data )
{ {
GtkModeManage( p_intf ); GtkModeManage( p_intf );
GtkSetupMenus( p_intf ); GtkSetupMenus( p_intf );
p_intf->p_sys->b_playing = 1;
} }
/* Manage the slider */ /* Manage the slider */
...@@ -370,9 +372,10 @@ static gint GnomeManage( gpointer p_data ) ...@@ -370,9 +372,10 @@ static gint GnomeManage( gpointer p_data )
vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock ); vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock );
} }
else if( !p_intf->b_die ) else if( p_intf->p_sys->b_playing && !p_intf->b_die )
{ {
GtkModeManage( p_intf ); GtkModeManage( p_intf );
p_intf->p_sys->b_playing = 0;
} }
/* Manage core vlc functions through the callback */ /* Manage core vlc functions through the callback */
......
...@@ -909,7 +909,7 @@ ...@@ -909,7 +909,7 @@
<update_policy>GTK_UPDATE_ALWAYS</update_policy> <update_policy>GTK_UPDATE_ALWAYS</update_policy>
<snap>False</snap> <snap>False</snap>
<wrap>False</wrap> <wrap>False</wrap>
<value>1</value> <value>0</value>
<lower>0</lower> <lower>0</lower>
<upper>100</upper> <upper>100</upper>
<step>1</step> <step>1</step>
...@@ -1953,7 +1953,7 @@ Henri Fallon &lt;henri@via.ecp.fr&gt; ...@@ -1953,7 +1953,7 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label17</name> <name>network_server_label</name>
<label>Address</label> <label>Address</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
...@@ -1979,7 +1979,7 @@ Henri Fallon &lt;henri@via.ecp.fr&gt; ...@@ -1979,7 +1979,7 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label18</name> <name>network_port_label</name>
<label>Port</label> <label>Port</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
...@@ -2194,7 +2194,7 @@ Henri Fallon &lt;henri@via.ecp.fr&gt; ...@@ -2194,7 +2194,7 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>channel_port</name> <name>network_channel_port_label</name>
<label>port:</label> <label>port:</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf_gtk.c: Gtk+ interface * intf_gtk.c: Gtk+ interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_gtk.c,v 1.26 2001/10/04 00:50:24 sam Exp $ * $Id: intf_gtk.c,v 1.27 2001/11/16 00:29:52 stef Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -146,6 +146,7 @@ static int intf_Open( intf_thread_t *p_intf ) ...@@ -146,6 +146,7 @@ static int intf_Open( intf_thread_t *p_intf )
} }
/* Initialize Gtk+ thread */ /* Initialize Gtk+ thread */
p_intf->p_sys->b_playing = 1;
p_intf->p_sys->b_popup_changed = 0; p_intf->p_sys->b_popup_changed = 0;
p_intf->p_sys->b_window_changed = 0; p_intf->p_sys->b_window_changed = 0;
p_intf->p_sys->b_playlist_changed = 0; p_intf->p_sys->b_playlist_changed = 0;
...@@ -325,6 +326,7 @@ static gint GtkManage( gpointer p_data ) ...@@ -325,6 +326,7 @@ static gint GtkManage( gpointer p_data )
{ {
GtkModeManage( p_intf ); GtkModeManage( p_intf );
GtkSetupMenus( p_intf ); GtkSetupMenus( p_intf );
p_intf->p_sys->b_playing = 1;
} }
/* Manage the slider */ /* Manage the slider */
...@@ -371,9 +373,10 @@ static gint GtkManage( gpointer p_data ) ...@@ -371,9 +373,10 @@ static gint GtkManage( gpointer p_data )
vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock ); vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock );
} }
else if( !p_intf->b_die ) else if( p_intf->p_sys->b_playing && !p_intf->b_die )
{ {
GtkModeManage( p_intf ); GtkModeManage( p_intf );
p_intf->p_sys->b_playing = 0;
} }
/* Manage core vlc functions through the callback */ /* Manage core vlc functions through the callback */
......
...@@ -907,7 +907,7 @@ ...@@ -907,7 +907,7 @@
<update_policy>GTK_UPDATE_ALWAYS</update_policy> <update_policy>GTK_UPDATE_ALWAYS</update_policy>
<snap>False</snap> <snap>False</snap>
<wrap>False</wrap> <wrap>False</wrap>
<value>1</value> <value>0</value>
<lower>0</lower> <lower>0</lower>
<upper>100</upper> <upper>100</upper>
<step>1</step> <step>1</step>
...@@ -2064,7 +2064,7 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;</label> ...@@ -2064,7 +2064,7 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;</label>
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label24</name> <name>network_port_label</name>
<label>Port</label> <label>Port</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
...@@ -2090,7 +2090,7 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;</label> ...@@ -2090,7 +2090,7 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;</label>
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>label25</name> <name>network_server_label</name>
<label>Address</label> <label>Address</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
...@@ -2288,7 +2288,7 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;</label> ...@@ -2288,7 +2288,7 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;</label>
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>channel_port</name> <name>network_channel_port_label</name>
<label>port:</label> <label>port:</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf_gtk.h: private Gtk+ interface description * intf_gtk.h: private Gtk+ interface description
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_gtk.h,v 1.8 2001/10/04 00:50:24 sam Exp $ * $Id: intf_gtk.h,v 1.9 2001/11/16 00:29:52 stef Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -43,6 +43,7 @@ static __inline__ intf_thread_t * GetIntf( GtkWidget *item, char * psz_parent ) ...@@ -43,6 +43,7 @@ static __inline__ intf_thread_t * GetIntf( GtkWidget *item, char * psz_parent )
typedef struct intf_sys_s typedef struct intf_sys_s
{ {
/* special actions */ /* special actions */
boolean_t b_playing;
boolean_t b_popup_changed; /* display menu ? */ boolean_t b_popup_changed; /* display menu ? */
boolean_t b_window_changed; /* window display toggled ? */ boolean_t b_window_changed; /* window display toggled ? */
boolean_t b_playlist_changed; /* playlist display toggled ? */ boolean_t b_playlist_changed; /* playlist display toggled ? */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* netutils.c: various network functions * netutils.c: various network functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: netutils.c,v 1.45 2001/11/13 00:46:23 sam Exp $ * $Id: netutils.c,v 1.46 2001/11/16 00:29:52 stef Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Benoit Steiner <benny@via.ecp.fr> * Benoit Steiner <benny@via.ecp.fr>
...@@ -402,8 +402,15 @@ int network_ChannelJoin( int i_channel ) ...@@ -402,8 +402,15 @@ int network_ChannelJoin( int i_channel )
# define p_item \ # define p_item \
(&p_main->p_playlist->p_item[ p_main->p_playlist->i_index + 1]) (&p_main->p_playlist->p_item[ p_main->p_playlist->i_index + 1])
vlc_mutex_lock( &p_main->p_playlist->change_lock ); vlc_mutex_lock( &p_main->p_playlist->change_lock );
if( p_item )
{
free( p_item->psz_name ); free( p_item->psz_name );
p_item->psz_name = strdup( psz_mess ); p_item->psz_name = strdup( psz_mess );
}
else
{
intf_PlaylistAdd( p_main->p_playlist, 0, psz_mess );
}
vlc_mutex_unlock( &p_main->p_playlist->change_lock ); vlc_mutex_unlock( &p_main->p_playlist->change_lock );
} }
......
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