Commit b465bcca authored by Stéphane Borel's avatar Stéphane Borel

-Updated the gtk/gnome interface to work in network mode,

-Fixed some bugs in interface (language menus in ts, misnamed fields)

-Play/Stop work in network mode to start/stop decoding of the stream

I have a segfault in imdct_3dn(93). But I can't underdand assembly.
parent 73620c74
......@@ -3,7 +3,7 @@
* Declaration and extern access to global program object.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: main.h,v 1.19 2001/05/30 17:03:11 sam Exp $
* $Id: main.h,v 1.20 2001/05/30 23:02:03 stef Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -47,7 +47,6 @@ typedef struct main_s
/* Generic settings */
boolean_t b_audio; /* is audio output allowed ? */
boolean_t b_video; /* is video output allowed ? */
boolean_t b_channels; /* is channel changing supported ? */
/* Unique threads */
p_intf_thread_t p_intf; /* main interface thread */
......
......@@ -53,6 +53,7 @@ typedef struct module_symbols_s
void ( * msleep ) ( mtime_t );
mtime_t ( * mdate ) ( void );
int ( * network_ChannelCreate )( void );
int ( * network_ChannelJoin ) ( int );
void ( * input_SetStatus ) ( struct input_thread_s *, int );
......@@ -94,6 +95,7 @@ typedef struct module_symbols_s
(p_symbols)->intf_UrlDecode = intf_UrlDecode; \
(p_symbols)->msleep = msleep; \
(p_symbols)->mdate = mdate; \
(p_symbols)->network_ChannelCreate = network_ChannelCreate; \
(p_symbols)->network_ChannelJoin = network_ChannelJoin; \
(p_symbols)->input_SetStatus = input_SetStatus; \
(p_symbols)->input_SetRate = input_SetRate; \
......@@ -138,6 +140,7 @@ extern module_symbols_t* p_symbols;
# define msleep(a) p_symbols->msleep(a)
# define mdate() p_symbols->mdate()
# define network_ChannelCreate() p_symbols->network_ChannelCreate()
# define network_ChannelJoin(a) p_symbols->network_ChannelJoin(a)
# define input_SetStatus(a,b) p_symbols->input_SetStatus(a,b)
......
......@@ -261,3 +261,4 @@ GnomePopupJumpActivate (GtkMenuItem *menuitem,
}
......@@ -133,3 +133,11 @@ GtkNetworkJoin (GtkEditable *editable,
void
GtkChannelGo (GtkButton *button,
gpointer user_data);
void
GtkNetworkOpenBroadcast (GtkToggleButton *togglebutton,
gpointer user_data);
void
GtkNetworkOpenChannel (GtkToggleButton *togglebutton,
gpointer user_data);
......@@ -393,7 +393,6 @@ create_intf_window (void)
gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_stop", toolbar_stop,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (toolbar_stop);
gtk_widget_set_sensitive (toolbar_stop, FALSE);
tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_FORWARD);
toolbar_play = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
......@@ -1388,11 +1387,19 @@ create_intf_network (void)
GtkWidget *label18;
GtkObject *network_port_adj;
GtkWidget *network_port;
GtkWidget *broadcast_check;
GtkWidget *network_broadcast_check;
GtkWidget *network_broadcast_combo;
GtkWidget *network_broadcast;
GtkWidget *network_server_combo;
GtkWidget *network_server;
GtkWidget *frame5;
GtkWidget *hbox4;
GtkWidget *network_channel_check;
GtkWidget *network_channel_combo;
GtkWidget *network_channel;
GtkWidget *channel_port;
GtkObject *network_channel_port_adj;
GtkWidget *network_channel_port;
GtkWidget *hbuttonbox1;
GtkWidget *network_ok;
GtkWidget *network_cancel;
......@@ -1493,7 +1500,7 @@ create_intf_network (void)
(GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label18), 0, 0.5);
network_port_adj = gtk_adjustment_new (1234, 0, 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);
gtk_widget_ref (network_port);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_port", network_port,
......@@ -1504,15 +1511,14 @@ create_intf_network (void)
(GtkAttachOptions) (0), 0, 0);
gtk_tooltips_set_tip (tooltips, network_port, _("Port of the stream server"), NULL);
broadcast_check = gtk_check_button_new_with_label (_("Broadcast"));
gtk_widget_ref (broadcast_check);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "broadcast_check", broadcast_check,
network_broadcast_check = gtk_check_button_new_with_label (_("Broadcast"));
gtk_widget_ref (network_broadcast_check);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_broadcast_check", network_broadcast_check,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (broadcast_check);
gtk_table_attach (GTK_TABLE (table2), broadcast_check, 0, 1, 2, 3,
gtk_widget_show (network_broadcast_check);
gtk_table_attach (GTK_TABLE (table2), network_broadcast_check, 0, 1, 2, 3,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (broadcast_check), TRUE);
network_broadcast_combo = gnome_entry_new (NULL);
gtk_widget_ref (network_broadcast_combo);
......@@ -1547,6 +1553,60 @@ create_intf_network (void)
gtk_widget_show (network_server);
gtk_entry_set_text (GTK_ENTRY (network_server), _("vlsppc-02"));
frame5 = gtk_frame_new (_("Channels"));
gtk_widget_ref (frame5);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "frame5", frame5,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frame5);
gtk_box_pack_start (GTK_BOX (vbox5), frame5, TRUE, TRUE, 0);
gtk_frame_set_label_align (GTK_FRAME (frame5), 0.05, 0.5);
hbox4 = gtk_hbox_new (FALSE, 0);
gtk_widget_ref (hbox4);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "hbox4", hbox4,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (hbox4);
gtk_container_add (GTK_CONTAINER (frame5), hbox4);
network_channel_check = gtk_check_button_new_with_label (_("Channel server:"));
gtk_widget_ref (network_channel_check);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_channel_check", network_channel_check,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_channel_check);
gtk_box_pack_start (GTK_BOX (hbox4), network_channel_check, FALSE, FALSE, 0);
network_channel_combo = gnome_entry_new (NULL);
gtk_widget_ref (network_channel_combo);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_channel_combo", network_channel_combo,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_channel_combo);
gtk_box_pack_start (GTK_BOX (hbox4), network_channel_combo, FALSE, FALSE, 0);
gtk_widget_set_sensitive (network_channel_combo, FALSE);
network_channel = gnome_entry_gtk_entry (GNOME_ENTRY (network_channel_combo));
gtk_widget_ref (network_channel);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_channel", network_channel,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_channel);
gtk_entry_set_text (GTK_ENTRY (network_channel), _("138.195.143.220"));
channel_port = gtk_label_new (_("port:"));
gtk_widget_ref (channel_port);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "channel_port", channel_port,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (channel_port);
gtk_box_pack_start (GTK_BOX (hbox4), channel_port, FALSE, FALSE, 5);
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);
gtk_widget_ref (network_channel_port);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_channel_port", network_channel_port,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_channel_port);
gtk_box_pack_start (GTK_BOX (hbox4), network_channel_port, FALSE, FALSE, 0);
gtk_widget_set_usize (network_channel_port, 60, -2);
gtk_widget_set_sensitive (network_channel_port, FALSE);
hbuttonbox1 = GNOME_DIALOG (intf_network)->action_area;
gtk_object_set_data (GTK_OBJECT (intf_network), "hbuttonbox1", hbuttonbox1);
gtk_widget_show (hbuttonbox1);
......@@ -1569,9 +1629,12 @@ create_intf_network (void)
gtk_widget_show (network_cancel);
GTK_WIDGET_SET_FLAGS (network_cancel, GTK_CAN_DEFAULT);
gtk_signal_connect (GTK_OBJECT (broadcast_check), "toggled",
gtk_signal_connect (GTK_OBJECT (network_broadcast_check), "toggled",
GTK_SIGNAL_FUNC (GtkNetworkOpenBroadcast),
NULL);
"intf_network");
gtk_signal_connect (GTK_OBJECT (network_channel_check), "toggled",
GTK_SIGNAL_FUNC (GtkNetworkOpenChannel),
"intf_network");
gtk_signal_connect (GTK_OBJECT (network_ok), "clicked",
GTK_SIGNAL_FUNC (GtkNetworkOpenOk),
"intf_network");
......@@ -1806,7 +1869,7 @@ create_intf_playlist (void)
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (playlist_delete_menu_uiinfo[1].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "playmist_delete_item",
gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "playlist_delete_item",
playlist_delete_menu_uiinfo[1].widget,
(GtkDestroyNotify) gtk_widget_unref);
......
......@@ -2,7 +2,7 @@
* gtk_callbacks.c : Callbacks for the Gtk+ plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_callbacks.c,v 1.22 2001/05/30 17:03:12 sam Exp $
* $Id: gtk_callbacks.c,v 1.23 2001/05/30 23:02:03 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -282,7 +282,7 @@ void GtkNetworkJoin( GtkEditable * editable, gpointer user_data )
int i_channel;
i_channel = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( editable ) );
intf_WarnMsg( 3, "intf info: joining channel %d", i_channel );
// intf_WarnMsg( 3, "intf info: joining channel %d", i_channel );
// network_ChannelJoin( i_channel );
}
......@@ -293,6 +293,8 @@ void GtkChannelGo( GtkButton * button, gpointer user_data )
GtkWidget * spin;
int i_channel;
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), (char*)user_data );
window = gtk_widget_get_toplevel( GTK_WIDGET (button) );
spin = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( window ),
"network_channel_spinbutton" ) );
......@@ -300,7 +302,29 @@ void GtkChannelGo( GtkButton * button, gpointer user_data )
i_channel = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( spin ) );
intf_WarnMsg( 3, "intf info: joining channel %d", i_channel );
vlc_mutex_lock( &p_intf->change_lock );
if( p_intf->p_input != NULL )
{
/* end playing item */
p_intf->p_input->b_eof = 1;
/* update playlist */
vlc_mutex_lock( &p_main->p_playlist->change_lock );
p_main->p_playlist->i_index--;
p_main->p_playlist->b_stopped = 1;
vlc_mutex_unlock( &p_main->p_playlist->change_lock );
/* FIXME: ugly hack to close input and outputs */
p_intf->pf_manage( p_intf );
p_main->p_playlist->b_stopped = 0;
p_intf->pf_manage( p_intf );
}
vlc_mutex_unlock( &p_intf->change_lock );
network_ChannelJoin( i_channel );
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
}
......
......@@ -2,7 +2,7 @@
* gtk_callbacks.h : Callbacks for the gtk plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_callbacks.h,v 1.14 2001/05/30 05:19:03 stef Exp $
* $Id: gtk_callbacks.h,v 1.15 2001/05/30 23:02:03 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -68,3 +68,5 @@ void GtkJumpActivate ( GtkMenuItem *, gpointer );
void GtkNetworkJoin ( GtkEditable *, gpointer );
void GtkChannelGo ( GtkButton *, gpointer );
void GtkNetworkOpenChannel ( GtkToggleButton *, gpointer );
......@@ -2,7 +2,7 @@
* gtk_display.c: Gtk+ tools for main interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: gtk_display.c,v 1.3 2001/05/30 17:03:12 sam Exp $
* $Id: gtk_display.c,v 1.4 2001/05/30 23:02:03 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -101,6 +101,7 @@ gint GtkModeManage( intf_thread_t * p_intf )
GtkWidget * p_network_box;
GtkWidget * p_slider;
GtkWidget * p_label;
GtkWidget * p_channel;
boolean_t b_control;
#define GETWIDGET( ptr, name ) GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( \
......@@ -152,6 +153,18 @@ gint GtkModeManage( intf_thread_t * p_intf )
"network_address_label" );
gtk_label_set_text( GTK_LABEL( p_label ),
p_intf->p_input->p_source );
p_channel = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "network_channel_box" ) );
if( main_GetIntVariable( INPUT_NETWORK_CHANNEL_VAR,
INPUT_NETWORK_CHANNEL_DEFAULT ) )
{
gtk_widget_show( GTK_WIDGET( p_channel ) );
}
else
{
gtk_widget_hide( GTK_WIDGET( p_channel ) );
}
break;
default:
intf_ErrMsg( "intf error: can't determine input method" );
......@@ -206,12 +219,10 @@ gint GtkModeManage( intf_thread_t * p_intf )
/* set control items */
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_back"), FALSE );
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_stop"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_pause"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_slow"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_fast"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_back"), FALSE );
gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_stop"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_pause"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_slow"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_fast"), b_control );
......
......@@ -89,7 +89,7 @@ create_intf_window (void)
GtkWidget *chapter_prev_button;
GtkWidget *chapter_next_button;
GtkWidget *network_box;
GtkWidget *network_address;
GtkWidget *network_address_label;
GtkWidget *network_channel_box;
GtkWidget *channel_label;
GtkObject *network_channel_spinbutton_adj;
......@@ -503,7 +503,6 @@ create_intf_window (void)
gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_stop", toolbar_stop,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (toolbar_stop);
gtk_widget_set_sensitive (toolbar_stop, FALSE);
toolbar_play = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
GTK_TOOLBAR_CHILD_BUTTON,
......@@ -721,12 +720,12 @@ create_intf_window (void)
gtk_box_pack_start (GTK_BOX (window_vbox), network_box, TRUE, TRUE, 0);
gtk_widget_set_usize (network_box, 500, 24);
network_address = gtk_label_new (_("No server !"));
gtk_widget_ref (network_address);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "network_address", network_address,
network_address_label = gtk_label_new (_("No server !"));
gtk_widget_ref (network_address_label);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "network_address_label", network_address_label,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_address);
gtk_box_pack_start (GTK_BOX (network_box), network_address, TRUE, TRUE, 0);
gtk_widget_show (network_address_label);
gtk_box_pack_start (GTK_BOX (network_box), network_address_label, TRUE, TRUE, 0);
network_channel_box = gtk_hbox_new (FALSE, 0);
gtk_widget_ref (network_channel_box);
......@@ -938,7 +937,6 @@ create_intf_popup (void)
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (popup_stop);
gtk_container_add (GTK_CONTAINER (intf_popup), popup_stop);
gtk_widget_set_sensitive (popup_stop, FALSE);
popup_back = gtk_menu_item_new_with_label (_("Back"));
gtk_widget_ref (popup_back);
......@@ -1599,12 +1597,20 @@ create_intf_network (void)
GtkWidget *network_port;
GtkWidget *label24;
GtkWidget *label25;
GtkWidget *broadcast_check;
GtkWidget *network_broadcast_check;
GtkWidget *network_broadcast_combo;
GtkWidget *network_broadcast;
GtkWidget *network_server_combo;
GList *network_server_combo_items = NULL;
GtkWidget *network_server;
GtkWidget *frame6;
GtkWidget *hbox14;
GtkWidget *network_channel_check;
GtkWidget *network_channel_combo;
GtkWidget *network_channel;
GtkWidget *channel_port;
GtkObject *network_channel_port_adj;
GtkWidget *network_channel_port;
GtkWidget *hbox4;
GtkWidget *hbox5;
GtkWidget *network_ok;
......@@ -1723,12 +1729,12 @@ create_intf_network (void)
(GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label25), 0, 0.5);
broadcast_check = gtk_check_button_new_with_label (_("Broadcast"));
gtk_widget_ref (broadcast_check);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "broadcast_check", broadcast_check,
network_broadcast_check = gtk_check_button_new_with_label (_("Broadcast"));
gtk_widget_ref (network_broadcast_check);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_broadcast_check", network_broadcast_check,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (broadcast_check);
gtk_table_attach (GTK_TABLE (table2), broadcast_check, 0, 1, 2, 3,
gtk_widget_show (network_broadcast_check);
gtk_table_attach (GTK_TABLE (table2), network_broadcast_check, 0, 1, 2, 3,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
......@@ -1748,6 +1754,7 @@ create_intf_network (void)
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_broadcast);
gtk_widget_set_sensitive (network_broadcast, FALSE);
gtk_entry_set_text (GTK_ENTRY (network_broadcast), _("138.195.143.255"));
network_server_combo = gtk_combo_new ();
gtk_widget_ref (network_server_combo);
......@@ -1766,7 +1773,59 @@ create_intf_network (void)
gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_server", network_server,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_server);
gtk_entry_set_text (GTK_ENTRY (network_server), _("vls"));
gtk_entry_set_text (GTK_ENTRY (network_server), _("vlsppc-02"));
frame6 = gtk_frame_new (_("Channels"));
gtk_widget_ref (frame6);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "frame6", frame6,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frame6);
gtk_box_pack_start (GTK_BOX (vbox8), frame6, TRUE, TRUE, 5);
gtk_frame_set_label_align (GTK_FRAME (frame6), 0.05, 0.5);
hbox14 = gtk_hbox_new (FALSE, 0);
gtk_widget_ref (hbox14);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "hbox14", hbox14,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (hbox14);
gtk_container_add (GTK_CONTAINER (frame6), hbox14);
network_channel_check = gtk_check_button_new_with_label (_("Channel server:"));
gtk_widget_ref (network_channel_check);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_channel_check", network_channel_check,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_channel_check);
gtk_box_pack_start (GTK_BOX (hbox14), network_channel_check, FALSE, FALSE, 0);
network_channel_combo = gtk_combo_new ();
gtk_widget_ref (network_channel_combo);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_channel_combo", network_channel_combo,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_channel_combo);
gtk_box_pack_start (GTK_BOX (hbox14), network_channel_combo, TRUE, TRUE, 0);
network_channel = GTK_COMBO (network_channel_combo)->entry;
gtk_widget_ref (network_channel);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_channel", network_channel,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_channel);
gtk_entry_set_text (GTK_ENTRY (network_channel), _("138.195.143.220"));
channel_port = gtk_label_new (_("port:"));
gtk_widget_ref (channel_port);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "channel_port", channel_port,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (channel_port);
gtk_box_pack_start (GTK_BOX (hbox14), channel_port, FALSE, FALSE, 5);
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);
gtk_widget_ref (network_channel_port);
gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_channel_port", network_channel_port,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (network_channel_port);
gtk_box_pack_start (GTK_BOX (hbox14), network_channel_port, TRUE, TRUE, 0);
gtk_widget_set_usize (network_channel_port, 62, -2);
hbox4 = GTK_DIALOG (intf_network)->action_area;
gtk_object_set_data (GTK_OBJECT (intf_network), "hbox4", hbox4);
......@@ -1794,9 +1853,12 @@ create_intf_network (void)
gtk_widget_show (network_cancel);
gtk_box_pack_start (GTK_BOX (hbox5), network_cancel, FALSE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (broadcast_check), "toggled",
gtk_signal_connect (GTK_OBJECT (network_broadcast_check), "toggled",
GTK_SIGNAL_FUNC (GtkNetworkOpenBroadcast),
"intf_network");
gtk_signal_connect (GTK_OBJECT (network_channel_check), "toggled",
GTK_SIGNAL_FUNC (GtkNetworkOpenChannel),
"intf_network");
gtk_signal_connect (GTK_OBJECT (network_ok), "clicked",
GTK_SIGNAL_FUNC (GtkNetworkOpenOk),
"intf_network");
......
......@@ -2,7 +2,7 @@
* gtk_menu.c : functions to handle menu items.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_menu.c,v 1.6 2001/05/30 17:03:12 sam Exp $
* $Id: gtk_menu.c,v 1.7 2001/05/30 23:02:04 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -791,7 +791,7 @@ gint GtkSetupMenus( intf_thread_t * p_intf )
p_intf->p_sys->b_audio_update |= p_intf->p_sys->b_title_update;
p_intf->p_sys->b_spu_update |= p_intf->p_sys->b_title_update;
vlc_mutex_lock( &p_intf->p_input->stream.stream_lock );
// vlc_mutex_lock( &p_intf->p_input->stream.stream_lock );
if( p_intf->p_sys->b_title_update )
{
......@@ -923,6 +923,8 @@ gint GtkSetupMenus( intf_thread_t * p_intf )
p_intf->p_sys->b_spu_update = 0;
}
vlc_mutex_lock( &p_intf->p_input->stream.stream_lock );
return TRUE;
}
......@@ -2,7 +2,7 @@
* gtk_open.c : functions to handle file/disc/network open widgets.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_open.c,v 1.4 2001/05/30 17:03:12 sam Exp $
* $Id: gtk_open.c,v 1.5 2001/05/30 23:02:04 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -52,6 +52,7 @@
#include "intf_gtk.h"
#include "main.h"
#include "netutils.h"
#include "modules_export.h"
......@@ -275,6 +276,7 @@ void GtkNetworkOpenOk( GtkButton *button, gpointer user_data )
char * psz_source, *psz_server, *psz_protocol;
unsigned int i_port;
boolean_t b_broadcast;
boolean_t b_channel;
int i_end = p_main->p_playlist->i_size;
gtk_widget_hide( p_intf->p_sys->p_network );
......@@ -308,7 +310,7 @@ void GtkNetworkOpenOk( GtkButton *button, gpointer user_data )
/* do we have a broadcast address */
b_broadcast = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(
lookup_widget( GTK_WIDGET(button), "broadcast_check" ) ) );
lookup_widget( GTK_WIDGET(button), "network_broadcast_check" ) ) );
if( b_broadcast )
{
char * psz_broadcast;
......@@ -346,6 +348,32 @@ void GtkNetworkOpenOk( GtkButton *button, gpointer user_data )
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 );
free( psz_source );
......@@ -387,6 +415,27 @@ void GtkNetworkOpenBroadcast( GtkToggleButton * togglebutton,
}
void GtkNetworkOpenChannel( GtkToggleButton * togglebutton,
gpointer user_data )
{
GtkWidget * p_network;
p_network = gtk_widget_get_toplevel( GTK_WIDGET (togglebutton) );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_network ),
"network_channel_combo" ),
gtk_toggle_button_get_active( togglebutton ) );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_network ),
"network_channel" ),
gtk_toggle_button_get_active( togglebutton ) );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_network ),
"network_channel_port" ),
gtk_toggle_button_get_active( togglebutton ) );
}
/****************************************************************************
* Callbacks for menuitem
......
......@@ -2,7 +2,7 @@
* gtk_open.h: prototypes for open functions
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: gtk_open.h,v 1.2 2001/05/15 14:49:48 stef Exp $
* $Id: gtk_open.h,v 1.3 2001/05/30 23:02:04 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -36,6 +36,7 @@ gboolean GtkNetworkOpenShow ( GtkWidget *, GdkEventButton *, gpointer );