*initialization bugfixes in input_dvd

*added a b_stopped flag to interface playlist to have a stop function in
interface plugins. As a consequence, the playlist no longer loops on end
but wait for the user to press 'play' or to add another item (gtk/gnome
interface). I think that other plugins are broken but it shouldn't be
difficult to repair: just add a 'p_main->p_playlist->b_stopped = 0' in
play functions and 'p_main->p_playlist->b_stopped = 1' when you have to
stop.

*Updated gtk interface so that it has the same features as gnome. I
think I will merge the code so that we don't have to copy and paste each
change. Only the .glade file would be different.
This commit is contained in:
Stéphane Borel 2001-05-15 01:01:44 +00:00
parent db7b0421d5
commit 9530fc9f8c
31 changed files with 8850 additions and 2794 deletions

View File

@ -2,7 +2,7 @@
* intf_playlist.h : Playlist functions
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_playlist.h,v 1.2 2001/03/21 13:42:33 sam Exp $
* $Id: intf_playlist.h,v 1.3 2001/05/15 01:01:44 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
@ -45,6 +45,7 @@ typedef struct playlist_s
int i_mode; /* parse mode (random, forward, backward) */
int i_seed; /* seed used for random mode */
boolean_t b_stopped;
vlc_mutex_t change_lock;

View File

@ -10,7 +10,7 @@
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: input_dvd.c,v 1.57 2001/05/07 04:42:42 sam Exp $
* $Id: input_dvd.c,v 1.58 2001/05/15 01:01:44 stef Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
@ -562,6 +562,9 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
vlc_mutex_lock( &p_input->stream.stream_lock );
/* we can't use the interface slider until initilization is complete */
p_input->stream.b_seekable = 0;
if( p_area != p_input->stream.p_selected_area )
{
@ -581,7 +584,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
/* uodate title environnement variable so that we don't
* loop on the same title forever */
main_PutIntVariable( INPUT_TITLE_VAR, p_dvd->i_title + 1 );
// main_PutIntVariable( INPUT_TITLE_VAR, p_dvd->i_title + 1 );
/* ifo vts */
if( IfoTitleSet( p_dvd->p_ifo ) < 0 )
@ -947,7 +950,9 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
}
/* warn interface that something has changed */
p_input->stream.b_seekable = 1;
p_input->stream.b_changed = 1;
intf_WarnMsg( 3, "Pos: %lld Size: %lld", p_input->stream.p_selected_area->i_tell,p_input->stream.p_selected_area->i_size );
vlc_mutex_unlock( &p_input->stream.stream_lock );
@ -1153,6 +1158,7 @@ static int DVDRead( input_thread_t * p_input,
if( b_eot )
{
intf_WarnMsg( 3, "dvd info: new title" );
p_dvd->i_title++;
DVDSetArea( p_input, p_area );
return 0;

View File

@ -2,7 +2,7 @@
* gnome_callbacks.c : Callbacks for the Gnome plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gnome_callbacks.c,v 1.28 2001/05/10 06:47:31 sam Exp $
* $Id: gnome_callbacks.c,v 1.29 2001/05/15 01:01:44 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
@ -113,47 +113,6 @@ on_intf_window_drag_data_received (GtkWidget *widget,
guint time,
gpointer user_data)
{
#if 0
char *psz_text = data->data;
int i_len = strlen( psz_text );
switch( info )
{
case DROP_ACCEPT_TEXT_PLAIN: /* FIXME: handle multiple files */
if( i_len < 1 )
{
return;
}
/* get rid of ' ' at the end */
*( psz_text + i_len - 1 ) = 0;
intf_WarnMsg( 3, "intf: dropped text/uri-list data `%s'", psz_text );
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, psz_text );
break;
case DROP_ACCEPT_TEXT_URI_LIST: /* FIXME: handle multiple files */
if( i_len < 2 )
{
return;
}
/* get rid of \r\n at the end */
*( psz_text + i_len - 2 ) = 0;
intf_WarnMsg( 3, "intf: dropped text/uri-list data `%s'", psz_text );
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, psz_text );
break;
default:
intf_ErrMsg( "intf error: unknown dropped type");
break;
}
#else
intf_thread_t * p_intf = GetIntf( GTK_WIDGET( widget ), "intf_window" );
int i_end = p_main->p_playlist->i_size;
@ -166,8 +125,7 @@ on_intf_window_drag_data_received (GtkWidget *widget,
}
intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
#endif
p_main->p_playlist->b_stopped = 0;
}
@ -741,10 +699,10 @@ on_toolbar_stop_clicked (GtkButton *button,
if( p_intf->p_input != NULL )
{
p_vout_bank->pp_vout[0]->b_die = 1;
p_aout_bank->pp_aout[0]->b_die = 1;
p_intf->p_input->b_die = 1;
p_intf->p_input->b_eof = 1;
p_main->p_playlist->i_index--;
}
p_main->p_playlist->b_stopped = 1;
}
@ -758,6 +716,20 @@ on_toolbar_play_clicked (GtkButton *button,
{
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
}
else if( p_main->p_playlist->b_stopped )
{
if( p_main->p_playlist->i_size )
{
intf_PlaylistJumpto( p_main->p_playlist,
p_main->p_playlist->i_index );
p_main->p_playlist->b_stopped = 0;
}
else
{
on_toolbar_open_clicked( button, user_data );
}
}
}
@ -879,6 +851,7 @@ on_popup_play_activate (GtkMenuItem *menuitem,
if( p_intf->p_input != NULL )
{
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
p_main->p_playlist->b_stopped = 0;
}
}
@ -1210,6 +1183,7 @@ on_fileopen_ok_clicked (GtkButton *button,
}
intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
p_main->p_playlist->b_stopped = 0;
}
@ -1356,6 +1330,7 @@ on_disc_ok_clicked (GtkButton *button,
}
intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
p_main->p_playlist->b_stopped = 0;
}
@ -1468,6 +1443,7 @@ on_network_ok_clicked (GtkButton *button,
}
intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
p_main->p_playlist->b_stopped = 0;
}
@ -1545,6 +1521,7 @@ on_jump_apply_clicked (GtkButton *button,
{
input_Seek( p_intf->p_input, i_seek );
}
p_main->p_playlist->b_stopped = 0;
#endif
}
@ -1687,4 +1664,3 @@ on_preferences_cancel_clicked (GtkButton *button,
{
gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
}

View File

@ -2,7 +2,7 @@
* gnome_callbacks.h : Callbacks for the Gnome plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gnome_callbacks.h,v 1.16 2001/05/06 18:32:30 stef Exp $
* $Id: gnome_callbacks.h,v 1.17 2001/05/15 01:01:44 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
@ -426,3 +426,7 @@ on_playlist_cancel_clicked (GtkButton *button,
void
on_popup_back_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_playlist_destroy (GtkObject *object,
gpointer user_data);

View File

@ -500,7 +500,6 @@ create_intf_window (void)
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (slider);
gtk_container_add (GTK_CONTAINER (slider_frame), slider);
gtk_widget_set_usize (slider, 500, 15);
gtk_scale_set_draw_value (GTK_SCALE (slider), FALSE);
gtk_scale_set_digits (GTK_SCALE (slider), 3);
@ -510,7 +509,6 @@ create_intf_window (void)
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (file_box);
gtk_box_pack_start (GTK_BOX (vbox8), file_box, TRUE, TRUE, 0);
gtk_widget_set_usize (file_box, 500, 24);
label_status = gtk_label_new ("");
gtk_widget_ref (label_status);
@ -524,7 +522,6 @@ create_intf_window (void)
gtk_object_set_data_full (GTK_OBJECT (intf_window), "dvd_box", dvd_box,
(GtkDestroyNotify) gtk_widget_unref);
gtk_box_pack_start (GTK_BOX (vbox8), dvd_box, TRUE, TRUE, 0);
gtk_widget_set_usize (dvd_box, 500, 24);
label21 = gtk_label_new (_("DVD "));
gtk_widget_ref (label21);
@ -622,7 +619,6 @@ create_intf_window (void)
gtk_object_set_data_full (GTK_OBJECT (intf_window), "network_box", network_box,
(GtkDestroyNotify) gtk_widget_unref);
gtk_box_pack_start (GTK_BOX (vbox8), network_box, FALSE, FALSE, 0);
gtk_widget_set_usize (network_box, 500, 24);
network_address_label = gtk_label_new (_("No server"));
gtk_widget_ref (network_address_label);
@ -810,7 +806,7 @@ static GnomeUIInfo intf_popup_uiinfo[] =
},
GNOMEUIINFO_SEPARATOR,
{
GNOME_APP_UI_ITEM, N_("_Jump"),
GNOME_APP_UI_ITEM, N_("_Jump..."),
N_("Got directly so specified point"),
(gpointer) on_popup_jump_activate, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_JUMP_TO,
@ -988,7 +984,6 @@ create_intf_popup (void)
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_preferences",
intf_popup_uiinfo[17].widget,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_set_sensitive (intf_popup_uiinfo[17].widget, FALSE);
gtk_widget_ref (intf_popup_uiinfo[18].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator2",
@ -1699,6 +1694,7 @@ create_intf_playlist (void)
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (playlist_frame);
gtk_container_add (GTK_CONTAINER (playlist_viewport), playlist_frame);
gtk_container_set_border_width (GTK_CONTAINER (playlist_frame), 4);
gtk_frame_set_label_align (GTK_FRAME (playlist_frame), 0.05, 0.5);
playlist_clist = gtk_clist_new (2);
@ -1817,6 +1813,9 @@ create_intf_playlist (void)
gtk_widget_show (playlist_cancel);
GTK_WIDGET_SET_FLAGS (playlist_cancel, GTK_CAN_DEFAULT);
gtk_signal_connect (GTK_OBJECT (intf_playlist), "destroy",
GTK_SIGNAL_FUNC (on_playlist_destroy),
NULL);
gtk_signal_connect (GTK_OBJECT (playlist_clist), "event",
GTK_SIGNAL_FUNC (on_playlist_clist_event),
NULL);
@ -1870,6 +1869,7 @@ create_intf_jump (void)
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (jump_frame);
gtk_box_pack_start (GTK_BOX (jump_vbox), jump_frame, FALSE, FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (jump_frame), 5);
gtk_frame_set_label_align (GTK_FRAME (jump_frame), 0.05, 0.5);
jump_box = gtk_hbox_new (FALSE, 0);
@ -1878,6 +1878,7 @@ create_intf_jump (void)
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (jump_box);
gtk_container_add (GTK_CONTAINER (jump_frame), jump_box);
gtk_container_set_border_width (GTK_CONTAINER (jump_box), 5);
jump_label3 = gtk_label_new (_("s."));
gtk_widget_ref (jump_label3);
@ -2045,17 +2046,17 @@ create_intf_preferences (void)
GtkWidget *preferences_playlist_enqueue_as_default_checkbutton;
GtkWidget *preferences_playlist;
GtkWidget *preferences_misc_table;
GtkWidget *preferences_misc_associated_files_frame;
GtkWidget *preferences_misc_associated_table;
GtkWidget *preferences_misc_ts_checkbutton;
GtkWidget *preferences_misc_vob_checkbutton;
GtkWidget *preferences_misc_mp2_checkbutton;
GtkWidget *preferences_misc_mpeg_checkbutton;
GtkWidget *preferences_misc_message_frame;
GtkWidget *preferences_misc_message_table;
GtkWidget *preferences_misc_messages_label;
GtkObject *preferences_misc_messages_spinbutton_adj;
GtkWidget *preferences_misc_messages_spinbutton;
GtkWidget *preferences_misc_associated_files_frame;
GtkWidget *preferences_misc_associated_table;
GtkWidget *preferences_misc_mpeg_checkbutton;
GtkWidget *preferences_misc_mp2_checkbutton;
GtkWidget *preferences_misc_vob_checkbutton;
GtkWidget *preferences_misc_ts_checkbutton;
GtkWidget *preferences_misc;
GtkWidget *preferences_dialog;
GtkWidget *preferences_ok;
@ -2070,6 +2071,7 @@ create_intf_preferences (void)
preferences_vbox = GNOME_DIALOG (intf_preferences)->vbox;
gtk_object_set_data (GTK_OBJECT (intf_preferences), "preferences_vbox", preferences_vbox);
gtk_widget_show (preferences_vbox);
gtk_container_set_border_width (GTK_CONTAINER (preferences_vbox), 5);
preferences_frame = gtk_frame_new (_("Preferences"));
gtk_widget_ref (preferences_frame);
@ -2092,6 +2094,9 @@ create_intf_preferences (void)
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (preferences_file_table);
gtk_container_add (GTK_CONTAINER (preferences_notebook), preferences_file_table);
gtk_container_set_border_width (GTK_CONTAINER (preferences_file_table), 5);
gtk_table_set_row_spacings (GTK_TABLE (preferences_file_table), 5);
gtk_table_set_col_spacings (GTK_TABLE (preferences_file_table), 5);
preferences_file_combo = gnome_file_entry_new (NULL, NULL);
gtk_widget_ref (preferences_file_combo);
@ -2131,6 +2136,9 @@ create_intf_preferences (void)
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (preferences_disc_table);
gtk_container_add (GTK_CONTAINER (preferences_notebook), preferences_disc_table);
gtk_container_set_border_width (GTK_CONTAINER (preferences_disc_table), 5);
gtk_table_set_row_spacings (GTK_TABLE (preferences_disc_table), 5);
gtk_table_set_col_spacings (GTK_TABLE (preferences_disc_table), 5);
preferences_disc_dvd_combo = gnome_file_entry_new (NULL, NULL);
gtk_widget_ref (preferences_disc_dvd_combo);
@ -2195,6 +2203,9 @@ create_intf_preferences (void)
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (preferences_network_table);
gtk_container_add (GTK_CONTAINER (preferences_notebook), preferences_network_table);
gtk_container_set_border_width (GTK_CONTAINER (preferences_network_table), 5);
gtk_table_set_row_spacings (GTK_TABLE (preferences_network_table), 5);
gtk_table_set_col_spacings (GTK_TABLE (preferences_network_table), 5);
preferences_network_server_label = gtk_label_new (_("Default server: "));
gtk_widget_ref (preferences_network_server_label);
@ -2329,6 +2340,9 @@ create_intf_preferences (void)
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (preferences_network_interface_table);
gtk_container_add (GTK_CONTAINER (preferences_notebook), preferences_network_interface_table);
gtk_container_set_border_width (GTK_CONTAINER (preferences_network_interface_table), 5);
gtk_table_set_row_spacings (GTK_TABLE (preferences_network_interface_table), 5);
gtk_table_set_col_spacings (GTK_TABLE (preferences_network_interface_table), 5);
preferences_interface_label = gtk_label_new (_("Default interface: "));
gtk_widget_ref (preferences_interface_label);
@ -2368,6 +2382,9 @@ create_intf_preferences (void)
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (preferences_video_table);
gtk_container_add (GTK_CONTAINER (preferences_notebook), preferences_video_table);
gtk_container_set_border_width (GTK_CONTAINER (preferences_video_table), 5);
gtk_table_set_row_spacings (GTK_TABLE (preferences_video_table), 5);
gtk_table_set_col_spacings (GTK_TABLE (preferences_video_table), 5);
preferences_video_output_label = gtk_label_new (_("Default output: "));
gtk_widget_ref (preferences_video_output_label);
@ -2547,6 +2564,9 @@ create_intf_preferences (void)
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (preference_audio_table);
gtk_container_add (GTK_CONTAINER (preferences_notebook), preference_audio_table);
gtk_container_set_border_width (GTK_CONTAINER (preference_audio_table), 5);
gtk_table_set_row_spacings (GTK_TABLE (preference_audio_table), 5);
gtk_table_set_col_spacings (GTK_TABLE (preference_audio_table), 5);
preferences_audio_spdif_checkbutton = gtk_check_button_new_with_label (_("Spdif output"));
gtk_widget_ref (preferences_audio_spdif_checkbutton);
@ -2708,6 +2728,9 @@ create_intf_preferences (void)
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (preference_playlist_table);
gtk_container_add (GTK_CONTAINER (preferences_notebook), preference_playlist_table);
gtk_container_set_border_width (GTK_CONTAINER (preference_playlist_table), 5);
gtk_table_set_row_spacings (GTK_TABLE (preference_playlist_table), 5);
gtk_table_set_col_spacings (GTK_TABLE (preference_playlist_table), 5);
preferences_playlist_launch_on_startup_checkbutton = gtk_check_button_new_with_label (_("Launch on startup"));
gtk_widget_ref (preferences_playlist_launch_on_startup_checkbutton);
@ -2749,6 +2772,63 @@ create_intf_preferences (void)
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (preferences_misc_table);
gtk_container_add (GTK_CONTAINER (preferences_notebook), preferences_misc_table);
gtk_container_set_border_width (GTK_CONTAINER (preferences_misc_table), 5);
gtk_table_set_row_spacings (GTK_TABLE (preferences_misc_table), 5);
gtk_table_set_col_spacings (GTK_TABLE (preferences_misc_table), 5);
preferences_misc_associated_files_frame = gtk_frame_new (_("Files associated with vlc"));
gtk_widget_ref (preferences_misc_associated_files_frame);
gtk_object_set_data_full (GTK_OBJECT (intf_preferences), "preferences_misc_associated_files_frame", preferences_misc_associated_files_frame,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (preferences_misc_associated_files_frame);
gtk_table_attach (GTK_TABLE (preferences_misc_table), preferences_misc_associated_files_frame, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_EXPAND),
(GtkAttachOptions) (GTK_FILL), 0, 0);
gtk_widget_set_sensitive (preferences_misc_associated_files_frame, FALSE);
gtk_frame_set_label_align (GTK_FRAME (preferences_misc_associated_files_frame), 0.05, 0.5);
preferences_misc_associated_table = gtk_table_new (4, 1, FALSE);
gtk_widget_ref (preferences_misc_associated_table);
gtk_object_set_data_full (GTK_OBJECT (intf_preferences), "preferences_misc_associated_table", preferences_misc_associated_table,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (preferences_misc_associated_table);
gtk_container_add (GTK_CONTAINER (preferences_misc_associated_files_frame), preferences_misc_associated_table);
preferences_misc_ts_checkbutton = gtk_check_button_new_with_label (_("ts"));
gtk_widget_ref (preferences_misc_ts_checkbutton);
gtk_object_set_data_full (GTK_OBJECT (intf_preferences), "preferences_misc_ts_checkbutton", preferences_misc_ts_checkbutton,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (preferences_misc_ts_checkbutton);
gtk_table_attach (GTK_TABLE (preferences_misc_associated_table), preferences_misc_ts_checkbutton, 0, 1, 3, 4,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
preferences_misc_vob_checkbutton = gtk_check_button_new_with_label (_("vob"));
gtk_widget_ref (preferences_misc_vob_checkbutton);
gtk_object_set_data_full (GTK_OBJECT (intf_preferences), "preferences_misc_vob_checkbutton", preferences_misc_vob_checkbutton,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (preferences_misc_vob_checkbutton);
gtk_table_attach (GTK_TABLE (preferences_misc_associated_table), preferences_misc_vob_checkbutton, 0, 1, 2, 3,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
preferences_misc_mp2_checkbutton = gtk_check_button_new_with_label (_("mp2"));
gtk_widget_ref (preferences_misc_mp2_checkbutton);
gtk_object_set_data_full (GTK_OBJECT (intf_preferences), "preferences_misc_mp2_checkbutton", preferences_misc_mp2_checkbutton,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (preferences_misc_mp2_checkbutton);
gtk_table_attach (GTK_TABLE (preferences_misc_associated_table), preferences_misc_mp2_checkbutton, 0, 1, 1, 2,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
preferences_misc_mpeg_checkbutton = gtk_check_button_new_with_label (_("mpeg"));
gtk_widget_ref (preferences_misc_mpeg_checkbutton);
gtk_object_set_data_full (GTK_OBJECT (intf_preferences), "preferences_misc_mpeg_checkbutton", preferences_misc_mpeg_checkbutton,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (preferences_misc_mpeg_checkbutton);
gtk_table_attach (GTK_TABLE (preferences_misc_associated_table), preferences_misc_mpeg_checkbutton, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
preferences_misc_message_frame = gtk_frame_new (_("Messages"));
gtk_widget_ref (preferences_misc_message_frame);
@ -2757,7 +2837,7 @@ create_intf_preferences (void)
gtk_widget_show (preferences_misc_message_frame);
gtk_table_attach (GTK_TABLE (preferences_misc_table), preferences_misc_message_frame, 1, 2, 0, 1,
(GtkAttachOptions) (GTK_EXPAND),
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
(GtkAttachOptions) (GTK_FILL), 0, 0);
gtk_frame_set_label_align (GTK_FRAME (preferences_misc_message_frame), 0.05, 0.5);
preferences_misc_message_table = gtk_table_new (1, 2, FALSE);
@ -2786,60 +2866,6 @@ create_intf_preferences (void)
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
preferences_misc_associated_files_frame = gtk_frame_new (_("Files associated with vlc"));
gtk_widget_ref (preferences_misc_associated_files_frame);
gtk_object_set_data_full (GTK_OBJECT (intf_preferences), "preferences_misc_associated_files_frame", preferences_misc_associated_files_frame,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (preferences_misc_associated_files_frame);
gtk_table_attach (GTK_TABLE (preferences_misc_table), preferences_misc_associated_files_frame, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_EXPAND),
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
gtk_widget_set_sensitive (preferences_misc_associated_files_frame, FALSE);
gtk_frame_set_label_align (GTK_FRAME (preferences_misc_associated_files_frame), 0.05, 0.5);
preferences_misc_associated_table = gtk_table_new (4, 1, FALSE);
gtk_widget_ref (preferences_misc_associated_table);
gtk_object_set_data_full (GTK_OBJECT (intf_preferences), "preferences_misc_associated_table", preferences_misc_associated_table,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (preferences_misc_associated_table);
gtk_container_add (GTK_CONTAINER (preferences_misc_associated_files_frame), preferences_misc_associated_table);
preferences_misc_mpeg_checkbutton = gtk_check_button_new_with_label (_("mpeg"));
gtk_widget_ref (preferences_misc_mpeg_checkbutton);
gtk_object_set_data_full (GTK_OBJECT (intf_preferences), "preferences_misc_mpeg_checkbutton", preferences_misc_mpeg_checkbutton,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (preferences_misc_mpeg_checkbutton);
gtk_table_attach (GTK_TABLE (preferences_misc_associated_table), preferences_misc_mpeg_checkbutton, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
preferences_misc_mp2_checkbutton = gtk_check_button_new_with_label (_("mp2"));
gtk_widget_ref (preferences_misc_mp2_checkbutton);
gtk_object_set_data_full (GTK_OBJECT (intf_preferences), "preferences_misc_mp2_checkbutton", preferences_misc_mp2_checkbutton,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (preferences_misc_mp2_checkbutton);
gtk_table_attach (GTK_TABLE (preferences_misc_associated_table), preferences_misc_mp2_checkbutton, 0, 1, 1, 2,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
preferences_misc_vob_checkbutton = gtk_check_button_new_with_label (_("vob"));
gtk_widget_ref (preferences_misc_vob_checkbutton);
gtk_object_set_data_full (GTK_OBJECT (intf_preferences), "preferences_misc_vob_checkbutton", preferences_misc_vob_checkbutton,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (preferences_misc_vob_checkbutton);
gtk_table_attach (GTK_TABLE (preferences_misc_associated_table), preferences_misc_vob_checkbutton, 0, 1, 2, 3,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
preferences_misc_ts_checkbutton = gtk_check_button_new_with_label (_("ts"));
gtk_widget_ref (preferences_misc_ts_checkbutton);
gtk_object_set_data_full (GTK_OBJECT (intf_preferences), "preferences_misc_ts_checkbutton", preferences_misc_ts_checkbutton,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (preferences_misc_ts_checkbutton);
gtk_table_attach (GTK_TABLE (preferences_misc_associated_table), preferences_misc_ts_checkbutton, 0, 1, 3, 4,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
preferences_misc = gtk_label_new (_("Misc"));
gtk_widget_ref (preferences_misc);
gtk_object_set_data_full (GTK_OBJECT (intf_preferences), "preferences_misc", preferences_misc,

View File

@ -2,7 +2,7 @@
* gnome_playlist.c : Interface for the playlist dialog
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: gnome_playlist.c,v 1.2 2001/05/07 03:14:09 stef Exp $
* $Id: gnome_playlist.c,v 1.3 2001/05/15 01:01:44 stef Exp $
*
* Authors: Pierre Baillet <oct@zoy.org>
*
@ -68,7 +68,7 @@
* The following callbacks are related to the playlist.
*****************************************************************************/
void
on_intf_playlist_destroy (GtkObject *object,
on_playlist_destroy (GtkObject *object,
gpointer user_data)
{
gtk_widget_hide( GTK_WIDGET(object));
@ -314,6 +314,7 @@ on_playlist_clist_event (GtkWidget *widget,
p_intf->p_input->b_eof = 1;
}
intf_PlaylistJumpto( p_main->p_playlist, i_row - 1 );
p_main->p_playlist->b_stopped = 0;
}
return TRUE;
}
@ -337,6 +338,7 @@ on_playlist_clist_drag_data_received (GtkWidget *widget,
GtkCList * p_clist;
gint i_row;
gint i_col;
int i_end = p_main->p_playlist->i_size;
p_clist = GTK_CLIST( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_playlist ), "playlist_clist" ) );
@ -351,6 +353,10 @@ on_playlist_clist_drag_data_received (GtkWidget *widget,
/* else, put that at the end of the playlist */
GnomeDropDataReceived( p_intf, data, info, PLAYLIST_END );
}
intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
p_main->p_playlist->b_stopped = 0;
}
@ -506,6 +512,8 @@ void GnomeDropDataReceived( intf_thread_t * p_intf,
/* unlock the interface */
vlc_mutex_unlock( &p_intf->change_lock );
p_main->p_playlist->b_stopped = 0;
}
}

View File

@ -2,7 +2,7 @@
* intf_gnome.c: Gnome interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_gnome.c,v 1.38 2001/05/10 06:47:31 sam Exp $
* $Id: intf_gnome.c,v 1.39 2001/05/15 01:01:44 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
@ -439,7 +439,7 @@ static gint GnomeRadioMenu( intf_thread_t * p_intf,
}
snprintf( psz_name, GNOME_MENU_LABEL_SIZE,
"Chapters %d to %d", i_item + 1, i_item + 10);
"%ss %d to %d", psz_item_name, i_item + 1, i_item + 10);
psz_name[ GNOME_MENU_LABEL_SIZE - 1 ] = '\0';
p_item_group = gtk_menu_item_new_with_label( psz_name );
gtk_widget_show( p_item_group );
@ -1121,14 +1121,14 @@ static gint GnomeModeManage( intf_thread_t * p_intf )
/* control buttons for free pace streams */
b_control = p_intf->p_input->stream.b_pace_control;
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_back"), FALSE );
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_stop"), FALSE );
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_play"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_stop"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_play"), TRUE );
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"), FALSE );
gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_play"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_play"), TRUE );
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 );

View File

@ -73,8 +73,6 @@
<class>GtkMenuBar</class>
<name>menubar</name>
<border_width>2</border_width>
<width>500</width>
<height>32</height>
<shadow_type>GTK_SHADOW_NONE</shadow_type>
<widget>
@ -546,8 +544,6 @@
<widget>
<class>GtkHScale</class>
<name>slider</name>
<width>500</width>
<height>15</height>
<can_focus>True</can_focus>
<signal>
<name>button_press_event</name>
@ -576,8 +572,6 @@
<widget>
<class>GtkHBox</class>
<name>file_box</name>
<width>500</width>
<height>24</height>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
@ -607,8 +601,6 @@
<widget>
<class>GtkHBox</class>
<name>dvd_box</name>
<width>500</width>
<height>24</height>
<visible>False</visible>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
@ -816,8 +808,6 @@
<widget>
<class>GtkHBox</class>
<name>network_box</name>
<width>500</width>
<height>24</height>
<visible>False</visible>
<homogeneous>True</homogeneous>
<spacing>0</spacing>
@ -1034,7 +1024,7 @@
<handler>on_popup_jump_activate</handler>
<last_modification_time>Tue, 01 May 2001 22:22:49 GMT</last_modification_time>
</signal>
<label>_Jump</label>
<label>_Jump...</label>
<right_justify>False</right_justify>
<stock_icon>GNOME_STOCK_MENU_JUMP_TO</stock_icon>
</widget>
@ -1168,7 +1158,6 @@
<widget>
<class>GtkPixmapMenuItem</class>
<name>popup_preferences</name>
<sensitive>False</sensitive>
<signal>
<name>activate</name>
<handler>on_popup_preferences_activate</handler>
@ -2058,6 +2047,11 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;
<widget>
<class>GnomeDialog</class>
<name>intf_playlist</name>
<signal>
<name>destroy</name>
<handler>on_playlist_destroy</handler>
<last_modification_time>Tue, 08 May 2001 23:21:39 GMT</last_modification_time>
</signal>
<title>Playlist</title>
<type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_NONE</position>
@ -2147,6 +2141,7 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;
<widget>
<class>GtkFrame</class>
<name>playlist_frame</name>
<border_width>4</border_width>
<label>Playlist</label>
<label_xalign>0.05</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
@ -2382,7 +2377,7 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;
<homogeneous>False</homogeneous>
<spacing>8</spacing>
<child>
<padding>4</padding>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
@ -2434,6 +2429,7 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;
<widget>
<class>GtkFrame</class>
<name>jump_frame</name>
<border_width>5</border_width>
<label>Jump to: </label>
<label_xalign>0.05</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
@ -2446,6 +2442,7 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;
<widget>
<class>GtkHBox</class>
<name>jump_box</name>
<border_width>5</border_width>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
@ -2598,10 +2595,11 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;
<class>GtkVBox</class>
<child_name>GnomeDialog:vbox</child_name>
<name>preferences_vbox</name>
<border_width>5</border_width>
<homogeneous>False</homogeneous>
<spacing>8</spacing>
<spacing>10</spacing>
<child>
<padding>4</padding>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
@ -2690,11 +2688,12 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;
<widget>
<class>GtkTable</class>
<name>preferences_file_table</name>
<border_width>5</border_width>
<rows>1</rows>
<columns>2</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>0</column_spacing>
<row_spacing>5</row_spacing>
<column_spacing>5</column_spacing>
<widget>
<class>GnomeFileEntry</class>
@ -2772,11 +2771,12 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;
<widget>
<class>GtkTable</class>
<name>preferences_disc_table</name>
<border_width>5</border_width>
<rows>2</rows>
<columns>2</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>0</column_spacing>
<row_spacing>5</row_spacing>
<column_spacing>5</column_spacing>
<widget>
<class>GnomeFileEntry</class>
@ -2913,11 +2913,12 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;
<widget>
<class>GtkTable</class>
<name>preferences_network_table</name>
<border_width>5</border_width>
<rows>7</rows>
<columns>2</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>0</column_spacing>
<row_spacing>5</row_spacing>
<column_spacing>5</column_spacing>
<widget>
<class>GtkLabel</class>
@ -3229,11 +3230,12 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;
<widget>
<class>GtkTable</class>
<name>preferences_network_interface_table</name>
<border_width>5</border_width>
<rows>1</rows>
<columns>2</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>0</column_spacing>
<row_spacing>5</row_spacing>
<column_spacing>5</column_spacing>
<widget>
<class>GtkLabel</class>
@ -3309,11 +3311,12 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;
<widget>
<class>GtkTable</class>
<name>preferences_video_table</name>
<border_width>5</border_width>
<rows>7</rows>
<columns>2</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>0</column_spacing>
<row_spacing>5</row_spacing>
<column_spacing>5</column_spacing>
<widget>
<class>GtkLabel</class>
@ -3711,11 +3714,12 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;
<widget>
<class>GtkTable</class>
<name>preference_audio_table</name>
<border_width>5</border_width>
<rows>6</rows>
<columns>2</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>0</column_spacing>
<row_spacing>5</row_spacing>
<column_spacing>5</column_spacing>
<widget>
<class>GtkCheckButton</class>
@ -4023,11 +4027,12 @@ Stereo
<widget>
<class>GtkTable</class>
<name>preference_playlist_table</name>
<border_width>5</border_width>
<rows>3</rows>
<columns>1</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>0</column_spacing>
<row_spacing>5</row_spacing>
<column_spacing>5</column_spacing>
<widget>
<class>GtkCheckButton</class>
@ -4115,11 +4120,137 @@ Stereo
<widget>
<class>GtkTable</class>
<name>preferences_misc_table</name>
<border_width>5</border_width>
<rows>1</rows>
<columns>2</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>0</column_spacing>
<row_spacing>5</row_spacing>
<column_spacing>5</column_spacing>
<widget>
<class>GtkFrame</class>
<name>preferences_misc_associated_files_frame</name>
<sensitive>False</sensitive>
<label>Files associated with vlc</label>
<label_xalign>0.05</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>False</xfill>
<yfill>True</yfill>
</child>
<widget>
<class>GtkTable</class>
<name>preferences_misc_associated_table</name>
<rows>4</rows>
<columns>1</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>0</column_spacing>
<widget>
<class>GtkCheckButton</class>
<name>preferences_misc_ts_checkbutton</name>
<can_focus>True</can_focus>
<label>ts</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkCheckButton</class>
<name>preferences_misc_vob_checkbutton</name>
<can_focus>True</can_focus>
<label>vob</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkCheckButton</class>
<name>preferences_misc_mp2_checkbutton</name>
<can_focus>True</can_focus>
<label>mp2</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkCheckButton</class>
<name>preferences_misc_mpeg_checkbutton</name>
<can_focus>True</can_focus>
<label>mpeg</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
</widget>
</widget>
<widget>
<class>GtkFrame</class>
@ -4135,7 +4266,7 @@ Stereo
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>True</yexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>False</xfill>
@ -4210,131 +4341,6 @@ Stereo
</widget>
</widget>
</widget>
<widget>
<class>GtkFrame</class>
<name>preferences_misc_associated_files_frame</name>
<sensitive>False</sensitive>
<label>Files associated with vlc</label>
<label_xalign>0.05</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>True</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>False</xfill>
<yfill>True</yfill>
</child>
<widget>
<class>GtkTable</class>
<name>preferences_misc_associated_table</name>
<rows>4</rows>
<columns>1</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>0</column_spacing>
<widget>
<class>GtkCheckButton</class>
<name>preferences_misc_mpeg_checkbutton</name>
<can_focus>True</can_focus>
<label>mpeg</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkCheckButton</class>
<name>preferences_misc_mp2_checkbutton</name>
<can_focus>True</can_focus>
<label>mp2</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkCheckButton</class>
<name>preferences_misc_vob_checkbutton</name>
<can_focus>True</can_focus>
<label>vob</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkCheckButton</class>
<name>preferences_misc_ts_checkbutton</name>
<can_focus>True</can_focus>
<label>ts</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
</widget>
</widget>
</widget>
<widget>

View File

@ -7,7 +7,7 @@
# Objects
#
PLUGIN_C = gtk.o intf_gtk.o gtk_callbacks.o gtk_interface.o gtk_support.o gtk_playlist.o
PLUGIN_C = gtk.o intf_gtk.o gtk_callbacks.o gtk_interface.o gtk_support.o gtk_open.o gtk_control.o gtk_menu.o gtk_playlist.o gtk_modules.o gtk_preferences.o
BUILTIN_C = $(PLUGIN_C:%.o=BUILTIN_%.o)
ALL_OBJ = $(PLUGIN_C) $(BUILTIN_C)

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,64 @@
#include <gtk/gtk.h>
#include "gtk_control.h"
#include "gtk_menu.h"
#include "gtk_open.h"
#include "gtk_modules.h"
#include "gtk_playlist.h"
#include "gtk_preferences.h"
/* General glade callbacks */
gboolean
GtkExit (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
gboolean
GtkWindowToggle (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
gboolean
GtkSliderRelease (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
gboolean
GtkSliderPress (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
void
on_intf_window_drag_data_received (GtkWidget *widget,
GtkTitlePrev (GtkButton *button,
gpointer user_data);
void
GtkTitleNext (GtkButton *button,
gpointer user_data);
void
GtkChapterPrev (GtkButton *button,
gpointer user_data);
void
GtkChapterNext (GtkButton *button,
gpointer user_data);
gboolean
GtkFullscreen (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
gboolean
GtkAboutShow (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
void GtkAboutOk( GtkButton * button, gpointer user_data);
void
GtkWindowDrag (GtkWidget *widget,
GdkDragContext *drag_context,
gint x,
gint y,
@ -12,104 +67,66 @@ on_intf_window_drag_data_received (GtkWidget *widget,
guint time,
gpointer user_data);
void
on_toolbar_open_clicked (GtkButton *button,
gboolean
GtkWindowDelete (GtkWidget *widget,
GdkEvent *event,
gpointer user_data);
gboolean
GtkJumpShow (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
void
on_toolbar_back_clicked (GtkButton *button,
GtkJumpOk (GtkButton *button,
gpointer user_data);
void
GtkJumpCancel (GtkButton *button,
gpointer user_data);
void
on_toolbar_stop_clicked (GtkButton *button,
gboolean
GtkDiscOpenShow (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
void
on_toolbar_play_clicked (GtkButton *button,
gboolean
GtkFileOpenShow (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
void
on_toolbar_pause_clicked (GtkButton *button,
gboolean
GtkNetworkOpenShow (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
void
on_toolbar_slow_clicked (GtkButton *button,
gpointer user_data);
void
on_toolbar_fast_clicked (GtkButton *button,
gpointer user_data);
void
on_toolbar_playlist_clicked (GtkButton *button,
gpointer user_data);
void
on_toolbar_prev_clicked (GtkButton *button,
gpointer user_data);
void
on_toolbar_next_clicked (GtkButton *button,
gpointer user_data);
void
on_toolbar_network_clicked (GtkButton *button,
gpointer user_data);
void
on_intf_fileopen_destroy (GtkObject *object,
gpointer user_data);
void
on_fileopen_ok_clicked (GtkButton *button,
gpointer user_data);
void
on_fileopen_cancel_clicked (GtkButton *button,
gpointer user_data);
void
on_intf_modules_destroy (GtkObject *object,
gpointer user_data);
void
on_modules_ok_clicked (GtkButton *button,
gpointer user_data);
void
on_modules_apply_clicked (GtkButton *button,
gpointer user_data);
void
on_modules_cancel_clicked (GtkButton *button,
gpointer user_data);
void
on_intf_playlist_destroy (GtkObject *object,
gpointer user_data);
void
on_playlist_ok_clicked (GtkButton *button,
gpointer user_data);
void
on_popup_fast_activate (GtkMenuItem *menuitem,
on_menubar_open_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_menubar_open_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_menubar_disc_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_menubar_network_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_menubar_exit_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_popup_play_activate (GtkMenuItem *menuitem,
on_menubar_interface_hide_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_popup_exit_activate (GtkMenuItem *menuitem,
on_menubar_fullscreen_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
@ -128,191 +145,157 @@ void
on_menubar_about_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_popup_play_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_popup_pause_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_popup_stop_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_popup_back_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_popup_slow_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_popup_open_activate (GtkMenuItem *menuitem,
on_popup_fast_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_popup_about_activate (GtkMenuItem *menuitem,
on_popup_interface_toggle_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_about_ok_clicked (GtkButton *button,
gpointer user_data);
void
on_disc_dvd_toggled (GtkToggleButton *togglebutton,
on_popup_fullscreen_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_disc_vcd_toggled (GtkToggleButton *togglebutton,
on_popup_next_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_disc_ok_clicked (GtkButton *button,
on_popup_prev_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_disc_cancel_clicked (GtkButton *button,
on_popup_jump_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_menubar_disc_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_toolbar_disc_clicked (GtkButton *button,
on_popup_file_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_popup_disc_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_popup_audio_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_popup_subpictures_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_menubar_audio_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_menubar_subpictures_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_popup_navigation_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_menubar_title_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_menubar_chapter_activate (GtkMenuItem *menuitem,
gpointer user_data);
gboolean
on_playlist_clist_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data);
gboolean
on_intf_window_delete (GtkWidget *widget,
GdkEvent *event,
gpointer user_data);
gboolean
on_intf_playlist_destroy_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data);
gboolean
on_intf_playlist_destroy_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data);
void
on_intf_playlist_drag_data_received (GtkWidget *widget,
GdkDragContext *drag_context,
gint x,
gint y,
GtkSelectionData *data,
guint info,
guint time,
gpointer user_data);
gboolean
on_playlist_clist_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data);
gboolean
on_intf_playlist_destroy_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data);
gboolean
on_intf_window_destroy (GtkWidget *widget,
GdkEvent *event,
gpointer user_data);
gboolean
on_intf_window_destroy (GtkWidget *widget,
GdkEvent *event,
gpointer user_data);
void
on_main_window_toggle (GtkMenuItem *menuitem,
gpointer user_data);
void
on_delete_clicked (GtkMenuItem *menuitem,
gpointer user_data);
void
on_crop_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_invertselection_clicked (GtkMenuItem *menuitem,
gpointer user_data);
gboolean
on_playlist_clist_drag_motion (GtkWidget *widget,
GdkDragContext *drag_context,
gint x,
gint y,
guint time,
gpointer user_data);
void
on_intf_network_destroy (GtkObject *object,
gpointer user_data);
void
on_network_ok_clicked (GtkButton *button,
gpointer user_data);
void
on_network_cancel_clicked (GtkButton *button,
gpointer user_data);
void
on_menubar_network_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_popup_network_activate (GtkMenuItem *menuitem,
gpointer user_data);
gboolean
on_slider_button_release_event (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
gboolean
on_slider_button_press_event (GtkWidget *widget,
GdkEventButton *event,
void
on_popup_about_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_menubar_fullscreen_activate (GtkMenuItem *menuitem,
on_popup_playlist_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_menubar_angle_activate (GtkMenuItem *menuitem,
on_popup_preferences_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_popup_exit_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
GtkPreferencesOk (GtkButton *button,
gpointer user_data);
void
GtkPreferencesApply (GtkButton *button,
gpointer user_data);
void
GtkPreferencesCancel (GtkButton *button,
gpointer user_data);
void
GtkFileOpenActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GtkDiscOpenActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GtkNetworkOpenActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GtkExitActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GtkWindowToggleActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GtkFullscreenActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GtkPlaylistActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GtkModulesActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GtkPreferencesActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GtkAboutActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GtkNextActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GtkPrevActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GtkJumpActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GtkDiscOpenActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GtkFileOpenActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GtkNetworkOpenActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GtkPlaylistAddUrl (GtkMenuItem *menuitem,
gpointer user_data);

236
plugins/gtk/gtk_control.c Normal file
View File

@ -0,0 +1,236 @@
/*****************************************************************************
* gtk_control.c : functions to handle stream control buttons.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_control.c,v 1.1 2001/05/15 01:01:44 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME gtk
#include "modules_inner.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
#include "defs.h"
#include <sys/types.h> /* off_t */
#include <stdlib.h>
#include <gtk/gtk.h>
#include <string.h>
#include "config.h"
#include "common.h"
#include "threads.h"
#include "mtime.h"
#include "stream_control.h"
#include "input_ext-intf.h"
#include "interface.h"
#include "intf_playlist.h"
#include "intf_msg.h"
#include "gtk_callbacks.h"
#include "gtk_interface.h"
#include "gtk_support.h"
#include "gtk_playlist.h"
#include "intf_gtk.h"
#include "main.h"
/****************************************************************************
* Control functions: this is where the functions are defined
****************************************************************************
* These functions are button-items callbacks, and are used
* by other callbacks
****************************************************************************/
gboolean GtkControlBack( GtkWidget *widget,
GdkEventButton *event,
gpointer user_data )
{
return FALSE;
}
gboolean GtkControlStop( GtkWidget *widget,
GdkEventButton *event,
gpointer user_data )
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
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 );
}
return TRUE;
}
gboolean GtkControlPlay( GtkWidget *widget,
GdkEventButton *event,
gpointer user_data )
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
if( p_intf->p_input != NULL )
{
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
p_main->p_playlist->b_stopped = 0;
}
else
{
// vlc_mutex_lock( &p_main->p_playlist->change_lock );
if( p_main->p_playlist->b_stopped )
{
if( p_main->p_playlist->i_size )
{
intf_PlaylistJumpto( p_main->p_playlist,
p_main->p_playlist->i_index );
p_main->p_playlist->b_stopped = 0;
}
else
{
GtkFileOpenShow( widget, event, user_data );
}
}
// vlc_mutex_unlock( &p_main->p_playlist->change_lock );
}
return TRUE;
}
gboolean GtkControlPause( GtkWidget *widget,
GdkEventButton *event,
gpointer user_data )
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
if( p_intf->p_input != NULL )
{
input_SetStatus( p_intf->p_input, INPUT_STATUS_PAUSE );
p_main->p_playlist->b_stopped = 0;
}
return TRUE;
}
gboolean GtkControlSlow( GtkWidget *widget,
GdkEventButton *event,
gpointer user_data )
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
if( p_intf->p_input != NULL )
{
input_SetStatus( p_intf->p_input, INPUT_STATUS_SLOWER );
p_main->p_playlist->b_stopped = 0;
}
return TRUE;
}
gboolean GtkControlFast( GtkWidget *widget,
GdkEventButton *event,
gpointer user_data )
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
if( p_intf->p_input != NULL )
{
input_SetStatus( p_intf->p_input, INPUT_STATUS_FASTER );
p_main->p_playlist->b_stopped = 0;
}
return TRUE;
}
/****************************************************************************
* Control callbacks for menuitems
****************************************************************************
* We have different callaback for menuitem since we must use the
* activate signal toi popdown the menu automatically
****************************************************************************/
void GtkPlayActivate( GtkMenuItem * menuitem, gpointer user_data )
{
GtkControlPlay( GTK_WIDGET( menuitem ), NULL, user_data );
}
void GtkPauseActivate( GtkMenuItem * menuitem, gpointer user_data )
{
GtkControlPause( GTK_WIDGET( menuitem ), NULL, user_data );
}
void
GtKStopActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkControlStop( GTK_WIDGET( menuitem ), NULL, user_data );
}
void
GtkBackActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkControlBack( GTK_WIDGET( menuitem ), NULL, user_data );
}
void
GtkSlowActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkControlSlow( GTK_WIDGET( menuitem ), NULL, user_data );
}
void
GtkFastActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkControlFast( GTK_WIDGET( menuitem ), NULL, user_data );
}

37
plugins/gtk/gtk_control.h Normal file
View File

@ -0,0 +1,37 @@
/*****************************************************************************
* gtk_control.h: prototypes for control functions
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: gtk_control.h,v 1.1 2001/05/15 01:01:44 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
gboolean GtkControlBack ( GtkWidget *, GdkEventButton *, gpointer );
gboolean GtkControlStop ( GtkWidget *, GdkEventButton *, gpointer );
gboolean GtkControlPlay ( GtkWidget *, GdkEventButton *, gpointer );
gboolean GtkControlPause( GtkWidget *, GdkEventButton *, gpointer );
gboolean GtkControlSlow ( GtkWidget *, GdkEventButton *, gpointer );
gboolean GtkControlFast ( GtkWidget *, GdkEventButton *, gpointer );
void GtkPlayActivate ( GtkMenuItem *, gpointer );
void GtkPauseActivate ( GtkMenuItem *, gpointer );
void GtKStopActivate ( GtkMenuItem *, gpointer );
void GtkBackActivate ( GtkMenuItem *, gpointer );
void GtkSlowActivate ( GtkMenuItem *, gpointer );
void GtkFastActivate ( GtkMenuItem *, gpointer );

File diff suppressed because it is too large Load Diff

View File

@ -7,5 +7,7 @@ GtkWidget* create_intf_popup (void);
GtkWidget* create_intf_about (void);
GtkWidget* create_intf_fileopen (void);
GtkWidget* create_intf_disc (void);
GtkWidget* create_intf_playlist (void);
GtkWidget* create_intf_network (void);
GtkWidget* create_intf_jump (void);
GtkWidget* create_intf_playlist (void);
GtkWidget* create_intf_preferences (void);

886
plugins/gtk/gtk_menu.c Normal file
View File

@ -0,0 +1,886 @@
/*****************************************************************************
* gtk_menu.c : functions to handle menu items.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_menu.c,v 1.1 2001/05/15 01:01:44 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME gtk
#include "modules_inner.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
#include "defs.h"
#include <sys/types.h> /* off_t */
#include <stdlib.h>
#include <gtk/gtk.h>
#include <string.h>
#include "config.h"
#include "common.h"
#include "threads.h"
#include "mtime.h"
#include "stream_control.h"
#include "input_ext-intf.h"
#include "interface.h"
#include "intf_playlist.h"
#include "intf_msg.h"
#include "video.h"
#include "video_output.h"
#include "audio_output.h"
#include "gtk_callbacks.h"
#include "gtk_interface.h"
#include "gtk_support.h"
#include "gtk_playlist.h"
#include "intf_gtk.h"
#include "main.h"
/****************************************************************************
* Gtk*Toggle: callbacks to toggle the value of a checkmenuitem
****************************************************************************
* We need separate functions for menubar and popup here since we can't use
* user_data to transmit intf_*
****************************************************************************/
#define GtkLangToggle( b_update ) \
es_descriptor_t * p_es; \
\
if( !b_update ) \
{ \
p_es = (es_descriptor_t*)user_data; \
\
input_ToggleES( p_intf->p_input, p_es, menuitem->active ); \
\
b_update = menuitem->active; \
} \
/*
* Audio
*/
void GtkMenubarAudioToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
GtkLangToggle( p_intf->p_sys->b_audio_update );
}
void GtkPopupAudioToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
GtkLangToggle( p_intf->p_sys->b_audio_update );
}
/*
* Subtitles
*/
void GtkMenubarSubtitleToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
GtkLangToggle( p_intf->p_sys->b_spu_update );
}
void GtkPopupSubtitleToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
GtkLangToggle( p_intf->p_sys->b_spu_update );
}
/*
* Navigation
*/
void GtkPopupNavigationToggle( GtkCheckMenuItem * menuitem,
gpointer user_data )
{
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
if( menuitem->active &&
!p_intf->p_sys->b_title_update &&
!p_intf->p_sys->b_chapter_update )
{
input_area_t *p_area = p_intf->p_input->stream.p_selected_area;
gint i_title = DATA2TITLE( user_data );
gint i_chapter = DATA2CHAPTER( user_data );
if( p_area != p_intf->p_input->stream.pp_areas[i_title] )
{
p_area = p_intf->p_input->stream.pp_areas[i_title];
p_intf->p_sys->b_title_update = 1;
}
p_area->i_part = i_chapter;
p_intf->p_sys->b_chapter_update = 1;
p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
}
}
/*
* Title
*/
#define GtkTitleToggle( intf ) \
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), (intf) ); \
\
if( menuitem->active && !p_intf->p_sys->b_title_update ) \
{ \
gint i_title = (gint)user_data; \
p_intf->p_input->pf_set_area( p_intf->p_input, \
p_intf->p_input->stream.pp_areas[i_title] ); \
\
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY ); \
\
p_intf->p_sys->b_title_update = 1; \
}
void GtkMenubarTitleToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{
GtkTitleToggle( "intf_window" );
}
void GtkPopupTitleToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{
GtkTitleToggle( "intf_popup" );
}
/*
* Chapter
*/
#define GtkChapterToggle( intf ) \
intf_thread_t * p_intf; \
input_area_t * p_area; \
gint i_chapter; \
char psz_chapter[5]; \
\
p_intf = GetIntf( GTK_WIDGET(menuitem), (intf) ); \
p_area = p_intf->p_input->stream.p_selected_area; \
i_chapter = (gint)user_data; \
\
if( menuitem->active && !p_intf->p_sys->b_chapter_update ) \
{ \
p_area->i_part = i_chapter; \
p_intf->p_input->pf_set_area( p_intf->p_input, \
(input_area_t*)p_area ); \
\
snprintf( psz_chapter, 3, "%02d", p_area->i_part ); \
gtk_label_set_text( p_intf->p_sys->p_label_chapter, psz_chapter ); \
\
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY ); \
\
p_intf->p_sys->b_chapter_update = 1; \
}
void GtkMenubarChapterToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{
GtkChapterToggle( "intf_window" );
}
void GtkPopupChapterToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{
GtkChapterToggle( "intf_popup" );
}
/*
* Angle
*/
#define GtkAngleToggle( intf ) \
intf_thread_t * p_intf; \
input_area_t * p_area; \
gint i_angle; \
\
p_intf = GetIntf( GTK_WIDGET(menuitem), (intf) ); \
p_area = p_intf->p_input->stream.p_selected_area; \
i_angle = (gint)user_data; \
\
if( menuitem->active && !p_intf->p_sys->b_angle_update ) \
{ \
p_area->i_angle = i_angle; \
p_intf->p_input->pf_set_area( p_intf->p_input, \
(input_area_t*)p_area ); \
\
p_intf->p_sys->b_angle_update = 1; \
}
void GtkMenubarAngleToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{
GtkAngleToggle( "intf_window" )
}
void GtkPopupAngleToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{
GtkAngleToggle( "intf_popup" )
}
/****************************************************************************
* Functions to generate menus
****************************************************************************/
/*****************************************************************************
* GtkRadioMenu: update interactive menus of the interface
*****************************************************************************
* Sets up menus with information from input
* Warning: since this function is designed to be called by management
* function, the interface lock has to be taken
*****************************************************************************/
static gint GtkRadioMenu( intf_thread_t * p_intf,
GtkWidget * p_root, GSList * p_menu_group,
char * psz_item_name,
int i_nb, int i_selected,
void( *pf_toggle )( GtkCheckMenuItem *, gpointer ) )
{
char psz_name[ GTK_MENU_LABEL_SIZE ];
GtkWidget * p_menu;
GtkWidget * p_submenu;
GtkWidget * p_item_group;
GtkWidget * p_item;
GtkWidget * p_item_selected;
GSList * p_group;
gint i_item;
/* temporary hack to avoid blank menu when an open menu is removed */
if( GTK_MENU_ITEM(p_root)->submenu != NULL )
{
gtk_menu_popdown( GTK_MENU( GTK_MENU_ITEM(p_root)->submenu ) );
}
/* removes previous menu */
gtk_menu_item_remove_submenu( GTK_MENU_ITEM( p_root ) );
gtk_widget_set_sensitive( p_root, FALSE );
p_item_group = NULL;
p_submenu = NULL;
p_item_selected = NULL;
p_group = p_menu_group;
p_menu = gtk_menu_new();
for( i_item = 0 ; i_item < i_nb ; i_item++ )
{
/* we group chapters in packets of ten for small screens */
if( ( i_item % 10 == 0 ) && ( i_nb > 20 ) )
{
if( i_item != 0 )
{
gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_item_group ),
p_submenu );
gtk_menu_append( GTK_MENU( p_menu ), p_item_group );
}
snprintf( psz_name, GTK_MENU_LABEL_SIZE,
"%ss %d to %d", psz_item_name, i_item + 1, i_item + 10);
psz_name[ GTK_MENU_LABEL_SIZE - 1 ] = '\0';
p_item_group = gtk_menu_item_new_with_label( psz_name );
gtk_widget_show( p_item_group );
p_submenu = gtk_menu_new();
}
snprintf( psz_name, GTK_MENU_LABEL_SIZE, "%s %d",
psz_item_name, i_item + 1 );
psz_name[ GTK_MENU_LABEL_SIZE - 1 ] = '\0';
p_item = gtk_radio_menu_item_new_with_label( p_group, psz_name );
p_group = gtk_radio_menu_item_group( GTK_RADIO_MENU_ITEM( p_item ) );
if( i_selected == i_item + 1 )
{
p_item_selected = p_item;
}
gtk_widget_show( p_item );
/* setup signal hanling */
gtk_signal_connect( GTK_OBJECT( p_item ),
"toggled",
GTK_SIGNAL_FUNC( pf_toggle ),
(gpointer)(i_item + 1) );
if( i_nb > 20 )
{
gtk_menu_append( GTK_MENU( p_submenu ), p_item );
}
else
{
gtk_menu_append( GTK_MENU( p_menu ), p_item );
}
}
if( i_nb > 20 )
{
gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_item_group ), p_submenu );
gtk_menu_append( GTK_MENU( p_menu ), p_item_group );
}
/* link the new menu to the title menu item */
gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_root ), p_menu );
/* toggle currently selected chapter */
if( p_item_selected != NULL )
{
gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( p_item_selected ),
TRUE );
}
/* be sure that menu is sensitive, if there are several items */
if( i_nb > 1 )
{
gtk_widget_set_sensitive( p_root, TRUE );
}
return TRUE;
}
/*****************************************************************************
* GtkLanguageMenus: update interactive menus of the interface
*****************************************************************************
* Sets up menus with information from input:
* -languages
* -sub-pictures
* Warning: since this function is designed to be called by management
* function, the interface lock has to be taken
*****************************************************************************/
static gint GtkLanguageMenus( gpointer p_data,
GtkWidget * p_root,
es_descriptor_t * p_es,
gint i_cat,
void(*pf_toggle )( GtkCheckMenuItem *, gpointer ) )
{
intf_thread_t * p_intf;
GtkWidget * p_menu;
GtkWidget * p_separator;
GtkWidget * p_item;
GtkWidget * p_item_active;
GSList * p_group;
char psz_name[ GTK_MENU_LABEL_SIZE ];
gint i_item;
gint i;
/* cast */
p_intf = (intf_thread_t *)p_data;
/* temporary hack to avoid blank menu when an open menu is removed */
if( GTK_MENU_ITEM(p_root)->submenu != NULL )
{
gtk_menu_popdown( GTK_MENU( GTK_MENU_ITEM(p_root)->submenu ) );
}
/* removes previous menu */
gtk_menu_item_remove_submenu( GTK_MENU_ITEM( p_root ) );
gtk_widget_set_sensitive( p_root, FALSE );
p_group = NULL;
/* menu container */
p_menu = gtk_menu_new();
/* special case for "off" item */
snprintf( psz_name, GTK_MENU_LABEL_SIZE, "None" );
psz_name[ GTK_MENU_LABEL_SIZE - 1 ] = '\0';
p_item = gtk_radio_menu_item_new_with_label( p_group, psz_name );
p_group = gtk_radio_menu_item_group( GTK_RADIO_MENU_ITEM( p_item ) );
gtk_widget_show( p_item );
/* signal hanling for off */
gtk_signal_connect( GTK_OBJECT( p_item ), "toggled",
GTK_SIGNAL_FUNC ( pf_toggle ), NULL );
gtk_menu_append( GTK_MENU( p_menu ), p_item );
p_separator = gtk_menu_item_new();
gtk_widget_set_sensitive( p_separator, FALSE );
gtk_widget_show( p_separator );
gtk_menu_append( GTK_MENU( p_menu ), p_separator );
vlc_mutex_lock( &p_intf->p_input->stream.stream_lock );
p_item_active = NULL;
i_item = 0;
/* create a set of language buttons and append them to the container */
for( i = 0 ; i < p_intf->p_input->stream.i_es_number ; i++ )
{
if( p_intf->p_input->stream.pp_es[i]->i_cat == i_cat )
{
i_item++;
strcpy( psz_name, p_intf->p_input->stream.pp_es[i]->psz_desc );
if( psz_name[0] == '\0' )
{
snprintf( psz_name, GTK_MENU_LABEL_SIZE,
"Language %d", i_item );
psz_name[ GTK_MENU_LABEL_SIZE - 1 ] = '\0';
}
p_item = gtk_radio_menu_item_new_with_label( p_group, psz_name );
p_group =
gtk_radio_menu_item_group( GTK_RADIO_MENU_ITEM( p_item ) );
if( p_es == p_intf->p_input->stream.pp_es[i] )
{
/* don't lose p_item when we append into menu */
p_item_active = p_item;
}
gtk_widget_show( p_item );
/* setup signal hanling */
gtk_signal_connect( GTK_OBJECT( p_item ), "toggled",
GTK_SIGNAL_FUNC( pf_toggle ),
(gpointer)( p_intf->p_input->stream.pp_es[i] ) );
gtk_menu_append( GTK_MENU( p_menu ), p_item );
}
}
vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock );
/* link the new menu to the menubar item */
gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_root ), p_menu );
/* acitvation will call signals so we can only do it
* when submenu is attached to menu - to get intf_window */
if( p_item_active != NULL )
{
gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( p_item_active ),
TRUE );
}
/* be sure that menu is sensitive if non empty */
if( i_item > 0 )
{
gtk_widget_set_sensitive( p_root, TRUE );
}
return TRUE;
}
#if 1
/*****************************************************************************
* GtkTitleMenu: sets menus for titles and chapters selection
*****************************************************************************
* Generates two types of menus:
* -simple list of titles
* -cascaded lists of chapters for each title
*****************************************************************************/
static gint GtkTitleMenu( gpointer p_data,
GtkWidget * p_navigation,
void(*pf_toggle )( GtkCheckMenuItem *, gpointer ) )
{
intf_thread_t * p_intf;
char psz_name[ GTK_MENU_LABEL_SIZE ];
GtkWidget * p_title_menu;
GtkWidget * p_title_submenu;
GtkWidget * p_title_item;
GtkWidget * p_item_active;
GtkWidget * p_chapter_menu;
GtkWidget * p_chapter_submenu;
GtkWidget * p_title_menu_item;
GtkWidget * p_chapter_menu_item;
GtkWidget * p_item;
GSList * p_title_group;
GSList * p_chapter_group;
gint i_title;
gint i_chapter;
gint i_title_nb;
gint i_chapter_nb;
/* cast */
p_intf = (intf_thread_t*)p_data;
/* temporary hack to avoid blank menu when an open menu is removed */
if( GTK_MENU_ITEM(p_navigation)->submenu != NULL )
{
gtk_menu_popdown( GTK_MENU( GTK_MENU_ITEM(p_navigation)->submenu ) );
}
/* removes previous menu */
gtk_menu_item_remove_submenu( GTK_MENU_ITEM( p_navigation ) );
gtk_widget_set_sensitive( p_navigation, FALSE );
p_title_menu = gtk_menu_new();
p_title_group = NULL;
p_title_submenu = NULL;
p_title_menu_item = NULL;
p_chapter_group = NULL;
p_chapter_submenu = NULL;
p_chapter_menu_item = NULL;
p_item_active = NULL;
i_title_nb = p_intf->p_input->stream.i_area_nb;
/* loop on titles */
for( i_title = 1 ; i_title < i_title_nb ; i_title++ )
{
/* we group titles in packets of ten for small screens */
if( ( i_title % 10 == 1 ) && ( i_title_nb > 20 ) )
{
if( i_title != 1 )
{
gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_title_menu_item ),
p_title_submenu );
gtk_menu_append( GTK_MENU( p_title_menu ), p_title_menu_item );
}
snprintf( psz_name, GTK_MENU_LABEL_SIZE,
"%d - %d", i_title, i_title + 9 );
psz_name[ GTK_MENU_LABEL_SIZE - 1 ] = '\0';
p_title_menu_item = gtk_menu_item_new_with_label( psz_name );
gtk_widget_show( p_title_menu_item );
p_title_submenu = gtk_menu_new();
}
snprintf( psz_name, GTK_MENU_LABEL_SIZE, "Title %d (%d)", i_title,
p_intf->p_input->stream.pp_areas[i_title]->i_part_nb );
psz_name[ GTK_MENU_LABEL_SIZE - 1 ] = '\0';
#if 0
if( pf_toggle == on_menubar_title_toggle )
{
p_title_item = gtk_radio_menu_item_new_with_label( p_title_group,
psz_name );
p_title_group =
gtk_radio_menu_item_group( GTK_RADIO_MENU_ITEM( p_title_item ) );
if( p_intf->p_input->stream.pp_areas[i_title] ==
p_intf->p_input->stream.p_selected_area )
{
p_item_active = p_title_item;
}
/* setup signal hanling */
gtk_signal_connect( GTK_OBJECT( p_title_item ),
"toggled",
GTK_SIGNAL_FUNC( pf_toggle ),
(gpointer)(p_intf->p_input->stream.pp_areas[i_title]) );
if( p_intf->p_input->stream.i_area_nb > 1 )
{
/* be sure that menu is sensitive */
gtk_widget_set_sensitive( p_navigation, TRUE );
}
}
else
#endif
{
p_title_item = gtk_menu_item_new_with_label( psz_name );
#if 1
p_chapter_menu = gtk_menu_new();
i_chapter_nb =
p_intf->p_input->stream.pp_areas[i_title]->i_part_nb;
for( i_chapter = 0 ; i_chapter < i_chapter_nb ; i_chapter++ )
{
/* we group chapters in packets of ten for small screens */
if( ( i_chapter % 10 == 0 ) && ( i_chapter_nb > 20 ) )
{
if( i_chapter != 0 )
{
gtk_menu_item_set_submenu(
GTK_MENU_ITEM( p_chapter_menu_item ),
p_chapter_submenu );
gtk_menu_append( GTK_MENU( p_chapter_menu ),
p_chapter_menu_item );
}
snprintf( psz_name, GTK_MENU_LABEL_SIZE,
"%d - %d", i_chapter + 1, i_chapter + 10 );
psz_name[ GTK_MENU_LABEL_SIZE - 1 ] = '\0';
p_chapter_menu_item =
gtk_menu_item_new_with_label( psz_name );
gtk_widget_show( p_chapter_menu_item );
p_chapter_submenu = gtk_menu_new();
}
snprintf( psz_name, GTK_MENU_LABEL_SIZE,
"Chapter %d", i_chapter + 1 );
psz_name[ GTK_MENU_LABEL_SIZE - 1 ] = '\0';
p_item = gtk_radio_menu_item_new_with_label(
p_chapter_group, psz_name );
p_chapter_group = gtk_radio_menu_item_group(
GTK_RADIO_MENU_ITEM( p_item ) );
gtk_widget_show( p_item );
#define p_area p_intf->p_input->stream.pp_areas[i_title]
if( ( p_area == p_intf->p_input->stream.p_selected_area ) &&
( p_area->i_part == i_chapter + 1 ) )
{
p_item_active = p_item;
}
#undef p_area
/* setup signal hanling */
gtk_signal_connect( GTK_OBJECT( p_item ),
"toggled",
GTK_SIGNAL_FUNC( pf_toggle ),
(gpointer)POS2DATA( i_title, i_chapter + 1) );
if( i_chapter_nb > 20 )
{
gtk_menu_append( GTK_MENU( p_chapter_submenu ), p_item );
}
else
{
gtk_menu_append( GTK_MENU( p_chapter_menu ), p_item );
}
}
if( i_chapter_nb > 20 )
{
gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_chapter_menu_item ),
p_chapter_submenu );
gtk_menu_append( GTK_MENU( p_chapter_menu ),
p_chapter_menu_item );
}
/* link the new menu to the title menu item */
gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_title_item ),
p_chapter_menu );
if( p_intf->p_input->stream.pp_areas[i_title]->i_part_nb > 1 )
{
/* be sure that menu is sensitive */
gtk_widget_set_sensitive( p_navigation, TRUE );
}
#else
GtkRadioMenu( p_intf, p_title_item, p_chapter_group, "Chapter",
p_intf->p_input->stream.pp_areas[i_title]->i_part_nb,
i_title * 100,
p_intf->p_input->stream.p_selected_area->i_part +
p_intf->p_input->stream.p_selected_area->i_id *100,
pf_toggle );
#endif
}
gtk_widget_show( p_title_item );
if( i_title_nb > 20 )
{
gtk_menu_append( GTK_MENU( p_title_submenu ), p_title_item );
}
else
{
gtk_menu_append( GTK_MENU( p_title_menu ), p_title_item );
}
}
if( i_title_nb > 20 )
{
gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_title_menu_item ),
p_title_submenu );
gtk_menu_append( GTK_MENU( p_title_menu ), p_title_menu_item );
}
/* be sure that menu is sensitive */
gtk_widget_set_sensitive( p_title_menu, TRUE );
/* link the new menu to the menubar item */
gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_navigation ), p_title_menu );
if( p_item_active != NULL )
{
gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( p_item_active ),
TRUE );
}
#if 0
if( p_intf->p_input->stream.i_area_nb > 1 )
{
/* be sure that menu is sensitive */
gtk_widget_set_sensitive( p_navigation, TRUE );
}
#endif
return TRUE;
}
#endif
/*****************************************************************************
* GtkSetupMenu: function that generates title/chapter/audio/subpic
* menus with help from preceding functions
*****************************************************************************/
gint GtkSetupMenu( intf_thread_t * p_intf )
{
es_descriptor_t * p_audio_es;
es_descriptor_t * p_spu_es;
GtkWidget * p_menubar_menu;
GtkWidget * p_popup_menu;
gint i;
p_intf->p_sys->b_chapter_update |= p_intf->p_sys->b_title_update;
p_intf->p_sys->b_angle_update |= p_intf->p_sys->b_title_update;
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;
if( p_intf->p_sys->b_title_update )
{
char psz_title[5];
p_menubar_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "menubar_title" ) );
GtkRadioMenu( p_intf, p_menubar_menu, NULL, "Title",
p_intf->p_input->stream.i_area_nb - 1,
p_intf->p_input->stream.p_selected_area->i_id,
GtkMenubarTitleToggle );
snprintf( psz_title, 4, "%d",
p_intf->p_input->stream.p_selected_area->i_id );
psz_title[ 4 ] = '\0';
gtk_label_set_text( p_intf->p_sys->p_label_title, psz_title );
p_intf->p_sys->b_title_update = 0;
}
if( p_intf->p_sys->b_chapter_update )
{
char psz_chapter[5];
p_popup_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_popup ), "popup_navigation" ) );
GtkTitleMenu( p_intf, p_popup_menu, GtkPopupNavigationToggle );
#if 0
GtkRadioMenu( p_intf, p_menubar_menu, NULL, "Title",
p_intf->p_input->stream.i_area_nb - 1,
p_intf->p_input->stream.p_selected_area->i_id,
on_menubar_chapter_toggle );
#endif
p_menubar_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "menubar_chapter" ) );
GtkRadioMenu( p_intf, p_menubar_menu, NULL, "Chapter",
p_intf->p_input->stream.p_selected_area->i_part_nb,
p_intf->p_input->stream.p_selected_area->i_part,
GtkMenubarChapterToggle );
snprintf( psz_chapter, 4, "%d",
p_intf->p_input->stream.p_selected_area->i_part );
psz_chapter[ 4 ] = '\0';
gtk_label_set_text( p_intf->p_sys->p_label_chapter, psz_chapter );
p_intf->p_sys->i_part =
p_intf->p_input->stream.p_selected_area->i_part;
p_intf->p_sys->b_chapter_update = 0;
}
if( p_intf->p_sys->b_angle_update )
{
p_menubar_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "menubar_angle" ) );
GtkRadioMenu( p_intf, p_menubar_menu, NULL, "Angle",
p_intf->p_input->stream.p_selected_area->i_angle_nb,
p_intf->p_input->stream.p_selected_area->i_angle,
GtkMenubarAngleToggle );
p_popup_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_popup ), "popup_angle" ) );
GtkRadioMenu( p_intf, p_popup_menu, NULL, "Angle",
p_intf->p_input->stream.p_selected_area->i_angle_nb,
p_intf->p_input->stream.p_selected_area->i_angle,
GtkPopupAngleToggle );
p_intf->p_sys->b_angle_update = 0;
}
/* look for selected ES */
p_audio_es = NULL;
p_spu_es = NULL;
for( i = 0 ; i < p_intf->p_input->stream.i_selected_es_number ; i++ )
{
if( p_intf->p_input->stream.pp_selected_es[i]->i_cat == AUDIO_ES )
{
p_audio_es = p_intf->p_input->stream.pp_selected_es[i];
}
if( p_intf->p_input->stream.pp_selected_es[i]->i_cat == SPU_ES )
{
p_spu_es = p_intf->p_input->stream.pp_selected_es[i];
}
}
/* audio menus */
if( p_intf->p_sys->b_audio_update )
{
/* find audio root menu */
p_menubar_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "menubar_audio" ) );
p_popup_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_popup ), "popup_audio" ) );
GtkLanguageMenus( p_intf, p_menubar_menu, p_audio_es, AUDIO_ES,
GtkMenubarAudioToggle );
GtkLanguageMenus( p_intf, p_popup_menu, p_audio_es, AUDIO_ES,
GtkPopupAudioToggle );
p_intf->p_sys->b_audio_update = 0;
}
/* sub picture menus */
if( p_intf->p_sys->b_spu_update )
{
/* find spu root menu */
p_menubar_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "menubar_subpictures" ) );
p_popup_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_popup ), "popup_subpictures" ) );
GtkLanguageMenus( p_intf, p_menubar_menu, p_spu_es, SPU_ES,
GtkMenubarSubtitleToggle );
GtkLanguageMenus( p_intf, p_popup_menu, p_spu_es, SPU_ES,
GtkPopupSubtitleToggle );
p_intf->p_sys->b_spu_update = 0;
}
/* handle fullscreen check items */
if( p_vout_bank->i_count )
{
p_menubar_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "menubar_fullscreen" ) );
p_popup_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_popup ), "popup_fullscreen" ) );
gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( p_menubar_menu ),
p_vout_bank->pp_vout[0]->b_fullscreen );
gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( p_popup_menu ),
p_vout_bank->pp_vout[0]->b_fullscreen );
}
return TRUE;
}

38
plugins/gtk/gtk_menu.h Normal file
View File

@ -0,0 +1,38 @@
/*****************************************************************************
* gtk_menu.h: prototypes for menu functions
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: gtk_menu.h,v 1.1 2001/05/15 01:01:44 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#if 0
void GtkMenubarAudioToggle ( GtkCheckMenuItem *, gpointer );
void GtkPopupAudioToggle ( GtkCheckMenuItem *, gpointer );
void GtkMenubarSubtitleToggle ( GtkCheckMenuItem *, gpointer );
void GtkPopupSubtitleToggle ( GtkCheckMenuItem *, gpointer );
void GtkMenubarTitleToggle ( GtkCheckMenuItem *, gpointer );
void GtkPopupTitleToggle ( GtkCheckMenuItem *, gpointer );
void GtkMenubarChapterToggle ( GtkCheckMenuItem *, gpointer );
void GtkPopupChapterToggle ( GtkCheckMenuItem *, gpointer );
void GtkMenubarAngleToggle ( GtkCheckMenuItem *, gpointer );
void GtkPopupAngleToggle ( GtkCheckMenuItem *, gpointer );
#endif

83
plugins/gtk/gtk_modules.c Normal file
View File

@ -0,0 +1,83 @@
/*****************************************************************************
* gtk_modules.c : functions to build modules configuration boxes.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_modules.c,v 1.1 2001/05/15 01:01:44 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME gtk
#include "modules_inner.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
#include "defs.h"
#include <sys/types.h> /* off_t */
#include <stdlib.h>
#include <gtk/gtk.h>
#include <string.h>
#include "config.h"
#include "common.h"
#include "threads.h"
#include "mtime.h"
#include "stream_control.h"
#include "input_ext-intf.h"
#include "interface.h"
#include "intf_playlist.h"
#include "intf_msg.h"
#include "gtk_callbacks.h"
#include "gtk_interface.h"
#include "gtk_support.h"
#include "gtk_playlist.h"
#include "intf_gtk.h"
#include "main.h"
gboolean GtkModulesShow( GtkWidget *widget,
GdkEventButton *event,
gpointer user_data )
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" );
if( !GTK_IS_WIDGET( p_intf->p_sys->p_modules ) )
{
// p_intf->p_sys->p_modules = create_intf_modules();
gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_modules ),
"p_intf", p_intf );
}
gtk_widget_show( p_intf->p_sys->p_modules );
gdk_window_raise( p_intf->p_sys->p_modules->window );
return FALSE;
}
void GtkModulesCancel( GtkButton * button, gpointer user_data )
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_modules" );
gtk_widget_hide( p_intf->p_sys->p_modules );
}

29
plugins/gtk/gtk_modules.h Normal file
View File

@ -0,0 +1,29 @@
/*****************************************************************************
* gtk_modules.h: prototypes for modules functions
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: gtk_modules.h,v 1.1 2001/05/15 01:01:44 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
gboolean GtkModulesShow( GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
void GtkModulesCancel ( GtkButton * button, gpointer user_data );

462
plugins/gtk/gtk_open.c Normal file
View File

@ -0,0 +1,462 @@
/*****************************************************************************
* gtk_open.c : functions to handle file/disc/network open widgets.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_open.c,v 1.1 2001/05/15 01:01:44 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME gtk
#include "modules_inner.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
#include "defs.h"
#include <sys/types.h> /* off_t */
#include <stdlib.h>
#include <gtk/gtk.h>
#include <string.h>
#include "config.h"
#include "common.h"
#include "threads.h"
#include "mtime.h"
#include "stream_control.h"
#include "input_ext-intf.h"
#include "interface.h"
#include "intf_playlist.h"
#include "intf_msg.h"
#include "gtk_callbacks.h"
#include "gtk_interface.h"
#include "gtk_support.h"
#include "gtk_playlist.h"
#include "intf_gtk.h"
#include "main.h"
/*****************************************************************************
* Fileopen callbacks
*****************************************************************************
* The following callbacks are related to the file requester.
*****************************************************************************/
#if 0
void GtkFileOpenShow( GtkMenuItem * menuitem, gpointer user_data)
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), (char*)user_data );
/* If we have never used the file selector, open it */
if( !GTK_IS_WIDGET( p_intf->p_sys->p_fileopen ) )
{
p_intf->p_sys->p_fileopen = create_intf_fileopen();
gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_fileopen ),
"p_intf", p_intf );
gtk_file_selection_set_filename( GTK_FILE_SELECTION(
p_intf->p_sys->p_fileopen ),
main_GetPszVariable( INTF_PATH_VAR, INTF_PATH_DEFAULT ) );
}
gtk_widget_show( p_intf->p_sys->p_fileopen );
gdk_window_raise( p_intf->p_sys->p_fileopen->window );
}
#else
gboolean
GtkFileOpenShow (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data)
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
/* If we have never used the file selector, open it */
if( !GTK_IS_WIDGET( p_intf->p_sys->p_fileopen ) )
{
p_intf->p_sys->p_fileopen = create_intf_fileopen();
gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_fileopen ),
"p_intf", p_intf );
gtk_file_selection_set_filename( GTK_FILE_SELECTION(
p_intf->p_sys->p_fileopen ),
main_GetPszVariable( INTF_PATH_VAR, INTF_PATH_DEFAULT ) );
}
gtk_widget_show( p_intf->p_sys->p_fileopen );
gdk_window_raise( p_intf->p_sys->p_fileopen->window );
return FALSE;
}
#endif
void GtkFileOpenCancel( GtkButton * button, gpointer user_data)
{
gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
}
void GtkFileOpenOk( GtkButton * button, gpointer user_data )
{
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(button), "intf_fileopen" );
GtkCList * p_playlist_clist;
GtkWidget * p_filesel;
gchar * psz_filename;
int i_end = p_main->p_playlist->i_size;
/* hide the file selector */
p_filesel = gtk_widget_get_toplevel( GTK_WIDGET(button) );
gtk_widget_hide( p_filesel );
/* add the new file to the interface playlist */
psz_filename =
gtk_file_selection_get_filename( GTK_FILE_SELECTION( p_filesel ) );
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, (char*)psz_filename );
/* catch the GTK CList */
p_playlist_clist = GTK_CLIST( gtk_object_get_data(
GTK_OBJECT( p_intf->p_sys->p_playlist ), "playlist_clist" ) );
/* update the plugin display */
GtkRebuildCList( p_playlist_clist, p_main->p_playlist );
/* end current item, 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 );
p_main->p_playlist->b_stopped = 0;
}
/*****************************************************************************
* Open disc callbacks
*****************************************************************************
* The following callbacks are related to the disc manager.
*****************************************************************************/
#if 0
void GtkDiscOpenShow( GtkMenuItem * menuitem, gpointer user_data)
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), (char*)user_data );
if( !GTK_IS_WIDGET( p_intf->p_sys->p_disc ) )
{
p_intf->p_sys->p_disc = create_intf_disc();
gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_disc ),
"p_intf", p_intf );
}
gtk_widget_show( p_intf->p_sys->p_disc );
gdk_window_raise( p_intf->p_sys->p_disc->window );
}
#else
gboolean
GtkDiscOpenShow (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data)
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
if( !GTK_IS_WIDGET( p_intf->p_sys->p_disc ) )
{
p_intf->p_sys->p_disc = create_intf_disc();
gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_disc ),
"p_intf", p_intf );
}
gtk_widget_show( p_intf->p_sys->p_disc );
gdk_window_raise( p_intf->p_sys->p_disc->window );
return FALSE;
}
#endif
void GtkDiscOpenDvd( GtkToggleButton * togglebutton, gpointer user_data )
{
if( togglebutton->active )
{
gtk_entry_set_text(
GTK_ENTRY( lookup_widget( GTK_WIDGET(togglebutton), "disc_name" ) ),
main_GetPszVariable( INPUT_DVD_DEVICE_VAR, INPUT_DVD_DEVICE_DEFAULT )
);
}
}
void GtkDiscOpenVcd( GtkToggleButton *togglebutton, gpointer user_data )
{
if( togglebutton->active )
{
gtk_entry_set_text(
GTK_ENTRY( lookup_widget( GTK_WIDGET(togglebutton), "disc_name" ) ),
main_GetPszVariable( INPUT_VCD_DEVICE_VAR, INPUT_VCD_DEVICE_DEFAULT )
);
}
}
void GtkDiscOpenOk( GtkButton * button, gpointer user_data )
{
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(button), "intf_disc" );
GtkCList * p_playlist_clist;
char * psz_device, *psz_source, *psz_method;
int i_end = p_main->p_playlist->i_size;
gtk_widget_hide( p_intf->p_sys->p_disc );
psz_device = gtk_entry_get_text( GTK_ENTRY( lookup_widget(
GTK_WIDGET(button), "disc_name" ) ) );
/* "dvd:foo" has size 5 + strlen(foo) */
psz_source = malloc( 3 /* "dvd" */ + 1 /* ":" */
+ strlen( psz_device ) + 1 /* "\0" */ );
if( psz_source == NULL )
{
return;
}
/* Check which method was activated */
if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button),
"disc_dvd" ) )->active )
{
psz_method = "dvd";
}
else if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button),
"disc_vcd" ) )->active )
{
psz_method = "vcd";
}
else
{
intf_ErrMsg( "intf error: unknown disc type toggle button position" );
free( psz_source );
return;
}
/* Select title and chapter */
main_PutIntVariable( INPUT_TITLE_VAR, gtk_spin_button_get_value_as_int(
GTK_SPIN_BUTTON( lookup_widget(
GTK_WIDGET(button), "disc_title" ) ) ) );
main_PutIntVariable( INPUT_CHAPTER_VAR, gtk_spin_button_get_value_as_int(
GTK_SPIN_BUTTON( lookup_widget(
GTK_WIDGET(button), "disc_chapter" ) ) ) );
/* Build source name and add it to playlist */
sprintf( psz_source, "%s:%s", psz_method, psz_device );
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, psz_source );
free( psz_source );
/* catch the GTK CList */
p_playlist_clist = GTK_CLIST( gtk_object_get_data(
GTK_OBJECT( p_intf->p_sys->p_playlist ), "playlist_clist" ) );
/* update the display */
GtkRebuildCList( p_playlist_clist, p_main->p_playlist );
/* stop current item, select added item */
if( p_intf->p_input != NULL )
{
p_intf->p_input->b_eof = 1;
}
// vlc_mutex_lock( &p_main->p_playlist->change_lock );
intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
p_main->p_playlist->b_stopped = 0;
// vlc_mutex_unlock( &p_main->p_playlist->change_lock );
}
void GtkDiscOpenCancel( GtkButton * button, gpointer user_data)
{
gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
}
/*****************************************************************************
* Network stream callbacks
*****************************************************************************
* The following callbacks are related to the network stream manager.
*****************************************************************************/
#if 0
void GtkNetworkOpenShow( GtkMenuItem * menuitem, gpointer user_data)
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), (char*)user_data );
if( !GTK_IS_WIDGET( p_intf->p_sys->p_network ) )
{
p_intf->p_sys->p_disc = create_intf_network();
gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_network ),
"p_intf", p_intf );
}
gtk_widget_show( p_intf->p_sys->p_network );
gdk_window_raise( p_intf->p_sys->p_network->window );
}
#else
gboolean
GtkNetworkOpenShow (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data)
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
if( !GTK_IS_WIDGET( p_intf->p_sys->p_network ) )
{
p_intf->p_sys->p_network = create_intf_network();
gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_network ),
"p_intf", p_intf );
}
gtk_widget_show( p_intf->p_sys->p_network );
gdk_window_raise( p_intf->p_sys->p_network->window );
return FALSE;
}
#endif
void GtkNetworkOpenOk( GtkButton *button, gpointer user_data )
{
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(button), "intf_network" );
GtkCList * p_playlist_clist;
char * psz_source, *psz_server, *psz_protocol;
unsigned int i_port;
boolean_t b_broadcast;
int i_end = p_main->p_playlist->i_size;
gtk_widget_hide( p_intf->p_sys->p_network );
psz_server = gtk_entry_get_text( GTK_ENTRY( lookup_widget(
GTK_WIDGET(button), "network_server" ) ) );
/* Check which protocol was activated */
if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button),
"network_ts" ) )->active )
{
psz_protocol = "ts";
}
else if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button),
"network_rtp" ) )->active )
{
psz_protocol = "rtp";
}
else
{
intf_ErrMsg( "intf error: unknown protocol toggle button position" );
return;
}
/* 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(
lookup_widget( GTK_WIDGET(button), "network_port" ) ) );
if( i_port > 65535 )
{
intf_ErrMsg( "intf error: invalid port %i", i_port );
}
/* do we have a broadcast address */
b_broadcast = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(
lookup_widget( GTK_WIDGET(button), "broadcast_check" ) ) );
if( b_broadcast )
{
char * psz_broadcast;
psz_broadcast = gtk_entry_get_text( GTK_ENTRY( lookup_widget(
GTK_WIDGET(button), "network_broadcast" ) ) );
/* Allocate room for "protocol://server:port" */
psz_source = malloc( strlen( psz_protocol ) + 3 /* "://" */
+ strlen( psz_server ) + 1 /* ":" */
+ 5 /* 0-65535 */
+ strlen( psz_broadcast ) + 2 /* "::" */
+ 1 /* "\0" */ );
if( psz_source == NULL )
{
return;
}
/* Build source name and add it to playlist */
sprintf( psz_source, "%s://%s:%i::%s", psz_protocol,
psz_server,
i_port,
psz_broadcast );
}
else
{
/* Allocate room for "protocol://server:port" */
psz_source = malloc( strlen( psz_protocol ) + 3 /* "://" */
+ strlen( psz_server ) + 1 /* ":" */
+ 5 /* 0-65535 */ + 1 /* "\0" */ );
if( psz_source == NULL )
{
return;
}
/* Build source name and add it to playlist */
sprintf( psz_source, "%s://%s:%i", psz_protocol, psz_server, i_port );
}
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, psz_source );
free( psz_source );
/* catch the GTK CList */
p_playlist_clist = GTK_CLIST( gtk_object_get_data(
GTK_OBJECT( p_intf->p_sys->p_playlist ), "playlist_clist" ) );
/* update the display */
GtkRebuildCList( p_playlist_clist, p_main->p_playlist );
/* select added item */
if( p_intf->p_input != NULL )
{
p_intf->p_input->b_eof = 1;
}
// vlc_mutex_lock( &p_main->p_playlist->change_lock );
intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
p_main->p_playlist->b_stopped = 0;
// vlc_mutex_unlock( &p_main->p_playlist->change_lock );
}
void GtkNetworkOpenCancel( GtkButton * button, gpointer user_data)
{
gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
}
void GtkNetworkOpenBroadcast( 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_broadcast_combo" ),
gtk_toggle_button_get_active( togglebutton ) );
gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_network ),
"network_broadcast" ),
gtk_toggle_button_get_active( togglebutton ) );
}

56
plugins/gtk/gtk_open.h Normal file
View File

@ -0,0 +1,56 @@
/*****************************************************************************
* gtk_open.h: prototypes for open functions
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: gtk_open.h,v 1.1 2001/05/15 01:01:44 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
gboolean
GtkFileOpenShow (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
void GtkFileOpenCancel( GtkButton * button, gpointer user_data);
void GtkFileOpenOk( GtkButton * button, gpointer user_data );
gboolean
GtkDiscOpenShow (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
void GtkDiscOpenDvd( GtkToggleButton * togglebutton, gpointer user_data );
void GtkDiscOpenVcd( GtkToggleButton *togglebutton, gpointer user_data );
void GtkDiscOpenOk( GtkButton * button, gpointer user_data );
void GtkDiscOpenCancel( GtkButton * button, gpointer user_data);
gboolean
GtkNetworkOpenShow (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
void GtkNetworkOpenOk( GtkButton *button, gpointer user_data );
void GtkNetworkOpenCancel( GtkButton * button, gpointer user_data);
void GtkNetworkOpenBroadcast( GtkToggleButton * togglebutton,
gpointer user_data );

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +1,46 @@
void on_generic_drop_data_received( intf_thread_t * p_intf,
GtkSelectionData *data, guint info, int position);
void rebuildCList(GtkCList * clist, playlist_t * playlist_p);
int hasValidExtension(gchar * filename);
int intf_AppendList( playlist_t * p_playlist, int i_pos, GList * list );
void GtkPlayListManage( gpointer p_data );
void on_generic_drop_data_received( intf_thread_t * p_intf,
GtkSelectionData *data, guint info, int position);
gint compareItems(gconstpointer a, gconstpointer b);
GList * intf_readFiles(gchar * fsname );
/*****************************************************************************
* gtk_playlist.h : Playlist functions for the Gtk plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_playlist.h,v 1.2 2001/05/15 01:01:44 stef Exp $
*
* Authors: Pierre Baillet <oct@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
void GtkPlaylistDeleteAll ( GtkMenuItem *, gpointer );
void GtkPlaylistDeleteSelected( GtkMenuItem *, gpointer );
void GtkPlaylistCrop ( GtkMenuItem *, gpointer );
void GtkPlaylistInvert ( GtkMenuItem *, gpointer );
void GtkPlaylistSelect ( GtkMenuItem *, gpointer );
void GtkPlaylistOk ( GtkButton *, gpointer );
void GtkPlaylistCancel ( GtkButton *, gpointer );
int GtkHasValidExtension ( gchar * );
gint GtkCompareItems ( gconstpointer, gconstpointer );
GList * GtkReadFiles ( gchar * );
gboolean GtkPlaylistShow ( GtkWidget *, GdkEventButton *, gpointer );
gboolean GtkPlaylistPrev ( GtkWidget *, GdkEventButton *, gpointer );
gboolean GtkPlaylistNext ( GtkWidget *, GdkEventButton *, gpointer );
gboolean GtkPlaylistDragMotion( GtkWidget *, GdkDragContext *,
gint, gint, uint, gpointer );
gboolean GtkPlaylistEvent ( GtkWidget *, GdkEvent *, gpointer );
void GtkPlaylistDragData ( GtkWidget *, GdkDragContext *,
gint, gint, GtkSelectionData *,
guint, guint, gpointer );
void GtkDeleteGListItem ( gpointer, gpointer );

View File

@ -0,0 +1,320 @@
/*****************************************************************************
* gtk_control.c : functions to handle stream control buttons.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_preferences.c,v 1.1 2001/05/15 01:01:44 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME gtk
#include "modules_inner.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
#include "defs.h"
#include <sys/types.h> /* off_t */
#include <stdlib.h>
#include <gtk/gtk.h>
#include <string.h>
#include "config.h"
#include "common.h"
#include "threads.h"
#include "mtime.h"
#include "stream_control.h"
#include "input_ext-intf.h"
#include "interface.h"
#include "intf_playlist.h"
#include "intf_msg.h"
#include "gtk_callbacks.h"
#include "gtk_interface.h"
#include "gtk_support.h"
#include "gtk_playlist.h"
#include "intf_gtk.h"
#include "main.h"
/****************************************************************************
* GtkPreferencesShow: display interface window after initialization
* if necessary
****************************************************************************/
/* macros to create preference box */
#define ASSIGN_PSZ_ENTRY( var, default, name ) \
gtk_entry_set_text( GTK_ENTRY( gtk_object_get_data( GTK_OBJECT( \
p_intf->p_sys->p_preferences ), name ) ), \
main_GetPszVariable( var, default ) )
#define ASSIGN_INT_VALUE( var, default, name ) \
gtk_spin_button_set_value( GTK_SPIN_BUTTON( gtk_object_get_data( \
GTK_OBJECT( p_intf->p_sys->p_preferences ), name ) ), \
main_GetIntVariable( var, default ) )
#define ASSIGN_INT_TOGGLE( var, default, name ) \
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( gtk_object_get_data( \
GTK_OBJECT( p_intf->p_sys->p_preferences ), name ) ), \
main_GetIntVariable( var, default ) )
gboolean GtkPreferencesShow( GtkWidget *widget,
GdkEventButton *event,
gpointer user_data )
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
/* If we have never used the file selector, open it */
if( !GTK_IS_WIDGET( p_intf->p_sys->p_preferences ) )
{
p_intf->p_sys->p_preferences = create_intf_preferences();
gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_preferences ),
"p_intf", p_intf );
/* Default path */
ASSIGN_PSZ_ENTRY( INTF_PATH_VAR, INTF_PATH_DEFAULT,
"preferences_file_path_entry" );
/* Default DVD */
ASSIGN_PSZ_ENTRY( INPUT_DVD_DEVICE_VAR,INPUT_DVD_DEVICE_DEFAULT,
"preferences_disc_dvd_entry" );
/* Default VCD */
ASSIGN_PSZ_ENTRY( INPUT_VCD_DEVICE_VAR, INPUT_VCD_DEVICE_DEFAULT,
"preferences_disc_vcd_entry" );
/* Default server */
ASSIGN_PSZ_ENTRY( INPUT_SERVER_VAR, INPUT_SERVER_DEFAULT,
"preferences_network_server_entry" );
/* Default port */
ASSIGN_INT_VALUE( INPUT_PORT_VAR, INPUT_PORT_DEFAULT,
"preferences_network_port_spinbutton" );
/* Broadcast address */
ASSIGN_PSZ_ENTRY( INPUT_BCAST_ADRR_VAR, INPUT_BCAST_ADDR_DEFAULT,
"preferences_network_broadcast_entry" );
/* Broadcast stream by default ? */
ASSIGN_INT_TOGGLE( INPUT_BROADCAST_VAR, INPUT_BROADCAST_DEFAULT,
"preferences_network_broadcast_checkbutton" );
/* XXX Protocol */
/* Default interface */
ASSIGN_PSZ_ENTRY( INTF_METHOD_VAR, INTF_METHOD_DEFAULT,
"preferences_interface_entry" );
/* Default video output */
ASSIGN_PSZ_ENTRY( VOUT_METHOD_VAR, VOUT_METHOD_DEFAULT,
"preferences_video_output_entry" );
/* Default output width */
ASSIGN_INT_VALUE( VOUT_WIDTH_VAR, VOUT_WIDTH_DEFAULT,
"preferences_video_width_spinbutton" );
/* Default output height */
ASSIGN_INT_VALUE( VOUT_HEIGHT_VAR, VOUT_HEIGHT_DEFAULT,
"preferences_video_height_spinbutton" );
/* XXX Default screen depth */
/* XXX Default fullscreen depth */
/* XXX Default gamma */
/* Fullscreen on play */
ASSIGN_INT_TOGGLE( VOUT_FULLSCREEN_VAR, VOUT_FULLSCREEN_DEFAULT,
"preferences_video_fullscreen_checkbutton" );
/* Grayscale display */
ASSIGN_INT_TOGGLE( VOUT_GRAYSCALE_VAR, VOUT_GRAYSCALE_DEFAULT,
"preferences_video_grayscale_checkbutton" );
/* Default audio output */
ASSIGN_PSZ_ENTRY( AOUT_METHOD_VAR, AOUT_METHOD_DEFAULT,
"preferences_audio_output_entry" );
/* Default audio device */
ASSIGN_PSZ_ENTRY( AOUT_DSP_VAR, AOUT_DSP_DEFAULT,
"preferences_audio_device_entry" );
/* XXX Default frequency */
/* XXX Default quality */
/* XXX Default number of channels */
/* Use spdif output ? */
ASSIGN_INT_TOGGLE( AOUT_SPDIF_VAR, AOUT_SPDIF_DEFAULT,
"preferences_audio_spdif_checkbutton" );
/* Launch playlist on startup */
ASSIGN_INT_TOGGLE( PLAYLIST_STARTUP_VAR, PLAYLIST_STARTUP_DEFAULT,
"preferences_playlist_startup_checkbutton" );
/* Enqueue drag'n dropped item as default */
ASSIGN_INT_TOGGLE( PLAYLIST_ENQUEUE_VAR, PLAYLIST_ENQUEUE_DEFAULT,
"preferences_playlist_enqueue_checkbutton" );
/* Loop on playlist end */
ASSIGN_INT_TOGGLE( PLAYLIST_LOOP_VAR, PLAYLIST_LOOP_DEFAULT,
"preferences_playlist_loop_checkbutton" );
/* Verbosity of warning messages */
ASSIGN_INT_VALUE( INTF_WARNING_VAR, INTF_WARNING_DEFAULT,
"preferences_misc_messages_spinbutton" );
#undef ASSIGN_PSZ_ENTRY
#undef ASSIGN_INT_VALUE
#undef ASSIGN_INT_TOGGLE
}
gtk_widget_show( p_intf->p_sys->p_preferences );
gdk_window_raise( p_intf->p_sys->p_preferences->window );
return TRUE;
}
/****************************************************************************
* GtkPreferencesApply: store the values into the environnement variables
****************************************************************************/
/* macros to read value frfom preference box */
#define ASSIGN_PSZ_ENTRY( var, name ) \
main_PutPszVariable( var, gtk_entry_get_text( \
GTK_ENTRY( gtk_object_get_data( GTK_OBJECT( p_preferences ), name ) ) ) )
#define ASSIGN_INT_VALUE( var, name ) \
main_PutIntVariable( var, gtk_spin_button_get_value_as_int( \
GTK_SPIN_BUTTON( gtk_object_get_data( GTK_OBJECT( p_preferences ), \
name ) ) ) )
#define ASSIGN_INT_TOGGLE( var, name ) \
main_PutIntVariable( var, gtk_toggle_button_get_active( \
GTK_TOGGLE_BUTTON( gtk_object_get_data( GTK_OBJECT( p_preferences ), \
name ) ) ) )
void GtkPreferencesApply( GtkButton * button, gpointer user_data )
{
GtkWidget * p_preferences;
/* get preferences window */
p_preferences = gtk_widget_get_toplevel( GTK_WIDGET( button ) );
/* Default path */
ASSIGN_PSZ_ENTRY( INTF_PATH_VAR, "preferences_file_path_entry" );
/* Default DVD */
ASSIGN_PSZ_ENTRY( INPUT_DVD_DEVICE_VAR, "preferences_disc_dvd_entry" );
/* Default VCD */
ASSIGN_PSZ_ENTRY( INPUT_VCD_DEVICE_VAR, "preferences_disc_vcd_entry" );
/* Default server */
ASSIGN_PSZ_ENTRY( INPUT_SERVER_VAR, "preferences_network_server_entry" );
/* Default port */
ASSIGN_INT_VALUE( INPUT_PORT_VAR, "preferences_network_port_spinbutton" );
/* Broadcast address */
ASSIGN_PSZ_ENTRY( INPUT_BCAST_ADRR_VAR,
"preferences_network_broadcast_entry" );
/* Broadcast stream by default ? */
ASSIGN_INT_TOGGLE( INPUT_BROADCAST_VAR,
"preferences_network_broadcast_checkbutton" );
/* XXX Protocol */
/* Default interface */
ASSIGN_PSZ_ENTRY( INTF_METHOD_VAR, "preferences_interface_entry" );
/* Default video output */
ASSIGN_PSZ_ENTRY( VOUT_METHOD_VAR, "preferences_video_output_entry" );
/* Default output width */
ASSIGN_INT_VALUE( VOUT_WIDTH_VAR, "preferences_video_width_spinbutton" );
/* Default output height */
ASSIGN_INT_VALUE( VOUT_HEIGHT_VAR, "preferences_video_height_spinbutton" );
/* XXX Default screen depth */
/* XXX Default fullscreen depth */
/* XXX Default gamma */
/* Fullscreen on play */
ASSIGN_INT_TOGGLE( VOUT_FULLSCREEN_VAR,
"preferences_video_fullscreen_checkbutton" );
/* Grayscale display */
ASSIGN_INT_TOGGLE( VOUT_GRAYSCALE_VAR,
"preferences_video_grayscale_checkbutton" );
/* Default audio output */
ASSIGN_PSZ_ENTRY( AOUT_METHOD_VAR, "preferences_audio_output_entry" );
/* Default audio device */
ASSIGN_PSZ_ENTRY( AOUT_DSP_VAR, "preferences_audio_device_entry" );
/* XXX Default frequency */
/* XXX Default quality */
/* XXX Default number of channels */
/* Use spdif output ? */
ASSIGN_INT_TOGGLE( AOUT_SPDIF_VAR, "preferences_audio_spdif_checkbutton" );
/* Launch playlist on startup */
ASSIGN_INT_TOGGLE( PLAYLIST_STARTUP_VAR,
"preferences_playlist_startup_checkbutton" );
/* Enqueue drag'n dropped item as default */
ASSIGN_INT_TOGGLE( PLAYLIST_ENQUEUE_VAR,
"preferences_playlist_enqueue_checkbutton" );
/* Loop on playlist end */
ASSIGN_INT_TOGGLE( PLAYLIST_LOOP_VAR,
"preferences_playlist_loop_checkbutton" );
/* Verbosity of warning messages */
ASSIGN_INT_VALUE( INTF_WARNING_VAR,
"preferences_misc_messages_spinbutton" );
}
#undef ASSIGN_PSZ_ENTRY
#undef ASSIGN_INT_VALUE
#undef ASSIGN_INT_TOGGLE
void GtkPreferencesOk( GtkButton * button, gpointer user_data )
{
GtkPreferencesApply( button, user_data );
gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
}
void GtkPreferencesCancel( GtkButton * button, gpointer user_data )
{
gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
}

View File

@ -0,0 +1,28 @@
/*****************************************************************************
* gtk_control.h: prototypes for control functions
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: gtk_preferences.h,v 1.1 2001/05/15 01:01:44 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
gboolean GtkPreferencesShow ( GtkWidget *, GdkEventButton *, gpointer );
void GtkPreferencesOk ( GtkButton *, gpointer );
void GtkPreferencesApply ( GtkButton *, gpointer );
void GtkPreferencesCancel( GtkButton *, gpointer );

View File

@ -2,7 +2,7 @@
* intf_gtk.c: Gtk+ interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_gtk.c,v 1.17 2001/05/07 03:14:09 stef Exp $
* $Id: intf_gtk.c,v 1.18 2001/05/15 01:01:44 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
@ -47,12 +47,17 @@
#include "stream_control.h"
#include "input_ext-intf.h"
#include "intf_msg.h"
#include "interface.h"
#include "intf_msg.h"
#include "intf_playlist.h"
#include "video.h"
#include "video_output.h"
#include "gtk_callbacks.h"
#include "gtk_interface.h"
#include "gtk_support.h"
#include "gtk_menu.h"
#include "intf_gtk.h"
#include "main.h"
@ -66,16 +71,9 @@ static void intf_Close ( intf_thread_t *p_intf );
static void intf_Run ( intf_thread_t *p_intf );
static gint GtkManage ( gpointer p_data );
static gint GtkLanguageMenus( gpointer, GtkWidget *, es_descriptor_t *, gint,
void (*pf_activate)(GtkMenuItem *, gpointer) );
static gint GtkChapterMenu ( gpointer, GtkWidget *,
void (*pf_activate)(GtkMenuItem *, gpointer) );
static gint GtkTitleMenu ( gpointer, GtkWidget *,
void (*pf_activate)(GtkMenuItem *, gpointer) );
static gint GtkModeManage ( intf_thread_t * p_intf );
static void GtkDisplayDate ( GtkAdjustment *p_adj );
void GtkPlayListManage( gpointer p_data );
/*****************************************************************************
* g_atexit: kludge to avoid the Gtk+ thread to segfault at exit
*****************************************************************************
@ -151,12 +149,8 @@ static int intf_Open( intf_thread_t *p_intf )
p_intf->p_sys->b_window_changed = 0;
p_intf->p_sys->b_playlist_changed = 0;
p_intf->p_sys->b_menus_update = 1;
p_intf->p_sys->b_slider_free = 1;
p_intf->p_sys->i_playing = -1;
p_intf->p_sys->pf_gtk_callback = NULL;
p_intf->p_sys->pf_gdk_callback = NULL;
@ -204,10 +198,7 @@ static void intf_Run( intf_thread_t *p_intf )
/* Create some useful widgets that will certainly be used */
p_intf->p_sys->p_window = create_intf_window( );
p_intf->p_sys->p_popup = create_intf_popup( );
p_intf->p_sys->p_disc = create_intf_disc( );
p_intf->p_sys->p_network = create_intf_network( );
p_intf->p_sys->p_playlist = create_intf_playlist( );
/* Set the title of the main window */
gtk_window_set_title( GTK_WINDOW(p_intf->p_sys->p_window),
@ -228,20 +219,30 @@ static void intf_Run( intf_thread_t *p_intf )
p_intf->p_sys->p_slider_frame = GTK_FRAME( gtk_object_get_data(
GTK_OBJECT(p_intf->p_sys->p_window ), "slider_frame" ) );
#define P_LABEL( name ) GTK_LABEL( gtk_object_get_data( \
GTK_OBJECT( p_intf->p_sys->p_window ), name ) )
p_intf->p_sys->p_label_title = P_LABEL( "title_label" );
p_intf->p_sys->p_label_chapter = P_LABEL( "chapter_label" );
#undef P_LABEL
/* Connect the date display to the slider */
#define P_SLIDER GTK_RANGE( gtk_object_get_data( \
#define P_SLIDER GTK_RANGE( gtk_object_get_data( \
GTK_OBJECT( p_intf->p_sys->p_window ), "slider" ) )
p_intf->p_sys->p_adj = gtk_range_get_adjustment( P_SLIDER );
gtk_signal_connect ( GTK_OBJECT( p_intf->p_sys->p_adj ), "value_changed",
GTK_SIGNAL_FUNC( GtkDisplayDate ), NULL );
p_intf->p_sys->f_adj_oldvalue = 0;
#undef P_SLIDER
#undef P_SLIDER
/* We don't create these ones yet because we perhaps won't need them */
p_intf->p_sys->p_about = NULL;
p_intf->p_sys->p_modules = NULL;
p_intf->p_sys->p_fileopen = NULL;
p_intf->p_sys->p_disc = NULL;
p_intf->p_sys->p_network = NULL;
p_intf->p_sys->p_preferences = NULL;
p_intf->p_sys->p_jump = NULL;
/* Store p_intf to keep an eye on it */
gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_window),
@ -253,12 +254,6 @@ static void intf_Run( intf_thread_t *p_intf )
gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_playlist),
"p_intf", p_intf );
gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_disc),
"p_intf", p_intf );
gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_network),
"p_intf", p_intf );
gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_adj),
"p_intf", p_intf );
@ -300,8 +295,6 @@ static gint GtkManage( gpointer p_data )
{
#define p_intf ((intf_thread_t *)p_data)
GtkPlayListManage( p_data );
vlc_mutex_lock( &p_intf->change_lock );
/* If the "display popup" flag has changed */
@ -318,122 +311,53 @@ static gint GtkManage( gpointer p_data )
p_intf->b_menu_change = 0;
}
if( p_intf->p_input != NULL )
/* update the playlist */
GtkPlayListManage( p_data );
if( p_intf->p_input != NULL && !p_intf->b_die )
{
/* Used by TS input when PMT changes */
/* New input or stream map change */
if( p_intf->p_input->stream.b_changed )
{
p_intf->p_sys->b_menus_update = 1;
p_intf->p_input->stream.b_changed = 0;
intf_WarnMsg( 3,
"Interface menus refreshed as stream has changed" );
GtkModeManage( p_intf );
}
}
/* Update language/chapter menus after user request */
if( p_intf->p_input != NULL && p_intf->p_sys->p_window != NULL &&
p_intf->p_sys->b_menus_update )
{
es_descriptor_t * p_audio_es;
es_descriptor_t * p_spu_es;
GtkWidget * p_menubar_menu;
GtkWidget * p_popup_menu;
gint i;
GtkSetupMenu( p_intf );
p_menubar_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "menubar_title" ) );
GtkTitleMenu( p_intf, p_menubar_menu, on_menubar_title_activate );
p_menubar_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "menubar_chapter" ) );
GtkChapterMenu( p_intf, p_menubar_menu, on_menubar_chapter_activate );
p_popup_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_popup ), "popup_navigation" ) );
GtkTitleMenu( p_intf, p_popup_menu, on_popup_navigation_activate );
/* look for selected ES */
p_audio_es = NULL;
p_spu_es = NULL;
for( i = 0 ; i < p_intf->p_input->stream.i_selected_es_number ; i++ )
/* Manage the slider */
if( p_intf->p_input->stream.b_seekable )
{
if( p_intf->p_input->stream.pp_es[i]->i_cat == AUDIO_ES )
{
p_audio_es = p_intf->p_input->stream.pp_es[i];
}
float newvalue = p_intf->p_sys->p_adj->value;
if( p_intf->p_input->stream.pp_es[i]->i_cat == SPU_ES )
{
p_spu_es = p_intf->p_input->stream.pp_es[i];
}
}
/* audio menus */
/* find audio root menu */
p_menubar_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "menubar_audio" ) );
p_popup_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_popup ), "popup_audio" ) );
GtkLanguageMenus( p_intf, p_menubar_menu, p_audio_es, AUDIO_ES,
on_menubar_audio_activate );
GtkLanguageMenus( p_intf, p_popup_menu, p_audio_es, AUDIO_ES,
on_popup_audio_activate );
/* sub picture menus */
/* find spu root menu */
p_menubar_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "menubar_subpictures" ) );
p_popup_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_popup ), "popup_subpictures" ) );
GtkLanguageMenus( p_intf, p_menubar_menu, p_spu_es, SPU_ES,
on_menubar_subpictures_activate );
GtkLanguageMenus( p_intf, p_popup_menu, p_spu_es, SPU_ES,
on_popup_subpictures_activate );
/* everything is ready */
p_intf->p_sys->b_menus_update = 0;
}
/* Manage the slider */
if( p_intf->p_input != NULL && p_intf->p_input->stream.b_seekable )
{
float newvalue = p_intf->p_sys->p_adj->value;
#define p_area p_intf->p_input->stream.p_selected_area
/* If the user hasn't touched the slider since the last time,
* then the input can safely change it */
if( newvalue == p_intf->p_sys->f_adj_oldvalue )
{
/* Update the value */
p_intf->p_sys->p_adj->value = p_intf->p_sys->f_adj_oldvalue =
( 100. * p_area->i_tell ) / p_area->i_size;
gtk_signal_emit_by_name( GTK_OBJECT( p_intf->p_sys->p_adj ),
"value_changed" );
}
/* Otherwise, send message to the input if the user has
* finished dragging the slider */
else if( p_intf->p_sys->b_slider_free )
{
off_t i_seek = ( newvalue * p_area->i_size ) / 100;
input_Seek( p_intf->p_input, i_seek );
/* Update the old value */
p_intf->p_sys->f_adj_oldvalue = newvalue;
}
/* If the user hasn't touched the slider since the last time,
* then the input can safely change it */
if( newvalue == p_intf->p_sys->f_adj_oldvalue )
{
/* Update the value */
p_intf->p_sys->p_adj->value = p_intf->p_sys->f_adj_oldvalue =
( 100. * p_area->i_tell ) / p_area->i_size;
gtk_signal_emit_by_name( GTK_OBJECT( p_intf->p_sys->p_adj ),
"value_changed" );
}
/* Otherwise, send message to the input if the user has
* finished dragging the slider */
else if( p_intf->p_sys->b_slider_free )
{
off_t i_seek = ( newvalue * p_area->i_size ) / 100;
input_Seek( p_intf->p_input, i_seek );
/* Update the old value */
p_intf->p_sys->f_adj_oldvalue = newvalue;
}
#undef p_area
}
}
else if( !p_intf->b_die )
{
GtkModeManage( p_intf );
}
/* Manage core vlc functions through the callback */
@ -458,294 +382,15 @@ static gint GtkManage( gpointer p_data )
}
/*****************************************************************************
* GtkMenuRadioItem: give a menu item adapted to language/title selection,
* ie the menu item is a radio button.
*****************************************************************************/
static GtkWidget * GtkMenuRadioItem( GtkWidget * p_menu,
GSList ** p_button_group,
gint b_active,
char * psz_name )
{
GtkWidget * p_item;
#if 0
GtkWidget * p_button;
/* create button */
p_button =
gtk_radio_button_new_with_label( *p_button_group, psz_name );
/* add button to group */
*p_button_group =
gtk_radio_button_group( GTK_RADIO_BUTTON( p_button ) );
/* prepare button for display */
gtk_widget_show( p_button );
/* create menu item to store button */
p_item = gtk_menu_item_new();
/* put button inside item */
gtk_container_add( GTK_CONTAINER( p_item ), p_button );
/* add item to menu */
gtk_menu_append( GTK_MENU( p_menu ), p_item );
gtk_signal_connect( GTK_OBJECT( p_item ), "activate",
GTK_SIGNAL_FUNC( on_audio_toggle ),
NULL );
/* prepare item for display */
gtk_widget_show( p_item );
/* is it the selected item ? */
if( b_active )
{
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( p_button ), TRUE );
}
#else
p_item = gtk_menu_item_new_with_label( psz_name );
gtk_menu_append( GTK_MENU( p_menu ), p_item );
gtk_widget_show( p_item );
#endif
return p_item;
}
/*****************************************************************************
* GtkLanguageMenus: update interactive menus of the interface
* GtkDisplayDate: display stream date
*****************************************************************************
* Sets up menus with information from input:
* -languages
* -sub-pictures
* Warning: since this function is designed to be called by management
* function, the interface lock has to be taken
* This function displays the current date related to the position in
* the stream. It is called whenever the slider changes its value.
*****************************************************************************/
static gint GtkLanguageMenus( gpointer p_data,
GtkWidget * p_root,
es_descriptor_t * p_es,
gint i_cat,
void(*pf_activate )( GtkMenuItem *, gpointer ) )
{
intf_thread_t * p_intf;
GtkWidget * p_menu;
GtkWidget * p_separator;
GtkWidget * p_item;
GSList * p_button_group;
char * psz_name;
gint b_active;
gint i;
/* cast */
p_intf = (intf_thread_t *)p_data;
vlc_mutex_lock( &p_intf->p_input->stream.stream_lock );
p_button_group = NULL;
/* menu container for audio */
p_menu = gtk_menu_new();
/* create a set of language buttons and append them to the container */
b_active = ( p_es == NULL );
psz_name = "Off";
p_item = GtkMenuRadioItem( p_menu, &p_button_group, b_active, psz_name );
/* setup signal hanling */
gtk_signal_connect( GTK_OBJECT( p_item ), "activate",
GTK_SIGNAL_FUNC ( pf_activate ), NULL );
p_separator = gtk_menu_item_new();
gtk_widget_show( p_separator );
gtk_menu_append( GTK_MENU( p_menu ), p_separator );
gtk_widget_set_sensitive( p_separator, FALSE );
for( i = 0 ; i < p_intf->p_input->stream.i_es_number ; i++ )
{
if( p_intf->p_input->stream.pp_es[i]->i_cat == i_cat )
{
b_active = ( p_es == p_intf->p_input->stream.pp_es[i] ) ? 1 : 0;
psz_name = p_intf->p_input->stream.pp_es[i]->psz_desc;
p_item = GtkMenuRadioItem( p_menu, &p_button_group,
b_active, psz_name );
/* setup signal hanling */
gtk_signal_connect( GTK_OBJECT( p_item ), "activate",
GTK_SIGNAL_FUNC( pf_activate ),
(gpointer)( p_intf->p_input->stream.pp_es[i] ) );
}
}
/* link the new menu to the menubar item */
gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_root ), p_menu );
/* be sure that menu is sensitive */
gtk_widget_set_sensitive( p_root, TRUE );
vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock );
return TRUE;
}
/*****************************************************************************
* GtkChapterMenu: generate chapter menu for current title
*****************************************************************************/
static gint GtkChapterMenu( gpointer p_data, GtkWidget * p_chapter,
void(*pf_activate )( GtkMenuItem *, gpointer ) )
{
intf_thread_t * p_intf;
char psz_name[ GTK_MENU_LABEL_SIZE ];
GtkWidget * p_chapter_menu;
GtkWidget * p_item;
GSList * p_chapter_button_group;
gint i_title;
gint i_chapter;
gint b_active;
/* cast */
p_intf = (intf_thread_t*)p_data;
i_title = p_intf->p_input->stream.p_selected_area->i_id;
p_chapter_menu = gtk_menu_new();
for( i_chapter = 0;
i_chapter < p_intf->p_input->stream.pp_areas[i_title]->i_part_nb ;
i_chapter++ )
{
b_active = ( p_intf->p_input->stream.pp_areas[i_title]->i_part
== i_chapter + 1 ) ? 1 : 0;
snprintf( psz_name, GTK_MENU_LABEL_SIZE,
"Chapter %d", i_chapter + 1 );
psz_name[ GTK_MENU_LABEL_SIZE - 1 ] = '\0';
p_item = GtkMenuRadioItem( p_chapter_menu, &p_chapter_button_group,
b_active, psz_name );
/* setup signal hanling */
gtk_signal_connect( GTK_OBJECT( p_item ),
"activate",
GTK_SIGNAL_FUNC( pf_activate ),
(gpointer)(i_chapter + 1) );
}
/* link the new menu to the title menu item */
gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_chapter ),
p_chapter_menu );
/* be sure that chapter menu is sensitive */
gtk_widget_set_sensitive( p_chapter, TRUE );
return TRUE;
}
/*****************************************************************************
* GtkTitleMenu: sets menus for titles and chapters selection
*****************************************************************************
* Generates two type of menus:
* -simple list of titles
* -cascaded lists of chapters for each title
*****************************************************************************/
static gint GtkTitleMenu( gpointer p_data,
GtkWidget * p_navigation,
void(*pf_activate )( GtkMenuItem *, gpointer ) )
{
intf_thread_t * p_intf;
char psz_name[ GTK_MENU_LABEL_SIZE ];
GtkWidget * p_title_menu;
GtkWidget * p_title_item;
GtkWidget * p_chapter_menu;
GtkWidget * p_item;
GSList * p_title_button_group;
GSList * p_chapter_button_group;
gint i_title;
gint i_chapter;
gint b_active;
/* cast */
p_intf = (intf_thread_t*)p_data;
p_title_menu = gtk_menu_new();
p_title_button_group = NULL;
p_chapter_button_group = NULL;
/* loop on titles */
for( i_title = 1 ;
i_title < p_intf->p_input->stream.i_area_nb ;
i_title++ )
{
b_active = ( p_intf->p_input->stream.pp_areas[i_title] ==
p_intf->p_input->stream.p_selected_area ) ? 1 : 0;
snprintf( psz_name, GTK_MENU_LABEL_SIZE, "Title %d", i_title );
psz_name[ GTK_MENU_LABEL_SIZE - 1 ] = '\0';
p_title_item = GtkMenuRadioItem( p_title_menu, &p_title_button_group,
b_active, psz_name );
if( pf_activate == on_menubar_title_activate )
{
/* setup signal hanling */
gtk_signal_connect( GTK_OBJECT( p_title_item ),
"activate",
GTK_SIGNAL_FUNC( pf_activate ),
(gpointer)(p_intf->p_input->stream.pp_areas[i_title]) );
}
else
{
p_chapter_menu = gtk_menu_new();
for( i_chapter = 0;
i_chapter <
p_intf->p_input->stream.pp_areas[i_title]->i_part_nb ;
i_chapter++ )
{
b_active = ( p_intf->p_input->stream.pp_areas[i_title]->i_part
== i_chapter + 1 ) ? 1 : 0;
snprintf( psz_name, GTK_MENU_LABEL_SIZE,
"Chapter %d", i_chapter + 1 );
psz_name[ GTK_MENU_LABEL_SIZE - 1 ] = '\0';
p_item = GtkMenuRadioItem( p_chapter_menu,
&p_chapter_button_group,
b_active, psz_name );
/* setup signal hanling */
gtk_signal_connect( GTK_OBJECT( p_item ),
"activate",
GTK_SIGNAL_FUNC( pf_activate ),
(gpointer)( ( i_title * 100 ) + ( i_chapter + 1) ) );
}
/* link the new menu to the title menu item */
gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_title_item ),
p_chapter_menu );
}
/* be sure that chapter menu is sensitive */
gtk_widget_set_sensitive( p_title_menu, TRUE );
}
/* link the new menu to the menubar audio item */
gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_navigation ), p_title_menu );
/* be sure that audio menu is sensitive */
gtk_widget_set_sensitive( p_navigation, TRUE );
return TRUE;
}
void GtkDisplayDate( GtkAdjustment *p_adj )
{
intf_thread_t *p_intf;
p_intf = gtk_object_get_data( GTK_OBJECT( p_adj ), "p_intf" );
if( p_intf->p_input != NULL )
@ -755,7 +400,7 @@ void GtkDisplayDate( GtkAdjustment *p_adj )
vlc_mutex_lock( &p_intf->p_input->stream.stream_lock );
gtk_frame_set_label( p_intf->p_sys->p_slider_frame,
gtk_frame_set_label( GTK_FRAME( p_intf->p_sys->p_slider_frame ),
input_OffsetToTime( p_intf->p_input, psz_time,
( p_area->i_size * p_adj->value ) / 100 ) );
@ -765,3 +410,111 @@ void GtkDisplayDate( GtkAdjustment *p_adj )
}
/*****************************************************************************
* GtkModeManage
*****************************************************************************/
static gint GtkModeManage( intf_thread_t * p_intf )
{
GtkWidget * p_dvd_box;
GtkWidget * p_file_box;
GtkWidget * p_network_box;
GtkWidget * p_slider;
GtkWidget * p_label;
boolean_t b_control;
#define GETWIDGET( ptr, name ) GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( \
p_intf->p_sys->ptr ) , ( name ) ) )
/* hide all boxes except default file box */
p_file_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "file_box" ) );
gtk_widget_hide( GTK_WIDGET( p_file_box ) );
p_network_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "network_box" ) );
gtk_widget_hide( GTK_WIDGET( p_network_box ) );
p_dvd_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "dvd_box" ) );
gtk_widget_hide( GTK_WIDGET( p_dvd_box ) );
/* hide slider */
p_slider = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "slider_frame" ) );
gtk_widget_hide( GTK_WIDGET( p_slider ) );
/* controls unavailable */
b_control = 0;
/* show the box related to current input mode */
if( p_intf->p_input != NULL )
{
switch( p_intf->p_input->stream.i_method & 0xf0 )
{
case INPUT_METHOD_FILE:
gtk_widget_show( GTK_WIDGET( p_file_box ) );
p_label = gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ),
"label_status" );
gtk_label_set_text( GTK_LABEL( p_label ),
p_intf->p_input->p_source );
break;
case INPUT_METHOD_DISC:
gtk_widget_show( GTK_WIDGET( p_dvd_box ) );
break;
case INPUT_METHOD_NETWORK:
gtk_widget_show( GTK_WIDGET( p_network_box ) );
p_label = gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ),
"network_address_label" );
gtk_label_set_text( GTK_LABEL( p_label ),
p_intf->p_input->p_source );
break;
default:
intf_ErrMsg( "intf error: can't determine input method" );
break;
}
/* slider for seekable streams */
if( p_intf->p_input->stream.b_seekable )
{
gtk_widget_show( GTK_WIDGET( p_slider ) );
}
/* control buttons for free pace streams */
b_control = p_intf->p_input->stream.b_pace_control;
/* get ready for menu regeneration */
p_intf->p_sys->b_title_update = 1;
p_intf->p_sys->b_chapter_update = 1;
p_intf->p_sys->b_angle_update = 1;
p_intf->p_sys->b_audio_update = 1;
p_intf->p_sys->b_spu_update = 1;
p_intf->p_sys->i_part = 0;
p_intf->p_input->stream.b_changed = 0;
intf_WarnMsg( 3,
"intf info: menus refreshed as stream has changed" );
}
else
{
p_label = gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_window ),
"label_status" );
gtk_label_set_text( GTK_LABEL( p_label ), "" );
gtk_widget_show( GTK_WIDGET( p_file_box ) );
}
/* 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 );
#undef GETWIDGET
return TRUE;
}

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
* intf_gtk.h: private Gtk+ interface description
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_gtk.h,v 1.3 2001/05/06 18:32:30 stef Exp $
* $Id: intf_gtk.h,v 1.4 2001/05/15 01:01:44 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
@ -32,6 +32,13 @@
*****************************************************************************/
#define GTK_MENU_LABEL_SIZE 64
/*****************************************************************************
* Convert user_data structures to title and chapter information
*****************************************************************************/
#define DATA2TITLE( user_data ) ( (gint)(user_data) >> 16 )
#define DATA2CHAPTER( user_data ) ( (gint)(user_data) & 0xffff )
#define POS2DATA( title, chapter ) ( ((title) << 16) | ((chapter) & 0xffff) )
/*****************************************************************************
* Useful inline function
****************************************************************************/
@ -53,10 +60,13 @@ typedef struct intf_sys_s
boolean_t b_menus_update; /* menus have changed ? */
boolean_t b_slider_free; /* slider status */
int i_list_timeout;
/* Playlist selected item */
int i_playing;
/* menus handlers */
boolean_t b_title_update; /* do we need to update title menus */
boolean_t b_chapter_update; /* do we need to update
chapter menus */
boolean_t b_angle_update; /* do we need to update angle menus */
boolean_t b_audio_update; /* do we need to update audio menus */
boolean_t b_spu_update; /* do we need to update spu menus */
/* windows and widgets */
GtkWidget * p_window; /* main window */
@ -67,15 +77,43 @@ typedef struct intf_sys_s
GtkWidget * p_fileopen; /* file open window */
GtkWidget * p_disc; /* disc selection window */
GtkWidget * p_network; /* network stream window */
GtkWidget * p_preferences; /* preferences window */
GtkWidget * p_jump; /* jump window */
/* The slider */
GtkFrame * p_slider_frame;
GtkAdjustment * p_adj; /* slider adjustment object */
float f_adj_oldvalue; /* previous value */
/* Playlist management */
int i_playing; /* playlist selected item */
/* The window labels for DVD mode */
GtkLabel * p_label_title;
GtkLabel * p_label_chapter;
gint i_part; /* current chapter */
/* XXX: Ugly kludge, see intf_gnome.c */
void ( *pf_gtk_callback ) ( void );
void ( *pf_gdk_callback ) ( void );
} intf_sys_t;
/****************************************************************************
* Prototypes
****************************************************************************/
/*
* from gtk_menu.c
*/
gint GtkSetupMenu( intf_thread_t * );
/*
* from gtk_playlist.c
*/
void GtkDropDataReceived ( intf_thread_t *, GtkSelectionData *,
guint, int );
int GtkAppendList ( playlist_t *, int, GList * );
void GtkRebuildCList ( GtkCList *, playlist_t * );
void GtkPlayListManage ( intf_thread_t * );

View File

@ -2,7 +2,7 @@
* aout_spdif: ac3 passthrough output
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: aout_spdif.c,v 1.4 2001/05/07 03:14:09 stef Exp $
* $Id: aout_spdif.c,v 1.5 2001/05/15 01:01:44 stef Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Stéphane Borel <stef@via.ecp.fr>
@ -98,7 +98,9 @@ void aout_SpdifThread( aout_thread_t * p_aout )
}
else if( !AOUT_FIFO_ISEMPTY( p_aout->fifo[i_fifo] ) )
{
vlc_mutex_unlock( &p_aout->fifo[i_fifo].data_lock );
// vlc_mutex_unlock( &p_aout->fifo[i_fifo].data_lock );
//fprintf(stderr, "delay %lld\n",p_aout->fifo[i_fifo].date[p_aout->fifo[i_fifo].l_start_frame] -mdate() );
/* play spdif frame to the external decoder */
p_aout->pf_play( p_aout,
p_aout->fifo[i_fifo].buffer +

View File

@ -4,7 +4,7 @@
* interface, such as command line.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: interface.c,v 1.77 2001/05/07 03:14:09 stef Exp $
* $Id: interface.c,v 1.78 2001/05/15 01:01:44 stef Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
@ -154,20 +154,37 @@ static void intf_Manage( intf_thread_t *p_intf )
/* If no stream is being played, try to find one */
if( p_intf->p_input == NULL && !p_intf->b_die )
{
/* Select the next playlist item */
intf_PlaylistNext( p_main->p_playlist );
if( p_main->p_playlist->i_index == -1 )
if( !p_main->p_playlist->b_stopped )
{
/* FIXME: wait for user to add stuff to playlist ? */
#if 0
p_intf->b_die = 1;
#endif
/* Select the next playlist item */
intf_PlaylistNext( p_main->p_playlist );
/* don't loop by default: stop at playlist end */
if( p_main->p_playlist->i_index == -1 )
{
p_main->p_playlist->b_stopped = 1;
}
else
{
p_main->p_playlist->b_stopped = 0;
p_intf->p_input =
input_CreateThread( &p_main->p_playlist->current, NULL );
}
}
else
{
p_intf->p_input =
input_CreateThread( &p_main->p_playlist->current, NULL );
/* playing has been stopped: we no longer need outputs */
if( p_aout_bank->i_count )
{
/* FIXME kludge that does not work with several outputs */
aout_DestroyThread( p_aout_bank->pp_aout[0], NULL );
p_aout_bank->i_count--;
}
if( p_vout_bank->i_count )
{
vout_DestroyThread( p_vout_bank->pp_vout[0], NULL );
p_vout_bank->i_count--;
}
}
}
}

View File

@ -2,7 +2,7 @@
* intf_playlist.c : Playlist management functions
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_playlist.c,v 1.4 2001/05/07 03:14:09 stef Exp $
* $Id: intf_playlist.c,v 1.5 2001/05/15 01:01:44 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
@ -77,6 +77,7 @@ void intf_PlaylistInit ( playlist_t * p_playlist )
p_playlist->i_mode = PLAYLIST_FORWARD;
p_playlist->i_seed = 0;
p_playlist->b_stopped = 0;
/* There is no current item */
p_playlist->current.i_type = 0;
@ -246,7 +247,9 @@ void intf_PlaylistDestroy( playlist_t * p_playlist )
}
/*****************************************************************************
* intf_PlaylistJumpto
* intf_PlaylistJumpto: go to a specified position in playlist.
*****************************************************************************
* Note that this function does NOT take the lock
*****************************************************************************/
void intf_PlaylistJumpto( playlist_t * p_playlist , int i_pos)
{
@ -260,10 +263,12 @@ void intf_PlaylistJumpto( playlist_t * p_playlist , int i_pos)
{
free( p_playlist->current.psz_name );
}
p_playlist->current = p_playlist->p_item[ p_playlist->i_index ];
p_playlist->current.psz_name
= strdup( p_playlist->current.psz_name );
}
}
vlc_mutex_unlock( &p_playlist->change_lock );
}