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

-Working menus for run-time audio/spu/title/chapter selection with gtk

interface.

It is a bit buggy yet, and some pieces of code need to change,
especially to handle better menus change when title change but it
eventually works.
parent 66fc868f
......@@ -4,7 +4,7 @@
* control the pace of reading.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-intf.h,v 1.27 2001/03/02 03:32:46 stef Exp $
* $Id: input_ext-intf.h,v 1.28 2001/03/07 10:31:10 stef Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -52,6 +52,8 @@ typedef struct es_descriptor_s
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;
char psz_desc[20]; /* description of ES: audio language
* for instance ; NULL if not
* available */
......@@ -269,6 +271,8 @@ typedef struct input_thread_s
void (* pf_delete_pes)( void *, struct pes_packet_s * );
/* Stream control capabilities */
int (* pf_set_area)( struct input_thread_s *,
struct input_area_s * );
int (* pf_rewind)( struct input_thread_s * );
/* NULL if we don't support going *
* backwards (it's gonna be fun) */
......@@ -348,3 +352,4 @@ void input_SetRate ( struct input_thread_s *, int );
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 );
......@@ -49,6 +49,9 @@ typedef void * module_handle_t;
#define MODULE_CAPABILITY_AFX 1 << 11 /* Audio effects */
#define MODULE_CAPABILITY_VFX 1 << 12 /* Video effects */
/* FIXME: kludge */
struct input_area_s;
/* FIXME: not yet used */
typedef struct probedata_s
{
......@@ -81,9 +84,6 @@ typedef struct function_list_s
void ( * pf_close )( struct input_thread_s * );
void ( * pf_end ) ( struct input_thread_s * );
int ( * pf_set_area ) ( struct input_thread_s *,
int, int, int, int );
int ( * pf_read ) ( struct input_thread_s *,
struct data_packet_s *
pp_packets[] );
......@@ -95,6 +95,9 @@ typedef struct function_list_s
void ( * pf_delete_packet ) ( void *, struct data_packet_s * );
void ( * pf_delete_pes ) ( void *, struct pes_packet_s * );
int ( * pf_set_area ) ( struct input_thread_s *,
struct input_area_s * );
int ( * pf_rewind ) ( struct input_thread_s * );
void ( * pf_seek ) ( struct input_thread_s *, off_t );
} input;
......
......@@ -10,7 +10,7 @@
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: input_dvd.c,v 1.30 2001/03/06 10:21:59 massiot Exp $
* $Id: input_dvd.c,v 1.31 2001/03/07 10:31:10 stef Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -248,7 +248,7 @@ static int DVDRead ( struct input_thread_s *, data_packet_t ** );
static void DVDInit ( struct input_thread_s * );
static void DVDEnd ( struct input_thread_s * );
static void DVDSeek ( struct input_thread_s *, off_t );
static int DVDSetArea ( struct input_thread_s *, int, int, int, int );
static int DVDSetArea ( struct input_thread_s *, struct input_area_s * );
static int DVDRewind ( struct input_thread_s * );
/*****************************************************************************
......@@ -441,13 +441,10 @@ static int DVDChapterSelect( thread_dvd_data_t * p_dvd, int i_chapter )
* i_audio, i_spu start from 1 ; 0 means off.
* A negative value for an argument means it does not change
*****************************************************************************/
static int DVDSetArea( input_thread_t * p_input,
int i_title, int i_chapter,
int i_audio, int i_spu )
static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
{
thread_dvd_data_t * p_dvd;
es_descriptor_t * p_es;
int i_index;
int i_nb;
u16 i_id;
u8 i_ac3;
......@@ -460,25 +457,24 @@ static int DVDSetArea( input_thread_t * p_input,
vlc_mutex_lock( &p_input->stream.stream_lock );
if( i_title >= 0 )
if( p_area != p_input->stream.p_selected_area )
{
/*
* We have to load all title information
*/
/* Change the default area */
p_input->stream.p_selected_area = p_input->stream.pp_areas[i_title];
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 = i_title;
p_dvd->i_title = p_area->i_id;
/* title position inside the selected vts */
p_dvd->i_vts_title =
p_dvd->ifo.vmg.ptt_srpt.p_tts[i_title-1].i_vts_ttn;
p_dvd->ifo.vmg.ptt_srpt.p_tts[p_dvd->i_title-1].i_vts_ttn;
/* vts number */
p_dvd->ifo.i_title = i_title;
p_dvd->ifo.i_title = p_dvd->i_title;
/* ifo vts */
IfoReadVTS( &(p_dvd->ifo) );
......@@ -488,7 +484,7 @@ static int DVDSetArea( input_thread_t * p_input,
if( p_dvd->b_encrypted )
{
p_dvd->p_css->i_title =
p_dvd->ifo.vmg.ptt_srpt.p_tts[i_title-1].i_tts_nb;
p_dvd->ifo.vmg.ptt_srpt.p_tts[p_dvd->i_title-1].i_tts_nb;
p_dvd->p_css->i_title_pos =
p_dvd->ifo.vts.i_pos +
p_dvd->ifo.vts.mat.i_tt_vobs_ssector * DVD_LB_SIZE;
......@@ -526,11 +522,11 @@ static int DVDSetArea( input_thread_t * p_input,
lseek( p_input->i_handle, p_dvd->i_start, SEEK_SET );
intf_WarnMsg( 2, "dvd info: title: %d", i_title );
intf_WarnMsg( 2, "dvd info: title: %d", p_dvd->i_title );
intf_WarnMsg( 2, "dvd info: vobstart at: %lld", p_dvd->i_start );
intf_WarnMsg( 2, "dvd info: stream size: %lld", p_dvd->i_size );
intf_WarnMsg( 2, "dvd info: number of chapters: %d",
p_dvd->ifo.vmg.ptt_srpt.p_tts[i_title-1].i_ptt_nb );
p_dvd->ifo.vmg.ptt_srpt.p_tts[p_dvd->i_title-1].i_ptt_nb );
/* intf_WarnMsg( 3, "last: %d index: %d", i_last_chapter, i_index );*/
......@@ -547,7 +543,19 @@ static int DVDSetArea( input_thread_t * p_input,
*/
if( p_input->stream.pp_programs != NULL )
{
/* We don't use input_EndStream here since
* we keep area structures */
for( i = 0 ; i < p_input->stream.i_selected_es_number ; i++ )
{
input_UnselectES( p_input, p_input->stream.pp_selected_es[i] );
}
input_DelProgram( p_input, p_input->stream.pp_programs[0] );
free( p_input->stream.pp_selected_es );
p_input->stream.pp_selected_es = NULL;
p_input->stream.i_selected_es_number = 0;
}
input_AddProgram( p_input, 0, sizeof( stream_ps_data_t ) );
......@@ -561,6 +569,7 @@ static int DVDSetArea( input_thread_t * p_input,
input_SelectES( p_input, p_es );
intf_WarnMsg( 1, "dvd info: video MPEG2 stream" );
/* Audio ES, in the order they appear in .ifo */
i_nb = p_dvd->ifo.vts.mat.i_audio_nb;
......@@ -648,6 +657,7 @@ static int DVDSetArea( input_thread_t * p_input,
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;
strcpy( p_es->psz_desc, Language( hton16(
p_dvd->ifo.vts.mat.p_subpic_atrt[i-1].i_lang_code ) ) );
intf_WarnMsg( 1, "dvd info: spu stream %d %s\t(0x%x)",
......@@ -660,84 +670,31 @@ static int DVDSetArea( input_thread_t * p_input,
}
} // i_title >= 0
/*
* Select requested ES
*/
if( ( i_audio >= 0 ) || ( i_title >= 0 ) )
{
/* Audio: we check it is in the range and
* default it to the first if not */
if( i_audio > p_dvd->ifo.vts.mat.i_audio_nb )
{
i_audio = 1;
}
p_es = p_input->stream.pp_programs[0]->pp_es[i_audio];
/* We can only have one audio channel */
/* Look for a preselected one */
i_index = -1;
for( i = 0 ; i < p_input->stream.i_selected_es_number ; i++ )
{
if( p_input->stream.pp_selected_es[i]->b_audio )
{
i_index = i;
break;
}
}
if( i_index != -1 )
{
if( p_input->stream.pp_selected_es[i_index] != 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: audio %d selected -> %s (0x%x)",
i_audio, p_es->psz_desc, p_es->i_id );
}
}
else
{
input_SelectES( p_input, p_es );
intf_WarnMsg( 1, "dvd info: audio %d selected -> %s (0x%x)",
i_audio, p_es->psz_desc, p_es->i_id );
}
}
if( ( i_spu >= 0 ) || ( i_title >= 0 ) )
{
/* For spu: no one if none or a not existing one requested */
if( ( i_spu <= p_dvd->ifo.vts.mat.i_subpic_nb ) && ( i_spu > 0 ) )
{
input_SelectES( p_input, ( p_es = p_input->stream.pp_programs[0]->
pp_es[ i_spu + p_dvd->ifo.vts.mat.i_audio_nb ] ) );
intf_WarnMsg( 1, "dvd info: spu %d selected -> %s (0x%x)",
i_spu, p_es->psz_desc, p_es->i_id );
}
p_area = p_input->stream.p_selected_area;
}
/*
* Chapter selection
*/
if( ( i_chapter > 0 ) &&
( i_chapter <= p_input->stream.p_selected_area->i_part_nb ) )
if( ( p_area->i_part > 0 ) &&
( p_area->i_part <= p_area->i_part_nb ) )
{
DVDChapterSelect( p_dvd, i_chapter );
DVDChapterSelect( p_dvd, p_area->i_part );
p_input->stream.p_selected_area->i_tell = p_dvd->i_start -
p_input->stream.p_selected_area->i_start;
p_area->i_start;
p_input->stream.p_selected_area->i_part = p_dvd->i_chapter;
intf_WarnMsg( 2, "dvd info: chapter %d start at: %lld", i_chapter,
p_input->stream.p_selected_area->i_tell );
intf_WarnMsg( 2, "dvd info: chapter %d start at: %lld",
p_area->i_part, p_area->i_tell );
}
/* By default first audio stream and no spu */
input_SelectES( p_input, p_input->stream.pp_es[1] );
/* No PSM to read in DVD mode, we already have all information */
p_input->stream.pp_programs[0]->b_is_ok = 1;
......@@ -779,7 +736,8 @@ static void DVDInit( input_thread_t * p_input )
/* Reading structures initialisation */
p_input->p_method_data =
DVDNetlistInit( 4096, 8192, 4096, DVD_LB_SIZE, p_dvd->i_block_once );
// DVDNetlistInit( 4096, 8192, 4096, DVD_LB_SIZE, p_dvd->i_block_once );
DVDNetlistInit( 8192, 16384, 16384, DVD_LB_SIZE, p_dvd->i_block_once );
intf_WarnMsg( 2, "dvd info: netlist initialized" );
/* Ifo initialisation */
......@@ -845,7 +803,6 @@ static void DVDInit( input_thread_t * p_input )
i_title = 1;
}
#undef srpt
/* Get requested chapter - if none defaults to first one */
i_chapter = main_GetIntVariable( INPUT_CHAPTER_VAR, 1 );
if( i_chapter <= 0 )
......@@ -853,6 +810,9 @@ static void DVDInit( input_thread_t * p_input )
i_chapter = 1;
}
p_input->stream.pp_areas[i_title]->i_part = i_chapter;
DVDSetArea( p_input, p_input->stream.pp_areas[i_title] );
/* For audio: first one if none or a not existing one specified */
i_audio = main_GetIntVariable( INPUT_CHANNEL_VAR, 1 );
if( i_audio <= 0 )
......@@ -861,9 +821,17 @@ static void DVDInit( input_thread_t * p_input )
i_audio = 1;
}
input_ChangeES( p_input, p_input->stream.pp_es[i_audio], 1 );
i_spu = main_GetIntVariable( INPUT_SUBTITLE_VAR, 0 );
if( i_spu < 0 )
{
main_PutIntVariable( INPUT_CHANNEL_VAR, 1 );
i_spu = 0;
}
// input_ChangeES( p_input, p_input->stream.pp_es[i_spu], 1 );
DVDSetArea( p_input, i_title, i_chapter, i_audio, i_spu );
return;
}
......@@ -922,7 +890,7 @@ static int DVDRead( input_thread_t * p_input,
}
/* Get the position of the next cell if we're at cell end */
#if 1
if( p_dvd->i_sector > p_dvd->i_end_sector )
{
/* Find cell index in adress map */
......@@ -949,16 +917,16 @@ static int DVDRead( input_thread_t * p_input,
p_dvd->i_chapter = i_chapter;
vlc_mutex_lock( &p_input->stream.stream_lock );
// vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.p_selected_area->i_tell = i_off -
p_input->stream.p_selected_area->i_start;
p_input->stream.p_selected_area->i_part = p_dvd->i_chapter;
vlc_mutex_unlock( &p_input->stream.stream_lock );
// vlc_mutex_unlock( &p_input->stream.stream_lock );
}
#endif
/* Reads from DVD */
i_read_bytes = readv( p_dvd->i_fd, p_vec, p_dvd->i_block_once );
i_read_blocks = ( i_read_bytes + 0x7ff ) >> 11;
......@@ -1036,13 +1004,13 @@ static int DVDRead( input_thread_t * p_input,
pp_packets[i_packet] = NULL;
vlc_mutex_lock( &p_input->stream.stream_lock );
// vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.p_selected_area->i_tell +=
p_dvd->i_block_once *DVD_LB_SIZE;
b_eof = p_input->stream.p_selected_area->i_tell < p_dvd->i_size ? 0 : 1;
vlc_mutex_unlock( &p_input->stream.stream_lock );
// vlc_mutex_unlock( &p_input->stream.stream_lock );
if( ( i_read_blocks == p_dvd->i_block_once ) && ( !b_eof ) )
{
......
......@@ -4,6 +4,7 @@
* Copyright (C) 2000, 2001 VideoLAN
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -733,3 +734,101 @@ on_popup_disc_activate (GtkMenuItem *menuitem,
gdk_window_raise( p_intf->p_sys->p_disc->window );
}
void
on_popup_audio_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
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_subpictures_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
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,
gpointer user_data)
{
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_subpictures_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
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,
gpointer user_data)
{
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
input_area_t * p_area;
gint i_title;
gint i_chapter;
i_title = (gint)(user_data) / 100 ;
i_chapter = (gint)(user_data) - ( 100 * i_title );
fprintf(stderr, "title %d chapter %d\n", i_title, i_chapter );
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,
gpointer user_data)
{
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_sys->b_menus_update = 1;
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
}
void
on_menubar_chapter_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
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;
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 );
}
......@@ -185,3 +185,31 @@ on_toolbar_disc_clicked (GtkButton *button,
void
on_popup_disc_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_popup_audio_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_popup_subpictures_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_menubar_audio_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_menubar_subpictures_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_popup_navigation_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_menubar_title_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_menubar_chapter_activate (GtkMenuItem *menuitem,
gpointer user_data);
......@@ -36,11 +36,18 @@ create_intf_window (void)
GtkWidget *menubar_view;
GtkWidget *menubar_view_menu;
GtkAccelGroup *menubar_view_menu_accels;
GtkWidget *menubar_title;
GtkWidget *menubar_chapter;
GtkWidget *separator11;
GtkWidget *menubar_playlist;
GtkWidget *menubar_modules;
GtkWidget *menubar_settings;
GtkWidget *menubar_settings_menu;
GtkAccelGroup *menubar_settings_menu_accels;
GtkWidget *separator7;
GtkWidget *menubar_audio;
GtkWidget *menubar_subpictures;
GtkWidget *separator8;
GtkWidget *menubar_preferences;
GtkWidget *menubar_help;
GtkWidget *menubar_help_menu;
......@@ -182,6 +189,39 @@ create_intf_window (void)
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menubar_view), menubar_view_menu);
menubar_view_menu_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (menubar_view_menu));
menubar_title = gtk_menu_item_new_with_label ("");
tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (menubar_title)->child),
_("_Title"));
gtk_widget_add_accelerator (menubar_title, "activate_item", menubar_view_menu_accels,
tmp_key, 0, 0);
gtk_widget_ref (menubar_title);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_title", menubar_title,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (menubar_title);
gtk_container_add (GTK_CONTAINER (menubar_view_menu), menubar_title);
gtk_widget_set_sensitive (menubar_title, FALSE);
gtk_tooltips_set_tip (tooltips, menubar_title, _("Navigate through the stream"), NULL);
menubar_chapter = gtk_menu_item_new_with_label ("");
tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (menubar_chapter)->child),
_("_Chapter"));
gtk_widget_add_accelerator (menubar_chapter, "activate_item", menubar_view_menu_accels,
tmp_key, 0, 0);
gtk_widget_ref (menubar_chapter);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_chapter", menubar_chapter,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (menubar_chapter);
gtk_container_add (GTK_CONTAINER (menubar_view_menu), menubar_chapter);
gtk_widget_set_sensitive (menubar_chapter, FALSE);
separator11 = gtk_menu_item_new ();
gtk_widget_ref (separator11);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "separator11", separator11,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (separator11);
gtk_container_add (GTK_CONTAINER (menubar_view_menu), separator11);
gtk_widget_set_sensitive (separator11, FALSE);
menubar_playlist = gtk_menu_item_new_with_label ("");
tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (menubar_playlist)->child),
_("_Playlist..."));
......@@ -226,6 +266,48 @@ create_intf_window (void)
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menubar_settings), menubar_settings_menu);
menubar_settings_menu_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (menubar_settings_menu));
separator7 = gtk_menu_item_new ();
gtk_widget_ref (separator7);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "separator7", separator7,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (separator7);
gtk_container_add (GTK_CONTAINER (menubar_settings_menu), separator7);
gtk_widget_set_sensitive (separator7, FALSE);
menubar_audio = gtk_menu_item_new_with_label ("");
tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (menubar_audio)->child),
_("A_udio"));
gtk_widget_add_accelerator (menubar_audio, "activate_item", menubar_settings_menu_accels,
tmp_key, 0, 0);
gtk_widget_ref (menubar_audio);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_audio", menubar_audio,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (menubar_audio);
gtk_container_add (GTK_CONTAINER (menubar_settings_menu), menubar_audio);
gtk_widget_set_sensitive (menubar_audio, FALSE);
gtk_tooltips_set_tip (tooltips, menubar_audio, _("Select audio language"), NULL);
menubar_subpictures = gtk_menu_item_new_with_label ("");
tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (menubar_subpictures)->child),
_("Sub _Pictures"));
gtk_widget_add_accelerator (menubar_subpictures, "activate_item", menubar_settings_menu_accels,
tmp_key, 0, 0);
gtk_widget_ref (menubar_subpictures);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_subpictures", menubar_subpictures,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (menubar_subpictures);
gtk_container_add (GTK_CONTAINER (menubar_settings_menu), menubar_subpictures);
gtk_widget_set_sensitive (menubar_subpictures, FALSE);
gtk_tooltips_set_tip (tooltips, menubar_subpictures, _("Select sub-title"), NULL);
separator8 = gtk_menu_item_new ();
gtk_widget_ref (separator8);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "separator8", separator8,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (separator8);
gtk_container_add (GTK_CONTAINER (menubar_settings_menu), separator8);
gtk_widget_set_sensitive (separator8, FALSE);
menubar_preferences = gtk_menu_item_new_with_label ("");
tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (menubar_preferences)->child),
_("_Preferences..."));
......@@ -545,6 +627,11 @@ create_intf_popup (void)
GtkWidget *popup_open;
GtkWidget *popup_disc;
GtkWidget *separator5;
GtkWidget *popup_navigation;
GtkWidget *separator10;
GtkWidget *popup_audio;
GtkWidget *popup_subpictures;
GtkWidget *separator9;
GtkWidget *popup_about;
GtkWidget *popup_exit;
GtkTooltips *tooltips;
......@@ -627,6 +714,54 @@ create_intf_popup (void)
gtk_container_add (GTK_CONTAINER (intf_popup), separator5);
gtk_widget_set_sensitive (separator5, FALSE);
popup_navigation = gtk_menu_item_new_with_label (_("Navigation"));
gtk_widget_ref (popup_navigation);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_navigation", popup_navigation,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (popup_navigation);
gtk_container_add (GTK_CONTAINER (intf_popup), popup_navigation);
gtk_widget_set_sensitive (popup_navigation, FALSE);
separator10 = gtk_menu_item_new ();
gtk_widget_ref (separator10);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator10", separator10,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (separator10);
gtk_container_add (GTK_CONTAINER (intf_popup), separator10);
gtk_widget_set_sensitive (separator10, FALSE);
popup_audio = gtk_menu_item_new_with_label ("");
tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (popup_audio)->child),
_("A_udio"));
gtk_widget_add_accelerator (popup_audio, "activate_item", intf_popup_accels,
tmp_key, 0, 0);
gtk_widget_ref (popup_audio);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_audio", popup_audio,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (popup_audio);
gtk_container_add (GTK_CONTAINER (intf_popup), popup_audio);
gtk_widget_set_sensitive (popup_audio, FALSE);
popup_subpictures = gtk_menu_item_new_with_label ("");
tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (popup_subpictures)->child),
_("Sub _Pictures"));
gtk_widget_add_accelerator (popup_subpictures, "activate_item", intf_popup_accels,
tmp_key, 0, 0);
gtk_widget_ref (popup_subpictures);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_subpictures", popup_subpictures,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (popup_subpictures);
gtk_container_add (GTK_CONTAINER (intf_popup), popup_subpictures);
gtk_widget_set_sensitive (popup_subpictures, FALSE);
separator9 = gtk_menu_item_new ();
gtk_widget_ref (separator9);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator9", separator9,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (separator9);
gtk_container_add (GTK_CONTAINER (intf_popup), separator9);
gtk_widget_set_sensitive (separator9, FALSE);
popup_about = gtk_menu_item_new_with_label ("");
tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (popup_about)->child),
_("_About..."));
......
......@@ -2,7 +2,7 @@
* gtk_sys.h: private Gtk+ interface description
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: gtk_sys.h,v 1.2 2001/03/04 03:12:00 sam Exp $
* $Id: gtk_sys.h,v 1.3 2001/03/07 10:31:10 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -38,6 +38,7 @@ typedef struct intf_sys_s
boolean_t b_popup_changed; /* display menu ? */
boolean_t b_window_changed; /* window display toggled ? */
boolean_t b_playlist_changed; /* playlist display toggled ? */
boolean_t b_menus_update; /* menus have changed ? */
boolean_t b_scale_isfree; /* user isn't dragging scale ? */
/* intf_Manage callback timeout */
......
......@@ -2,9 +2,10 @@
* intf_gtk.c: Gtk+ interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_gtk.c,v 1.3 2001/03/05 01:29:25 sam Exp $
* $Id: intf_gtk.c,v 1.4 2001/03/07 10:31:10 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -50,6 +51,7 @@
#include "interface.h"
#include "gtk_sys.h"
#include "gtk_callbacks.h"
#include "gtk_interface.h"
#include "gtk_support.h"
......@@ -64,6 +66,13 @@ static void intf_Close ( intf_thread_t *p_intf );