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 @@ ...@@ -4,7 +4,7 @@
* control the pace of reading. * control the pace of reading.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * 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> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -52,6 +52,8 @@ typedef struct es_descriptor_s ...@@ -52,6 +52,8 @@ typedef struct es_descriptor_s
boolean_t b_audio; /* is the stream an audio stream that boolean_t b_audio; /* is the stream an audio stream that
* will need to be discarded with * will need to be discarded with
* fast forward and slow motion ? */ * fast forward and slow motion ? */
boolean_t b_spu;
char psz_desc[20]; /* description of ES: audio language char psz_desc[20]; /* description of ES: audio language
* for instance ; NULL if not * for instance ; NULL if not
* available */ * available */
...@@ -269,6 +271,8 @@ typedef struct input_thread_s ...@@ -269,6 +271,8 @@ typedef struct input_thread_s
void (* pf_delete_pes)( void *, struct pes_packet_s * ); void (* pf_delete_pes)( void *, struct pes_packet_s * );
/* Stream control capabilities */ /* Stream control capabilities */
int (* pf_set_area)( struct input_thread_s *,
struct input_area_s * );
int (* pf_rewind)( struct input_thread_s * ); int (* pf_rewind)( struct input_thread_s * );
/* NULL if we don't support going * /* NULL if we don't support going *
* backwards (it's gonna be fun) */ * backwards (it's gonna be fun) */
...@@ -348,3 +352,4 @@ void input_SetRate ( struct input_thread_s *, int ); ...@@ -348,3 +352,4 @@ void input_SetRate ( struct input_thread_s *, int );
void input_Seek ( struct input_thread_s *, off_t ); void input_Seek ( struct input_thread_s *, off_t );
void input_DumpStream( struct input_thread_s * ); void input_DumpStream( struct input_thread_s * );
char * input_OffsetToTime( struct input_thread_s *, char * psz_buffer, off_t ); 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; ...@@ -49,6 +49,9 @@ typedef void * module_handle_t;
#define MODULE_CAPABILITY_AFX 1 << 11 /* Audio effects */ #define MODULE_CAPABILITY_AFX 1 << 11 /* Audio effects */
#define MODULE_CAPABILITY_VFX 1 << 12 /* Video effects */ #define MODULE_CAPABILITY_VFX 1 << 12 /* Video effects */
/* FIXME: kludge */
struct input_area_s;
/* FIXME: not yet used */ /* FIXME: not yet used */
typedef struct probedata_s typedef struct probedata_s
{ {
...@@ -81,9 +84,6 @@ typedef struct function_list_s ...@@ -81,9 +84,6 @@ typedef struct function_list_s
void ( * pf_close )( struct input_thread_s * ); void ( * pf_close )( struct input_thread_s * );
void ( * pf_end ) ( 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 *, int ( * pf_read ) ( struct input_thread_s *,
struct data_packet_s * struct data_packet_s *
pp_packets[] ); pp_packets[] );
...@@ -95,8 +95,11 @@ typedef struct function_list_s ...@@ -95,8 +95,11 @@ typedef struct function_list_s
void ( * pf_delete_packet ) ( void *, struct data_packet_s * ); void ( * pf_delete_packet ) ( void *, struct data_packet_s * );
void ( * pf_delete_pes ) ( void *, struct pes_packet_s * ); void ( * pf_delete_pes ) ( void *, struct pes_packet_s * );
int ( * pf_rewind ) ( struct input_thread_s * );
void ( * pf_seek ) ( struct input_thread_s *, off_t ); 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; } input;
/* Audio output plugin */ /* Audio output plugin */
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* -dvd_udf to find files * -dvd_udf to find files
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * 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> * Author: Stphane Borel <stef@via.ecp.fr>
* *
...@@ -248,7 +248,7 @@ static int DVDRead ( struct input_thread_s *, data_packet_t ** ); ...@@ -248,7 +248,7 @@ static int DVDRead ( struct input_thread_s *, data_packet_t ** );
static void DVDInit ( struct input_thread_s * ); static void DVDInit ( struct input_thread_s * );
static void DVDEnd ( struct input_thread_s * ); static void DVDEnd ( struct input_thread_s * );
static void DVDSeek ( struct input_thread_s *, off_t ); 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 * ); static int DVDRewind ( struct input_thread_s * );
/***************************************************************************** /*****************************************************************************
...@@ -441,13 +441,10 @@ static int DVDChapterSelect( thread_dvd_data_t * p_dvd, int i_chapter ) ...@@ -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. * i_audio, i_spu start from 1 ; 0 means off.
* A negative value for an argument means it does not change * A negative value for an argument means it does not change
*****************************************************************************/ *****************************************************************************/
static int DVDSetArea( input_thread_t * p_input, static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
int i_title, int i_chapter,
int i_audio, int i_spu )
{ {
thread_dvd_data_t * p_dvd; thread_dvd_data_t * p_dvd;
es_descriptor_t * p_es; es_descriptor_t * p_es;
int i_index;
int i_nb; int i_nb;
u16 i_id; u16 i_id;
u8 i_ac3; u8 i_ac3;
...@@ -455,30 +452,29 @@ static int DVDSetArea( input_thread_t * p_input, ...@@ -455,30 +452,29 @@ static int DVDSetArea( input_thread_t * p_input,
u8 i_sub_pic; u8 i_sub_pic;
u8 i; u8 i;
boolean_t b_last; boolean_t b_last;
p_dvd = (thread_dvd_data_t*)p_input->p_plugin_data; p_dvd = (thread_dvd_data_t*)p_input->p_plugin_data;
vlc_mutex_lock( &p_input->stream.stream_lock ); 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 * We have to load all title information
*/ */
/* Change the default area */ /* 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! */ /* 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 */ /* title position inside the selected vts */
p_dvd->i_vts_title = 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 */ /* vts number */
p_dvd->ifo.i_title = i_title; p_dvd->ifo.i_title = p_dvd->i_title;
/* ifo vts */ /* ifo vts */
IfoReadVTS( &(p_dvd->ifo) ); IfoReadVTS( &(p_dvd->ifo) );
...@@ -488,7 +484,7 @@ static int DVDSetArea( input_thread_t * p_input, ...@@ -488,7 +484,7 @@ static int DVDSetArea( input_thread_t * p_input,
if( p_dvd->b_encrypted ) if( p_dvd->b_encrypted )
{ {
p_dvd->p_css->i_title = 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->p_css->i_title_pos =
p_dvd->ifo.vts.i_pos + p_dvd->ifo.vts.i_pos +
p_dvd->ifo.vts.mat.i_tt_vobs_ssector * DVD_LB_SIZE; p_dvd->ifo.vts.mat.i_tt_vobs_ssector * DVD_LB_SIZE;
...@@ -526,11 +522,11 @@ static int DVDSetArea( input_thread_t * p_input, ...@@ -526,11 +522,11 @@ static int DVDSetArea( input_thread_t * p_input,
lseek( p_input->i_handle, p_dvd->i_start, SEEK_SET ); 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: vobstart at: %lld", p_dvd->i_start );
intf_WarnMsg( 2, "dvd info: stream size: %lld", p_dvd->i_size ); intf_WarnMsg( 2, "dvd info: stream size: %lld", p_dvd->i_size );
intf_WarnMsg( 2, "dvd info: number of chapters: %d", 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 );*/ /* intf_WarnMsg( 3, "last: %d index: %d", i_last_chapter, i_index );*/
...@@ -547,7 +543,19 @@ static int DVDSetArea( input_thread_t * p_input, ...@@ -547,7 +543,19 @@ static int DVDSetArea( input_thread_t * p_input,
*/ */
if( p_input->stream.pp_programs != NULL ) 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] ); 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 ) ); input_AddProgram( p_input, 0, sizeof( stream_ps_data_t ) );
...@@ -560,6 +568,7 @@ static int DVDSetArea( input_thread_t * p_input, ...@@ -560,6 +568,7 @@ static int DVDSetArea( input_thread_t * p_input,
p_es->i_type = MPEG2_VIDEO_ES; p_es->i_type = MPEG2_VIDEO_ES;
input_SelectES( p_input, p_es ); input_SelectES( p_input, p_es );
intf_WarnMsg( 1, "dvd info: video MPEG2 stream" ); intf_WarnMsg( 1, "dvd info: video MPEG2 stream" );
/* Audio ES, in the order they appear in .ifo */ /* Audio ES, in the order they appear in .ifo */
i_nb = p_dvd->ifo.vts.mat.i_audio_nb; i_nb = p_dvd->ifo.vts.mat.i_audio_nb;
...@@ -648,6 +657,7 @@ static int DVDSetArea( input_thread_t * p_input, ...@@ -648,6 +657,7 @@ static int DVDSetArea( input_thread_t * p_input,
p_input->stream.pp_programs[0], i_id, 0 ); p_input->stream.pp_programs[0], i_id, 0 );
p_es->i_stream_id = 0xbd; p_es->i_stream_id = 0xbd;
p_es->i_type = DVD_SPU_ES; p_es->i_type = DVD_SPU_ES;
p_es->b_spu = 1;
strcpy( p_es->psz_desc, Language( hton16( strcpy( p_es->psz_desc, Language( hton16(
p_dvd->ifo.vts.mat.p_subpic_atrt[i-1].i_lang_code ) ) ); 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)", intf_WarnMsg( 1, "dvd info: spu stream %d %s\t(0x%x)",
...@@ -660,84 +670,31 @@ static int DVDSetArea( input_thread_t * p_input, ...@@ -660,84 +670,31 @@ static int DVDSetArea( input_thread_t * p_input,
} }
} // i_title >= 0 } // i_title >= 0
else
/*
* 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 */ p_area = p_input->stream.p_selected_area;
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 );
}
} }
/* /*
* Chapter selection * Chapter selection
*/ */
if( ( i_chapter > 0 ) && if( ( p_area->i_part > 0 ) &&
( i_chapter <= p_input->stream.p_selected_area->i_part_nb ) ) ( 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_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; p_input->stream.p_selected_area->i_part = p_dvd->i_chapter;
intf_WarnMsg( 2, "dvd info: chapter %d start at: %lld", i_chapter, intf_WarnMsg( 2, "dvd info: chapter %d start at: %lld",
p_input->stream.p_selected_area->i_tell ); 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 */ /* No PSM to read in DVD mode, we already have all information */
p_input->stream.pp_programs[0]->b_is_ok = 1; p_input->stream.pp_programs[0]->b_is_ok = 1;
...@@ -779,7 +736,8 @@ static void DVDInit( input_thread_t * p_input ) ...@@ -779,7 +736,8 @@ static void DVDInit( input_thread_t * p_input )
/* Reading structures initialisation */ /* Reading structures initialisation */
p_input->p_method_data = 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" ); intf_WarnMsg( 2, "dvd info: netlist initialized" );
/* Ifo initialisation */ /* Ifo initialisation */
...@@ -845,7 +803,6 @@ static void DVDInit( input_thread_t * p_input ) ...@@ -845,7 +803,6 @@ static void DVDInit( input_thread_t * p_input )
i_title = 1; i_title = 1;
} }
#undef srpt #undef srpt
/* Get requested chapter - if none defaults to first one */ /* Get requested chapter - if none defaults to first one */
i_chapter = main_GetIntVariable( INPUT_CHAPTER_VAR, 1 ); i_chapter = main_GetIntVariable( INPUT_CHAPTER_VAR, 1 );
if( i_chapter <= 0 ) if( i_chapter <= 0 )
...@@ -853,6 +810,9 @@ static void DVDInit( input_thread_t * p_input ) ...@@ -853,6 +810,9 @@ static void DVDInit( input_thread_t * p_input )
i_chapter = 1; 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 */ /* For audio: first one if none or a not existing one specified */
i_audio = main_GetIntVariable( INPUT_CHANNEL_VAR, 1 ); i_audio = main_GetIntVariable( INPUT_CHANNEL_VAR, 1 );
if( i_audio <= 0 ) if( i_audio <= 0 )
...@@ -861,9 +821,17 @@ static void DVDInit( input_thread_t * p_input ) ...@@ -861,9 +821,17 @@ static void DVDInit( input_thread_t * p_input )
i_audio = 1; i_audio = 1;
} }
input_ChangeES( p_input, p_input->stream.pp_es[i_audio], 1 );
i_spu = main_GetIntVariable( INPUT_SUBTITLE_VAR, 0 ); 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; return;
} }
...@@ -922,7 +890,7 @@ static int DVDRead( input_thread_t * p_input, ...@@ -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 */ /* 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 ) if( p_dvd->i_sector > p_dvd->i_end_sector )
{ {
/* Find cell index in adress map */ /* Find cell index in adress map */
...@@ -949,16 +917,16 @@ static int DVDRead( input_thread_t * p_input, ...@@ -949,16 +917,16 @@ static int DVDRead( input_thread_t * p_input,
p_dvd->i_chapter = i_chapter; 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_tell = i_off -
p_input->stream.p_selected_area->i_start; p_input->stream.p_selected_area->i_start;
p_input->stream.p_selected_area->i_part = p_dvd->i_chapter; 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 */ /* Reads from DVD */
i_read_bytes = readv( p_dvd->i_fd, p_vec, p_dvd->i_block_once ); i_read_bytes = readv( p_dvd->i_fd, p_vec, p_dvd->i_block_once );
i_read_blocks = ( i_read_bytes + 0x7ff ) >> 11; i_read_blocks = ( i_read_bytes + 0x7ff ) >> 11;
...@@ -1036,13 +1004,13 @@ static int DVDRead( input_thread_t * p_input, ...@@ -1036,13 +1004,13 @@ static int DVDRead( input_thread_t * p_input,
pp_packets[i_packet] = NULL; 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_input->stream.p_selected_area->i_tell +=
p_dvd->i_block_once *DVD_LB_SIZE; p_dvd->i_block_once *DVD_LB_SIZE;
b_eof = p_input->stream.p_selected_area->i_tell < p_dvd->i_size ? 0 : 1; 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 ) ) if( ( i_read_blocks == p_dvd->i_block_once ) && ( !b_eof ) )
{ {
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
...@@ -733,3 +734,101 @@ on_popup_disc_activate (GtkMenuItem *menuitem, ...@@ -733,3 +734,101 @@ on_popup_disc_activate (GtkMenuItem *menuitem,
gdk_window_raise( p_intf->p_sys->p_disc->window ); 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, ...@@ -185,3 +185,31 @@ on_toolbar_disc_clicked (GtkButton *button,
void void
on_popup_disc_activate (GtkMenuItem *menuitem, on_popup_disc_activate (GtkMenuItem *menuitem,
gpointer user_data); 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) ...@@ -36,11 +36,18 @@ create_intf_window (void)
GtkWidget *menubar_view; GtkWidget *menubar_view;
GtkWidget *menubar_view_menu; GtkWidget *menubar_view_menu;
GtkAccelGroup *menubar_view_menu_accels; GtkAccelGroup *menubar_view_menu_accels;
GtkWidget *menubar_title;
GtkWidget *menubar_chapter;
GtkWidget *separator11;
GtkWidget *menubar_playlist; GtkWidget *menubar_playlist;
GtkWidget *menubar_modules; GtkWidget *menubar_modules;
GtkWidget *menubar_settings; GtkWidget *menubar_settings;
GtkWidget *menubar_settings_menu; GtkWidget *menubar_settings_menu;
GtkAccelGroup *menubar_settings_menu_accels; GtkAccelGroup *menubar_settings_menu_accels;
GtkWidget *separator7;
GtkWidget *menubar_audio;
GtkWidget *menubar_subpictures;
GtkWidget *separator8;
GtkWidget *menubar_preferences; GtkWidget *menubar_preferences;
GtkWidget *menubar_help; GtkWidget *menubar_help;
GtkWidget *menubar_help_menu; GtkWidget *menubar_help_menu;
...@@ -182,6 +189,39 @@ create_intf_window (void) ...@@ -182,6 +189,39 @@ create_intf_window (void)
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menubar_view), menubar_view_menu); 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_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);