Commit 0b163416 authored by Johan Bilien's avatar Johan Bilien

Added a menu in the GTK and gnome interfaces to change the current program

in multi-program streams (such as ones provided by a DVB-S card).
parent c40571df
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions * Collection of useful common types and macros definitions
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: common.h,v 1.76 2002/02/24 20:51:09 gbazin Exp $ * $Id: common.h,v 1.77 2002/02/24 21:36:20 jobi Exp $
* *
* Authors: Samuel Hocevar <sam@via.ecp.fr> * Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr> * Vincent Seguin <seguin@via.ecp.fr>
...@@ -488,6 +488,7 @@ typedef struct module_symbols_s ...@@ -488,6 +488,7 @@ typedef struct module_symbols_s
struct es_descriptor_s *, boolean_t ); struct es_descriptor_s *, boolean_t );
int ( * input_ChangeArea ) ( struct input_thread_s *, int ( * input_ChangeArea ) ( struct input_thread_s *,
struct input_area_s * ); struct input_area_s * );
int ( * input_ChangeProgram ) ( struct input_thread_s *, u16 );
struct es_descriptor_s * ( * input_FindES ) ( struct input_thread_s *, struct es_descriptor_s * ( * input_FindES ) ( struct input_thread_s *,
u16 ); u16 );
struct es_descriptor_s * ( * input_AddES ) ( struct input_thread_s *, struct es_descriptor_s * ( * input_AddES ) ( struct input_thread_s *,
......
...@@ -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.59 2002/02/15 13:32:52 sam Exp $ * $Id: input_ext-intf.h,v 1.60 2002/02/24 21:36:20 jobi Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -351,6 +351,7 @@ int input_ChangeES ( struct input_thread_s *, ...@@ -351,6 +351,7 @@ int input_ChangeES ( struct input_thread_s *,
int input_ToggleES ( struct input_thread_s *, int input_ToggleES ( struct input_thread_s *,
struct es_descriptor_s *, boolean_t ); struct es_descriptor_s *, boolean_t );
int input_ChangeArea ( struct input_thread_s *, struct input_area_s * ); int input_ChangeArea ( struct input_thread_s *, struct input_area_s * );
int input_ChangeProgram ( struct input_thread_s *, u16 );
int input_ToggleGrayscale( struct input_thread_s * ); int input_ToggleGrayscale( struct input_thread_s * );
int input_ToggleMute ( struct input_thread_s * ); int input_ToggleMute ( struct input_thread_s * );
int input_SetSMP ( struct input_thread_s *, int ); int input_SetSMP ( struct input_thread_s *, int );
...@@ -362,5 +363,6 @@ int input_SetSMP ( struct input_thread_s *, int ); ...@@ -362,5 +363,6 @@ int input_SetSMP ( struct input_thread_s *, int );
# define input_ChangeES p_symbols->input_ChangeES # define input_ChangeES p_symbols->input_ChangeES
# define input_ToggleES p_symbols->input_ToggleES # define input_ToggleES p_symbols->input_ToggleES
# define input_ChangeArea p_symbols->input_ChangeArea # define input_ChangeArea p_symbols->input_ChangeArea
# define input_ChangeProgram p_symbols->input_ChangeProgram
#endif #endif
...@@ -206,6 +206,15 @@ ...@@ -206,6 +206,15 @@
<right_justify>False</right_justify> <right_justify>False</right_justify>
</widget> </widget>
<widget>
<class>GtkMenuItem</class>
<name>menubar_program</name>
<sensitive>False</sensitive>
<tooltip>Choose the program</tooltip>
<label>Progr_am</label>
<right_justify>False</right_justify>
</widget>
<widget> <widget>
<class>GtkMenuItem</class> <class>GtkMenuItem</class>
<name>menubar_title</name> <name>menubar_title</name>
......
...@@ -66,6 +66,13 @@ static GnomeUIInfo menubar_view_menu_uiinfo[] = ...@@ -66,6 +66,13 @@ static GnomeUIInfo menubar_view_menu_uiinfo[] =
0, (GdkModifierType) 0, NULL 0, (GdkModifierType) 0, NULL
}, },
GNOMEUIINFO_SEPARATOR, GNOMEUIINFO_SEPARATOR,
{
GNOME_APP_UI_ITEM, N_("Progr_am"),
N_("Choose the program"),
(gpointer) NULL, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, (GdkModifierType) 0, NULL
},
{ {
GNOME_APP_UI_ITEM, N_("_Title"), GNOME_APP_UI_ITEM, N_("_Title"),
N_("Choose title"), N_("Choose title"),
...@@ -271,43 +278,49 @@ create_intf_window (void) ...@@ -271,43 +278,49 @@ create_intf_window (void)
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (menubar_view_menu_uiinfo[3].widget); gtk_widget_ref (menubar_view_menu_uiinfo[3].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_title", gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_program",
menubar_view_menu_uiinfo[3].widget, menubar_view_menu_uiinfo[3].widget,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_set_sensitive (menubar_view_menu_uiinfo[3].widget, FALSE); gtk_widget_set_sensitive (menubar_view_menu_uiinfo[3].widget, FALSE);
gtk_widget_ref (menubar_view_menu_uiinfo[4].widget); gtk_widget_ref (menubar_view_menu_uiinfo[4].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_chapter", gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_title",
menubar_view_menu_uiinfo[4].widget, menubar_view_menu_uiinfo[4].widget,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_set_sensitive (menubar_view_menu_uiinfo[4].widget, FALSE); gtk_widget_set_sensitive (menubar_view_menu_uiinfo[4].widget, FALSE);
gtk_widget_ref (menubar_view_menu_uiinfo[5].widget); gtk_widget_ref (menubar_view_menu_uiinfo[5].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_angle", gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_chapter",
menubar_view_menu_uiinfo[5].widget, menubar_view_menu_uiinfo[5].widget,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_set_sensitive (menubar_view_menu_uiinfo[5].widget, FALSE); gtk_widget_set_sensitive (menubar_view_menu_uiinfo[5].widget, FALSE);
gtk_widget_ref (menubar_view_menu_uiinfo[6].widget); gtk_widget_ref (menubar_view_menu_uiinfo[6].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "separator7", gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_angle",
menubar_view_menu_uiinfo[6].widget, menubar_view_menu_uiinfo[6].widget,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_set_sensitive (menubar_view_menu_uiinfo[6].widget, FALSE);
gtk_widget_ref (menubar_view_menu_uiinfo[7].widget); gtk_widget_ref (menubar_view_menu_uiinfo[7].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_playlist", gtk_object_set_data_full (GTK_OBJECT (intf_window), "separator7",
menubar_view_menu_uiinfo[7].widget, menubar_view_menu_uiinfo[7].widget,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (menubar_view_menu_uiinfo[8].widget); gtk_widget_ref (menubar_view_menu_uiinfo[8].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_modules", gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_playlist",
menubar_view_menu_uiinfo[8].widget, menubar_view_menu_uiinfo[8].widget,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_set_sensitive (menubar_view_menu_uiinfo[8].widget, FALSE);
gtk_widget_ref (menubar_view_menu_uiinfo[9].widget); gtk_widget_ref (menubar_view_menu_uiinfo[9].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_messages", gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_modules",
menubar_view_menu_uiinfo[9].widget, menubar_view_menu_uiinfo[9].widget,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_set_sensitive (menubar_view_menu_uiinfo[9].widget, FALSE);
gtk_widget_ref (menubar_view_menu_uiinfo[10].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_messages",
menubar_view_menu_uiinfo[10].widget,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (menubar_uiinfo[2].widget); gtk_widget_ref (menubar_uiinfo[2].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_settings", gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_settings",
......
...@@ -89,7 +89,6 @@ ...@@ -89,7 +89,6 @@
<signal> <signal>
<name>activate</name> <name>activate</name>
<handler>GtkFileOpenActivate</handler> <handler>GtkFileOpenActivate</handler>
<data>&quot;intf_window&quot;</data>
<last_modification_time>Mon, 14 May 2001 21:27:36 GMT</last_modification_time> <last_modification_time>Mon, 14 May 2001 21:27:36 GMT</last_modification_time>
</signal> </signal>
<label>_Open File...</label> <label>_Open File...</label>
...@@ -108,7 +107,6 @@ ...@@ -108,7 +107,6 @@
<signal> <signal>
<name>activate</name> <name>activate</name>
<handler>GtkDiscOpenActivate</handler> <handler>GtkDiscOpenActivate</handler>
<data>&quot;intf_window&quot;</data>
<last_modification_time>Mon, 14 May 2001 21:27:47 GMT</last_modification_time> <last_modification_time>Mon, 14 May 2001 21:27:47 GMT</last_modification_time>
</signal> </signal>
<label>Open _Disc...</label> <label>Open _Disc...</label>
...@@ -127,7 +125,6 @@ ...@@ -127,7 +125,6 @@
<signal> <signal>
<name>activate</name> <name>activate</name>
<handler>GtkNetworkOpenActivate</handler> <handler>GtkNetworkOpenActivate</handler>
<data>&quot;intf_window&quot;</data>
<last_modification_time>Mon, 14 May 2001 21:28:06 GMT</last_modification_time> <last_modification_time>Mon, 14 May 2001 21:28:06 GMT</last_modification_time>
</signal> </signal>
<label>_Network Stream...</label> <label>_Network Stream...</label>
...@@ -147,7 +144,6 @@ ...@@ -147,7 +144,6 @@
<signal> <signal>
<name>activate</name> <name>activate</name>
<handler>GtkEjectDiscActivate</handler> <handler>GtkEjectDiscActivate</handler>
<data>&quot;intf_window&quot;</data>
<last_modification_time>Fri, 21 Dec 2001 12:51:34 GMT</last_modification_time> <last_modification_time>Fri, 21 Dec 2001 12:51:34 GMT</last_modification_time>
</signal> </signal>
<label>_Eject Disc</label> <label>_Eject Disc</label>
...@@ -172,7 +168,6 @@ ...@@ -172,7 +168,6 @@
<signal> <signal>
<name>activate</name> <name>activate</name>
<handler>GtkExitActivate</handler> <handler>GtkExitActivate</handler>
<data>&quot;intf_window&quot;</data>
<last_modification_time>Mon, 14 May 2001 21:28:20 GMT</last_modification_time> <last_modification_time>Mon, 14 May 2001 21:28:20 GMT</last_modification_time>
</signal> </signal>
<label>E_xit</label> <label>E_xit</label>
...@@ -198,7 +193,6 @@ ...@@ -198,7 +193,6 @@
<signal> <signal>
<name>activate</name> <name>activate</name>
<handler>GtkWindowToggleActivate</handler> <handler>GtkWindowToggleActivate</handler>
<data>&quot;intf_window&quot;</data>
<last_modification_time>Mon, 14 May 2001 21:32:49 GMT</last_modification_time> <last_modification_time>Mon, 14 May 2001 21:32:49 GMT</last_modification_time>
</signal> </signal>
<label>_Hide interface</label> <label>_Hide interface</label>
...@@ -211,7 +205,6 @@ ...@@ -211,7 +205,6 @@
<signal> <signal>
<name>activate</name> <name>activate</name>
<handler>GtkFullscreenActivate</handler> <handler>GtkFullscreenActivate</handler>
<data>&quot;intf_window&quot;</data>
<last_modification_time>Mon, 14 May 2001 21:29:21 GMT</last_modification_time> <last_modification_time>Mon, 14 May 2001 21:29:21 GMT</last_modification_time>
</signal> </signal>
<label>_Fullscreen</label> <label>_Fullscreen</label>
...@@ -224,6 +217,15 @@ ...@@ -224,6 +217,15 @@
<right_justify>False</right_justify> <right_justify>False</right_justify>
</widget> </widget>
<widget>
<class>GtkMenuItem</class>
<name>menubar_program</name>
<sensitive>False</sensitive>
<tooltip>Choose the program</tooltip>
<label>Progr_am</label>
<right_justify>False</right_justify>
</widget>
<widget> <widget>
<class>GtkMenuItem</class> <class>GtkMenuItem</class>
<name>menubar_title</name> <name>menubar_title</name>
...@@ -262,7 +264,6 @@ ...@@ -262,7 +264,6 @@
<signal> <signal>
<name>activate</name> <name>activate</name>
<handler>GtkPlaylistActivate</handler> <handler>GtkPlaylistActivate</handler>
<data>&quot;intf_window&quot;</data>
<last_modification_time>Mon, 14 May 2001 21:29:34 GMT</last_modification_time> <last_modification_time>Mon, 14 May 2001 21:29:34 GMT</last_modification_time>
</signal> </signal>
<label>_Playlist...</label> <label>_Playlist...</label>
...@@ -277,7 +278,6 @@ ...@@ -277,7 +278,6 @@
<signal> <signal>
<name>activate</name> <name>activate</name>
<handler>GtkModulesActivate</handler> <handler>GtkModulesActivate</handler>
<data>&quot;intf_window&quot;</data>
<last_modification_time>Mon, 14 May 2001 21:29:44 GMT</last_modification_time> <last_modification_time>Mon, 14 May 2001 21:29:44 GMT</last_modification_time>
</signal> </signal>
<label>_Modules...</label> <label>_Modules...</label>
...@@ -291,7 +291,6 @@ ...@@ -291,7 +291,6 @@
<signal> <signal>
<name>activate</name> <name>activate</name>
<handler>GtkMessagesActivate</handler> <handler>GtkMessagesActivate</handler>
<data>&quot;intf_window&quot;</data>
<last_modification_time>Tue, 19 Feb 2002 02:03:47 GMT</last_modification_time> <last_modification_time>Tue, 19 Feb 2002 02:03:47 GMT</last_modification_time>
</signal> </signal>
<label>Messages...</label> <label>Messages...</label>
...@@ -341,7 +340,6 @@ ...@@ -341,7 +340,6 @@
<signal> <signal>
<name>activate</name> <name>activate</name>
<handler>GtkPreferencesActivate</handler> <handler>GtkPreferencesActivate</handler>
<data>&quot;intf_window&quot;</data>
<last_modification_time>Mon, 14 May 2001 21:30:02 GMT</last_modification_time> <last_modification_time>Mon, 14 May 2001 21:30:02 GMT</last_modification_time>
</signal> </signal>
<label>_Preferences...</label> <label>_Preferences...</label>
...@@ -367,7 +365,6 @@ ...@@ -367,7 +365,6 @@
<signal> <signal>
<name>activate</name> <name>activate</name>
<handler>GtkAboutActivate</handler> <handler>GtkAboutActivate</handler>
<data>&quot;intf_window&quot;</data>
<last_modification_time>Mon, 14 May 2001 21:30:15 GMT</last_modification_time> <last_modification_time>Mon, 14 May 2001 21:30:15 GMT</last_modification_time>
</signal> </signal>
<label>_About...</label> <label>_About...</label>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk_common.h: private Gtk+ interface description * gtk_common.h: private Gtk+ interface description
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: gtk_common.h,v 1.2 2002/02/19 03:54:55 sam Exp $ * $Id: gtk_common.h,v 1.3 2002/02/24 21:36:20 jobi Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -52,6 +52,8 @@ typedef struct intf_sys_s ...@@ -52,6 +52,8 @@ typedef struct intf_sys_s
boolean_t b_slider_free; /* slider status */ boolean_t b_slider_free; /* slider status */
/* menus handlers */ /* menus handlers */
boolean_t b_program_update; /* do we need to update programs
menu */
boolean_t b_title_update; /* do we need to update title menus */ boolean_t b_title_update; /* do we need to update title menus */
boolean_t b_chapter_update; /* do we need to update boolean_t b_chapter_update; /* do we need to update
chapter menus */ chapter menus */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk_display.c: Gtk+ tools for main interface * gtk_display.c: Gtk+ tools for main interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: gtk_display.c,v 1.14 2002/02/24 20:51:10 gbazin Exp $ * $Id: gtk_display.c,v 1.15 2002/02/24 21:36:20 jobi Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -181,6 +181,7 @@ gint GtkModeManage( intf_thread_t * p_intf ) ...@@ -181,6 +181,7 @@ gint GtkModeManage( intf_thread_t * p_intf )
b_control = p_input_bank->pp_input[0]->stream.b_pace_control; b_control = p_input_bank->pp_input[0]->stream.b_pace_control;
/* get ready for menu regeneration */ /* get ready for menu regeneration */
p_intf->p_sys->b_program_update = 1;
p_intf->p_sys->b_title_update = 1; p_intf->p_sys->b_title_update = 1;
p_intf->p_sys->b_chapter_update = 1; p_intf->p_sys->b_chapter_update = 1;
p_intf->p_sys->b_angle_update = 1; p_intf->p_sys->b_angle_update = 1;
...@@ -211,6 +212,8 @@ gint GtkModeManage( intf_thread_t * p_intf ) ...@@ -211,6 +212,8 @@ gint GtkModeManage( intf_thread_t * p_intf )
gtk_widget_show( GTK_WIDGET( p_file_box ) ); gtk_widget_show( GTK_WIDGET( p_file_box ) );
/* unsensitize menus */ /* unsensitize menus */
gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_program"),
FALSE );
gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_title"), FALSE ); gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_title"), FALSE );
gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_chapter"), gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_chapter"),
FALSE ); FALSE );
......
...@@ -38,6 +38,7 @@ create_intf_window (void) ...@@ -38,6 +38,7 @@ create_intf_window (void)
GtkWidget *menubar_interface_hide; GtkWidget *menubar_interface_hide;
GtkWidget *menubar_fullscreen; GtkWidget *menubar_fullscreen;
GtkWidget *separator13; GtkWidget *separator13;
GtkWidget *menubar_program;
GtkWidget *menubar_title; GtkWidget *menubar_title;
GtkWidget *menubar_chapter; GtkWidget *menubar_chapter;
GtkWidget *menubar_angle; GtkWidget *menubar_angle;
...@@ -284,6 +285,19 @@ create_intf_window (void) ...@@ -284,6 +285,19 @@ create_intf_window (void)
gtk_container_add (GTK_CONTAINER (menubar_view_menu), separator13); gtk_container_add (GTK_CONTAINER (menubar_view_menu), separator13);
gtk_widget_set_sensitive (separator13, FALSE); gtk_widget_set_sensitive (separator13, FALSE);
menubar_program = gtk_menu_item_new_with_label ("");
tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (menubar_program)->child),
_("Progr_am"));
gtk_widget_add_accelerator (menubar_program, "activate_item", menubar_view_menu_accels,
tmp_key, 0, 0);
gtk_widget_ref (menubar_program);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_program", menubar_program,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (menubar_program);
gtk_container_add (GTK_CONTAINER (menubar_view_menu), menubar_program);
gtk_widget_set_sensitive (menubar_program, FALSE);
gtk_tooltips_set_tip (tooltips, menubar_program, _("Choose the program"), NULL);
menubar_title = gtk_menu_item_new_with_label (""); menubar_title = gtk_menu_item_new_with_label ("");
tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (menubar_title)->child), tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (menubar_title)->child),
_("_Title")); _("_Title"));
...@@ -812,40 +826,40 @@ create_intf_window (void) ...@@ -812,40 +826,40 @@ create_intf_window (void)
"intf_window"); "intf_window");
gtk_signal_connect (GTK_OBJECT (menubar_open), "activate", gtk_signal_connect (GTK_OBJECT (menubar_open), "activate",
GTK_SIGNAL_FUNC (GtkFileOpenActivate), GTK_SIGNAL_FUNC (GtkFileOpenActivate),
"intf_window"); NULL);
gtk_signal_connect (GTK_OBJECT (menubar_disc), "activate", gtk_signal_connect (GTK_OBJECT (menubar_disc), "activate",
GTK_SIGNAL_FUNC (GtkDiscOpenActivate), GTK_SIGNAL_FUNC (GtkDiscOpenActivate),
"intf_window"); NULL);
gtk_signal_connect (GTK_OBJECT (menubar_network), "activate", gtk_signal_connect (GTK_OBJECT (menubar_network), "activate",
GTK_SIGNAL_FUNC (GtkNetworkOpenActivate), GTK_SIGNAL_FUNC (GtkNetworkOpenActivate),
"intf_window"); NULL);
gtk_signal_connect (GTK_OBJECT (menubar_eject), "activate", gtk_signal_connect (GTK_OBJECT (menubar_eject), "activate",
GTK_SIGNAL_FUNC (GtkEjectDiscActivate), GTK_SIGNAL_FUNC (GtkEjectDiscActivate),
"intf_window"); NULL);
gtk_signal_connect (GTK_OBJECT (menubar_exit), "activate", gtk_signal_connect (GTK_OBJECT (menubar_exit), "activate",
GTK_SIGNAL_FUNC (GtkExitActivate), GTK_SIGNAL_FUNC (GtkExitActivate),
"intf_window"); NULL);
gtk_signal_connect (GTK_OBJECT (menubar_interface_hide), "activate", gtk_signal_connect (GTK_OBJECT (menubar_interface_hide), "activate",
GTK_SIGNAL_FUNC (GtkWindowToggleActivate), GTK_SIGNAL_FUNC (GtkWindowToggleActivate),
"intf_window"); NULL);
gtk_signal_connect (GTK_OBJECT (menubar_fullscreen), "activate", gtk_signal_connect (GTK_OBJECT (menubar_fullscreen), "activate",
GTK_SIGNAL_FUNC (GtkFullscreenActivate), GTK_SIGNAL_FUNC (GtkFullscreenActivate),
"intf_window"); NULL);
gtk_signal_connect (GTK_OBJECT (menubar_playlist), "activate", gtk_signal_connect (GTK_OBJECT (menubar_playlist), "activate",
GTK_SIGNAL_FUNC (GtkPlaylistActivate), GTK_SIGNAL_FUNC (GtkPlaylistActivate),
"intf_window"); NULL);
gtk_signal_connect (GTK_OBJECT (menubar_modules), "activate", gtk_signal_connect (GTK_OBJECT (menubar_modules), "activate",
GTK_SIGNAL_FUNC (GtkModulesActivate), GTK_SIGNAL_FUNC (GtkModulesActivate),
"intf_window"); NULL);
gtk_signal_connect (GTK_OBJECT (menubar_messages), "activate", gtk_signal_connect (GTK_OBJECT (menubar_messages), "activate",
GTK_SIGNAL_FUNC (GtkMessagesActivate), GTK_SIGNAL_FUNC (GtkMessagesActivate),
"intf_window"); NULL);
gtk_signal_connect (GTK_OBJECT (menubar_preferences), "activate", gtk_signal_connect (GTK_OBJECT (menubar_preferences), "activate",
GTK_SIGNAL_FUNC (GtkPreferencesActivate), GTK_SIGNAL_FUNC (GtkPreferencesActivate),
"intf_window"); NULL);
gtk_signal_connect (GTK_OBJECT (menubar_about), "activate", gtk_signal_connect (GTK_OBJECT (menubar_about), "activate",
GTK_SIGNAL_FUNC (GtkAboutActivate), GTK_SIGNAL_FUNC (GtkAboutActivate),
"intf_window"); NULL);
gtk_signal_connect (GTK_OBJECT (toolbar_open), "button_press_event", gtk_signal_connect (GTK_OBJECT (toolbar_open), "button_press_event",
GTK_SIGNAL_FUNC (GtkFileOpenShow), GTK_SIGNAL_FUNC (GtkFileOpenShow),
"intf_window"); "intf_window");
......
...@@ -2,10 +2,11 @@ ...@@ -2,10 +2,11 @@
* gtk_menu.c : functions to handle menu items. * gtk_menu.c : functions to handle menu items.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_menu.c,v 1.18 2002/01/07 02:12:29 sam Exp $ * $Id: gtk_menu.c,v 1.19 2002/02/24 21:36:20 jobi Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
* Johan Bilien <jobi@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
...@@ -179,6 +180,34 @@ void GtkPopupNavigationToggle( GtkCheckMenuItem * menuitem, ...@@ -179,6 +180,34 @@ void GtkPopupNavigationToggle( GtkCheckMenuItem * menuitem,
} }
} }
/*
* Program
*/
void GtkMenubarProgramToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
if( menuitem->active && !p_intf->p_sys->b_program_update )
{
u16 i_program_id = (u16)user_data;
input_ChangeProgram( p_input_bank->pp_input[0], i_program_id );
p_intf->p_sys->b_program_update = 1;
vlc_mutex_lock( &p_input_bank->pp_input[0]->stream.stream_lock );
GtkSetupMenus( p_intf );
vlc_mutex_unlock( &p_input_bank->pp_input[0]->stream.stream_lock );
p_intf->p_sys->b_title_update = 0;
input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_PLAY );
}
}
/* /*
* Title * Title
*/ */
...@@ -406,6 +435,104 @@ static gint GtkRadioMenu( intf_thread_t * p_intf, ...@@ -406,6 +435,104 @@ static gint GtkRadioMenu( intf_thread_t * p_intf,
return TRUE; return TRUE;
} }
/*****************************************************************************
* GtkProgramMenu: update the programs menu of the interface
*****************************************************************************
* Builds the program menu according to what have been found in the PAT
* by the input. Usefull for multi-programs streams such as DVB ones.
*****************************************************************************/
static gint GtkProgramMenu( gpointer p_data,
GtkWidget * p_root,
void(*pf_toggle )( GtkCheckMenuItem *, gpointer ) )
{
intf_thread_t * p_intf;
GtkWidget * p_menu;
GtkWidget * p_item;
GtkWidget * p_item_active;
GSList * p_group;
char psz_name[ GTK_MENU_LABEL_SIZE ];
gint i_item;
gint i;
/* cast */
p_intf = (intf_thread_t *)p_data;
/* temporary hack to avoid blank menu when an open menu is removed */
if( GTK_MENU_ITEM(p_root)->submenu != NULL )
{
gtk_menu_popdown( GTK_MENU( GTK_MENU_ITEM(p_root)->submenu ) );
}
/* removes previous menu */
gtk_menu_item_remove_submenu( GTK_MENU_ITEM( p_root ) );
gtk_widget_set_sensitive( p_root, FALSE );
p_group = NULL;
/* menu container */
p_menu = gtk_menu_new();
p_item_active = NULL;
i_item = 0;
/* create a set of program buttons and append them to the container */
for( i = 0 ; i < p_input_bank->pp_input[0]->stream.i_pgrm_number ; i++ )
{
i_item++;
snprintf( psz_name, GTK_MENU_LABEL_SIZE, "id %x",
p_input_bank->pp_input[0]->stream.pp_programs[i]->i_number );
if( psz_name[0] == '\0' )
{
snprintf( psz_name, GTK_MENU_LABEL_SIZE,
"Program %d", i_item );
psz_name[ GTK_MENU_LABEL_SIZE - 1 ] = '\0';
}
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 ) );
if( p_input_bank->pp_input[0]->stream.p_new_program ==
p_input_bank->pp_input[0]->stream.pp_programs[i] ||
p_input_bank->pp_input[0]->stream.p_selected_program ==
p_input_bank->pp_input[0]->stream.pp_programs[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_connect( GTK_OBJECT( p_item ), "toggled",
GTK_SIGNAL_FUNC( pf_toggle ),
(gpointer)( p_input_bank->pp_input[0]->
stream.pp_programs[i]->i_number ) );
gtk_menu_append( GTK_MENU( p_menu ), p_item );
}
/* link the new menu to the menubar item */
gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_root ), p_menu );
/* activation will call signals so we can only do it
* when submenu is attached to menu - to get intf_window
* We have to release the lock since input_ToggleES needs it */
if( p_item_active != NULL )
{
gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( p_item_active ),
TRUE );
}
/* be sure that menu is sensitive if more than 1 program */
if( i_item > 1 )
{
gtk_widget_set_sensitive( p_root, TRUE );
}
return TRUE;
}
/***************************************************************************** /*****************************************************************************
* GtkLanguageMenus: update interactive menus of the interface * GtkLanguageMenus: update interactive menus of the interface
***************************************************************************** *****************************************************************************
...@@ -785,6 +912,7 @@ gint GtkSetupMenus( intf_thread_t * p_intf ) ...@@ -785,6 +912,7 @@ gint GtkSetupMenus( intf_thread_t * p_intf )
GtkWidget * p_popup_menu; GtkWidget * p_popup_menu;
gint i; gint i;
p_intf->p_sys->b_title_update |= p_intf->p_sys->b_program_update;
p_intf->p_sys->b_chapter_update |= p_intf->p_sys->b_title_update; p_intf->p_sys->b_chapter_update |= p_intf->p_sys->b_title_update;
p_intf->p_sys->b_angle_update |= p_intf->p_sys->b_title_update; p_intf->p_sys->b_angle_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_audio_update |= p_intf->p_sys->b_title_update;
...@@ -792,6 +920,16 @@ gint GtkSetupMenus( intf_thread_t * p_intf ) ...@@ -792,6 +920,16 @@ gint GtkSetupMenus( intf_thread_t * p_intf )
// vlc_mutex_lock( &p_input_bank->pp_input[0]->stream.stream_lock ); // vlc_mutex_lock( &p_input_bank->pp_input[0]->stream.stream_lock );
if( p_intf->p_sys->b_program_update )
{
p_menubar_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "menubar_program" ) );
GtkProgramMenu( p_intf, p_menubar_menu, GtkMenubarProgramToggle );
p_intf->p_sys->b_program_update = 0;
}
if( p_intf->p_sys->b_title_update ) if( p_intf->p_sys->b_title_update )
{ {
char psz_title[5]; char psz_title[5];
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_ext-intf.c: services to the interface * input_ext-intf.c: services to the interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: input_ext-intf.c,v 1.33 2002/01/10 04:11:25 sam Exp $ * $Id: input_ext-intf.c,v 1.34 2002/02/24 21:36:20 jobi Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -328,15 +328,25 @@ int input_ChangeArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -328,15 +328,25 @@ int input_ChangeArea( input_thread_t * p_input, input_area_t * p_area )
} }
/**************************************************************************** /****************************************************************************
* input_ChangeProgram: interface request an area change * input_ChangeProgram: interface request a program change
****************************************************************************/ ****************************************************************************/
int input_ChangeProgram( input_thread_t * p_input, int input_ChangeProgram( input_thread_t * p_input,
pgrm_descriptor_t * p_program ) u16 i_program_number )
{ {
pgrm_descriptor_t * p_program;
vlc_mutex_lock( &p_input->stream.stream_lock ); vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.p_new_program = p_program; p_program = input_FindProgram( p_input, i_program_number );
if ( p_program == NULL )
{
intf_ErrMsg("input: Could not find selected program");
return -1;
}
p_input->stream.p_new_program = p_program;
vlc_mutex_unlock( &p_input->stream.stream_lock ); vlc_mutex_unlock( &p_input->stream.stream_lock );
return 0; return 0;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* modules_plugin.h : Plugin management functions used by the core application. * modules_plugin.h : Plugin management functions used by the core application.
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: modules_plugin.h,v 1.11 2002/02/24 20:51:10 gbazin Exp $ * $Id: modules_plugin.h,v 1.12 2002/02/24 21:36:20 jobi Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -189,6 +189,7 @@ module_error( void ) ...@@ -189,6 +189,7 @@ module_error( void )
(p_symbols)->input_OffsetToTime = input_OffsetToTime; \ (p_symbols)->input_OffsetToTime = input_OffsetToTime; \
(p_symbols)->input_ChangeES = input_ChangeES; \ (p_symbols)->input_ChangeES = input_ChangeES; \
(p_symbols)->input_ToggleES = input_ToggleES; \ (p_symbols)->input_ToggleES = input_ToggleES; \
(p_symbols)->input_ChangeProgram = input_ChangeProgram; \
(p_symbols)->input_ChangeArea = input_ChangeArea; \ (p_symbols)->input_ChangeArea = input_ChangeArea; \
(p_symbols)->input_FindES = input_FindES; \ (p_symbols)->input_FindES = input_FindES; \
(p_symbols)->input_AddES = input_AddES; \ (p_symbols)->input_AddES = input_AddES; \
......
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