gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/trunk r11010: Stop the advance timer when


From: Sandro Santilli
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r11010: Stop the advance timer when in pause mode. Brings wakeups down to zero when sound handler is disabled (-r1).
Date: Sat, 06 Jun 2009 00:48:18 +0200
User-agent: Bazaar (1.13.1)

------------------------------------------------------------
revno: 11010
committer: Sandro Santilli <address@hidden>
branch nick: trunk
timestamp: Sat 2009-06-06 00:48:18 +0200
message:
  Stop the advance timer when in pause mode. Brings wakeups down to zero when 
sound handler is disabled (-r1).
modified:
  gui/gtk.cpp
  gui/gtksup.h
=== modified file 'gui/gtk.cpp'
--- a/gui/gtk.cpp       2009-04-23 18:14:24 +0000
+++ b/gui/gtk.cpp       2009-06-05 22:48:18 +0000
@@ -573,14 +573,11 @@
     gtk_main_quit();
 }
 
+/*private*/
 void
-GtkGui::setInterval(unsigned int interval)
+GtkGui::startAdvanceTimer()
 {
-    _interval = interval;
-    if (_advanceSourceTimer)
-    {
-        g_source_remove(_advanceSourceTimer);
-    }
+    stopAdvanceTimer();
     
     _advanceSourceTimer = g_timeout_add_full(G_PRIORITY_LOW, _interval,
             (GSourceFunc)advance_movie, this, NULL);
@@ -589,6 +586,25 @@
             _interval, 1000/_interval);
 }
 
+/*private*/
+void
+GtkGui::stopAdvanceTimer()
+{
+    if (_advanceSourceTimer)
+    {
+        g_source_remove(_advanceSourceTimer);
+        _advanceSourceTimer = 0;
+    }
+}
+
+void
+GtkGui::setInterval(unsigned int interval)
+{
+    _interval = interval;
+
+    startAdvanceTimer();
+}
+
 ///////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////
 ///                                                                         ///
@@ -2043,6 +2059,8 @@
     if (_resumeButton) {
         gtk_box_pack_start(GTK_BOX(_vbox), _resumeButton, FALSE, FALSE, 0);
     }
+
+    stopAdvanceTimer();
 }
 
 void
@@ -2052,6 +2070,8 @@
     if (_resumeButton) {
         gtk_container_remove(GTK_CONTAINER(_vbox), _resumeButton);
     }
+
+    startAdvanceTimer();
 }
 
 

=== modified file 'gui/gtksup.h'
--- a/gui/gtksup.h      2009-04-22 16:37:31 +0000
+++ b/gui/gtksup.h      2009-06-05 22:48:18 +0000
@@ -182,6 +182,10 @@
     void playHook();
 
     guint _advanceSourceTimer;
+
+    void startAdvanceTimer();
+
+    void stopAdvanceTimer();
 };
 
 } // namespace gnash


reply via email to

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