* intf_gnome.c: Gnome interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: intf_gnome.c,v 1.22 2001/03/15 01:42:19 sam Exp $
+ * $Id: intf_gnome.c,v 1.29 2001/04/13 01:49:22 henri Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
+ * Stéphane 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
#include "intf_msg.h"
#include "interface.h"
+#include "intf_playlist.h"
#include "gnome_callbacks.h"
#include "gnome_interface.h"
void (*pf_toggle)(GtkCheckMenuItem *, gpointer) );
static gint GnomeSetupMenu ( intf_thread_t * p_intf );
static void GnomeDisplayDate ( GtkAdjustment *p_adj );
+static gint GnomeDVDModeManage( intf_thread_t * p_intf );
+static gint GnomeFileModeManage( intf_thread_t * p_intf );
+static gint GnomeNetworkModeManage( intf_thread_t * p_intf );
/*****************************************************************************
* g_atexit: kludge to avoid the Gnome thread to segfault at exit
return( 999 );
}
+ if( TestProgram( "gnome-vlc" ) )
+ {
+ return( 200 );
+ }
+
return( 100 );
}
p_intf->p_sys->b_slider_free = 1;
+ p_intf->p_sys->b_mode_changed = 1;
+ p_intf->p_sys->i_intf_mode = FILE_MODE;
+
+ p_intf->p_sys->i_part = 0;
+
p_intf->p_sys->pf_gtk_callback = NULL;
p_intf->p_sys->pf_gdk_callback = NULL;
GTK_OBJECT( p_intf->p_sys->p_window ), name ) )
p_intf->p_sys->p_label_date = P_LABEL( "label_date" );
p_intf->p_sys->p_label_status = P_LABEL( "label_status" );
+ p_intf->p_sys->p_label_title = P_LABEL( "label_title" );
+ p_intf->p_sys->p_label_chapter = P_LABEL( "label_chapter" );
#undef P_LABEL
/* Connect the date display to the slider */
p_intf->b_menu_change = 0;
}
- /* Update language/chapter menus after user request */
- if( p_intf->p_input != NULL && p_intf->p_sys->p_window != NULL &&
- p_intf->p_sys->b_menus_update )
+ if( p_intf->p_sys->b_mode_changed )
{
- GnomeSetupMenu( p_intf );
+ /* 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;
+ }
+
+ p_intf->p_sys->b_mode_changed = 0;
}
- /* Manage the slider */
+
if( p_intf->p_input != NULL )
{
- float newvalue = p_intf->p_sys->p_adj->value;
+ float newvalue;
+ char psz_title[3];
+ char psz_chapter[3];
+
+ /* Used by TS input when PMT changes */
+ if( p_intf->p_input->stream.b_changed )
+ {
+ p_intf->p_sys->b_menus_update = 1;
+ p_intf->p_input->stream.b_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;
+
/* 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 )
static gint GnomeLanguageMenus( gpointer p_data,
GtkWidget * p_root,
es_descriptor_t * p_es,
- gint i_type,
+ gint i_cat,
void(*pf_toggle )( GtkCheckMenuItem *, gpointer ) )
{
intf_thread_t * p_intf;
GtkWidget * p_menu;
GtkWidget * p_separator;
GtkWidget * p_item;
- GtkWidget * p_item_off;
+ GtkWidget * p_item_active;
GSList * p_group;
char * psz_name;
- gint b_active;
- gint b_audio;
- gint b_spu;
+ gint i_item;
gint i;
/* cast */
p_intf = (intf_thread_t *)p_data;
- vlc_mutex_lock( &p_intf->p_input->stream.stream_lock );
-
/* removes previous menu */
gtk_menu_item_remove_submenu( GTK_MENU_ITEM( p_root ) );
+ gtk_widget_set_sensitive( p_root, FALSE );
- b_audio = ( i_type == 1 );
p_group = NULL;
/* menu container */
p_menu = gtk_menu_new();
/* special case for "off" item */
- b_active = ( p_es == NULL ) ? TRUE : FALSE;
psz_name = "Off";
- p_item_off = gtk_radio_menu_item_new_with_label( p_group, psz_name );
- p_group = gtk_radio_menu_item_group( GTK_RADIO_MENU_ITEM( p_item_off ) );
- gtk_widget_show( p_item_off );
- gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( p_item_off ),
- b_active );
- gtk_menu_append( GTK_MENU( p_menu ), p_item_off );
+ p_item = gtk_radio_menu_item_new_with_label( p_group, psz_name );
+ p_group = gtk_radio_menu_item_group( GTK_RADIO_MENU_ITEM( p_item ) );
+
+ gtk_widget_show( p_item );
+
+ /* signal hanling for off */
+ gtk_signal_connect( GTK_OBJECT( p_item ), "toggled",
+ GTK_SIGNAL_FUNC ( pf_toggle ), NULL );
+
+ gtk_menu_append( GTK_MENU( p_menu ), p_item );
p_separator = gtk_menu_item_new();
+ gtk_widget_set_sensitive( p_separator, FALSE );
gtk_widget_show( p_separator );
gtk_menu_append( GTK_MENU( p_menu ), p_separator );
- gtk_widget_set_sensitive( p_separator, FALSE );
+
+ vlc_mutex_lock( &p_intf->p_input->stream.stream_lock );
+ p_item_active = NULL;
+ i_item = 0;
/* create a set of language buttons and append them to the container */
for( i = 0 ; i < p_intf->p_input->stream.i_es_number ; i++ )
{
-
- b_audio = ( i_type == 1 ) && p_intf->p_input->stream.pp_es[i]->b_audio;
- b_spu = ( i_type == 2 ) && p_intf->p_input->stream.pp_es[i]->b_spu;
-
- if( b_audio || b_spu )
+ if( p_intf->p_input->stream.pp_es[i]->i_cat == i_cat )
{
- b_active = ( p_es == p_intf->p_input->stream.pp_es[i] ) ? TRUE :
- FALSE;
+ i_item++;
psz_name = p_intf->p_input->stream.pp_es[i]->psz_desc;
+ if( psz_name[0] == '\0' )
+ {
+ sprintf( psz_name, "Language %d", i_item );
+ }
p_item = gtk_radio_menu_item_new_with_label( p_group, psz_name );
p_group =
gtk_radio_menu_item_group( GTK_RADIO_MENU_ITEM( p_item ) );
- gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( p_item ),
- b_active );
- gtk_menu_append( GTK_MENU( p_menu ), p_item );
+
+ if( p_es == p_intf->p_input->stream.pp_es[i] )
+ {
+ /* don't lose p_item when we append into menu */
+ p_item_active = p_item;
+ }
+
gtk_widget_show( p_item );
/* setup signal hanling */
GTK_SIGNAL_FUNC( pf_toggle ),
(gpointer)( p_intf->p_input->stream.pp_es[i] ) );
+ gtk_menu_append( GTK_MENU( p_menu ), p_item );
}
}
- /* signal hanling for off - dunno why this does not work
- * if it is before the loop */
- gtk_signal_connect( GTK_OBJECT( p_item_off ), "toggled",
- GTK_SIGNAL_FUNC ( pf_toggle ), NULL );
+ vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock );
/* link the new menu to the menubar item */
gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_root ), p_menu );
- /* be sure that menu is sensitive */
- gtk_widget_set_sensitive( p_root, TRUE );
+ /* acitvation will call signals so we can only do it
+ * when submenu is attached to menu - to get intf_window */
+ if( p_item_active != NULL )
+ {
+ gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( p_item_active ),
+ TRUE );
+ }
- vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock );
+ /* be sure that menu is sensitive if non empty */
+ if( i_item > 0 )
+ {
+ gtk_widget_set_sensitive( p_root, TRUE );
+ }
return TRUE;
}
intf_thread_t * p_intf;
char psz_name[10];
GtkWidget * p_chapter_menu;
+ GtkWidget * p_chapter_submenu;
+ GtkWidget * p_menu_item;
GtkWidget * p_item;
+ GtkWidget * p_item_selected;
GSList * p_chapter_group;
gint i_title;
gint i_chapter;
- gint b_active;
+ gint i_nb;
/* cast */
p_intf = (intf_thread_t*)p_data;
/* removes previous menu */
gtk_menu_item_remove_submenu( GTK_MENU_ITEM( p_chapter ) );
+ gtk_widget_set_sensitive( p_chapter, FALSE );
+ p_chapter_submenu = NULL;
p_chapter_group = NULL;
+ p_item_selected = NULL;
+ p_menu_item = NULL;
i_title = p_intf->p_input->stream.p_selected_area->i_id;
p_chapter_menu = gtk_menu_new();
+ i_nb = p_intf->p_input->stream.pp_areas[i_title]->i_part_nb;
- for( i_chapter = 0;
- i_chapter < p_intf->p_input->stream.pp_areas[i_title]->i_part_nb ;
- i_chapter++ )
+ for( i_chapter = 0 ; i_chapter < i_nb ; i_chapter++ )
{
- b_active = ( p_intf->p_input->stream.pp_areas[i_title]->i_part
- == i_chapter + 1 ) ? 1 : 0;
-
+ /* we group chapters in packets of ten for small screens */
+ if( ( i_chapter % 10 == 0 ) && ( i_nb > 20 ) )
+ {
+ if( i_chapter != 0 )
+ {
+ gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_menu_item ),
+ p_chapter_submenu );
+ gtk_menu_append( GTK_MENU( p_chapter_menu ), p_menu_item );
+ }
+
+ sprintf( psz_name, "%d - %d", i_chapter + 1, i_chapter + 10);
+ p_menu_item = gtk_menu_item_new_with_label( psz_name );
+ gtk_widget_show( p_menu_item );
+ p_chapter_submenu = gtk_menu_new();
+ }
+
sprintf( psz_name, "Chapter %d", i_chapter + 1 );
p_item = gtk_radio_menu_item_new_with_label( p_chapter_group,
psz_name );
p_chapter_group =
gtk_radio_menu_item_group( GTK_RADIO_MENU_ITEM( p_item ) );
- gtk_menu_append( GTK_MENU( p_chapter_menu ), p_item );
+
+ if( p_intf->p_input->stream.pp_areas[i_title]->i_part
+ == i_chapter + 1 )
+ {
+ p_item_selected = p_item;
+ }
+
gtk_widget_show( p_item );
- gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( p_item ),
- b_active );
/* setup signal hanling */
gtk_signal_connect( GTK_OBJECT( p_item ),
"toggled",
GTK_SIGNAL_FUNC( pf_toggle ),
(gpointer)(i_chapter + 1) );
+
+ if( i_nb > 20 )
+ {
+ gtk_menu_append( GTK_MENU( p_chapter_submenu ), p_item );
+ }
+ else
+ {
+ gtk_menu_append( GTK_MENU( p_chapter_menu ), p_item );
+ }
+ }
+
+ if( i_nb > 20 )
+ {
+ gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_menu_item ),
+ p_chapter_submenu );
+ gtk_menu_append( GTK_MENU( p_chapter_menu ), p_menu_item );
}
/* link the new menu to the title menu item */
gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_chapter ),
p_chapter_menu );
- /* be sure that chapter menu is sensitive */
- gtk_widget_set_sensitive( p_chapter, TRUE );
+ /* toggle currently selected chapter */
+ if( p_item_selected != NULL )
+ {
+ gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( p_item_selected ),
+ TRUE );
+ }
+
+ /* be sure that chapter menu is sensitive, if there are several items */
+ if( p_intf->p_input->stream.pp_areas[i_title]->i_part_nb > 1 )
+ {
+ gtk_widget_set_sensitive( p_chapter, TRUE );
+ }
return TRUE;
}
intf_thread_t * p_intf;
char psz_name[10];
GtkWidget * p_title_menu;
+ GtkWidget * p_title_submenu;
GtkWidget * p_title_item;
+ GtkWidget * p_item_active;
GtkWidget * p_chapter_menu;
+ GtkWidget * p_chapter_submenu;
+ GtkWidget * p_title_menu_item;
+ GtkWidget * p_chapter_menu_item;
GtkWidget * p_item;
GSList * p_title_group;
GSList * p_chapter_group;
gint i_title;
gint i_chapter;
- gint b_active;
+ gint i_title_nb;
+ gint i_chapter_nb;
/* cast */
p_intf = (intf_thread_t*)p_data;
p_title_menu = gtk_menu_new();
p_title_group = NULL;
+ p_title_submenu = NULL;
+ p_title_menu_item = NULL;
p_chapter_group = NULL;
+ p_chapter_submenu = NULL;
+ p_chapter_menu_item = NULL;
+ p_item_active = NULL;
+ i_title_nb = p_intf->p_input->stream.i_area_nb;
/* loop on titles */
- for( i_title = 1 ;
- i_title < p_intf->p_input->stream.i_area_nb ;
- i_title++ )
+ for( i_title = 1 ; i_title < i_title_nb ; i_title++ )
{
- b_active = ( p_intf->p_input->stream.pp_areas[i_title] ==
- p_intf->p_input->stream.p_selected_area ) ? 1 : 0;
- sprintf( psz_name, "Title %d", i_title );
-
- p_title_item = gtk_radio_menu_item_new_with_label( p_title_group,
- psz_name );
- p_title_group =
- gtk_radio_menu_item_group( GTK_RADIO_MENU_ITEM( p_title_item ) );
- gtk_menu_append( GTK_MENU( p_title_menu ), p_title_item );
- gtk_widget_show( p_title_item );
+ /* we group titles in packets of ten for small screens */
+ if( ( i_title % 10 == 1 ) && ( i_title_nb > 20 ) )
+ {
+ if( i_title != 1 )
+ {
+ gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_title_menu_item ),
+ p_title_submenu );
+ gtk_menu_append( GTK_MENU( p_title_menu ), p_title_menu_item );
+ }
+
+ sprintf( psz_name, "%d - %d", i_title, i_title + 9 );
+ p_title_menu_item = gtk_menu_item_new_with_label( psz_name );
+ gtk_widget_show( p_title_menu_item );
+ p_title_submenu = gtk_menu_new();
+ }
-
+ sprintf( psz_name, "Title %d", i_title );
if( pf_toggle == on_menubar_title_toggle )
{
+ p_title_item = gtk_radio_menu_item_new_with_label( p_title_group,
+ psz_name );
+ p_title_group =
+ gtk_radio_menu_item_group( GTK_RADIO_MENU_ITEM( p_title_item ) );
+
+ if( p_intf->p_input->stream.pp_areas[i_title] ==
+ p_intf->p_input->stream.p_selected_area )
+ {
+ p_item_active = p_title_item;
+ }
- gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( p_title_item ),
- b_active );
/* setup signal hanling */
gtk_signal_connect( GTK_OBJECT( p_title_item ),
"toggled",
GTK_SIGNAL_FUNC( pf_toggle ),
(gpointer)(p_intf->p_input->stream.pp_areas[i_title]) );
+
+ if( p_intf->p_input->stream.i_area_nb > 1 )
+ {
+ /* be sure that menu is sensitive */
+ gtk_widget_set_sensitive( p_navigation, TRUE );
+ }
}
else
{
+
+ p_title_item = gtk_menu_item_new_with_label( psz_name );
p_chapter_menu = gtk_menu_new();
+ i_chapter_nb =
+ p_intf->p_input->stream.pp_areas[i_title]->i_part_nb;
- for( i_chapter = 0;
- i_chapter <
- p_intf->p_input->stream.pp_areas[i_title]->i_part_nb ;
- i_chapter++ )
+ for( i_chapter = 0 ; i_chapter < i_chapter_nb ; i_chapter++ )
{
- b_active = ( p_intf->p_input->stream.pp_areas[i_title]->i_part
- == i_chapter + 1 ) ? 1 : 0;
-
+ /* we group chapters in packets of ten for small screens */
+ if( ( i_chapter % 10 == 0 ) && ( i_chapter_nb > 20 ) )
+ {
+ if( i_chapter != 0 )
+ {
+ gtk_menu_item_set_submenu(
+ GTK_MENU_ITEM( p_chapter_menu_item ),
+ p_chapter_submenu );
+ gtk_menu_append( GTK_MENU( p_chapter_menu ),
+ p_chapter_menu_item );
+ }
+
+ sprintf( psz_name, "%d - %d", i_chapter + 1,
+ i_chapter + 10);
+ p_chapter_menu_item =
+ gtk_menu_item_new_with_label( psz_name );
+ gtk_widget_show( p_chapter_menu_item );
+ p_chapter_submenu = gtk_menu_new();
+ }
+
sprintf( psz_name, "Chapter %d", i_chapter + 1 );
p_item = gtk_radio_menu_item_new_with_label(
p_chapter_group, psz_name );
p_chapter_group = gtk_radio_menu_item_group(
GTK_RADIO_MENU_ITEM( p_item ) );
- gtk_menu_append( GTK_MENU( p_chapter_menu ), p_item );
gtk_widget_show( p_item );
- gtk_check_menu_item_set_active(
- GTK_CHECK_MENU_ITEM( p_item ), b_active );
+
+#define p_area p_intf->p_input->stream.pp_areas[i_title]
+ if( ( p_area == p_intf->p_input->stream.p_selected_area ) &&
+ ( p_area->i_part == i_chapter + 1 ) )
+ {
+ p_item_active = p_item;
+ }
+#undef p_area
/* setup signal hanling */
gtk_signal_connect( GTK_OBJECT( p_item ),
"toggled",
GTK_SIGNAL_FUNC( pf_toggle ),
(gpointer)( ( i_title * 100 ) + ( i_chapter + 1) ) );
- }
- /* link the new menu to the title menu item */
- gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_title_item ),
- p_chapter_menu );
+ if( i_chapter_nb > 20 )
+ {
+ gtk_menu_append( GTK_MENU( p_chapter_submenu ), p_item );
+ }
+ else
+ {
+ gtk_menu_append( GTK_MENU( p_chapter_menu ), p_item );
+ }
+ }
+
+ if( i_chapter_nb > 20 )
+ {
+ gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_chapter_menu_item ),
+ p_chapter_submenu );
+ gtk_menu_append( GTK_MENU( p_chapter_menu ),
+ p_chapter_menu_item );
+ }
+
+ /* link the new menu to the title menu item */
+ gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_title_item ),
+ p_chapter_menu );
+
+ if( p_intf->p_input->stream.pp_areas[i_title]->i_part_nb > 1 )
+ {
+ /* be sure that menu is sensitive */
+ gtk_widget_set_sensitive( p_navigation, TRUE );
+ }
}
+ gtk_widget_show( p_title_item );
- /* be sure that chapter menu is sensitive */
- gtk_widget_set_sensitive( p_title_menu, TRUE );
+ if( i_title_nb > 20 )
+ {
+ gtk_menu_append( GTK_MENU( p_title_submenu ), p_title_item );
+ }
+ else
+ {
+ gtk_menu_append( GTK_MENU( p_title_menu ), p_title_item );
+ }
+ }
+ if( i_title_nb > 20 )
+ {
+ gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_title_menu_item ),
+ p_title_submenu );
+ gtk_menu_append( GTK_MENU( p_title_menu ), p_title_menu_item );
}
+ /* be sure that menu is sensitive */
+ gtk_widget_set_sensitive( p_title_menu, TRUE );
+
/* link the new menu to the menubar item */
gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_navigation ), p_title_menu );
- /* be sure that menu is sensitive */
- gtk_widget_set_sensitive( p_navigation, TRUE );
+ if( p_item_active != NULL )
+ {
+ gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( p_item_active ),
+ TRUE );
+ }
return TRUE;
GtkWidget * p_popup_menu;
gint i;
- 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 );
-
- 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 );
-
- p_popup_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_popup ), "popup_navigation" ) );
+ if( p_intf->p_input->stream.i_area_nb > 1 )
+ {
+ 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 );
- GnomeTitleMenu( p_intf, p_popup_menu, on_popup_navigation_toggle );
+ 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 );
+ }
/* look for selected ES */
p_audio_es = NULL;
for( i = 0 ; i < p_intf->p_input->stream.i_selected_es_number ; i++ )
{
- if( p_intf->p_input->stream.pp_es[i]->b_audio )
+ if( p_intf->p_input->stream.pp_selected_es[i]->i_cat == AUDIO_ES )
{
- p_audio_es = p_intf->p_input->stream.pp_es[i];
+ p_audio_es = p_intf->p_input->stream.pp_selected_es[i];
}
- if( p_intf->p_input->stream.pp_es[i]->b_spu )
+ if( p_intf->p_input->stream.pp_selected_es[i]->i_cat == SPU_ES )
{
- p_spu_es = p_intf->p_input->stream.pp_es[i];
+ p_spu_es = p_intf->p_input->stream.pp_selected_es[i];
}
}
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, 1,
- on_menubar_audio_toggle );
- GnomeLanguageMenus( p_intf, p_popup_menu, p_audio_es, 1,
- on_popup_audio_toggle );
+ 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 );
/* sub picture menus */
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, 2,
- on_menubar_subtitle_toggle );
- GnomeLanguageMenus( p_intf, p_popup_menu, p_spu_es, 2,
- on_popup_subtitle_toggle );
-
- /* everything is ready */
- p_intf->p_sys->b_menus_update = 0;
+ 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 );
return TRUE;
}
}
+/*****************************************************************************
+ * GnomeDVDModeManage
+ *****************************************************************************/
+static gint GnomeDVDModeManage( intf_thread_t * p_intf )
+{
+ GtkWidget * p_dvd_box;
+ GtkWidget * p_file_box;
+ GtkWidget * p_network_box;
+
+ p_file_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
+ p_intf->p_sys->p_window ), "file_box" ) );
+ gtk_widget_hide( GTK_WIDGET( p_file_box ) );
+
+ p_network_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
+ p_intf->p_sys->p_window ), "network_box" ) );
+ gtk_widget_hide( GTK_WIDGET( p_network_box ) );
+
+ p_dvd_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
+ p_intf->p_sys->p_window ), "dvd_box" ) );
+ gtk_widget_show( GTK_WIDGET( p_dvd_box ) );
+
+ gtk_label_set_text( p_intf->p_sys->p_label_status,
+ "Status: playing DVD" );
+
+ return TRUE;
+}
+
+/*****************************************************************************
+ * GnomeFileModeManage
+ *****************************************************************************/
+static gint GnomeFileModeManage( intf_thread_t * p_intf )
+{
+ GtkWidget * p_dvd_box;
+ GtkWidget * p_file_box;
+ GtkWidget * p_network_box;
+
+ p_network_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
+ p_intf->p_sys->p_window ), "network_box" ) );
+ gtk_widget_hide( GTK_WIDGET( p_network_box ) );
+
+ p_dvd_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
+ p_intf->p_sys->p_window ), "dvd_box" ) );
+ gtk_widget_hide( GTK_WIDGET( p_dvd_box ) );
+
+ p_file_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
+ p_intf->p_sys->p_window ), "file_box" ) );
+ gtk_widget_show( GTK_WIDGET( p_file_box ) );
+
+ gtk_label_set_text( p_intf->p_sys->p_label_status,
+ "Status: foo" );
+
+ return TRUE;
+}
+
+/*****************************************************************************
+ * GnomeNetworkModeManage
+ *****************************************************************************/
+static gint GnomeNetworkModeManage( intf_thread_t * p_intf )
+{
+ GtkWidget * p_dvd_box;
+ GtkWidget * p_file_box;
+ GtkWidget * p_network_box;
+
+ p_dvd_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
+ p_intf->p_sys->p_window ), "dvd_box" ) );
+ gtk_widget_hide( GTK_WIDGET( p_dvd_box ) );
+
+ p_file_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
+ p_intf->p_sys->p_window ), "file_box" ) );
+ gtk_widget_hide( GTK_WIDGET( p_file_box ) );
+
+ p_network_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
+ p_intf->p_sys->p_window ), "network_box" ) );
+ gtk_widget_show( GTK_WIDGET( p_network_box ) );
+
+ gtk_label_set_text( p_intf->p_sys->p_label_status,
+ "Status: waiting for stream" );
+
+ return TRUE;
+}