[SCM] calf/master: + Line graph: provide a way to update the graphs conditionally
js at users.alioth.debian.org
js at users.alioth.debian.org
Tue May 7 15:39:09 UTC 2013
The following commit has been merged in the master branch:
commit b11cfb535db142c32715e9ee723d0e5cbe2f71ed
Author: Krzysztof Foltman <wdev at foltman.com>
Date: Sun Jan 25 09:58:57 2009 +0000
+ Line graph: provide a way to update the graphs conditionally
diff --git a/src/calf/custom_ctl.h b/src/calf/custom_ctl.h
index 307e526..39ade93 100644
--- a/src/calf/custom_ctl.h
+++ b/src/calf/custom_ctl.h
@@ -55,6 +55,8 @@ 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);
+
#define CALF_TYPE_VUMETER (calf_vumeter_get_type())
#define CALF_VUMETER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CALF_TYPE_VUMETER, CalfVUMeter))
#define CALF_IS_VUMETER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CALF_TYPE_VUMETER))
diff --git a/src/calf/modules.h b/src/calf/modules.h
index eaa347b..7c16ddc 100644
--- a/src/calf/modules.h
+++ b/src/calf/modules.h
@@ -22,6 +22,7 @@
#define __CALF_MODULES_H
#include <assert.h>
+#include <limits.h>
#include "biquad.h"
#include "inertia.h"
#include "audio_fx.h"
@@ -728,10 +729,16 @@ public:
old_resonance = inertia_resonance.get_last();
old_mode = *params[par_mode];
last_generation++;
+ subindex_graph = 0;
+ subindex_dot = INT_MAX;
+ subindex_gridline = INT_MAX;
+ }
+ else {
+ subindex_graph = 0;
+ subindex_dot = subindex_gridline = generation ? INT_MAX : 0;
}
- frequency_response_line_graph::get_changed_offsets(generation, subindex_graph, subindex_dot, subindex_gridline);
if (generation == last_generation)
- subindex_graph = 2;
+ subindex_graph = INT_MAX;
return last_generation;
}
};
diff --git a/src/custom_ctl.cpp b/src/custom_ctl.cpp
index 6658ad3..c2a4c88 100644
--- a/src/custom_ctl.cpp
+++ b/src/custom_ctl.cpp
@@ -258,6 +258,20 @@ void calf_line_graph_set_square(CalfLineGraph *graph, bool is_square)
graph->is_square = is_square;
}
+void calf_line_graph_update_if(CalfLineGraph *graph)
+{
+ g_assert(CALF_IS_LINE_GRAPH(graph));
+ int generation = 0;
+ 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;
+ gtk_widget_queue_draw(GTK_WIDGET(graph));
+ }
+}
+
static void
calf_line_graph_size_request (GtkWidget *widget,
GtkRequisition *requisition)
diff --git a/src/gui.cpp b/src/gui.cpp
index 7f6eaf4..2e6c1b2 100644
--- a/src/gui.cpp
+++ b/src/gui.cpp
@@ -525,7 +525,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;
- gtk_widget_queue_draw(widget);
+ calf_line_graph_update_if(CALF_LINE_GRAPH(widget));
}
}
--
calf audio plugins packaging
More information about the pkg-multimedia-commits
mailing list