Allow to limit strip-inline controls (GUI optimization)
authorRobin Gareus <robin@gareus.org>
Wed, 31 Oct 2018 22:43:39 +0000 (23:43 +0100)
committerRobin Gareus <robin@gareus.org>
Wed, 31 Oct 2018 22:44:04 +0000 (23:44 +0100)
gtk2_ardour/processor_box.cc
gtk2_ardour/rc_option_editor.cc
gtk2_ardour/ui_config_vars.h

index 2ef301b96dc4b625d9c542154d8ae9f376c5697a..f4f19c2e91e2d3984ba2b6723f35331239446f72 100644 (file)
@@ -218,6 +218,8 @@ ProcessorEntry::ProcessorEntry (ProcessorBox* parent, boost::shared_ptr<Processo
                _processor->PropertyChanged.connect (name_connection, invalidator (*this), boost::bind (&ProcessorEntry::processor_property_changed, this, _1), gui_context());
                _processor->ConfigurationChanged.connect (config_connection, invalidator (*this), boost::bind (&ProcessorEntry::processor_configuration_changed, this, _1, _2), gui_context());
 
+               const uint32_t limit_inline_controls = UIConfiguration::instance().get_max_inline_controls ();
+
                set<Evoral::Parameter> p = _processor->what_can_be_automated ();
                for (set<Evoral::Parameter>::iterator i = p.begin(); i != p.end(); ++i) {
 
@@ -241,6 +243,10 @@ ProcessorEntry::ProcessorEntry (ProcessorBox* parent, boost::shared_ptr<Processo
                                /* Add non-Amp (Fader & Trim) controls to the processor box */
                                _vbox.pack_start (c->box);
                        }
+
+                       if (limit_inline_controls > 0 && _controls.size() >= limit_inline_controls) {
+                               break;
+                       }
                }
 
                setup_tooltip ();
index 9cf26847a4877f9fe7e704b06bacbe383e50af30..93d7c76fb3910ae68fd1062ef395473996a5cc67 100644 (file)
@@ -3805,6 +3805,19 @@ RCOptionEditor::RCOptionEditor ()
                     sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_default_narrow_ms)
                     ));
 
+       ComboOption<uint32_t>* mic = new ComboOption<uint32_t> (
+                    "max-inline-controls",
+                    _("Limit inline-mixer-strip controls per plugin"),
+                    sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_max_inline_controls),
+                    sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_max_inline_controls)
+                    );
+       mic->add (0, _("Unlimited"));
+       mic->add (16,  _("16 parameters"));
+       mic->add (32,  _("32 parameters"));
+       mic->add (64,  _("64 parameters"));
+       mic->add (128, _("128 parameters"));
+       add_option (_("Appearance/Mixer"), mic);
+
        add_option (_("Appearance/Mixer"), new OptionEditorBlank ());
 
        add_option (_("Appearance/Toolbar"), new OptionEditorHeading (_("Main Transport Toolbar Items")));
index d25d50cfa5e501eddc869c6d3a722f3d05e1a89a..1713bbd5e4d1606c3b57d5a00997797e740a9bff 100644 (file)
@@ -96,6 +96,7 @@ UI_CONFIG_VARIABLE (std::string, xjadeo_binary, "xjadeo-binary", "")
 UI_CONFIG_VARIABLE (bool, open_gui_after_adding_plugin, "open-gui-after-adding-plugin", true)
 UI_CONFIG_VARIABLE (bool, show_inline_display_by_default, "show-inline-display-by-default", true)
 UI_CONFIG_VARIABLE (bool, prefer_inline_over_gui, "prefer-inline-over-gui", true)
+UI_CONFIG_VARIABLE (uint32_t, max_inline_controls, "max-inline-controls", 32) /* per processor */
 UI_CONFIG_VARIABLE (uint32_t, action_table_columns, "action-table-columns", 0)
 UI_CONFIG_VARIABLE (bool, use_wm_visibility, "use-wm-visibility", true)
 UI_CONFIG_VARIABLE (std::string, stripable_color_palette, "stripable-color-palette", "#AA3939:#FFAAAA:#D46A6A:#801515:#550000:#AA8E39:#FFEAAA:#D4BA6A:#806515:#554000:#343477:#8080B3:#565695:#1A1A59:#09093B:#2D882D:#88CC88:#55AA55:#116611:#004400")  /* Gtk::ColorSelection::palette_to_string */