13
0

Fix generic plugin UI for plugins with only properties

e.g. reMID.lv2 has only a atom/file-property and no control-inputs.
This commit is contained in:
Robin Gareus 2018-12-05 20:18:56 +01:00
parent c2652437da
commit d6b5c23579
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -199,7 +199,7 @@ GenericPluginUI::GenericPluginUI (boost::shared_ptr<PluginInsert> pi, bool scrol
main_contents.pack_start (scroller, true, true);
prefheight = 0;
prefheight = -1;
build ();
if (insert->plugin()->has_midnam() && insert->plugin()->knows_bank_patch()) {
@ -317,7 +317,8 @@ void
GenericPluginUI::build ()
{
std::vector<ControlUI *> control_uis;
bool grid = plugin->parameter_count() > 0;
bool grid_avail = false;
bool grid_veto = false;
// Build a ControlUI for each control port
for (size_t i = 0; i < plugin->parameter_count(); ++i) {
@ -340,8 +341,10 @@ GenericPluginUI::build ()
ControlUI* cui;
Plugin::UILayoutHint hint;
if (!plugin->get_layout(i, hint)) {
grid = false;
if (plugin->get_layout(i, hint)) {
grid_avail = true;
} else {
grid_veto = true;
}
boost::shared_ptr<ARDOUR::AutomationControl> c
@ -355,7 +358,7 @@ GenericPluginUI::build ()
continue;
}
if (grid) {
if (grid_avail && !grid_veto) {
cui->x0 = hint.x0;
cui->x1 = hint.x1;
cui->y0 = hint.y0;
@ -371,6 +374,8 @@ GenericPluginUI::build ()
}
}
bool grid = grid_avail && !grid_veto;
// Build a ControlUI for each property
const Plugin::PropertyDescriptors& descs = plugin->get_supported_properties();
for (Plugin::PropertyDescriptors::const_iterator d = descs.begin(); d != descs.end(); ++d) {
@ -605,7 +610,7 @@ GenericPluginUI::automatic_layout (const std::vector<ControlUI*>& control_uis)
box->pack_start (*cui, false, false);
}
if (is_scrollable) {
if (is_scrollable && i > 0) {
prefheight = 30 * i;
}