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

-corrected some bugs in gnome interface: language menu are now

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.
parent 9f8fcf88
......@@ -209,6 +209,7 @@
#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"
......
......@@ -4,7 +4,7 @@
* 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>
*
......@@ -168,6 +168,9 @@ typedef struct input_area_s
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;
......
......@@ -2,7 +2,7 @@
* 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: Stphane Borel <stef@via.ecp.fr>
*
......@@ -520,6 +520,9 @@ int CSSDescrambleSector( dvd_key_t pi_key, u8* pi_sec )
pi_sec++;
i_t5 >>= 8;
}
pi_sec[0x14] &= 0x8F;
}
return 0;
......
......@@ -2,7 +2,7 @@
* 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: Stphane Borel <stef@via.ecp.fr>
*
......@@ -1186,6 +1186,7 @@ static int ReadUnitInf( ifo_t * p_ifo, unit_inf_t * p_unit_inf, off_t i_pos )
//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 );
......@@ -1201,6 +1202,7 @@ static int ReadUnitInf( ifo_t * p_ifo, unit_inf_t * p_unit_inf, off_t i_pos )
{
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 );
}
......@@ -1259,7 +1261,9 @@ static int ReadTitleUnit( ifo_t * p_ifo, title_unit_t * p_title_unit,
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 =
......
......@@ -2,7 +2,7 @@
* 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: Stphane Borel <stef@via.ecp.fr>
*
......@@ -182,7 +182,7 @@ typedef struct title_s
/* 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
......
......@@ -10,7 +10,7 @@
* -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: Stphane Borel <stef@via.ecp.fr>
*
......@@ -394,6 +394,20 @@ static int DVDFindSector( thread_dvd_data_t * p_dvd )
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 )
......@@ -411,13 +425,17 @@ static int DVDFindSector( thread_dvd_data_t * p_dvd )
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
......@@ -493,11 +511,17 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
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 )
{
......@@ -515,11 +539,11 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
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 )
{
......@@ -546,6 +570,16 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
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
......@@ -577,7 +611,8 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
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 )
{
......@@ -593,10 +628,15 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
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
......@@ -645,7 +685,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
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,
......@@ -659,7 +699,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
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 )
{
......@@ -928,6 +968,10 @@ static void DVDInit( input_thread_t * p_input )
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 );
......@@ -940,7 +984,9 @@ static void DVDInit( input_thread_t * p_input )
{
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 )
......@@ -1088,7 +1134,6 @@ static int DVDRead( input_thread_t * p_input,
{
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;
......
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -46,6 +46,9 @@ typedef struct thread_dvd_data_s
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 */
......
......@@ -2,7 +2,7 @@
* 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>
* Stphane Borel <stef@via.ecp.fr>
......@@ -175,11 +175,10 @@ on_button_title_prev_clicked (GtkButton *button,
{
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;
}
}
......@@ -199,11 +198,10 @@ on_button_title_next_clicked (GtkButton *button,
{
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;
}
}
......@@ -225,7 +223,7 @@ on_button_chapter_prev_clicked (GtkButton *button,
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;
}
}
......@@ -247,7 +245,7 @@ on_button_chapter_next_clicked (GtkButton *button,
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;
}
}
......@@ -337,11 +335,13 @@ on_menubar_audio_toggle (GtkCheckMenuItem *menuitem,
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;
}
}
......@@ -355,11 +355,13 @@ on_menubar_subtitle_toggle (GtkCheckMenuItem *menuitem,
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;
}
}
......@@ -370,14 +372,14 @@ on_menubar_title_toggle (GtkCheckMenuItem *menuitem,
{
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;
}
}
......@@ -391,7 +393,7 @@ on_menubar_chapter_toggle (GtkCheckMenuItem *menuitem,
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 );
......@@ -401,7 +403,7 @@ on_menubar_chapter_toggle (GtkCheckMenuItem *menuitem,
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;
}
}
......@@ -681,9 +683,11 @@ on_popup_audio_toggle (GtkCheckMenuItem *menuitem,
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;
}
}
......@@ -697,9 +701,11 @@ on_popup_subtitle_toggle (GtkCheckMenuItem *menuitem,
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;
}
}
......@@ -710,7 +716,9 @@ on_popup_navigation_toggle (GtkCheckMenuItem *menuitem,
{
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;
......@@ -718,15 +726,21 @@ on_popup_navigation_toggle (GtkCheckMenuItem *menuitem,
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;
}
}
......
......@@ -536,6 +536,7 @@ create_intf_window (void)
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);
......@@ -543,6 +544,7 @@ create_intf_window (void)
(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);
......@@ -572,6 +574,7 @@ create_intf_window (void)
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);
......@@ -580,6 +583,7 @@ create_intf_window (void)
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);
......
......@@ -2,7 +2,7 @@
* 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>
* Stphane Borel <stef@via.ecp.fr>
......@@ -153,7 +153,10 @@ static int intf_Open( intf_thread_t *p_intf )
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;
......@@ -314,110 +317,67 @@ static gint GnomeManage( gpointer p_data )
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
}
......@@ -731,7 +691,7 @@ static gint GnomeTitleMenu( gpointer p_data,
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 )
{
......@@ -885,21 +845,47 @@ static gint GnomeSetupMenu( intf_thread_t * p_intf )
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;
......@@ -918,32 +904,40 @@ static gint GnomeSetupMenu( intf_thread_t * p_intf )
}
/* 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;
}
......@@ -1036,6 +1030,7 @@ static gint GnomeFileModeManage( intf_thread_t * p_intf )
gtk_label_set_text( p_intf->p_sys->p_label_status,
"Status: foo" );
#endif
return TRUE;
}
......
......@@ -681,7 +681,7 @@
<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>
......@@ -699,7 +699,7 @@
<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>
......@@ -764,7 +764,7 @@
<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>
......@@ -783,7 +783,7 @@
<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>
......
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -45,7 +45,11 @@ typedef struct intf_sys_s
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 */
......
......@@ -2,7 +2,7 @@
* 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>
......@@ -267,7 +267,10 @@ static void PSInit( input_thread_t * p_input )
}
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) */
......
......@@ -4,7 +4,7 @@
* 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>
......@@ -159,6 +159,7 @@ static const struct option longopts[] =
/* 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' },
......@@ -176,7 +177,7 @@ static const struct option longopts[] =
};
/* 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
......@@ -650,6 +651,9 @@ static int GetConfiguration( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] )
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 );
......@@ -769,12 +773,13 @@ static void Usage( int i_fashion )
"\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"
......@@ -819,6 +824,7 @@ static void Usage( int i_fashion )
"\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" );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment