Skip to content

Commit

Permalink
Work on TODOs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
michaelgregorius committed Sep 23, 2023
1 parent de18ee2 commit 55a3920
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions plugins/LadspaEffect/LadspaMatrixControlDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand Down
2 changes: 0 additions & 2 deletions plugins/LadspaEffect/LadspaWidgetFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
#include "LadspaBase.h"

#include "BarModelEditor.h"
// TODO Only for testing! Remove!
#include "FloatModelEditorBase.h"
#include "LedCheckBox.h"
#include "TempoSyncBarModelEditor.h"

Expand Down

0 comments on commit 55a3920

Please sign in to comment.