summaryrefslogtreecommitdiff
path: root/gtk2_ardour/mac_vst_plugin_ui.mm
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-11-15 00:01:27 +0100
committerRobin Gareus <robin@gareus.org>2016-11-15 00:32:59 +0100
commita610157955af2f588f59d00ed585c2d842197c85 (patch)
tree2a3df7a57f2078d7eb4a3c8940c7b9e2c81b92e8 /gtk2_ardour/mac_vst_plugin_ui.mm
parent35de5080a60fd648455557974f967f5e4090cbfb (diff)
MacVST Program/Preset support
Diffstat (limited to 'gtk2_ardour/mac_vst_plugin_ui.mm')
-rw-r--r--gtk2_ardour/mac_vst_plugin_ui.mm29
1 files changed, 29 insertions, 0 deletions
diff --git a/gtk2_ardour/mac_vst_plugin_ui.mm b/gtk2_ardour/mac_vst_plugin_ui.mm
index 2b10fc2a88..2c0cd1c502 100644
--- a/gtk2_ardour/mac_vst_plugin_ui.mm
+++ b/gtk2_ardour/mac_vst_plugin_ui.mm
@@ -56,6 +56,8 @@ MacVSTPluginUI::MacVSTPluginUI (boost::shared_ptr<PluginInsert> pi, boost::share
low_box.signal_realize().connect (mem_fun (this, &MacVSTPluginUI::lower_box_realized));
pack_start (low_box, true, true);
low_box.show ();
+ vst->LoadPresetProgram.connect (_program_connection, invalidator (*this), boost::bind (&MacVSTPluginUI::set_program, this), gui_context());
+
}
MacVSTPluginUI::~MacVSTPluginUI ()
@@ -149,3 +151,30 @@ MacVSTPluginUI::idle ()
_vst->state()->wantIdle = plugin->dispatcher (plugin, effEditIdle, 0, 0, NULL, 0);
return true; // _vst->state()->wantIdle;
}
+
+void
+MacVSTPluginUI::set_program ()
+{
+ VSTState* vstfx = _vst->state();
+
+ if (vstfx->want_program != -1) {
+ if (vstfx->vst_version >= 2) {
+ vstfx->plugin->dispatcher (vstfx->plugin, 67 /* effBeginSetProgram */, 0, 0, NULL, 0);
+ }
+
+ vstfx->plugin->dispatcher (vstfx->plugin, effSetProgram, 0, vstfx->want_program, NULL, 0);
+
+ if (vstfx->vst_version >= 2) {
+ vstfx->plugin->dispatcher (vstfx->plugin, 68 /* effEndSetProgram */, 0, 0, NULL, 0);
+ }
+
+ vstfx->want_program = -1;
+ }
+
+ if (vstfx->want_chunk == 1) {
+ pthread_mutex_lock (&vstfx->state_lock);
+ vstfx->plugin->dispatcher (vstfx->plugin, 24 /* effSetChunk */, 1, vstfx->wanted_chunk_size, vstfx->wanted_chunk, 0);
+ vstfx->want_chunk = 0;
+ pthread_mutex_unlock (&vstfx->state_lock);
+ }
+}