[SCM] calf/master: + Line graph: do not skip redrawing if generation number changed

js at users.alioth.debian.org js at users.alioth.debian.org
Tue May 7 15:39:13 UTC 2013


The following commit has been merged in the master branch:
commit f04b2966b14c0eedb6dc59d7a50fa1d119fc005b
Author: Krzysztof Foltman <wdev at foltman.com>
Date:   Mon Jan 26 19:25:54 2009 +0000

    + Line graph: do not skip redrawing if generation number changed

diff --git a/src/calf/custom_ctl.h b/src/calf/custom_ctl.h
index 8b37359..ed8c185 100644
--- a/src/calf/custom_ctl.h
+++ b/src/calf/custom_ctl.h
@@ -55,7 +55,7 @@ extern GType calf_line_graph_get_type();
 
 extern void calf_line_graph_set_square(CalfLineGraph *graph, bool is_square);
 
-extern void calf_line_graph_update_if(CalfLineGraph *graph);
+extern int calf_line_graph_update_if(CalfLineGraph *graph, int generation);
 
 #define CALF_TYPE_VUMETER           (calf_vumeter_get_type())
 #define CALF_VUMETER(obj)           (G_TYPE_CHECK_INSTANCE_CAST ((obj), CALF_TYPE_VUMETER, CalfVUMeter))
diff --git a/src/calf/gui.h b/src/calf/gui.h
index f92a6b0..35c61f5 100644
--- a/src/calf/gui.h
+++ b/src/calf/gui.h
@@ -234,6 +234,7 @@ struct combo_box_param_control: public param_control
 struct line_graph_param_control: public param_control
 {
     CalfLineGraph *graph;
+    int last_generation;
 
     virtual GtkWidget *create(plugin_gui *_gui, int _param_no);
     virtual void get() {}
diff --git a/src/custom_ctl.cpp b/src/custom_ctl.cpp
index e742d3e..1e552cd 100644
--- a/src/custom_ctl.cpp
+++ b/src/custom_ctl.cpp
@@ -262,7 +262,7 @@ calf_line_graph_expose (GtkWidget *widget, GdkEventExpose *event)
     cairo_destroy(c);
     
     gtk_paint_shadow(widget->style, widget->window, GTK_STATE_NORMAL, GTK_SHADOW_IN, NULL, widget, NULL, ox - 1, oy - 1, sx + 2, sy + 2);
-    // printf("exposed %p %d+%d\n", widget->window, widget->allocation.x, widget->allocation.y);
+    // printf("exposed %p %dx%d %d+%d\n", widget->window, event->area.x, event->area.y, event->area.width, event->area.height);
     
     return TRUE;
 }
@@ -273,18 +273,19 @@ void calf_line_graph_set_square(CalfLineGraph *graph, bool is_square)
     graph->is_square = is_square;
 }
 
-void calf_line_graph_update_if(CalfLineGraph *graph)
+int calf_line_graph_update_if(CalfLineGraph *graph, int last_drawn_generation)
 {
     g_assert(CALF_IS_LINE_GRAPH(graph));
-    int generation = 0;
+    int generation = last_drawn_generation;
     if (graph->source)
     {
         int subgraph, dot, gridline;
         generation = graph->source->get_changed_offsets(graph->last_generation, subgraph, dot, gridline);
-        if (subgraph == INT_MAX && dot == INT_MAX && gridline == INT_MAX)
-            return;
+        if (subgraph == INT_MAX && dot == INT_MAX && gridline == INT_MAX && generation == last_drawn_generation)
+            return generation;
         gtk_widget_queue_draw(GTK_WIDGET(graph));
     }
+    return generation;
 }
 
 static void
diff --git a/src/gui.cpp b/src/gui.cpp
index c13ccce..7be087c 100644
--- a/src/gui.cpp
+++ b/src/gui.cpp
@@ -505,6 +505,7 @@ GtkWidget *line_graph_param_control::create(plugin_gui *_gui, int _param_no)
 {
     gui = _gui;
     param_no = _param_no;
+    last_generation = -1;
     // const parameter_properties &props = get_props();
     
     widget = calf_line_graph_new ();
@@ -526,7 +527,7 @@ void line_graph_param_control::set()
         int ws = gdk_window_get_state(widget->window);
         if (ws & (GDK_WINDOW_STATE_WITHDRAWN | GDK_WINDOW_STATE_ICONIFIED))
             return;
-        calf_line_graph_update_if(CALF_LINE_GRAPH(widget));
+        last_generation = calf_line_graph_update_if(CALF_LINE_GRAPH(widget), last_generation);
     }
 }
 

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list