synchronized ; and menus have less chances to be changed when they're opened.
-added basic angle support ; this is a first try. It works with my 2
test-DVDs, but I'd like that people having DVDs with repeated scenes to
test it. We can choose angle with command line option -u (don't ask me
why :)
-a cosmetic change in css decryption.
Since config.h.in has changed, you have to re-run ./configure.
#define INPUT_TITLE_VAR "vlc_input_title"
#define INPUT_CHAPTER_VAR "vlc_input_chapter"
+#define INPUT_ANGLE_VAR "vlc_input_angle"
#define INPUT_AUDIO_VAR "vlc_input_audio"
#define INPUT_CHANNEL_VAR "vlc_input_channel"
#define INPUT_SUBTITLE_VAR "vlc_input_subtitle"
* control the pace of reading.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: input_ext-intf.h,v 1.33 2001/04/13 05:36:12 stef Exp $
+ * $Id: input_ext-intf.h,v 1.34 2001/04/20 05:40:03 stef Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
int i_part_nb; /* number of parts (chapter for DVD)*/
int i_part; /* currently selected part */
+ int i_angle_nb; /* number of angles/title units */
+ int i_angle;
+
/* offset to plugin related data */
off_t i_plugin_data;
} input_area_t;
* dvd_css.c: Functions for DVD authentification and unscrambling
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: dvd_css.c,v 1.24 2001/04/11 04:31:59 sam Exp $
+ * $Id: dvd_css.c,v 1.25 2001/04/20 05:40:03 stef Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
pi_sec++;
i_t5 >>= 8;
}
+
+ pi_sec[0x14] &= 0x8F;
+
}
return 0;
* dvd_ifo.c: Functions for ifo parsing
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: dvd_ifo.c,v 1.22 2001/04/15 21:17:50 stef Exp $
+ * $Id: dvd_ifo.c,v 1.23 2001/04/20 05:40:03 stef Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
//fprintf( stderr, "Unit\n" );
p_unit_inf->i_title_nb = ReadWord( p_ifo, pi_buffer, &p_current );
+//fprintf( stderr, "Unit nb: %d\n", p_unit_inf->i_title_nb );
DumpBits( p_ifo, pi_buffer, &p_current, 2 );
p_unit_inf->i_end_byte = ReadDouble( p_ifo, pi_buffer, &p_current );
{
p_unit_inf->p_title[i].i_category_mask = ReadByte( p_ifo, pi_buffer, &p_current );
p_unit_inf->p_title[i].i_category = ReadByte( p_ifo, pi_buffer, &p_current );
+//fprintf( stderr, "cat mask %d: %x cat %x\n", i, p_unit_inf->p_title[i].i_category_mask, p_unit_inf->p_title[i].i_category );
p_unit_inf->p_title[i].i_parental_mask = ReadWord( p_ifo, pi_buffer, &p_current );
p_unit_inf->p_title[i].i_title_start_byte = ReadDouble( p_ifo, pi_buffer, &p_current );
}
for( i = 0 ; i < p_title_unit->i_unit_nb ; i++ )
{
- ReadBits( p_ifo, pi_buffer, &p_current, p_title_unit->p_unit[i].ps_lang_code, 2 );
+ //ReadBits( p_ifo, pi_buffer, &p_current, p_title_unit->p_unit[i].ps_lang_code, 2 );
+ p_title_unit->p_unit[i].i_lang_code = ReadWord( p_ifo, pi_buffer, &p_current );
+//fprintf( stderr, "lang %d %x\n", i,p_title_unit->p_unit[i].i_lang_code );
DumpBits( p_ifo, pi_buffer, &p_current, 1 );
p_title_unit->p_unit[i].i_existence_mask = ReadByte( p_ifo, pi_buffer, &p_current );
p_title_unit->p_unit[i].i_unit_inf_start_byte =
* dvd_ifo.h: Structures for ifo parsing
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: dvd_ifo.h,v 1.12 2001/04/12 02:40:09 stef Exp $
+ * $Id: dvd_ifo.h,v 1.13 2001/04/20 05:40:03 stef Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
/* Menu PGCI Language unit Descriptor */
typedef struct unit_s
{
- char ps_lang_code[2]; // 2 bytes (ISO-xx)
+ u16 i_lang_code; // 2 bytes (ISO-xx)
// char ???
u8 i_existence_mask; // 1 byte
u32 i_unit_inf_start_byte; // 4 bytes
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: input_dvd.c,v 1.47 2001/04/15 21:17:50 stef Exp $
+ * $Id: input_dvd.c,v 1.48 2001/04/20 05:40:03 stef Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
if( p_dvd->i_sector > title.p_cell_play[p_dvd->i_prg_cell].i_end_sector )
{
p_dvd->i_prg_cell++;
+
+ /* basic handling of angles */
+ switch( ( ( title.p_cell_play[p_dvd->i_prg_cell].i_category & 0xf000 )
+ >> 12 ) )
+ {
+ case 0x5:
+ p_dvd->i_prg_cell += p_dvd->i_angle - 1;
+ intf_WarnMsg( 1, "dvd info: choosing angle %d", p_dvd->i_angle );
+ break;
+ case 0x9:
+ case 0xd:
+ p_dvd->i_prg_cell += p_dvd->i_angle_nb - p_dvd->i_angle;
+ break;
+ }
}
if( DVDFindCell( p_dvd ) < 0 )
title.p_cell_play[p_dvd->i_prg_cell].i_end_sector );
intf_WarnMsg( 1, "cell: %d sector1: 0x%x end1: 0x%x\n"
- "index: %d sector2: 0x%x end2: 0x%x",
+ "index: %d sector2: 0x%x end2: 0x%x\n"
+ "category: 0x%x ilvu end: 0x%x vobu start 0x%x",
p_dvd->i_cell,
p_dvd->p_ifo->vts.cell_inf.p_cell_map[p_dvd->i_cell].i_start_sector,
p_dvd->p_ifo->vts.cell_inf.p_cell_map[p_dvd->i_cell].i_end_sector,
p_dvd->i_prg_cell,
title.p_cell_play[p_dvd->i_prg_cell].i_start_sector,
- title.p_cell_play[p_dvd->i_prg_cell].i_end_sector );
+ title.p_cell_play[p_dvd->i_prg_cell].i_end_sector,
+ title.p_cell_play[p_dvd->i_prg_cell].i_category,
+ title.p_cell_play[p_dvd->i_prg_cell].i_first_ilvu_vobu_esector,
+ title.p_cell_play[p_dvd->i_prg_cell].i_last_vobu_start_sector );
#undef title
p_input->stream.p_selected_area =
p_input->stream.pp_areas[p_area->i_id];
+// vlc_mutex_unlock( &p_input->stream.stream_lock );
+
/* title number: it is not vts nb!,
* it is what appears in the interface list */
p_dvd->i_title = p_area->i_id;
p_dvd->p_ifo->i_title = p_dvd->i_title;
+ /* 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 );
+
/* ifo vts */
if( IfoTitleSet( p_dvd->p_ifo ) < 0 )
{
p_dvd->i_program_chain =
vts.title_inf.p_title_start[p_dvd->i_vts_title-1].i_program_chain_num;
-/* intf_WarnMsg( 1, "dvd: title %d vts_title %d pgc %d",
+ intf_WarnMsg( 1, "dvd: title %d vts_title %d pgc %d",
p_dvd->i_title,
p_dvd->i_vts_title,
p_dvd->i_program_chain );
-*/
+
/* css title key for current vts */
if( p_dvd->b_encrypted )
{
return -1;
}
}
+
+ /*
+ * Angle management
+ */
+ p_dvd->i_angle_nb = vmg.title_inf.p_attr[p_dvd->i_title-1].i_angle_nb;
+ p_dvd->i_angle = main_GetIntVariable( INPUT_ANGLE_VAR, 1 );
+ if( ( p_dvd->i_angle <= 0 ) || p_dvd->i_angle > p_dvd->i_angle_nb )
+ {
+ p_dvd->i_angle = 1;
+ }
/*
* Set selected title start and size
p_dvd->i_sector = 0;
p_dvd->i_size = DVD_LB_SIZE *
(off_t)( vts.cell_inf.p_cell_map[p_dvd->i_cell].i_end_sector );
- intf_WarnMsg( 2, "dvd info: stream size 1: %lld @ %d", p_dvd->i_size,vts.cell_inf.p_cell_map[p_dvd->i_cell].i_end_sector );
+ intf_WarnMsg( 2, "dvd info: stream size 1: %lld @ %d", p_dvd->i_size,
+ vts.cell_inf.p_cell_map[p_dvd->i_cell].i_end_sector );
if( DVDChapterSelect( p_dvd, 1 ) < 0 )
{
intf_WarnMsg( 2, "dvd info: stream size: %lld", p_dvd->i_size );
intf_WarnMsg( 2, "dvd info: number of chapters: %d",
vmg.title_inf.p_attr[p_dvd->i_title-1].i_chapter_nb );
+ intf_WarnMsg( 2, "dvd info: number of angles: %d", p_dvd->i_angle_nb );
+
+// vlc_mutex_lock( &p_input->stream.stream_lock );
/* Area definition */
p_input->stream.p_selected_area->i_start = p_dvd->i_start;
p_input->stream.p_selected_area->i_size = p_dvd->i_size;
+ p_input->stream.p_selected_area->i_angle_nb = p_dvd->i_angle_nb;
+ p_input->stream.p_selected_area->i_angle = p_dvd->i_angle;
/*
* Destroy obsolete ES by reinitializing program 0
for( i = 1 ; i <= vts.manager_inf.i_audio_nb ; i++ )
{
-#ifdef DEBUG
+//#ifdef DEBUG
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_sample_freq,
vts.manager_inf.p_audio_attr[i-1].i_lang_code,
vts.manager_inf.p_audio_attr[i-1].i_caption );
-#endif
+//#endif
switch( vts.manager_inf.p_audio_attr[i-1].i_coding_mode )
{
area[i]->i_part_nb = title_inf.p_attr[i-1].i_chapter_nb;
area[i]->i_part = 1;
+ /* Number of angles */
+ area[i]->i_angle_nb = 0;
+ area[i]->i_angle = 1;
+
/* Offset to vts_i_0.ifo */
area[i]->i_plugin_data = p_dvd->p_ifo->i_off +
( title_inf.p_attr[i-1].i_start_sector * DVD_LB_SIZE );
{
i_title = 1;
}
+
#undef title_inf
+
/* Get requested chapter - if none defaults to first one */
i_chapter = main_GetIntVariable( INPUT_CHAPTER_VAR, 1 );
if( i_chapter <= 0 )
{
CSSDescrambleSector( p_dvd->p_css->pi_title_key,
p_vec[i_iovec].iov_base );
- ((u8*)(p_vec[i_iovec].iov_base))[0x14] &= 0x8F;
}
i_pos = 0;
* input_dvd.h: thread structure of the DVD plugin
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: input_dvd.h,v 1.19 2001/04/12 02:40:09 stef Exp $
+ * $Id: input_dvd.h,v 1.20 2001/04/20 05:40:03 stef Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
int i_chapter_nb;
int i_chapter;
+ int i_angle_nb;
+ int i_angle;
+
int i_cell; /* cell index in adress map */
int i_prg_cell; /* cell index in program map */
* gnome_callbacks.c : Callbacks for the Gnome plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: gnome_callbacks.c,v 1.22 2001/04/08 07:45:03 stef Exp $
+ * $Id: gnome_callbacks.c,v 1.23 2001/04/20 05:40:03 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
{
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;
+ p_intf->p_sys->b_title_update = 1;
}
}
{
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;
+ p_intf->p_sys->b_title_update = 1;
}
}
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
- p_intf->p_sys->b_menus_update = 1;
+ p_intf->p_sys->b_chapter_update = 1;
}
}
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
- p_intf->p_sys->b_menus_update = 1;
+ p_intf->p_sys->b_chapter_update = 1;
}
}
p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
- if( !p_intf->p_sys->b_menus_update )
+ if( !p_intf->p_sys->b_audio_update )
{
p_es = (es_descriptor_t*)user_data;
input_ToggleES( p_intf->p_input, p_es, menuitem->active );
+
+ p_intf->p_sys->b_audio_update = menuitem->active;
}
}
p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
- if( !p_intf->p_sys->b_menus_update )
+ if( !p_intf->p_sys->b_spu_update )
{
p_es = (es_descriptor_t*)user_data;
input_ToggleES( p_intf->p_input, p_es, menuitem->active );
+
+ p_intf->p_sys->b_spu_update = menuitem->active;
}
}
{
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
- if( menuitem->active && !p_intf->p_sys->b_menus_update )
+ if( menuitem->active && !p_intf->p_sys->b_title_update )
{
p_intf->p_input->pf_set_area( p_intf->p_input,
(input_area_t*)user_data );
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
- p_intf->p_sys->b_menus_update = 1;
+ p_intf->p_sys->b_title_update = 1;
}
}
gint i_chapter = (gint)user_data;
char psz_chapter[3];
- if( menuitem->active && !p_intf->p_sys->b_menus_update )
+ 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 );
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
- p_intf->p_sys->b_menus_update = 1;
+ p_intf->p_sys->b_chapter_update = 1;
}
}
p_es = (es_descriptor_t*)user_data;
- if( !p_intf->p_sys->b_menus_update )
+ if( !p_intf->p_sys->b_audio_update )
{
input_ToggleES( p_intf->p_input, p_es, menuitem->active );
+
+ p_intf->p_sys->b_audio_update = menuitem->active;
}
}
p_es = (es_descriptor_t*)user_data;
- if( !p_intf->p_sys->b_menus_update )
+ if( !p_intf->p_sys->b_spu_update )
{
input_ToggleES( p_intf->p_input, p_es, menuitem->active );
+
+ p_intf->p_sys->b_spu_update = menuitem->active;
}
}
{
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
- if( menuitem->active && !p_intf->p_sys->b_menus_update )
+ if( menuitem->active &&
+ !p_intf->p_sys->b_title_update &&
+ !p_intf->p_sys->b_chapter_update )
{
input_area_t * p_area;
gint i_title;
i_title = (gint)(user_data) / 100;
i_chapter = (gint)(user_data) - ( 100 * i_title );
+ p_area = p_intf->p_input->stream.p_selected_area;
+
+
+ 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 = p_intf->p_input->stream.pp_areas[i_title];
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 );
-
- p_intf->p_sys->b_menus_update = 1;
}
}
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);
(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);
dvd_chapter_box = gtk_hbox_new (FALSE, 10);
gtk_widget_ref (dvd_chapter_box);
gtk_widget_show (button_chapter_prev);
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);
button_chapter_next = gnome_stock_button (GNOME_STOCK_BUTTON_NEXT);
gtk_widget_ref (button_chapter_next);
gtk_widget_show (button_chapter_next);
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);
* intf_gnome.c: Gnome interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: intf_gnome.c,v 1.30 2001/04/13 05:36:12 stef Exp $
+ * $Id: intf_gnome.c,v 1.31 2001/04/20 05:40:03 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
p_intf->p_sys->b_popup_changed = 0;
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_title_update = 1;
+ p_intf->p_sys->b_chapter_update = 1;
+ p_intf->p_sys->b_audio_update = 1;
+ p_intf->p_sys->b_spu_update = 1;
p_intf->p_sys->b_slider_free = 1;
if( p_intf->p_input != NULL )
{
float newvalue;
- char psz_title[3];
- char psz_chapter[3];
/* New input or stream map change */
- if( p_intf->p_input->stream.b_changed )
+ if( p_intf->p_input->stream.b_changed || p_intf->p_sys->b_mode_changed )
{
- /* input method */
- if( p_intf->p_sys->b_mode_changed )
+ switch( p_intf->p_input->stream.i_method & 0xf0 )
{
-#if 0
- /* 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;
- }
-#else
- switch( p_intf->p_input->stream.i_method & 0xf0 )
- {
- case INPUT_METHOD_FILE:
- GnomeFileModeManage( p_intf );
- break;
- case INPUT_METHOD_DISC:
- GnomeDiscModeManage( p_intf );
- break;
- case INPUT_METHOD_NETWORK:
- GnomeNetworkModeManage( p_intf );
- break;
- default:
- intf_ErrMsg( "intf error: can't determine input method" );
- break;
- }
-#endif
- p_intf->p_sys->b_mode_changed = 0;
+ case INPUT_METHOD_FILE:
+ GnomeFileModeManage( p_intf );
+ break;
+ case INPUT_METHOD_DISC:
+ GnomeDiscModeManage( p_intf );
+ break;
+ case INPUT_METHOD_NETWORK:
+ GnomeNetworkModeManage( p_intf );
+ break;
+ default:
+ intf_ErrMsg( "intf error: can't determine input method" );
+ break;
}
- p_intf->p_sys->b_menus_update = 1;
p_intf->p_input->stream.b_changed = 0;
+ p_intf->p_sys->b_mode_changed = 0;
intf_WarnMsg( 2,
"Interface menus refreshed as stream has changed" );
}
-#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;
+ GnomeSetupMenu( p_intf );
- /* 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;
+#define p_area p_intf->p_input->stream.p_selected_area
+ /* Update menus when chapter changes */
+ p_intf->p_sys->b_chapter_update =
+ ( p_intf->p_sys->i_part != p_area->i_part );
- 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 )
+ if( p_intf->p_input->stream.b_seekable )
{
- 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;
+ /* 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 )
+ {
+ /* 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
}
p_title_submenu = gtk_menu_new();
}
- sprintf( psz_name, "Title %d", i_title );
+ sprintf( psz_name, "Title %d (%d)", i_title, p_intf->p_input->stream.pp_areas[i_title]->i_part_nb );
if( pf_toggle == on_menubar_title_toggle )
{
GtkWidget * p_popup_menu;
gint i;
- if( p_intf->p_input->stream.i_area_nb > 1 )
- {
+ p_intf->p_sys->b_title_update &= ( p_intf->p_input->stream.i_area_nb > 1 );
+ p_intf->p_sys->b_chapter_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[3];
+
p_menubar_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "menubar_title" ) );
GnomeTitleMenu( p_intf, p_menubar_menu, on_menubar_title_toggle );
+ snprintf( psz_title, 3, "%02d",
+ p_intf->p_input->stream.p_selected_area->i_id );
+ 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[3];
+
p_popup_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_popup ), "popup_navigation" ) );
GnomeTitleMenu( p_intf, p_popup_menu, on_popup_navigation_toggle );
-
+
p_menubar_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "menubar_chapter" ) );
GnomeChapterMenu( p_intf, p_menubar_menu, on_menubar_chapter_toggle );
- }
+ snprintf( psz_chapter, 3, "%02d",
+ p_intf->p_input->stream.p_selected_area->i_part );
+ 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;
+ }
+
/* look for selected ES */
p_audio_es = NULL;
p_spu_es = NULL;
}
/* 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" ) );
+
+ GnomeLanguageMenus( p_intf, p_menubar_menu, p_audio_es, AUDIO_ES,
+ on_menubar_audio_toggle );
+ GnomeLanguageMenus( p_intf, p_popup_menu, p_audio_es, AUDIO_ES,
+ on_popup_audio_toggle );
- /* 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" ) );
-
- GnomeLanguageMenus( p_intf, p_menubar_menu, p_audio_es, AUDIO_ES,
- on_menubar_audio_toggle );
- GnomeLanguageMenus( p_intf, p_popup_menu, p_audio_es, AUDIO_ES,
- on_popup_audio_toggle );
-
+ 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_subtitle" ) );
+
+ 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, SPU_ES,
+ on_menubar_subtitle_toggle );
+ GnomeLanguageMenus( p_intf, p_popup_menu, p_spu_es, SPU_ES,
+ on_popup_subtitle_toggle );
- /* find spu root menu */
- p_menubar_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_window ), "menubar_subtitle" ) );
-
- 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, SPU_ES,
- on_menubar_subtitle_toggle );
- GnomeLanguageMenus( p_intf, p_popup_menu, p_spu_es, SPU_ES,
- on_popup_subtitle_toggle );
+ p_intf->p_sys->b_spu_update = 0;
+ }
return TRUE;
}
gtk_label_set_text( p_intf->p_sys->p_label_status,
"Status: foo" );
#endif
+
return TRUE;
}
<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_NORMAL</relief>
+ <relief>GTK_RELIEF_NONE</relief>
<child>
<padding>0</padding>
<expand>False</expand>
<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_NORMAL</relief>
+ <relief>GTK_RELIEF_NONE</relief>
<child>
<padding>0</padding>
<expand>False</expand>
<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_NORMAL</relief>
+ <relief>GTK_RELIEF_NONE</relief>
<child>
<padding>0</padding>
<expand>False</expand>
<last_modification_time>Tue, 03 Apr 2001 00:53:40 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_NEXT</stock_button>
- <relief>GTK_RELIEF_NORMAL</relief>
+ <relief>GTK_RELIEF_NONE</relief>
<child>
<padding>0</padding>
<expand>False</expand>
* intf_gnome.h: private Gnome interface description
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: intf_gnome.h,v 1.6 2001/04/08 07:24:47 stef Exp $
+ * $Id: intf_gnome.h,v 1.7 2001/04/20 05:40:03 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
boolean_t b_window_changed; /* window display toggled ? */
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_title_update; /* do we need to update title menus */
+ boolean_t b_chapter_update; /* do we need to update
+ chapter 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 */
* input_ps.c: PS demux and packet management
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: input_ps.c,v 1.15 2001/04/16 12:34:28 asmax Exp $
+ * $Id: input_ps.c,v 1.16 2001/04/20 05:40:03 stef Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Cyril Deguet <asmax@via.ecp.fr>
}
rewind( p_method->stream );
vlc_mutex_lock( &p_input->stream.stream_lock );
+
+ p_input->stream.i_method = INPUT_METHOD_FILE;
p_input->stream.p_selected_area->i_tell = 0;
+
if( p_demux_data->b_has_PSM )
{
/* (The PSM decoder will care about spawning the decoders) */
* and spawn threads.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: main.c,v 1.86 2001/04/14 07:41:20 sam Exp $
+ * $Id: main.c,v 1.87 2001/04/20 05:40:03 stef Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
/* DVD options */
{ "dvdtitle", 1, 0, 't' },
{ "dvdchapter", 1, 0, 'T' },
+ { "dvdangle", 1, 0, 'u' },
{ "dvdaudio", 1, 0, 'a' },
{ "dvdchannel", 1, 0, 'c' },
{ "dvdsubtitle", 1, 0, 's' },
};
/* Short options */
-static const char *psz_shortopts = "hHvgt:T:a:s:c:I:A:V:";
+static const char *psz_shortopts = "hHvgt:T:u:a:s:c:I:A:V:";
/*****************************************************************************
* Global variable program_data - this is the one and only, see main.h
case 'T':
main_PutIntVariable( INPUT_CHAPTER_VAR, atoi(optarg) );
break;
+ case 'u':
+ main_PutIntVariable( INPUT_ANGLE_VAR, atoi(optarg) );
+ break;
case 'a':
if ( ! strcmp(optarg, "ac3") )
main_PutIntVariable( INPUT_AUDIO_VAR, REQUESTED_AC3 );
"\n"
"\n -t, --dvdtitle <num> \tchoose DVD title"
"\n -T, --dvdchapter <num> \tchoose DVD chapter"
+ "\n -u, --dvdangle <num> \tchoose DVD angle"
"\n -a, --dvdaudio <type> \tchoose DVD audio type"
"\n -c, --dvdchannel <channel> \tchoose DVD audio channel"
"\n -s, --dvdsubtitle <channel> \tchoose DVD subtitle channel"
"\n"
"\n --input \tinput method"
- "\n --channels \tenable channels"
+ "\n --channels \tenable channels"
"\n --server <host> \tvideo server address"
"\n --port <port> \tvideo server port"
"\n --broadcast \tlisten to a broadcast"
"\n " INPUT_DVD_DEVICE_VAR "=<device> \tDVD device"
"\n " INPUT_TITLE_VAR "=<title> \ttitle number"
"\n " INPUT_CHAPTER_VAR "=<chapter> \tchapter number"
+ "\n " INPUT_ANGLE_VAR "=<angle> \tangle number"
"\n " INPUT_AUDIO_VAR "={ac3|lpcm|mpeg|off} \taudio type"
"\n " INPUT_CHANNEL_VAR "=[0-15] \taudio channel"
"\n " INPUT_SUBTITLE_VAR "=[0-31] \tsubtitle channel" );