[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnash-commit] gnash ChangeLog gui/Player.cpp gui/gtk.cpp
From: |
Bastiaan Jacques |
Subject: |
Re: [Gnash-commit] gnash ChangeLog gui/Player.cpp gui/gtk.cpp |
Date: |
Sat, 21 Oct 2006 10:58:36 +0200 |
User-agent: |
KMail/1.9.4 |
On Thursday 19 October 2006 00:36, Rob Savoye wrote:
> CVSROOT: /sources/gnash
> Module name: gnash
> Changes by: Rob Savoye <rsavoye> 06/10/18 22:36:21
> Log message:
> * gui/gtk.cpp: Add static variable for the sound toggle. Don't
> add
> the "Toggle Sound" item if sound is disabled on the command line with
> -r 1.
I think we should have a sound_handler::is_muted() function instead of
keeping track of muteness in the GUI. Tomas?
Bastiaan
> Index: gui/gtk.cpp
> ===================================================================
> RCS file: /sources/gnash/gnash/gui/gtk.cpp,v
> retrieving revision 1.39
> retrieving revision 1.40
> diff -u -b -r1.39 -r1.40
> --- gui/gtk.cpp 18 Oct 2006 21:39:53 -0000 1.39
> +++ gui/gtk.cpp 18 Oct 2006 22:36:21 -0000 1.40
> @@ -61,6 +61,10 @@
> namespace gnash
> {
>
> +// This has to be a static instead of private data so we can access
> it +// from static member functions.
> +static bool s_use_sound;
> +
> GtkGui::~GtkGui()
> {
> }
> @@ -119,6 +123,11 @@
> glue.prepDrawingArea(_drawing_area);
> #endif
>
> + if (get_sound_handler()) {
> + s_use_sound = true;
> + } else {
> + s_use_sound = false;
> + }
>
> _renderer = glue.createRenderHandler();
> set_render_handler(_renderer);
> @@ -333,8 +342,10 @@
> gtk_widget_show(GTK_WIDGET(menuitem_jump_backward));
> GtkMenuItem *menuitem_sound =
> GTK_MENU_ITEM(gtk_menu_item_new_with_label("Toggle Sound"));
> + if (get_sound_handler()) {
> gtk_menu_append(_popup_menu, GTK_WIDGET(menuitem_sound));
> gtk_widget_show(GTK_WIDGET(menuitem_sound));
> + }
>
> GtkMenuItem *menuitem_quit =
> GTK_MENU_ITEM(gtk_menu_item_new_with_label("Quit Gnash"));
> @@ -358,8 +369,10 @@
> G_CALLBACK(&menuitem_jump_backward_callback),
> this); g_signal_connect(GTK_OBJECT(menuitem_quit), "activate",
> G_CALLBACK(&menuitem_quit_callback), this); + if
> (get_sound_handler()) {
> g_signal_connect(GTK_OBJECT(menuitem_sound), "activate",
> G_CALLBACK(&menuitem_sound_callback), this);
> + }
>
> return true;
> }
> @@ -433,15 +446,14 @@
> GtkGui::menuitem_sound_callback(GtkMenuItem* /*menuitem*/, gpointer
> /*data*/) {
> GNASH_REPORT_FUNCTION;
> - static bool use_sound = rcfile.useSound();
>
> if (get_sound_handler()) {
> - if (use_sound) {
> + if (s_use_sound) {
> get_sound_handler()->mute();
> - use_sound = false;
> + s_use_sound = false;
> } else {
> get_sound_handler()->unmute();
> - use_sound = true;
> + s_use_sound = true;
> }
> }
> }
>
>