X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fplugin_ui.cc;h=7314eb0042df0f80ea6573b6dbc41aadcf8d40f7;hb=7e4f261853574a979865bddc94770600588f551e;hp=711b1f555fc1d430bf53cec56192135f1a7f6c87;hpb=cf52d6e4b40111eb04b244ec054055a4ec15dbe0;p=ardour.git diff --git a/gtk2_ardour/plugin_ui.cc b/gtk2_ardour/plugin_ui.cc index 711b1f555f..7314eb0042 100644 --- a/gtk2_ardour/plugin_ui.cc +++ b/gtk2_ardour/plugin_ui.cc @@ -52,6 +52,10 @@ #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" @@ -64,6 +68,7 @@ #include "utils.h" #include "gui_thread.h" #include "public_editor.h" +#include "processor_box.h" #include "keyboard.h" #include "latency_gui.h" #include "plugin_eq_gui.h" @@ -87,8 +92,8 @@ PluginUIWindow::PluginUIWindow ( , was_visible (false) , _keyboard_focused (false) #ifdef AUDIOUNIT_SUPPORT - , pre_deactivate_x (-1) - , pre_deactivate_y (-1) + , pre_deactivate_x (-1) + , pre_deactivate_y (-1) #endif { @@ -106,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; @@ -179,9 +188,9 @@ PluginUIWindow::on_show () if (_pluginui) { #if defined (HAVE_AUDIOUNITS) && defined(__APPLE__) - if (pre_deactivate_x >= 0) { - move (pre_deactivate_x, pre_deactivate_y); - } + if (pre_deactivate_x >= 0) { + move (pre_deactivate_x, pre_deactivate_y); + } #endif if (_pluginui->on_window_show (_title)) { @@ -194,7 +203,7 @@ void PluginUIWindow::on_hide () { #if defined (HAVE_AUDIOUNITS) && defined(__APPLE__) - get_position (pre_deactivate_x, pre_deactivate_y); + get_position (pre_deactivate_x, pre_deactivate_y); #endif Window::on_hide (); @@ -271,6 +280,35 @@ PluginUIWindow::create_lxvst_editor(boost::shared_ptr) #endif } +bool +#ifdef MACVST_SUPPORT +PluginUIWindow::create_mac_vst_editor (boost::shared_ptr insert) +#else +PluginUIWindow::create_mac_vst_editor (boost::shared_ptr) +#endif +{ +#ifndef MACVST_SUPPORT + return false; +#else + boost::shared_ptr mvst; + if ((mvst = boost::dynamic_pointer_cast (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 insert) @@ -304,15 +342,15 @@ PluginUIWindow::app_activated (bool) if (yn) { if (was_visible) { _pluginui->activate (); - if (pre_deactivate_x >= 0) { - move (pre_deactivate_x, pre_deactivate_y); - } + if (pre_deactivate_x >= 0) { + move (pre_deactivate_x, pre_deactivate_y); + } present (); was_visible = true; } } else { was_visible = is_visible(); - get_position (pre_deactivate_x, pre_deactivate_y); + get_position (pre_deactivate_x, pre_deactivate_y); hide (); _pluginui->deactivate (); } @@ -420,6 +458,7 @@ PlugUIBase::PlugUIBase (boost::shared_ptr pi) , delete_button (_("Delete")) , reset_button (_("Reset")) , bypass_button (ArdourButton::led_default_elements) + , pin_management_button (_("Pinout")) , description_expander (_("Description")) , plugin_analysis_expander (_("Plugin analysis")) , latency_gui (0) @@ -433,6 +472,7 @@ PlugUIBase::PlugUIBase (boost::shared_ptr 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)")); + set_tooltip (pin_management_button, _("Show Plugin Pin Management Dialog")); set_tooltip (bypass_button, _("Disable signal processing by the plugin")); _no_load_preset = 0; @@ -451,6 +491,8 @@ PlugUIBase::PlugUIBase (boost::shared_ptr pi) reset_button.set_name ("generic button"); reset_button.signal_clicked.connect (sigc::mem_fun (*this, &PlugUIBase::reset_plugin_parameters)); + pin_management_button.set_name ("generic button"); + pin_management_button.signal_clicked.connect (sigc::mem_fun (*this, &PlugUIBase::manage_pins)); insert->ActiveChanged.connect (active_connection, invalidator (*this), boost::bind (&PlugUIBase::processor_active_changed, this, boost::weak_ptr(insert)), gui_context()); @@ -658,6 +700,17 @@ PlugUIBase::reset_plugin_parameters () insert->reset_parameters_to_default (); } +void +PlugUIBase::manage_pins () +{ + PluginPinWindowProxy* proxy = insert->pinmgr_proxy (); + if (proxy) { + proxy->get (true); + proxy->present (); + proxy->get ()->raise(); + } +} + bool PlugUIBase::bypass_button_release (GdkEventButton*) { @@ -710,7 +763,19 @@ PlugUIBase::toggle_description() } if (!description_expander.get_expanded()) { + const int child_height = description_expander.get_child ()->get_height (); + description_expander.remove(); + + Gtk::Window *toplevel = (Gtk::Window*) description_expander.get_ancestor (GTK_TYPE_WINDOW); + + if (toplevel) { + Gtk::Requisition wr; + toplevel->get_size (wr.width, wr.height); + wr.height -= child_height; + toplevel->resize (wr.width, wr.height); + } + } } @@ -725,12 +790,6 @@ PlugUIBase::toggle_plugin_analysis() eqgui = new PluginEqGui (insert); } - Gtk::Window *toplevel = (Gtk::Window*) plugin_analysis_expander.get_ancestor (GTK_TYPE_WINDOW); - - if (toplevel) { - toplevel->get_size (pre_eq_size.width, pre_eq_size.height); - } - plugin_analysis_expander.add (*eqgui); plugin_analysis_expander.show_all (); eqgui->start_listening (); @@ -738,6 +797,7 @@ PlugUIBase::toggle_plugin_analysis() if (!plugin_analysis_expander.get_expanded()) { // Hide & remove from expander + const int child_height = plugin_analysis_expander.get_child ()->get_height (); eqgui->hide (); eqgui->stop_listening (); @@ -746,7 +806,10 @@ PlugUIBase::toggle_plugin_analysis() Gtk::Window *toplevel = (Gtk::Window*) plugin_analysis_expander.get_ancestor (GTK_TYPE_WINDOW); if (toplevel) { - toplevel->resize (pre_eq_size.width, pre_eq_size.height); + Gtk::Requisition wr; + toplevel->get_size (wr.width, wr.height); + wr.height -= child_height; + toplevel->resize (wr.width, wr.height); } } }