Region pulse is no longer a property.
[ardour.git] / gtk2_ardour / plugin_ui.cc
index 711b1f555fc1d430bf53cec56192135f1a7f6c87..03c5ef301d488e3913a14f77777394f0068ecbfa 100644 (file)
@@ -64,6 +64,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"
@@ -420,6 +421,7 @@ PlugUIBase::PlugUIBase (boost::shared_ptr<PluginInsert> 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 +435,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)"));
+       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 +454,8 @@ PlugUIBase::PlugUIBase (boost::shared_ptr<PluginInsert> 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<Processor>(insert)), gui_context());
 
@@ -658,6 +663,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 +726,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 +753,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 +760,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 +769,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);
                }
        }
 }