* control the pace of reading.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: input_ext-intf.h,v 1.29 2001/04/01 07:31:38 stef Exp $
+ * $Id: input_ext-intf.h,v 1.30 2001/04/08 07:24:47 stef Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
boolean_t b_audio; /* is the stream an audio stream that
* will need to be discarded with
* fast forward and slow motion ? */
- boolean_t b_spu;
+ u8 i_cat; /* stream category: video, audio,
+ * spu, other */
char psz_desc[20]; /* description of ES: audio language
* for instance ; NULL if not
#define LPCM_AUDIO_ES 0x83
#define UNKNOWN_ES 0xFF
+/* ES Categories */
+#define VIDEO_ES 0x00
+#define AUDIO_ES 0x01
+#define SPU_ES 0x02
+#define NAV_ES 0x03
+#define UNKNOWN_ES 0xFF
/*****************************************************************************
* pgrm_descriptor_t
*****************************************************************************
void input_Seek ( struct input_thread_s *, off_t );
void input_DumpStream( struct input_thread_s * );
char * input_OffsetToTime( struct input_thread_s *, char * psz_buffer, off_t );
-int input_ChangeES ( struct input_thread_s *, struct es_descriptor_s *, int );
+int input_ChangeES ( struct input_thread_s *, struct es_descriptor_s *, u8 );
int input_ToggleES ( struct input_thread_s *,
struct es_descriptor_s *,
boolean_t );
* dvd_ifo.c: Functions for ifo parsing
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: dvd_ifo.c,v 1.16 2001/04/01 07:31:38 stef Exp $
+ * $Id: dvd_ifo.c,v 1.17 2001/04/08 07:24:47 stef Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
{
GETLL( &i_temp );
//fprintf( stderr, "Audio %d: %llx\n", i, i_temp );
- i_temp >>= 32;
+ i_temp >>= 8;
+ manager_inf.p_audio_attr[i].i_bar = i_temp & 0xff;
+ i_temp >>= 8;
+ manager_inf.p_audio_attr[i].i_caption = i_temp & 0xff;
+ i_temp >>= 8;
+ manager_inf.p_audio_attr[i].i_foo = i_temp & 0xff;
+ i_temp >>= 8;
manager_inf.p_audio_attr[i].i_lang_code = i_temp & 0xffff;
i_temp >>= 16;
manager_inf.p_audio_attr[i].i_num_channels = i_temp & 0x7;
- i_temp >>= 4;
+ i_temp >>= 3;
+ manager_inf.p_audio_attr[i].i_test = i_temp & 0x1;
+ i_temp >>= 1;
manager_inf.p_audio_attr[i].i_sample_freq = i_temp & 0x3;
i_temp >>= 2;
manager_inf.p_audio_attr[i].i_quantization = i_temp & 0x3;
* dvd_ifo.h: Structures for ifo parsing
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: dvd_ifo.h,v 1.10 2001/04/04 02:49:18 sam Exp $
+ * $Id: dvd_ifo.h,v 1.11 2001/04/08 07:24:47 stef Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
u8 i_quantization ;// 2;
u8 i_sample_freq ;// 2;
-// u8 ;// 1;
+ u8 i_test ;// 1;
u8 i_num_channels ;// 3;
u16 i_lang_code ;// 16; // <char> description
u8 i_foo ;// 8; // 0x00000000 ?
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: input_dvd.c,v 1.37 2001/04/03 03:39:41 stef Exp $
+ * $Id: input_dvd.c,v 1.38 2001/04/08 07:24:47 stef Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
if( i_cell == cell.i_cell_nb )
{
+ intf_ErrMsg( "dvd error: can't find cell" );
return -1;
}
else
if( DVDFindCell( p_dvd ) < 0 )
{
+ intf_ErrMsg( "dvd error: can't find sector" );
return -1;
}
/* Find cell index in Program chain for current chapter */
p_dvd->i_prg_cell = title.chapter_map.pi_start_cell[i_chapter-1] - 1;
p_dvd->i_cell = 0;
+ p_dvd->i_sector = 0;
/* Search for cell_index in cell adress_table and initialize start sector */
DVDFindSector( p_dvd );
input_AddProgram( p_input, 0, sizeof( stream_ps_data_t ) );
+ /* No PSM to read in DVD mode, we already have all information */
+ p_input->stream.pp_programs[0]->b_is_ok = 1;
+ p_input->stream.pp_programs[0]->i_synchro_state = SYNCHRO_START;
+
p_es = NULL;
/* ES 0 -> video MPEG2 */
p_es = input_AddES( p_input, p_input->stream.pp_programs[0], 0xe0, 0 );
p_es->i_stream_id = 0xe0;
p_es->i_type = MPEG2_VIDEO_ES;
+ p_es->i_cat = VIDEO_ES;
input_SelectES( p_input, p_es );
intf_WarnMsg( 1, "dvd info: video MPEG2 stream" );
{
#ifdef DEBUG
- intf_DbgMsg( "Audio %d: %x %x %x %x %x %x %x %x %x %x %x %x\n", i,
+ intf_WarnMsg( 1, "Audio %d: %x %x %x %x %x %x %x %x %x %x %x %x", i,
vts.manager_inf.p_audio_attr[i-1].i_num_channels,
vts.manager_inf.p_audio_attr[i-1].i_coding_mode,
vts.manager_inf.p_audio_attr[i-1].i_multichannel_extension,
vts.manager_inf.p_audio_attr[i-1].i_type,
vts.manager_inf.p_audio_attr[i-1].i_appl_mode,
vts.manager_inf.p_audio_attr[i-1].i_foo,
+ vts.manager_inf.p_audio_attr[i-1].i_test,
vts.manager_inf.p_audio_attr[i-1].i_bar,
- vts.manager_inf.p_audio_attr[i-1].i_appl_mode,
vts.manager_inf.p_audio_attr[i-1].i_quantization,
vts.manager_inf.p_audio_attr[i-1].i_sample_freq,
vts.manager_inf.p_audio_attr[i-1].i_lang_code,
p_es->i_stream_id = 0xbd;
p_es->i_type = AC3_AUDIO_ES;
p_es->b_audio = 1;
+ p_es->i_cat = AUDIO_ES;
strcpy( p_es->psz_desc, Language( hton16(
vts.manager_inf.p_audio_attr[i-1].i_lang_code ) ) );
+ strcat( p_es->psz_desc, " (ac3)" );
intf_WarnMsg( 1, "dvd info: audio stream %d %s\t(0x%x)",
i, p_es->psz_desc, i_id );
p_es->i_stream_id = i_id;
p_es->i_type = MPEG2_AUDIO_ES;
p_es->b_audio = 1;
+ p_es->i_cat = AUDIO_ES;
strcpy( p_es->psz_desc, Language( hton16(
vts.manager_inf.p_audio_attr[i-1].i_lang_code ) ) );
+ strcat( p_es->psz_desc, " (mpeg)" );
intf_WarnMsg( 1, "dvd info: audio stream %d %s\t(0x%x)",
i, p_es->psz_desc, i_id );
p_input->stream.pp_programs[0], i_id, 0 );
p_es->i_stream_id = 0xbd;
p_es->i_type = DVD_SPU_ES;
- p_es->b_spu = 1;
+ p_es->i_cat = SPU_ES;
strcpy( p_es->psz_desc, Language( hton16(
vts.manager_inf.p_spu_attr[i-1].i_lang_code ) ) );
intf_WarnMsg( 1, "dvd info: spu stream %d %s\t(0x%x)",
main_PutIntVariable( INPUT_CHANNEL_VAR, 1 );
i_audio = 1;
}
- if( i_audio > 0 )
+ if( i_audio > 0 && vts.manager_inf.i_audio_nb > 0 )
{
input_SelectES( p_input, p_input->stream.pp_es[i_audio] );
}
main_PutIntVariable( INPUT_CHANNEL_VAR, 1 );
i_spu = 0;
}
- if( i_spu > 0 )
+ if( i_spu > 0 && vts.manager_inf.i_spu_nb > 0 )
{
i_spu += vts.manager_inf.i_audio_nb;
input_SelectES( p_input, p_input->stream.pp_es[i_spu] );
p_area->i_part, p_area->i_tell );
}
- /* No PSM to read in DVD mode, we already have all information */
- p_input->stream.pp_programs[0]->b_is_ok = 1;
- p_input->stream.pp_programs[0]->i_synchro_state = SYNCHRO_START;
-
vlc_mutex_unlock( &p_input->stream.stream_lock );
#undef vts
#undef vmg
* gnome_callbacks.c : Callbacks for the Gnome plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: gnome_callbacks.c,v 1.20 2001/04/03 03:39:41 stef Exp $
+ * $Id: gnome_callbacks.c,v 1.21 2001/04/08 07:24:47 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
}
+void
+on_button_title_prev_clicked (GtkButton *button,
+ gpointer user_data)
+{
+ intf_thread_t * p_intf;
+ input_area_t * p_area;
+ int i_id;
+
+ p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
+ i_id = p_intf->p_input->stream.p_selected_area->i_id - 1;
+
+ if( i_id >= 0 )
+ {
+ p_area = p_intf->p_input->stream.pp_areas[i_id];
+ p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
+ p_intf->p_sys->b_menus_update = 1;
+
+ input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
+
+ p_intf->p_sys->b_menus_update = 1;
+ }
+}
+
+
+void
+on_button_title_next_clicked (GtkButton *button,
+ gpointer user_data)
+{
+ intf_thread_t * p_intf;
+ input_area_t * p_area;
+ int i_id;
+
+ p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
+ i_id = p_intf->p_input->stream.p_selected_area->i_id + 1;
+
+ if( i_id < p_intf->p_input->stream.i_area_nb )
+ {
+ p_area = p_intf->p_input->stream.pp_areas[i_id];
+ p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
+ p_intf->p_sys->b_menus_update = 1;
+
+ input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
+
+ p_intf->p_sys->b_menus_update = 1;
+ }
+}
+
+
void
on_button_chapter_prev_clicked (GtkButton *button,
gpointer user_data)
p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
p_area = p_intf->p_input->stream.p_selected_area;
- if( p_area->i_part - 1 >= 0 )
+ if( p_area->i_part > 0 )
{
p_area->i_part--;
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 );
+
+ p_intf->p_sys->b_menus_update = 1;
}
}
p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
p_area = p_intf->p_input->stream.p_selected_area;
- if( p_area->i_part + 1 < p_area->i_part_nb )
+ if( p_area->i_part < p_area->i_part_nb )
{
p_area->i_part++;
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 );
+
+ p_intf->p_sys->b_menus_update = 1;
}
}
on_menubar_audio_toggle (GtkCheckMenuItem *menuitem,
gpointer user_data)
{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
+ intf_thread_t * p_intf;
es_descriptor_t * p_es;
- p_es = (es_descriptor_t*)user_data;
-
- if( p_intf->p_sys->b_menus_ready )
+ if( !p_intf->p_sys->b_menus_update )
{
+ p_es = (es_descriptor_t*)user_data;
+
input_ToggleES( p_intf->p_input, p_es, menuitem->active );
}
}
on_menubar_subtitle_toggle (GtkCheckMenuItem *menuitem,
gpointer user_data)
{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
+ intf_thread_t * p_intf;
es_descriptor_t * p_es;
- p_es = (es_descriptor_t*)user_data;
+ p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
- if( p_intf->p_sys->b_menus_ready )
+ if( !p_intf->p_sys->b_menus_update )
{
+ p_es = (es_descriptor_t*)user_data;
+
input_ToggleES( p_intf->p_input, p_es, menuitem->active );
}
}
on_menubar_title_toggle (GtkCheckMenuItem *menuitem,
gpointer user_data)
{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
+ intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
- if( menuitem->active && p_intf->p_sys->b_menus_ready )
+ if( menuitem->active && !p_intf->p_sys->b_menus_update )
{
p_intf->p_input->pf_set_area( p_intf->p_input,
(input_area_t*)user_data );
- p_intf->p_sys->b_menus_update = 1;
+
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
+
+ p_intf->p_sys->b_menus_update = 1;
}
}
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
input_area_t * p_area = p_intf->p_input->stream.p_selected_area;
gint i_chapter = (gint)user_data;
+ char psz_chapter[3];
- if( menuitem->active && p_intf->p_sys->b_menus_ready )
+ if( menuitem->active && !p_intf->p_sys->b_menus_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_menus_update = 1;
}
- input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
}
void
intf_PlaylistPrev( p_main->p_playlist );
p_intf->p_input->b_eof = 1;
}
+
+ p_intf->p_sys->b_mode_changed = 1;
}
/* FIXME: temporary hack */
p_intf->p_input->b_eof = 1;
}
-}
-
-
-void
-on_toolbar_prev_title_clicked (GtkButton *button,
- gpointer user_data)
-{
- intf_thread_t * p_intf;
- input_area_t * p_area;
- int i_id;
-
- p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
- i_id = p_intf->p_input->stream.p_selected_area->i_id - 1;
-
- if( i_id >= 0 )
- {
- p_area = p_intf->p_input->stream.pp_areas[i_id];
- p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
- p_intf->p_sys->b_menus_update = 1;
- input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
- }
-}
-
-
-void
-on_toolbar_next_title_clicked (GtkButton *button,
- gpointer user_data)
-{
- intf_thread_t * p_intf;
- input_area_t * p_area;
- int i_id;
-
- p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
- i_id = p_intf->p_input->stream.p_selected_area->i_id + 1;
- if( i_id < p_intf->p_input->stream.i_area_nb )
- {
- p_area = p_intf->p_input->stream.pp_areas[i_id];
- p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
- p_intf->p_sys->b_menus_update = 1;
- input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
- }
+ p_intf->p_sys->b_mode_changed = 1;
}
p_es = (es_descriptor_t*)user_data;
- if( p_intf->p_sys->b_menus_ready )
+ if( !p_intf->p_sys->b_menus_update )
{
input_ToggleES( p_intf->p_input, p_es, menuitem->active );
}
p_es = (es_descriptor_t*)user_data;
- if( p_intf->p_sys->b_menus_ready )
+ if( !p_intf->p_sys->b_menus_update )
{
input_ToggleES( p_intf->p_input, p_es, menuitem->active );
}
{
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
- if( menuitem->active && p_intf->p_sys->b_menus_ready )
+ if( menuitem->active && !p_intf->p_sys->b_menus_update )
{
input_area_t * p_area;
gint i_title;
i_title = (gint)(user_data) / 100;
i_chapter = (gint)(user_data) - ( 100 * i_title );
- if( i_title != p_intf->p_input->stream.p_selected_area->i_id )
- {
- p_intf->p_sys->b_menus_update = 1;
- }
-
p_area = p_intf->p_input->stream.pp_areas[i_title];
p_area->i_part = i_chapter;
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 );
+
+ p_intf->p_sys->b_menus_update = 1;
}
}
on_fileopen_ok_clicked (GtkButton *button,
gpointer user_data)
{
+ intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_fileopen" );
+
GtkWidget *filesel;
gchar *filename;
filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION (filesel));
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, (char*)filename );
+
+ /* Select added item and switch to file interface */
+ intf_PlaylistJumpto( p_main->p_playlist, p_main->p_playlist->i_size-2 );
+ if( p_intf->p_input != NULL )
+ p_intf->p_input->b_eof = 1;
+ p_intf->p_sys->i_intf_mode = FILE_MODE;
+ p_intf->p_sys->b_mode_changed = 1;
}
{
psz_method = "dvd";
p_intf->p_sys->i_intf_mode = DVD_MODE;
- p_intf->p_sys->b_mode_changed = 1;
}
else if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button),
"disc_vcd" ) )->active )
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, psz_source );
free( psz_source );
+ /* Select added item and switch to DVD interface */
+ intf_PlaylistJumpto( p_main->p_playlist, p_main->p_playlist->i_size-2 );
+ if( p_intf->p_input != NULL )
+ p_intf->p_input->b_eof = 1;
+ p_intf->p_sys->b_mode_changed = 1;
+
gtk_widget_hide( p_intf->p_sys->p_disc );
}
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, psz_source );
free( psz_source );
+ /* Select added item and switch to network interface */
+ intf_PlaylistJumpto( p_main->p_playlist, p_main->p_playlist->i_size-2 );
+ if( p_intf->p_input != NULL )
+ p_intf->p_input->b_eof = 1;
+ p_intf->p_sys->b_mode_changed = 1;
+ p_intf->p_sys->i_intf_mode = NET_MODE;
+
gtk_widget_hide( p_intf->p_sys->p_network );
}
* gnome_callbacks.h : Callbacks for the Gnome plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: gnome_callbacks.h,v 1.13 2001/04/03 03:39:41 stef Exp $
+ * $Id: gnome_callbacks.h,v 1.14 2001/04/08 07:24:47 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
on_toolbar_next_clicked (GtkButton *button,
gpointer user_data);
-void
-on_toolbar_prev_title_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_toolbar_next_title_clicked (GtkButton *button,
- gpointer user_data);
-
void
on_popup_play_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_button_chapter_next_clicked (GtkButton *button,
gpointer user_data);
+
+void
+on_button_title_prev_clicked (GtkButton *button,
+ gpointer user_data);
+
+void
+on_button_title_next_clicked (GtkButton *button,
+ gpointer user_data);
GtkWidget *label_status;
GtkWidget *label_bar;
GtkWidget *slider;
+ GtkWidget *file_box;
+ GtkWidget *label_file;
GtkWidget *dvd_box;
+ GtkWidget *title_chapter_box;
+ GtkWidget *label19;
GtkWidget *label_title;
- GtkWidget *hbox6;
- GtkWidget *button_chapter_prev;
+ GtkWidget *button_title_prev;
+ GtkWidget *button_title_next;
+ GtkWidget *dvd_chapter_box;
+ GtkWidget *label20;
GtkWidget *label_chapter;
+ GtkWidget *button_chapter_prev;
GtkWidget *button_chapter_next;
+ GtkWidget *network_box;
+ GtkWidget *label_network;
+ GtkWidget *button_network_channel_1;
+ GtkWidget *button_network_channel_2;
+ GtkWidget *button_network_channel_3;
+ GtkWidget *button_network_channel_4;
+ GtkWidget *button_network_channel_5;
+ GtkWidget *button_network_channel_6;
GtkWidget *appbar;
GtkTooltips *tooltips;
gtk_scale_set_draw_value (GTK_SCALE (slider), FALSE);
gtk_scale_set_digits (GTK_SCALE (slider), 3);
+ file_box = gtk_hbox_new (FALSE, 0);
+ gtk_widget_ref (file_box);
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "file_box", file_box,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (file_box);
+ gtk_box_pack_start (GTK_BOX (vbox2), file_box, TRUE, TRUE, 0);
+
+ label_file = gtk_label_new (_("Vlc File Mode"));
+ gtk_widget_ref (label_file);
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "label_file", label_file,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (label_file);
+ gtk_box_pack_start (GTK_BOX (file_box), label_file, TRUE, TRUE, 0);
+ gtk_widget_set_usize (label_file, -2, 24);
+
dvd_box = gtk_hbox_new (FALSE, 0);
gtk_widget_ref (dvd_box);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "dvd_box", dvd_box,
(GtkDestroyNotify) gtk_widget_unref);
gtk_box_pack_start (GTK_BOX (vbox2), dvd_box, TRUE, TRUE, 0);
+ gtk_widget_set_usize (dvd_box, -2, 24);
- label_title = gtk_label_new (_("Title:"));
+ title_chapter_box = gtk_hbox_new (FALSE, 10);
+ gtk_widget_ref (title_chapter_box);
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "title_chapter_box", title_chapter_box,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (title_chapter_box);
+ gtk_box_pack_start (GTK_BOX (dvd_box), title_chapter_box, TRUE, FALSE, 0);
+
+ label19 = gtk_label_new (_("Title:"));
+ gtk_widget_ref (label19);
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "label19", label19,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (label19);
+ gtk_box_pack_start (GTK_BOX (title_chapter_box), label19, FALSE, FALSE, 0);
+
+ label_title = gtk_label_new (_("--"));
gtk_widget_ref (label_title);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "label_title", label_title,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label_title);
- gtk_box_pack_start (GTK_BOX (dvd_box), label_title, TRUE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (title_chapter_box), label_title, FALSE, FALSE, 0);
+
+ button_title_prev = gnome_stock_button (GNOME_STOCK_BUTTON_PREV);
+ gtk_widget_ref (button_title_prev);
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "button_title_prev", button_title_prev,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (button_title_prev);
+ gtk_box_pack_start (GTK_BOX (title_chapter_box), button_title_prev, FALSE, FALSE, 0);
+ gtk_tooltips_set_tip (tooltips, button_title_prev, _("Select previous title"), NULL);
+ gtk_button_set_relief (GTK_BUTTON (button_title_prev), GTK_RELIEF_NONE);
+
+ button_title_next = gnome_stock_button (GNOME_STOCK_BUTTON_NEXT);
+ gtk_widget_ref (button_title_next);
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "button_title_next", button_title_next,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (button_title_next);
+ gtk_box_pack_start (GTK_BOX (title_chapter_box), button_title_next, FALSE, FALSE, 0);
+ gtk_button_set_relief (GTK_BUTTON (button_title_next), GTK_RELIEF_NONE);
- hbox6 = gtk_hbox_new (FALSE, 10);
- gtk_widget_ref (hbox6);
- gtk_object_set_data_full (GTK_OBJECT (intf_window), "hbox6", hbox6,
+ dvd_chapter_box = gtk_hbox_new (FALSE, 10);
+ gtk_widget_ref (dvd_chapter_box);
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "dvd_chapter_box", dvd_chapter_box,
(GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (hbox6);
- gtk_box_pack_start (GTK_BOX (dvd_box), hbox6, TRUE, FALSE, 0);
+ gtk_widget_show (dvd_chapter_box);
+ gtk_box_pack_start (GTK_BOX (dvd_box), dvd_chapter_box, TRUE, FALSE, 0);
+
+ label20 = gtk_label_new (_("Chapter:"));
+ gtk_widget_ref (label20);
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "label20", label20,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (label20);
+ gtk_box_pack_start (GTK_BOX (dvd_chapter_box), label20, FALSE, FALSE, 0);
+
+ label_chapter = gtk_label_new (_("--"));
+ gtk_widget_ref (label_chapter);
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "label_chapter", label_chapter,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (label_chapter);
+ gtk_box_pack_start (GTK_BOX (dvd_chapter_box), label_chapter, FALSE, FALSE, 0);
button_chapter_prev = gnome_stock_button (GNOME_STOCK_BUTTON_PREV);
gtk_widget_ref (button_chapter_prev);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "button_chapter_prev", button_chapter_prev,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (button_chapter_prev);
- gtk_box_pack_start (GTK_BOX (hbox6), button_chapter_prev, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (dvd_chapter_box), button_chapter_prev, FALSE, FALSE, 0);
gtk_tooltips_set_tip (tooltips, button_chapter_prev, _("Select previous chapter"), NULL);
gtk_button_set_relief (GTK_BUTTON (button_chapter_prev), GTK_RELIEF_NONE);
- label_chapter = gtk_label_new (_("Chapter: "));
- gtk_widget_ref (label_chapter);
- gtk_object_set_data_full (GTK_OBJECT (intf_window), "label_chapter", label_chapter,
- (GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (label_chapter);
- gtk_box_pack_start (GTK_BOX (hbox6), label_chapter, FALSE, FALSE, 0);
-
button_chapter_next = gnome_stock_button (GNOME_STOCK_BUTTON_NEXT);
gtk_widget_ref (button_chapter_next);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "button_chapter_next", button_chapter_next,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (button_chapter_next);
- gtk_box_pack_start (GTK_BOX (hbox6), button_chapter_next, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (dvd_chapter_box), button_chapter_next, FALSE, FALSE, 0);
gtk_tooltips_set_tip (tooltips, button_chapter_next, _("Select next chapter"), NULL);
gtk_button_set_relief (GTK_BUTTON (button_chapter_next), GTK_RELIEF_NONE);
+ network_box = gtk_hbox_new (FALSE, 0);
+ gtk_widget_ref (network_box);
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "network_box", network_box,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_box_pack_start (GTK_BOX (vbox2), network_box, TRUE, TRUE, 0);
+ gtk_widget_set_usize (network_box, -2, 24);
+
+ label_network = gtk_label_new (_("Network Channel:"));
+ gtk_widget_ref (label_network);
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "label_network", label_network,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (label_network);
+ gtk_box_pack_start (GTK_BOX (network_box), label_network, TRUE, FALSE, 0);
+
+ button_network_channel_1 = gtk_toggle_button_new_with_label (_("Channel 1"));
+ gtk_widget_ref (button_network_channel_1);
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "button_network_channel_1", button_network_channel_1,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (button_network_channel_1);
+ gtk_box_pack_start (GTK_BOX (network_box), button_network_channel_1, FALSE, TRUE, 2);
+ gtk_button_set_relief (GTK_BUTTON (button_network_channel_1), GTK_RELIEF_HALF);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button_network_channel_1), TRUE);
+
+ button_network_channel_2 = gtk_toggle_button_new_with_label (_("Channel 2"));
+ gtk_widget_ref (button_network_channel_2);
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "button_network_channel_2", button_network_channel_2,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (button_network_channel_2);
+ gtk_box_pack_start (GTK_BOX (network_box), button_network_channel_2, FALSE, TRUE, 2);
+ gtk_widget_set_sensitive (button_network_channel_2, FALSE);
+ gtk_button_set_relief (GTK_BUTTON (button_network_channel_2), GTK_RELIEF_HALF);
+
+ button_network_channel_3 = gtk_toggle_button_new_with_label (_("Channel 3"));
+ gtk_widget_ref (button_network_channel_3);
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "button_network_channel_3", button_network_channel_3,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (button_network_channel_3);
+ gtk_box_pack_start (GTK_BOX (network_box), button_network_channel_3, FALSE, TRUE, 2);
+ gtk_widget_set_sensitive (button_network_channel_3, FALSE);
+ gtk_button_set_relief (GTK_BUTTON (button_network_channel_3), GTK_RELIEF_HALF);
+
+ button_network_channel_4 = gtk_toggle_button_new_with_label (_("Channel 4"));
+ gtk_widget_ref (button_network_channel_4);
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "button_network_channel_4", button_network_channel_4,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (button_network_channel_4);
+ gtk_box_pack_start (GTK_BOX (network_box), button_network_channel_4, FALSE, TRUE, 2);
+ gtk_widget_set_sensitive (button_network_channel_4, FALSE);
+ gtk_button_set_relief (GTK_BUTTON (button_network_channel_4), GTK_RELIEF_HALF);
+
+ button_network_channel_5 = gtk_toggle_button_new_with_label (_("Channel 5"));
+ gtk_widget_ref (button_network_channel_5);
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "button_network_channel_5", button_network_channel_5,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (button_network_channel_5);
+ gtk_box_pack_start (GTK_BOX (network_box), button_network_channel_5, FALSE, TRUE, 2);
+ gtk_widget_set_sensitive (button_network_channel_5, FALSE);
+ gtk_button_set_relief (GTK_BUTTON (button_network_channel_5), GTK_RELIEF_HALF);
+
+ button_network_channel_6 = gtk_toggle_button_new_with_label (_("Channel 6"));
+ gtk_widget_ref (button_network_channel_6);
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "button_network_channel_6", button_network_channel_6,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (button_network_channel_6);
+ gtk_box_pack_start (GTK_BOX (network_box), button_network_channel_6, FALSE, TRUE, 2);
+ gtk_widget_set_sensitive (button_network_channel_6, FALSE);
+ gtk_button_set_relief (GTK_BUTTON (button_network_channel_6), GTK_RELIEF_HALF);
+
appbar = gnome_appbar_new (TRUE, TRUE, GNOME_PREFERENCES_NEVER);
gtk_widget_ref (appbar);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "appbar", appbar,
gtk_signal_connect (GTK_OBJECT (slider), "button_release_event",
GTK_SIGNAL_FUNC (on_slider_button_release_event),
NULL);
+ gtk_signal_connect (GTK_OBJECT (button_title_prev), "clicked",
+ GTK_SIGNAL_FUNC (on_button_title_prev_clicked),
+ NULL);
+ gtk_signal_connect (GTK_OBJECT (button_title_next), "clicked",
+ GTK_SIGNAL_FUNC (on_button_title_next_clicked),
+ NULL);
gtk_signal_connect (GTK_OBJECT (button_chapter_prev), "clicked",
GTK_SIGNAL_FUNC (on_button_chapter_prev_clicked),
NULL);
* intf_gnome.c: Gnome interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: intf_gnome.c,v 1.25 2001/04/03 03:39:41 stef Exp $
+ * $Id: intf_gnome.c,v 1.26 2001/04/08 07:24:47 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
static gint GnomeSetupMenu ( intf_thread_t * p_intf );
static void GnomeDisplayDate ( GtkAdjustment *p_adj );
static gint GnomeDVDModeManage( intf_thread_t * p_intf );
+static gint GnomeFileModeManage( intf_thread_t * p_intf );
+static gint GnomeNetworkModeManage( intf_thread_t * p_intf );
/*****************************************************************************
* g_atexit: kludge to avoid the Gnome thread to segfault at exit
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_menus_ready = 0;
p_intf->p_sys->b_slider_free = 1;
- p_intf->p_sys->b_mode_changed = 0;
+ p_intf->p_sys->b_mode_changed = 1;
p_intf->p_sys->i_intf_mode = FILE_MODE;
+ p_intf->p_sys->i_part = 0;
+
p_intf->p_sys->pf_gtk_callback = NULL;
p_intf->p_sys->pf_gdk_callback = NULL;
p_intf->p_sys->p_disc = create_intf_disc( );
p_intf->p_sys->p_network = create_intf_network( );
- /* Sets the interface mode according to playlist item */
- if( p_main->p_playlist->p_item != NULL )
- {
- if( !strncmp( p_main->p_playlist->p_item->psz_name, "dvd:", 4 ) )
- {
- p_intf->p_sys->i_intf_mode = DVD_MODE;
- p_intf->p_sys->b_mode_changed = 1;
- }
- }
-
/* Set the title of the main window */
gtk_window_set_title( GTK_WINDOW(p_intf->p_sys->p_window),
VOUT_TITLE " (Gnome interface)");
p_intf->b_menu_change = 0;
}
- if( p_intf->p_input != NULL && p_intf->p_sys->p_window != NULL &&
- p_intf->p_sys->b_mode_changed )
+ if( p_intf->p_sys->b_mode_changed )
{
+ /* Sets the interface mode according to playlist item */
+ if( p_main->p_playlist->p_item != NULL )
+ {
+ if( !strncmp( p_main->p_playlist->p_item->psz_name, "dvd:", 4 ) )
+ {
+ p_intf->p_sys->i_intf_mode = DVD_MODE;
+ }
+ else if( !strncmp(
+ p_main->p_playlist->p_item->psz_name, "ts:", 4 ) )
+ {
+ p_intf->p_sys->i_intf_mode = NET_MODE;
+ }
+ }
+
switch( p_intf->p_sys->i_intf_mode )
{
case DVD_MODE:
GnomeDVDModeManage( p_intf );
break;
+ case NET_MODE:
+ GnomeNetworkModeManage( p_intf );
+ break;
+ case FILE_MODE:
+ default:
+ GnomeFileModeManage( p_intf );
+ break;
}
p_intf->p_sys->b_mode_changed = 0;
}
- /* 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 )
- {
- p_intf->p_sys->b_menus_ready = 0;
- GnomeSetupMenu( p_intf );
- p_intf->p_sys->b_menus_ready = 1;
- }
-
- /* Manage the slider */
if( p_intf->p_input != NULL )
{
- float newvalue = p_intf->p_sys->p_adj->value;
+ float newvalue;
+ char psz_title[3];
+ char psz_chapter[3];
#define p_area p_intf->p_input->stream.p_selected_area
+ /* Update language/chapter menus after user request */
+ if( ( p_intf->p_sys->b_menus_update ) ||
+ ( p_intf->p_sys->i_part != p_area->i_part ) )
+ {
+ p_intf->p_sys->b_menus_update = 1;
+ GnomeSetupMenu( p_intf );
+ p_intf->p_sys->b_menus_update = 0;
+
+ snprintf( psz_title, 3, "%02d", p_area->i_id );
+ gtk_label_set_text( p_intf->p_sys->p_label_title, psz_title );
+
+ p_intf->p_sys->i_part = p_area->i_part;
+ snprintf( psz_chapter, 3, "%02d", p_area->i_part );
+ gtk_label_set_text( p_intf->p_sys->p_label_chapter, psz_chapter );
+ }
+
+ /* Manage the slider */
+ newvalue = p_intf->p_sys->p_adj->value;
+
/* 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 )
static gint GnomeLanguageMenus( gpointer p_data,
GtkWidget * p_root,
es_descriptor_t * p_es,
- gint i_type,
+ gint i_cat,
void(*pf_toggle )( GtkCheckMenuItem *, gpointer ) )
{
intf_thread_t * p_intf;
GtkWidget * p_item_active;
GSList * p_group;
char * psz_name;
- gint b_audio;
- gint b_spu;
gint i_item;
gint i;
/* 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++ )
{
-
- b_audio = ( i_type == 1 ) && p_intf->p_input->stream.pp_es[i]->b_audio;
- b_spu = ( i_type == 2 ) && p_intf->p_input->stream.pp_es[i]->b_spu;
-
- if( b_audio || b_spu )
+ if( p_intf->p_input->stream.pp_es[i]->i_cat == i_cat )
{
i_item++;
psz_name = p_intf->p_input->stream.pp_es[i]->psz_desc;
GTK_RADIO_MENU_ITEM( p_item ) );
gtk_widget_show( p_item );
- if( p_intf->p_input->stream.pp_areas[i_title]->i_part
- == i_chapter + 1 )
+#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 ),
for( i = 0 ; i < p_intf->p_input->stream.i_selected_es_number ; i++ )
{
- if( p_intf->p_input->stream.pp_selected_es[i]->b_audio )
+ 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]->b_spu )
+ 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];
}
p_popup_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_popup ), "popup_audio" ) );
- GnomeLanguageMenus( p_intf, p_menubar_menu, p_audio_es, 1,
+ GnomeLanguageMenus( p_intf, p_menubar_menu, p_audio_es, AUDIO_ES,
on_menubar_audio_toggle );
- GnomeLanguageMenus( p_intf, p_popup_menu, p_audio_es, 1,
+ GnomeLanguageMenus( p_intf, p_popup_menu, p_audio_es, AUDIO_ES,
on_popup_audio_toggle );
/* sub picture menus */
p_popup_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_popup ), "popup_subtitle" ) );
- GnomeLanguageMenus( p_intf, p_menubar_menu, p_spu_es, 2,
+ GnomeLanguageMenus( p_intf, p_menubar_menu, p_spu_es, SPU_ES,
on_menubar_subtitle_toggle );
- GnomeLanguageMenus( p_intf, p_popup_menu, p_spu_es, 2,
+ GnomeLanguageMenus( p_intf, p_popup_menu, p_spu_es, SPU_ES,
on_popup_subtitle_toggle );
- /* everything is ready */
- p_intf->p_sys->b_menus_update = 0;
-
return TRUE;
}
static gint GnomeDVDModeManage( intf_thread_t * p_intf )
{
GtkWidget * p_dvd_box;
- GtkWidget * p_toolbar_next;
- GtkWidget * p_toolbar_prev;
+ GtkWidget * p_file_box;
+ GtkWidget * p_network_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_show( GTK_WIDGET( p_dvd_box ) );
- p_toolbar_next = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_window ), "toolbar_next" ) );
- gtk_signal_disconnect_by_data( GTK_OBJECT( p_toolbar_next ), NULL );
- gtk_signal_connect( GTK_OBJECT( p_toolbar_next ), "clicked",
- GTK_SIGNAL_FUNC( on_toolbar_next_title_clicked ),
- NULL);
+ gtk_label_set_text( p_intf->p_sys->p_label_status,
+ "Status: playing DVD" );
+
+ return TRUE;
+}
+
+/*****************************************************************************
+ * GnomeFileModeManage
+ *****************************************************************************/
+static gint GnomeFileModeManage( intf_thread_t * p_intf )
+{
+ GtkWidget * p_dvd_box;
+ GtkWidget * p_file_box;
+ GtkWidget * p_network_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 ) );
+
+ p_file_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
+ p_intf->p_sys->p_window ), "file_box" ) );
+ gtk_widget_show( GTK_WIDGET( p_file_box ) );
- p_toolbar_prev = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_window ), "toolbar_prev" ) );
- gtk_signal_disconnect_by_data( GTK_OBJECT( p_toolbar_prev ), NULL );
- gtk_signal_connect( GTK_OBJECT( p_toolbar_prev ), "clicked",
- GTK_SIGNAL_FUNC( on_toolbar_prev_title_clicked ),
- NULL);
+ gtk_label_set_text( p_intf->p_sys->p_label_status,
+ "Status: foo" );
return TRUE;
}
+/*****************************************************************************
+ * GnomeNetworkModeManage
+ *****************************************************************************/
+static gint GnomeNetworkModeManage( intf_thread_t * p_intf )
+{
+ GtkWidget * p_dvd_box;
+ GtkWidget * p_file_box;
+ GtkWidget * 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 ) );
+
+ 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_show( GTK_WIDGET( p_network_box ) );
+
+ gtk_label_set_text( p_intf->p_sys->p_label_status,
+ "Status: waiting for stream" );
+
+ return TRUE;
+}
<widget>
<class>GtkHBox</class>
- <name>dvd_box</name>
- <visible>False</visible>
+ <name>file_box</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<widget>
<class>GtkLabel</class>
- <name>label_title</name>
- <label>Title:</label>
+ <name>label_file</name>
+ <height>24</height>
+ <label>Vlc File Mode</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<child>
<padding>0</padding>
<expand>True</expand>
- <fill>False</fill>
+ <fill>True</fill>
</child>
</widget>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>dvd_box</name>
+ <height>24</height>
+ <visible>False</visible>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
<widget>
<class>GtkHBox</class>
- <name>hbox6</name>
+ <name>title_chapter_box</name>
<homogeneous>False</homogeneous>
<spacing>10</spacing>
<child>
<fill>False</fill>
</child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label19</name>
+ <label>Title:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label_title</name>
+ <label>--</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
<widget>
<class>GtkButton</class>
- <name>button_chapter_prev</name>
- <tooltip>Select previous chapter</tooltip>
+ <name>button_title_prev</name>
+ <tooltip>Select previous title</tooltip>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
- <handler>on_button_chapter_prev_clicked</handler>
- <last_modification_time>Tue, 03 Apr 2001 00:53:47 GMT</last_modification_time>
+ <handler>on_button_title_prev_clicked</handler>
+ <last_modification_time>Tue, 03 Apr 2001 03:46:25 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_PREV</stock_button>
<relief>GTK_RELIEF_NONE</relief>
</child>
</widget>
+ <widget>
+ <class>GtkButton</class>
+ <name>button_title_next</name>
+ <can_focus>True</can_focus>
+ <signal>
+ <name>clicked</name>
+ <handler>on_button_title_next_clicked</handler>
+ <last_modification_time>Tue, 03 Apr 2001 03:47:01 GMT</last_modification_time>
+ </signal>
+ <stock_button>GNOME_STOCK_BUTTON_NEXT</stock_button>
+ <relief>GTK_RELIEF_NONE</relief>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>dvd_chapter_box</name>
+ <homogeneous>False</homogeneous>
+ <spacing>10</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>False</fill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label20</name>
+ <label>Chapter:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
<widget>
<class>GtkLabel</class>
<name>label_chapter</name>
- <label>Chapter: </label>
+ <label>--</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
</child>
</widget>
+ <widget>
+ <class>GtkButton</class>
+ <name>button_chapter_prev</name>
+ <tooltip>Select previous chapter</tooltip>
+ <can_focus>True</can_focus>
+ <signal>
+ <name>clicked</name>
+ <handler>on_button_chapter_prev_clicked</handler>
+ <last_modification_time>Tue, 03 Apr 2001 00:53:47 GMT</last_modification_time>
+ </signal>
+ <stock_button>GNOME_STOCK_BUTTON_PREV</stock_button>
+ <relief>GTK_RELIEF_NONE</relief>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
<widget>
<class>GtkButton</class>
<name>button_chapter_next</name>
</widget>
</widget>
</widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>network_box</name>
+ <height>24</height>
+ <visible>False</visible>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label_network</name>
+ <label>Network Channel:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkToggleButton</class>
+ <name>button_network_channel_1</name>
+ <can_focus>True</can_focus>
+ <label>Channel 1</label>
+ <relief>GTK_RELIEF_HALF</relief>
+ <active>True</active>
+ <child>
+ <padding>2</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkToggleButton</class>
+ <name>button_network_channel_2</name>
+ <sensitive>False</sensitive>
+ <can_focus>True</can_focus>
+ <label>Channel 2</label>
+ <relief>GTK_RELIEF_HALF</relief>
+ <active>False</active>
+ <child>
+ <padding>2</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkToggleButton</class>
+ <name>button_network_channel_3</name>
+ <sensitive>False</sensitive>
+ <can_focus>True</can_focus>
+ <label>Channel 3</label>
+ <relief>GTK_RELIEF_HALF</relief>
+ <active>False</active>
+ <child>
+ <padding>2</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkToggleButton</class>
+ <name>button_network_channel_4</name>
+ <sensitive>False</sensitive>
+ <can_focus>True</can_focus>
+ <label>Channel 4</label>
+ <relief>GTK_RELIEF_HALF</relief>
+ <active>False</active>
+ <child>
+ <padding>2</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkToggleButton</class>
+ <name>button_network_channel_5</name>
+ <sensitive>False</sensitive>
+ <can_focus>True</can_focus>
+ <label>Channel 5</label>
+ <relief>GTK_RELIEF_HALF</relief>
+ <active>False</active>
+ <child>
+ <padding>2</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkToggleButton</class>
+ <name>button_network_channel_6</name>
+ <sensitive>False</sensitive>
+ <can_focus>True</can_focus>
+ <label>Channel 6</label>
+ <relief>GTK_RELIEF_HALF</relief>
+ <active>False</active>
+ <child>
+ <padding>2</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+ </widget>
</widget>
</widget>
* intf_gnome.h: private Gnome interface description
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: intf_gnome.h,v 1.5 2001/04/03 03:39:41 stef Exp $
+ * $Id: intf_gnome.h,v 1.6 2001/04/08 07:24:47 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
boolean_t b_playlist_changed; /* playlist display toggled ? */
boolean_t b_slider_free; /* slider status */
boolean_t b_menus_update; /* do we need to update menus */
- boolean_t b_menus_ready; /* has the update been commpleted */
/* Windows and widgets */
GtkWidget * p_window; /* main window */
boolean_t b_mode_changed;
gint i_intf_mode; /* interface mode: file, net, disc */
+ 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;
-
* intf_gtk.c: Gtk+ interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: intf_gtk.c,v 1.10 2001/03/15 01:42:20 sam Exp $
+ * $Id: intf_gtk.c,v 1.11 2001/04/08 07:24:47 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
for( i = 0 ; i < p_intf->p_input->stream.i_selected_es_number ; i++ )
{
- if( p_intf->p_input->stream.pp_es[i]->b_audio )
+ if( p_intf->p_input->stream.pp_es[i]->i_cat == AUDIO_ES )
{
p_audio_es = p_intf->p_input->stream.pp_es[i];
}
- if( p_intf->p_input->stream.pp_es[i]->b_spu )
+ if( p_intf->p_input->stream.pp_es[i]->i_cat == SPU_ES )
{
p_spu_es = p_intf->p_input->stream.pp_es[i];
}
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, 1,
+ GtkLanguageMenus( p_intf, p_menubar_menu, p_audio_es, AUDIO_ES,
on_menubar_audio_activate );
- GtkLanguageMenus( p_intf, p_popup_menu, p_audio_es, 1,
+ GtkLanguageMenus( p_intf, p_popup_menu, p_audio_es, AUDIO_ES,
on_popup_audio_activate );
/* sub picture menus */
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, 2,
+ GtkLanguageMenus( p_intf, p_menubar_menu, p_spu_es, SPU_ES,
on_menubar_subpictures_activate );
- GtkLanguageMenus( p_intf, p_popup_menu, p_spu_es, 2,
+ GtkLanguageMenus( p_intf, p_popup_menu, p_spu_es, SPU_ES,
on_popup_subpictures_activate );
/* everything is ready */
static gint GtkLanguageMenus( gpointer p_data,
GtkWidget * p_root,
es_descriptor_t * p_es,
- gint i_type,
+ gint i_cat,
void(*pf_activate )( GtkMenuItem *, gpointer ) )
{
intf_thread_t * p_intf;
GSList * p_button_group;
char * psz_name;
gint b_active;
- gint b_audio;
- gint b_spu;
gint i;
vlc_mutex_lock( &p_intf->p_input->stream.stream_lock );
- b_audio = ( i_type == 1 );
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 ) ? 1 : 0;
+ b_active = ( p_es == NULL );
psz_name = "Off";
p_item = GtkMenuRadioItem( p_menu, &p_button_group, b_active, psz_name );
for( i = 0 ; i < p_intf->p_input->stream.i_es_number ; i++ )
{
-
- b_audio = ( i_type == 1 ) && p_intf->p_input->stream.pp_es[i]->b_audio;
- b_spu = ( i_type == 2 ) && p_intf->p_input->stream.pp_es[i]->b_spu;
-
- if( b_audio || b_spu )
+ 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;
* input_ext-intf.c: services to the interface
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: input_ext-intf.c,v 1.19 2001/04/06 09:15:47 sam Exp $
+ * $Id: input_ext-intf.c,v 1.20 2001/04/08 07:24:47 stef Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
* Useful since the interface plugins know p_es
*****************************************************************************/
int input_ChangeES( input_thread_t * p_input, es_descriptor_t * p_es,
- int i_type )
+ u8 i_cat )
{
- boolean_t b_audio;
- boolean_t b_spu;
int i_index;
int i;
i_index = -1;
- b_audio = ( i_type == 1 ) ? 1 : 0;
- b_spu = ( i_type == 2 ) ? 1 : 0;
vlc_mutex_lock( &p_input->stream.stream_lock );
for( i = 0 ; i < p_input->stream.i_selected_es_number ; i++ )
{
- if( ( b_audio && p_input->stream.pp_selected_es[i]->b_audio )
- || ( b_spu && p_input->stream.pp_selected_es[i]->b_spu ) )
+ if( p_input->stream.pp_selected_es[i]->i_cat == i_cat )
{
i_index = i;
break;
vlc_mutex_lock( &p_input->stream.stream_lock );
- if( p_es != NULL && ( p_es->b_audio || p_es->b_spu ) )
+ if( p_es != NULL )
{
if( b_select )
{
* input_programs.c: es_descriptor_t, pgrm_descriptor_t management
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: input_programs.c,v 1.44 2001/04/06 09:15:47 sam Exp $
+ * $Id: input_programs.c,v 1.45 2001/04/08 07:24:47 stef Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
p_es->p_pes = NULL;
p_es->p_decoder_fifo = NULL;
p_es->b_audio = 0;
- p_es->b_spu = 0;
+ p_es->i_cat = UNKNOWN_ES;
if( i_data_len )
{
if( p_input->stream.pp_selected_es == NULL )
{
- intf_ErrMsg( "No more selected ES in input_UnselectES" );
+#ifdef DEBUG_INPUT
+ intf_DbgMsg( "No more selected ES in input_UnselectES" );
+#endif
return( 1 );
}
}
* mpeg_system.c: TS, PS and PES management
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: mpeg_system.c,v 1.47 2001/04/06 09:15:47 sam Exp $
+ * $Id: mpeg_system.c,v 1.48 2001/04/08 07:24:47 stef Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr>
{
/* MPEG video */
p_es->i_type = MPEG2_VIDEO_ES;
+ p_es->i_cat = VIDEO_ES;
#ifdef AUTO_SPAWN
if( !p_input->stream.b_seekable )
input_SelectES( p_input, p_es );
/* MPEG audio */
p_es->i_type = MPEG2_AUDIO_ES;
p_es->b_audio = 1;
+ p_es->i_cat = AUDIO_ES;
#ifdef AUTO_SPAWN
if( !p_input->stream.b_seekable )
if( main_GetIntVariable( INPUT_CHANNEL_VAR, 0 )
/* AC3 audio (0x80->0x8F) */
p_es->i_type = AC3_AUDIO_ES;
p_es->b_audio = 1;
+ p_es->i_cat = AUDIO_ES;
#ifdef AUTO_SPAWN
if( !p_input->stream.b_seekable )
if( main_GetIntVariable( INPUT_CHANNEL_VAR, 0 )
{
/* Subtitles video (0x20->0x3F) */
p_es->i_type = DVD_SPU_ES;
- p_es->b_spu = 1;
+ p_es->i_cat = SPU_ES;
#ifdef AUTO_SPAWN
if( main_GetIntVariable( INPUT_SUBTITLE_VAR, -1 )
== ((p_es->i_id & 0x1F00) >> 8) )
/* LPCM audio (0xA0->0xAF) */
p_es->i_type = LPCM_AUDIO_ES;
p_es->b_audio = 1;
+ p_es->i_cat = AUDIO_ES;
/* FIXME : write the decoder */
}
else
* intf_playlist.c : Playlist management functions
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: intf_playlist.c,v 1.2 2001/03/21 13:42:34 sam Exp $
+ * $Id: intf_playlist.c,v 1.3 2001/04/08 07:24:47 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
intf_WarnMsg( 1, "intf: playlist destroyed" );
}
+
+/*****************************************************************************
+ * intf_PlaylistJumpto
+ *****************************************************************************/
void intf_PlaylistJumpto( playlist_t * p_playlist , int i_pos)
{
vlc_mutex_lock( &p_playlist->change_lock );