X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fplugin_pin_dialog.cc;h=11efbcfb9065d7d323826c80fa54b32e2b7dc69e;hb=7f280e2bed51cfa56fedeaf08f28b6040c93b5b1;hp=070f6da064649ef553ebc437c4b3a8ee6edfbf90;hpb=cc0abf4ef57a1211ea856e6ddd869d3953bef86d;p=ardour.git diff --git a/gtk2_ardour/plugin_pin_dialog.cc b/gtk2_ardour/plugin_pin_dialog.cc index 070f6da064..11efbcfb90 100644 --- a/gtk2_ardour/plugin_pin_dialog.cc +++ b/gtk2_ardour/plugin_pin_dialog.cc @@ -43,7 +43,7 @@ #include "tooltips.h" #include "ui_config.h" -#include "i18n.h" +#include "pbd/i18n.h" using namespace ARDOUR; using namespace PBD; @@ -470,33 +470,8 @@ PluginPinWidget::refill_output_presets () { using namespace Menu_Helpers; _out_presets.clear_items (); - PluginOutputConfiguration ppc (_pi->plugin (0)->possible_output ()); - - bool need_dropdown = true; - - if (ppc.size () == 0) { - need_dropdown = false; - } - if (!_pi->strict_io () && ppc.size () == 1) { - need_dropdown = false; - } - - if (_pi->strict_io () && ppc.size () == 1) { - // "stereo" is currently preferred default for instruments, see PluginInsert - if (ppc.find (2) != ppc.end ()) { - need_dropdown = false; - } - } - - if (!_pi->needs_midi_input ()) { - /* loose definition of instruments, maybe impose additional - * || _pi->natural_input_streams ().n_audio () != 0 - * and special case variable output plugins - * && !_pi->plugin (0)->info->reconfigurable_io() - */ - need_dropdown = false; - } + bool need_dropdown = _pi->has_output_presets (); if (!need_dropdown) { _out_presets.set_sensitive (false); @@ -511,6 +486,7 @@ PluginPinWidget::refill_output_presets () _out_presets.set_text (_("Automatic")); } + PluginOutputConfiguration ppc (_pi->plugin (0)->possible_output ()); if (ppc.find (0) != ppc.end ()) { // anyting goes ppc.clear (); @@ -1994,10 +1970,18 @@ PluginPinDialog::PluginPinDialog (boost::shared_ptr pi) PluginPinDialog::PluginPinDialog (boost::shared_ptr r) : ArdourWindow (string_compose (_("Pin Configuration: %1"), r->name ())) , _route (r) + , _height_mapped (false) { vbox = manage (new VBox ()); - add (*vbox); + vbox->signal_size_allocate().connect (sigc::mem_fun (*this, &PluginPinDialog::map_height)); + scroller = manage (new ScrolledWindow); + scroller->set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); + scroller->set_shadow_type (Gtk::SHADOW_NONE); + scroller->show (); vbox->show (); + scroller->add (*vbox); + add (*scroller); + _route->foreach_processor (sigc::mem_fun (*this, &PluginPinDialog::add_processor)); @@ -2018,15 +2002,26 @@ PluginPinDialog::set_session (ARDOUR::Session *s) } } +void +PluginPinDialog::map_height (Gtk::Allocation&) +{ + if (!_height_mapped) { + scroller->set_size_request (-1, std::min (600, 2 + vbox->get_height())); + _height_mapped = true; + } +} + void PluginPinDialog::route_processors_changed (ARDOUR::RouteProcessorChange) { ppw.clear (); - remove (); + _height_mapped = false; + scroller->remove (); vbox = manage (new VBox ()); - add (*vbox); - vbox->show (); + vbox->signal_size_allocate().connect (sigc::mem_fun (*this, &PluginPinDialog::map_height)); + scroller->add (*vbox); _route->foreach_processor (sigc::mem_fun (*this, &PluginPinDialog::add_processor)); + vbox->show (); } void @@ -2045,6 +2040,11 @@ PluginPinDialog::add_processor (boost::weak_ptr p) return; } boost::shared_ptr pi = boost::dynamic_pointer_cast (proc); +#ifdef MIXBUS + if (pi && pi->is_channelstrip ()) { + pi.reset (); + } +#endif if (pi) { ppw.push_back (PluginPinWidgetPtr(new PluginPinWidget (pi))); vbox->pack_start (*ppw.back()); @@ -2053,7 +2053,7 @@ PluginPinDialog::add_processor (boost::weak_ptr p) hbox->pack_start (*manage (new HSeparator ())); hbox->pack_start (*manage (new Label (proc->display_name ()))); hbox->pack_start (*manage (new HSeparator ())); - vbox->pack_start (*hbox); + vbox->pack_start (*hbox, false, false); hbox->show_all (); } }