gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog gui/Player.cpp gui/gtk.cpp


From: Rob Savoye
Subject: [Gnash-commit] gnash ChangeLog gui/Player.cpp gui/gtk.cpp
Date: Wed, 18 Oct 2006 22:36:22 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Rob Savoye <rsavoye>    06/10/18 22:36:21

Modified files:
        .              : ChangeLog 
        gui            : Player.cpp gtk.cpp 

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.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1308&r2=1.1309
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/Player.cpp?cvsroot=gnash&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gtk.cpp?cvsroot=gnash&r1=1.39&r2=1.40

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1308
retrieving revision 1.1309
diff -u -b -r1.1308 -r1.1309
--- ChangeLog   18 Oct 2006 21:39:53 -0000      1.1308
+++ ChangeLog   18 Oct 2006 22:36:21 -0000      1.1309
@@ -2,7 +2,9 @@
 
        * gui/gtk.cpp: Include rc.h, to get the default sound
        setting. Toggle the sound using mute() & unmute() via the menu
-       item.
+       item. 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.
 
 2006-10-18 Udo Giacomozzi <address@hidden>
 

Index: gui/Player.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/Player.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22

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;
         }
     }
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]