From 55a3920265f030c513902d3b9c47799b006426e5 Mon Sep 17 00:00:00 2001 From: Michael Gregorius Date: Sat, 23 Sep 2023 09:37:13 +0200 Subject: [PATCH] Work on TODOs The TODO "Assumes that all processors are equal..." has been turned into a comment when we start iterating over the channels. If the channels are not of the same structure this would likely also have been a problem in the old implementation. The TODO "Use a factory..." has been removed as this is already done. The include of `FloatModelEditorBase.h` in LadspaWidgetFactory has been removed. --- plugins/LadspaEffect/LadspaMatrixControlDialog.cpp | 4 ++-- plugins/LadspaEffect/LadspaWidgetFactory.cpp | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/LadspaEffect/LadspaMatrixControlDialog.cpp b/plugins/LadspaEffect/LadspaMatrixControlDialog.cpp index d93d86613..88810cee6 100644 --- a/plugins/LadspaEffect/LadspaMatrixControlDialog.cpp +++ b/plugins/LadspaEffect/LadspaMatrixControlDialog.cpp @@ -130,6 +130,8 @@ void LadspaMatrixControlDialog::arrangeControls(QWidget * parent, QGridLayout* g int maxRow = 0; // Iterate the channels and add widgets for each control + // Note: the code assumes that all channels have the same structure, i.e. that all channels + // have the same number of parameters which are in the same order. ch_cnt_t const numberOfChannels = getChannelCount(); for (ch_cnt_t i = 0; i < numberOfChannels; ++i) { @@ -155,14 +157,12 @@ void LadspaMatrixControlDialog::arrangeControls(QWidget * parent, QGridLayout* g // Only use the first channel to determine if we need to add link controls if (i == 0 && ladspaControl->m_link) { - // TODO Assumes that all processors are equal! Change to more general approach, e.g. map from name to row LedCheckBox * linkCheckBox = new LedCheckBox("", parent, "", LedCheckBox::LedColor::Green); linkCheckBox->setModel(&ladspaControl->m_linkEnabledModel); linkCheckBox->setToolTip(tr("Link channels")); gridLayout->addWidget(linkCheckBox, currentRow, linkColumn, Qt::AlignHCenter); } - // TODO Use a factory to directly create the widgets? Currently they are wrapped in another layout in LadspaMatrixControlView... QWidget * controlWidget = LadspaWidgetFactory::createWidget(ladspaControl, this); if (controlWidget) { diff --git a/plugins/LadspaEffect/LadspaWidgetFactory.cpp b/plugins/LadspaEffect/LadspaWidgetFactory.cpp index a232ac955..62d09ccbd 100644 --- a/plugins/LadspaEffect/LadspaWidgetFactory.cpp +++ b/plugins/LadspaEffect/LadspaWidgetFactory.cpp @@ -31,8 +31,6 @@ #include "LadspaBase.h" #include "BarModelEditor.h" -// TODO Only for testing! Remove! -#include "FloatModelEditorBase.h" #include "LedCheckBox.h" #include "TempoSyncBarModelEditor.h"