From 0d846bc008434a293631395ac689e4fa606c99a7 Mon Sep 17 00:00:00 2001 From: Hyunjin Song Date: Fri, 11 Nov 2022 11:46:26 +0900 Subject: [PATCH] Reformat a bit --- include/LadspaMatrixControlView.h | 54 ++++++------- .../LadspaMatrixControlDialog.cpp | 76 +++++++++---------- .../LadspaEffect/LadspaMatrixControlDialog.h | 10 +-- src/gui/LadspaMatrixControlView.cpp | 42 +++++----- 4 files changed, 91 insertions(+), 91 deletions(-) diff --git a/include/LadspaMatrixControlView.h b/include/LadspaMatrixControlView.h index 730943dcf..c6cffe99e 100644 --- a/include/LadspaMatrixControlView.h +++ b/include/LadspaMatrixControlView.h @@ -1,28 +1,28 @@ /* - * LadspaMatrixControlView.h - widget for controlling a LADSPA port - * - * Copyright (c) 2006-2008 Danny McRae - * Copyright (c) 2009 Tobias Doerffel - * Copyright (c) 2015 Michael Gregorius - * - * This file is part of LMMS - http://lmms.io - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program (see COPYING); if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA. - * - */ +* LadspaMatrixControlView.h - widget for controlling a LADSPA port +* +* Copyright (c) 2006-2008 Danny McRae +* Copyright (c) 2009 Tobias Doerffel +* Copyright (c) 2015 Michael Gregorius +* +* This file is part of LMMS - http://lmms.io +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public +* License as published by the Free Software Foundation; either +* version 2 of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* General Public License for more details. +* +* You should have received a copy of the GNU General Public +* License along with this program (see COPYING); if not, write to the +* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +* Boston, MA 02110-1301 USA. +* +*/ #ifndef LADSPA_MATRIX_CONTROL_VIEW_H #define LADSPA_MATRIX_CONTROL_VIEW_H @@ -43,12 +43,12 @@ class LMMS_EXPORT LadspaMatrixControlView : public QWidget, public ModelView { Q_OBJECT public: - LadspaMatrixControlView( QWidget * parent, LadspaControl * ladspaControl ); + LadspaMatrixControlView(QWidget* parent, LadspaControl* ladspaControl); private: - LadspaControl * m_ladspaControl; + LadspaControl* m_ladspaControl; -} ; +}; } // namespace gui diff --git a/plugins/LadspaEffect/LadspaMatrixControlDialog.cpp b/plugins/LadspaEffect/LadspaMatrixControlDialog.cpp index a062e799b..400280700 100644 --- a/plugins/LadspaEffect/LadspaMatrixControlDialog.cpp +++ b/plugins/LadspaEffect/LadspaMatrixControlDialog.cpp @@ -50,36 +50,36 @@ static int const s_channelBaseColumn = 4; -LadspaMatrixControlDialog::LadspaMatrixControlDialog( LadspaControls * ladspaControls ) : - EffectControlDialog( ladspaControls ), - m_effectGridLayout( NULL ), - m_stereoLink( NULL ) +LadspaMatrixControlDialog::LadspaMatrixControlDialog(LadspaControls * ladspaControls) : + EffectControlDialog(ladspaControls), + m_effectGridLayout(NULL), + m_stereoLink(NULL) { - QVBoxLayout * mainLayout = new QVBoxLayout( this ); + QVBoxLayout * mainLayout = new QVBoxLayout(this); m_effectGridLayout = new QGridLayout(); mainLayout->addLayout(m_effectGridLayout); - updateEffectView( ladspaControls ); + updateEffectView(ladspaControls); - if( ladspaControls->m_processors > 1 ) + if (ladspaControls->m_processors > 1) { - mainLayout->addSpacing( 3 ); + mainLayout->addSpacing(3); QHBoxLayout * center = new QHBoxLayout(); - mainLayout->addLayout( center ); - m_stereoLink = new LedCheckBox( tr( "Link Channels" ), this ); - m_stereoLink->setModel( &ladspaControls->m_stereoLinkModel ); - center->addWidget( m_stereoLink ); + mainLayout->addLayout(center); + m_stereoLink = new LedCheckBox(tr("Link Channels"), this); + m_stereoLink->setModel(&ladspaControls->m_stereoLinkModel); + center->addWidget(m_stereoLink); } } -void LadspaMatrixControlDialog::updateEffectView( LadspaControls * ladspaControls ) +void LadspaMatrixControlDialog::updateEffectView(LadspaControls * ladspaControls) { QList list = findChildren(); - for( QList::iterator it = list.begin(); it != list.end(); ++it ) + for (QList::iterator it = list.begin(); it != list.end(); ++it) { delete *it; } @@ -90,71 +90,71 @@ void LadspaMatrixControlDialog::updateEffectView( LadspaControls * ladspaControl QGridLayout *gridLayout = new QGridLayout(widget); widget->setLayout(gridLayout); - gridLayout->addWidget( new QLabel( "" + tr( "Parameter" ) + "", widget ), 0, s_parameterNameBaseColumn, Qt::AlignRight ); + gridLayout->addWidget(new QLabel("" + tr("Parameter") + "", widget), 0, s_parameterNameBaseColumn, Qt::AlignRight); bool linkLabelAdded = false; ch_cnt_t const numberOfChannels = ladspaControls->m_processors; gridLayout->setColumnMinimumWidth(1, 20); - for ( ch_cnt_t i = 0; i < numberOfChannels; ++i ) + for (ch_cnt_t i = 0; i < numberOfChannels; ++i) { - QString channelString( tr( "Channel %1" ) ); + QString channelString(tr("Channel %1")); int currentChannelColumn = s_channelBaseColumn + 2*i; - gridLayout->addWidget( new QLabel( "" + channelString.arg( QString::number( i + 1 ) ) + "", widget ), 0, currentChannelColumn, Qt::AlignHCenter ); + gridLayout->addWidget(new QLabel("" + channelString.arg(QString::number(i + 1)) + "", widget), 0, currentChannelColumn, Qt::AlignHCenter); control_list_t & controls = ladspaControls->m_controls[i]; int currentRow = 1; control_list_t::iterator end = controls.end(); - for( control_list_t::iterator it = controls.begin(); it != end; ++it ) + for (control_list_t::iterator it = controls.begin(); it != end; ++it) { LadspaControl * ladspaControl = *it; - if ( i == 0 ) + if (i == 0) { // TODO Assumes that all processors are equal! Change to more general approach, e.g. map from name to row // Link - if ( ladspaControl->m_link ) + if (ladspaControl->m_link) { - if ( !linkLabelAdded ) + if (!linkLabelAdded) { - gridLayout->addWidget( new QLabel( "" + tr( "Link" ) + "", widget ), 0, s_linkBaseColumn, Qt::AlignHCenter ); + gridLayout->addWidget(new QLabel("" + tr("Link") + "", widget), 0, s_linkBaseColumn, Qt::AlignHCenter); linkLabelAdded = true; } - LedCheckBox * linkCheckBox = new LedCheckBox( "", widget ); - linkCheckBox->setModel( &ladspaControl->m_linkEnabledModel ); - linkCheckBox->setToolTip( tr( "Link channels" ) ); - gridLayout->addWidget( linkCheckBox, currentRow, s_linkBaseColumn, Qt::AlignHCenter ); + LedCheckBox * linkCheckBox = new LedCheckBox("", widget); + linkCheckBox->setModel(&ladspaControl->m_linkEnabledModel); + linkCheckBox->setToolTip(tr("Link channels")); + gridLayout->addWidget(linkCheckBox, currentRow, s_linkBaseColumn, Qt::AlignHCenter); } // Parameter name QString portName = ladspaControl->port()->name; - QLabel *portNameLabel = new QLabel( portName, widget ); - gridLayout->addWidget( portNameLabel, currentRow, s_parameterNameBaseColumn, Qt::AlignRight ); + QLabel *portNameLabel = new QLabel(portName, widget); + gridLayout->addWidget(portNameLabel, currentRow, s_parameterNameBaseColumn, Qt::AlignRight); } - LadspaMatrixControlView *ladspaMatrixControlView = new LadspaMatrixControlView( widget, ladspaControl ); - gridLayout->addWidget( ladspaMatrixControlView, currentRow, currentChannelColumn, Qt::AlignHCenter ); + LadspaMatrixControlView *ladspaMatrixControlView = new LadspaMatrixControlView(widget, ladspaControl); + gridLayout->addWidget(ladspaMatrixControlView, currentRow, currentChannelColumn, Qt::AlignHCenter); gridLayout->setColumnMinimumWidth(currentChannelColumn - 1, 20); ++currentRow; } } - QScrollArea *scrollArea = new QScrollArea( this ); - scrollArea->setWidgetResizable( true ); - scrollArea->setWidget( widget ); - scrollArea->setFrameShape( QFrame::NoFrame ); + QScrollArea *scrollArea = new QScrollArea(this); + scrollArea->setWidgetResizable(true); + scrollArea->setWidget(widget); + scrollArea->setFrameShape(QFrame::NoFrame); - m_effectGridLayout->addWidget( scrollArea, 0, 0 ); + m_effectGridLayout->addWidget(scrollArea, 0, 0); m_effectGridLayout->setMargin(0); - if( numberOfChannels > 1 && m_stereoLink != NULL ) + if (numberOfChannels > 1 && m_stereoLink != NULL) { - m_stereoLink->setModel( &ladspaControls->m_stereoLinkModel ); + m_stereoLink->setModel(&ladspaControls->m_stereoLinkModel); } connect(ladspaControls, &LadspaControls::effectModelChanged, diff --git a/plugins/LadspaEffect/LadspaMatrixControlDialog.h b/plugins/LadspaEffect/LadspaMatrixControlDialog.h index fc02ce96d..a1564d1e6 100644 --- a/plugins/LadspaEffect/LadspaMatrixControlDialog.h +++ b/plugins/LadspaEffect/LadspaMatrixControlDialog.h @@ -46,19 +46,19 @@ class LadspaMatrixControlDialog : public EffectControlDialog { Q_OBJECT public: - LadspaMatrixControlDialog( LadspaControls * _ctl ); + LadspaMatrixControlDialog(LadspaControls* ctl); bool isResizable() const override { return true; } private slots: - void updateEffectView( LadspaControls * _ctl ); + void updateEffectView(LadspaControls* ctl); private: - QGridLayout * m_effectGridLayout; - LedCheckBox * m_stereoLink; + QGridLayout* m_effectGridLayout; + LedCheckBox* m_stereoLink; -} ; +}; } // namespace gui diff --git a/src/gui/LadspaMatrixControlView.cpp b/src/gui/LadspaMatrixControlView.cpp index 798e79b8d..3b0f21f15 100644 --- a/src/gui/LadspaMatrixControlView.cpp +++ b/src/gui/LadspaMatrixControlView.cpp @@ -38,51 +38,51 @@ namespace lmms::gui { -LadspaMatrixControlView::LadspaMatrixControlView( QWidget * parent, - LadspaControl * ladspaControl ) : - QWidget( parent ), - ModelView( ladspaControl, this ), - m_ladspaControl( ladspaControl ) +LadspaMatrixControlView::LadspaMatrixControlView(QWidget * parent, + LadspaControl * ladspaControl) : + QWidget(parent), + ModelView(ladspaControl, this), + m_ladspaControl(ladspaControl) { - QHBoxLayout * layout = new QHBoxLayout( this ); - layout->setMargin( 0 ); - layout->setSpacing( 0 ); + QHBoxLayout * layout = new QHBoxLayout(this); + layout->setMargin(0); + layout->setSpacing(0); Knob * knob = NULL; buffer_data_t dataType = m_ladspaControl->port()->data_type; - switch( dataType ) + switch (dataType) { case TOGGLED: { LedCheckBox * toggle = new LedCheckBox( - "", this, QString(), LedCheckBox::Green ); - toggle->setModel( m_ladspaControl->toggledModel() ); - layout->addWidget( toggle ); - setFixedSize( toggle->width(), toggle->height() ); + "", this, QString(), LedCheckBox::Green); + toggle->setModel(m_ladspaControl->toggledModel()); + layout->addWidget(toggle); + setFixedSize(toggle->width(), toggle->height()); break; } case INTEGER: case FLOATING: - knob = new Knob( knobBright_26, this, m_ladspaControl->port()->name ); - knob->setModel( m_ladspaControl->knobModel() ); + knob = new Knob(knobBright_26, this, m_ladspaControl->port()->name); + knob->setModel(m_ladspaControl->knobModel()); break; case TIME: - knob = new TempoSyncKnob( knobBright_26, this, m_ladspaControl->port()->name ); - knob->setModel( m_ladspaControl->tempoSyncKnobModel() ); + knob = new TempoSyncKnob(knobBright_26, this, m_ladspaControl->port()->name); + knob->setModel(m_ladspaControl->tempoSyncKnobModel()); break; default: break; } - if( knob != NULL ) + if (knob != NULL) { - knob->setHintText( tr( "Value:" ), "" ); - layout->addWidget( knob ); - setFixedSize( knob->width(), knob->height() ); + knob->setHintText(tr("Value:"), ""); + layout->addWidget(knob); + setFixedSize(knob->width(), knob->height()); } }