a-High/LowPass allow 8K samples inclusive
[ardour.git] / gtk2_ardour / plugin_ui.cc
index 19ea8ebc6c0c178c340b87dd58f667067fe1d6bc..15600772e2620abf78105fa2a7525d31afbba7df 100644 (file)
 #include "ardour/lxvst_plugin.h"
 #include "lxvst_plugin_ui.h"
 #endif
+#ifdef MACVST_SUPPORT
+#include "ardour/mac_vst_plugin.h"
+#include "vst_plugin_ui.h"
+#endif
 #ifdef LV2_SUPPORT
 #include "ardour/lv2_plugin.h"
 #include "lv2_plugin_ui.h"
@@ -107,6 +111,10 @@ PluginUIWindow::PluginUIWindow (
                        have_gui = create_lxvst_editor (insert);
                        break;
 
+               case ARDOUR::MacVST:
+                       have_gui = create_mac_vst_editor (insert);
+                       break;
+
                case ARDOUR::AudioUnit:
                        have_gui = create_audiounit_editor (insert);
                        break;
@@ -272,6 +280,35 @@ PluginUIWindow::create_lxvst_editor(boost::shared_ptr<PluginInsert>)
 #endif
 }
 
+bool
+#ifdef MACVST_SUPPORT
+PluginUIWindow::create_mac_vst_editor (boost::shared_ptr<PluginInsert> insert)
+#else
+PluginUIWindow::create_mac_vst_editor (boost::shared_ptr<PluginInsert>)
+#endif
+{
+#ifndef MACVST_SUPPORT
+       return false;
+#else
+       boost::shared_ptr<MacVSTPlugin> mvst;
+       if ((mvst = boost::dynamic_pointer_cast<MacVSTPlugin> (insert->plugin())) == 0) {
+               error << string_compose (_("unknown type of editor-supplying plugin (note: no MacVST support in this version of %1)"), PROGRAM_NAME)
+                     << endmsg;
+               throw failed_constructor ();
+       }
+       VSTPluginUI* vpu = create_mac_vst_gui (insert);
+       _pluginui = vpu;
+       _pluginui->KeyboardFocused.connect (sigc::mem_fun (*this, &PluginUIWindow::keyboard_focused));
+       add (*vpu);
+       vpu->package (*this);
+
+       Application::instance()->ActivationChanged.connect (mem_fun (*this, &PluginUIWindow::app_activated));
+
+       return true;
+#endif
+}
+
+
 bool
 #ifdef AUDIOUNIT_SUPPORT
 PluginUIWindow::create_audiounit_editor (boost::shared_ptr<PluginInsert> insert)
@@ -421,7 +458,7 @@ PlugUIBase::PlugUIBase (boost::shared_ptr<PluginInsert> pi)
        , delete_button (_("Delete"))
        , reset_button (_("Reset"))
        , bypass_button (ArdourButton::led_default_elements)
-       , pin_management_button (_("Pin Connections...")) // TODO use a shorter label once the string-freeze is over.
+       , pin_management_button (_("Pinout"))
        , description_expander (_("Description"))
        , plugin_analysis_expander (_("Plugin analysis"))
        , latency_gui (0)
@@ -435,9 +472,7 @@ PlugUIBase::PlugUIBase (boost::shared_ptr<PluginInsert> pi)
        set_tooltip (save_button, _("Save the current preset"));
        set_tooltip (delete_button, _("Delete the current preset"));
        set_tooltip (reset_button, _("Reset parameters to default (if no parameters are in automation play mode)"));
-#if 0 // string freeze is over
        set_tooltip (pin_management_button, _("Show Plugin Pin Management Dialog"));
-#endif
        set_tooltip (bypass_button, _("Disable signal processing by the plugin"));
        _no_load_preset = 0;