Commit 93ca3031 authored by Stéphane Borel's avatar Stéphane Borel

-Fixed most of the bugs in gnome interface menus

-Added radio checks in menu items.

There are still issues with default selected item but it works well.
parent e996c64e
......@@ -10,7 +10,7 @@
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: input_dvd.c,v 1.31 2001/03/07 10:31:10 stef Exp $
* $Id: input_dvd.c,v 1.32 2001/03/15 00:37:04 stef Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -393,7 +393,7 @@ static int DVDFindSector( thread_dvd_data_t * p_dvd )
p_dvd->ifo.vts.c_adt.p_cell_inf[i_cell].i_esector,
p_pgc->p_cell_play_inf[i_index].i_lsector );
//intf_WarnMsg( 3, "cell: %d index: %d sector1: %x sector2: %x end1: %x end2: %x", i_cell, i_index, p_dvd->ifo.vts.c_adt.p_cell_inf[i_cell].i_ssector, p_pgc->p_cell_play_inf[i_index].i_entry_sector, p_dvd->ifo.vts.c_adt.p_cell_inf[i_cell].i_esector,p_pgc->p_cell_play_inf[i_index].i_lsector );
intf_WarnMsg( 3, "cell: %d index: %d sector1: %x sector2: %x end1: %x end2: %x", i_cell, i_index, p_dvd->ifo.vts.c_adt.p_cell_inf[i_cell].i_ssector, p_pgc->p_cell_play_inf[i_index].i_entry_sector, p_dvd->ifo.vts.c_adt.p_cell_inf[i_cell].i_esector,p_pgc->p_cell_play_inf[i_index].i_lsector );
return 0;
}
......@@ -464,7 +464,8 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
* We have to load all title information
*/
/* Change the default area */
p_input->stream.p_selected_area = p_input->stream.pp_areas[p_area->i_id];
p_input->stream.p_selected_area =
p_input->stream.pp_areas[p_area->i_id];
/* title number: it is not vts nb! */
p_dvd->i_title = p_area->i_id;
......@@ -897,6 +898,7 @@ static int DVDRead( input_thread_t * p_input,
if( DVDFindSector( p_dvd ) < 0 )
{
pp_packets[0] = NULL;
intf_ErrMsg( "dvd error: can't find next cell" );
return 1;
}
......
......@@ -723,61 +723,75 @@ on_popup_disc_activate (GtkMenuItem *menuitem,
void
on_popup_audio_activate (GtkMenuItem *menuitem,
on_popup_audio_toggle (GtkCheckMenuItem *menuitem,
gpointer user_data)
{
if( menuitem->active )
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
es_descriptor_t * p_es;
p_es = (es_descriptor_t*)user_data;
input_ChangeES( p_intf->p_input, p_es, 1 );
}
}
void
on_popup_subtitle_activate (GtkMenuItem *menuitem,
on_popup_subtitle_toggle (GtkCheckMenuItem *menuitem,
gpointer user_data)
{
if( menuitem->active )
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
es_descriptor_t * p_es;
p_es = (es_descriptor_t*)user_data;
input_ChangeES( p_intf->p_input, p_es, 2 );
}
}
void
on_menubar_audio_activate (GtkMenuItem *menuitem,
on_menubar_audio_toggle (GtkCheckMenuItem *menuitem,
gpointer user_data)
{
if( menuitem->active )
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
es_descriptor_t * p_es;
p_es = (es_descriptor_t*)user_data;
input_ChangeES( p_intf->p_input, p_es, 1 );
}
}
void
on_menubar_subtitle_activate (GtkMenuItem *menuitem,
on_menubar_subtitle_toggle (GtkCheckMenuItem *menuitem,
gpointer user_data)
{
if( menuitem->active )
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
es_descriptor_t * p_es;
p_es = (es_descriptor_t*)user_data;
input_ChangeES( p_intf->p_input, p_es, 2 );
}
}
void
on_popup_navigation_activate (GtkMenuItem *menuitem,
on_popup_navigation_toggle (GtkCheckMenuItem *menuitem,
gpointer user_data)
{
if( menuitem->active )
{
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
input_area_t * p_area;
gint i_title;
......@@ -785,31 +799,45 @@ on_popup_navigation_activate (GtkMenuItem *menuitem,
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 );
}
}
void
on_menubar_title_activate (GtkMenuItem *menuitem,
on_menubar_title_toggle (GtkCheckMenuItem *menuitem,
gpointer user_data)
{
if( menuitem->active )
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)user_data );
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 );
}
}
void
on_menubar_chapter_activate (GtkMenuItem *menuitem,
on_menubar_chapter_toggle (GtkCheckMenuItem *menuitem,
gpointer user_data)
{
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
if( menuitem->active )
{
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;
......@@ -817,4 +845,5 @@ on_menubar_chapter_activate (GtkMenuItem *menuitem,
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 );
}
}
......@@ -231,29 +231,29 @@ on_popup_disc_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_popup_audio_activate (GtkMenuItem *menuitem,
on_menubar_audio_toggle (GtkCheckMenuItem *menuitem,
gpointer user_data);
void
on_popup_subtitle_activate (GtkMenuItem *menuitem,
on_menubar_subtitle_toggle (GtkCheckMenuItem *menuitem,
gpointer user_data);
void
on_menubar_audio_activate (GtkMenuItem *menuitem,
on_popup_audio_toggle (GtkCheckMenuItem *menuitem,
gpointer user_data);
void
on_menubar_subtitle_activate (GtkMenuItem *menuitem,
on_popup_subtitle_toggle (GtkCheckMenuItem *menuitem,
gpointer user_data);
void
on_popup_navigation_activate (GtkMenuItem *menuitem,
on_popup_navigation_toggle (GtkCheckMenuItem *menuitem,
gpointer user_data);
void
on_menubar_title_activate (GtkMenuItem *menuitem,
on_menubar_title_toggle (GtkCheckMenuItem *menuitem,
gpointer user_data);
void
on_menubar_chapter_activate (GtkMenuItem *menuitem,
on_menubar_chapter_toggle (GtkCheckMenuItem *menuitem,
gpointer user_data);
......@@ -540,7 +540,7 @@ static GnomeUIInfo intf_popup_uiinfo[] =
GNOMEUIINFO_SEPARATOR,
{
GNOME_APP_UI_ITEM, N_("_Navigation"),
NULL,
N_("Navigate through titles and chapters"),
(gpointer) NULL, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, (GdkModifierType) 0, NULL
......@@ -549,14 +549,14 @@ static GnomeUIInfo intf_popup_uiinfo[] =
{
GNOME_APP_UI_ITEM, N_("Audio"),
N_("Select audio channel"),
(gpointer) on_popup_audio_activate, NULL, NULL,
(gpointer) NULL, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, (GdkModifierType) 0, NULL
},
{
GNOME_APP_UI_ITEM, N_("_Subtitle"),
NULL,
(gpointer) on_popup_subtitle_activate, NULL, NULL,
N_("Select subtitle channel"),
(gpointer) NULL, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, (GdkModifierType) 0, NULL
},
......
This diff is collapsed.
......@@ -657,6 +657,7 @@
<class>GtkMenuItem</class>
<name>popup_navigation</name>
<sensitive>False</sensitive>
<tooltip>Navigate through titles and chapters</tooltip>
<label>_Navigation</label>
<right_justify>False</right_justify>
</widget>
......@@ -672,11 +673,6 @@
<name>popup_audio</name>
<sensitive>False</sensitive>
<tooltip>Select audio channel</tooltip>
<signal>
<name>activate</name>
<handler>on_popup_audio_activate</handler>
<last_modification_time>Thu, 22 Feb 2001 05:35:57 GMT</last_modification_time>
</signal>
<label>Audio</label>
<right_justify>False</right_justify>
</widget>
......@@ -685,11 +681,7 @@
<class>GtkMenuItem</class>
<name>popup_subtitle</name>
<sensitive>False</sensitive>
<signal>
<name>activate</name>
<handler>on_popup_subtitle_activate</handler>
<last_modification_time>Thu, 22 Feb 2001 05:35:57 GMT</last_modification_time>
</signal>
<tooltip>Select subtitle channel</tooltip>
<label>_Subtitle</label>
<right_justify>False</right_justify>
</widget>
......
......@@ -267,14 +267,14 @@ int input_ChangeES( input_thread_t * p_input, es_descriptor_t * p_es,
input_UnselectES( p_input,
p_input->stream.pp_selected_es[i_index] );
input_SelectES( p_input, p_es );
intf_WarnMsg( 1, "dvd info: ES selected -> %s (0x%x)",
intf_WarnMsg( 1, "input info: es selected -> %s (0x%x)",
p_es->psz_desc, p_es->i_id );
}
}
else
{
input_SelectES( p_input, p_es );
intf_WarnMsg( 1, "dvd info: selected -> %s (0x%x)",
intf_WarnMsg( 1, "input info: es selected -> %s (0x%x)",
p_es->psz_desc, p_es->i_id );
}
}
......@@ -282,6 +282,10 @@ int input_ChangeES( input_thread_t * p_input, es_descriptor_t * p_es,
{
if( i_index != -1 )
{
intf_WarnMsg( 1, "input info: es unselected -> %s (0x%x)",
p_input->stream.pp_selected_es[i_index]->psz_desc,
p_input->stream.pp_selected_es[i_index]->i_id );
input_UnselectES( p_input,
p_input->stream.pp_selected_es[i_index] );
}
......
......@@ -2,7 +2,7 @@
* mpeg_system.c: TS, PS and PES management
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: mpeg_system.c,v 1.43 2001/03/07 00:18:46 henri Exp $
* $Id: mpeg_system.c,v 1.44 2001/03/15 00:37:04 stef Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr>
......@@ -748,6 +748,7 @@ es_descriptor_t * input_ParsePS( input_thread_t * p_input,
{
/* Subtitles video (0x20->0x3F) */
p_es->i_type = DVD_SPU_ES;
p_es->b_spu = 1;
#ifdef AUTO_SPAWN
if( main_GetIntVariable( INPUT_SUBTITLE_VAR, -1 )
== ((p_es->i_id & 0x1F00) >> 8) )
......
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