summaryrefslogtreecommitdiff
path: root/gtk2_ardour/au_pluginui.h
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-04-28 18:41:50 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-04-28 18:42:04 -0400
commit961e7ecdc8437ecd7d9ec61060083ceb393c8be2 (patch)
treeadb796af3e88ec27540a57a6da278a0146ab7d2e /gtk2_ardour/au_pluginui.h
parent7f1bd3c94126026deb17d8b043aa90a6ad10c6ec (diff)
clever tricks with code swizzling to slow down errant plugin GUIs for AU
This commit swizzles (replaces) NSView::displayIfNeeded to allow us to stop redraws of plugin windows if the Glib idle timer fires less often then every 40msec. The next 10 plugin redraws (for all plugin windows combined) will be skipped. Heuristics will likely need some adjustments
Diffstat (limited to 'gtk2_ardour/au_pluginui.h')
-rw-r--r--gtk2_ardour/au_pluginui.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/gtk2_ardour/au_pluginui.h b/gtk2_ardour/au_pluginui.h
index bc7d9a521b..807d6b751a 100644
--- a/gtk2_ardour/au_pluginui.h
+++ b/gtk2_ardour/au_pluginui.h
@@ -23,6 +23,8 @@
#include <vector>
#include <string>
+#include <stdint.h>
+
#include <AppKit/AppKit.h>
#include <Carbon/Carbon.h>
#include <AudioUnit/AudioUnitCarbonView.h>
@@ -94,7 +96,7 @@ class AUPluginUI : public PlugUIBase, public Gtk::VBox
void lower_box_unmap ();
void lower_box_size_request (GtkRequisition*);
void lower_box_size_allocate (Gtk::Allocation&);
- gboolean lower_box_expose (GdkEventExpose*);
+ bool lower_box_expose (GdkEventExpose*);
void cocoa_view_resized ();
void on_realize ();
@@ -124,14 +126,9 @@ class AUPluginUI : public PlugUIBase, public Gtk::VBox
static std::vector<std::string> automation_mode_strings;
- bool mapped;
bool resizable;
- int min_width;
- int min_height;
int req_width;
int req_height;
- int alo_width;
- int alo_height;
/* Cocoa */
@@ -167,6 +164,11 @@ class AUPluginUI : public PlugUIBase, public Gtk::VBox
void update_view_size ();
bool plugin_class_valid (Class pluginClass);
+
+ static bool idle_meter();
+ static int64_t last_idle;
+ static bool idle_meter_needed;
+ int64_t expose_cnt;
};
#endif /* __gtk2_ardour_auplugin_ui_h__ */