Skip to content

Commit

Permalink
Lv2: Don't show ports with prop notOnGUI (#6310)
Browse files Browse the repository at this point in the history
Additionally, this commit removes an unused variable.
  • Loading branch information
JohannesLorenz authored Feb 13, 2022
1 parent dc73911 commit 77fee49
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
27 changes: 16 additions & 11 deletions src/gui/Lv2ViewBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <QPushButton>
#include <QHBoxLayout>
#include <lilv/lilv.h>
#include <lv2/lv2plug.in/ns/ext/port-props/port-props.h>

#include "AudioEngine.h"
#include "Controls.h"
Expand Down Expand Up @@ -102,18 +103,22 @@ Lv2ViewProc::Lv2ViewProc(QWidget* parent, Lv2Proc* ctrlBase, int colNum) :
ctrlBase->foreach_port(
[this, &commentUri](const Lv2Ports::PortBase* port)
{
SetupWidget setup;
setup.m_par = this;
setup.m_commentUri = commentUri.get();
port->accept(setup);

if (setup.m_control)
if(!lilv_port_has_property(port->m_plugin, port->m_port,
uri(LV2_PORT_PROPS__notOnGUI).get()))
{
addControl(setup.m_control,
lilv_node_as_string(lilv_port_get_symbol(
port->m_plugin, port->m_port)),
port->name().toUtf8().data(),
false);
SetupWidget setup;
setup.m_par = this;
setup.m_commentUri = commentUri.get();
port->accept(setup);

if (setup.m_control)
{
addControl(setup.m_control,
lilv_node_as_string(lilv_port_get_symbol(
port->m_plugin, port->m_port)),
port->name().toUtf8().data(),
false);
}
}
});
}
Expand Down
2 changes: 0 additions & 2 deletions src/gui/widgets/LinkedModelGroupViews.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ void LinkedModelGroupView::modelChanged(LinkedModelGroup *group)
void LinkedModelGroupView::addControl(Control* ctrl, const std::string& id,
const std::string &display, bool removable)
{
int wdgNum = static_cast<int>(m_widgets.size());
if (ctrl)
{
QWidget* box = new QWidget(this);
Expand Down Expand Up @@ -116,7 +115,6 @@ void LinkedModelGroupView::addControl(Control* ctrl, const std::string& id,

// take ownership of control and add it
m_widgets.emplace(id, std::unique_ptr<Control>(ctrl));
++wdgNum;
}

if (isHidden()) { setHidden(false); }
Expand Down

0 comments on commit 77fee49

Please sign in to comment.