Skip to content

Commit

Permalink
clang-tidy: Apply modernize-use-auto everywhere (#6480)
Browse files Browse the repository at this point in the history
Note: clang-tidy was run with `--format-style=file`.
  • Loading branch information
sakertooth authored Sep 14, 2022
1 parent 550c7bf commit 0b27497
Show file tree
Hide file tree
Showing 170 changed files with 1,114 additions and 1,343 deletions.
8 changes: 4 additions & 4 deletions plugins/Amplifier/AmplifierControlDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,27 @@ AmplifierControlDialog::AmplifierControlDialog( AmplifierControls* controls ) :
setPalette( pal );
setFixedSize( 100, 110 );

Knob * volumeKnob = new Knob( knobBright_26, this);
auto volumeKnob = new Knob(knobBright_26, this);
volumeKnob -> move( 16, 10 );
volumeKnob -> setVolumeKnob( true );
volumeKnob->setModel( &controls->m_volumeModel );
volumeKnob->setLabel( tr( "VOL" ) );
volumeKnob->setHintText( tr( "Volume:" ) , "%" );

Knob * panKnob = new Knob( knobBright_26, this);
auto panKnob = new Knob(knobBright_26, this);
panKnob -> move( 57, 10 );
panKnob->setModel( &controls->m_panModel );
panKnob->setLabel( tr( "PAN" ) );
panKnob->setHintText( tr( "Panning:" ) , "" );

Knob * leftKnob = new Knob( knobBright_26, this);
auto leftKnob = new Knob(knobBright_26, this);
leftKnob -> move( 16, 65 );
leftKnob -> setVolumeKnob( true );
leftKnob->setModel( &controls->m_leftModel );
leftKnob->setLabel( tr( "LEFT" ) );
leftKnob->setHintText( tr( "Left gain:" ) , "%" );

Knob * rightKnob = new Knob( knobBright_26, this);
auto rightKnob = new Knob(knobBright_26, this);
rightKnob -> move( 57, 65 );
rightKnob -> setVolumeKnob( true );
rightKnob->setModel( &controls->m_rightModel );
Expand Down
19 changes: 9 additions & 10 deletions plugins/AudioFileProcessor/AudioFileProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,9 @@ void AudioFileProcessor::loopPointChanged()

void AudioFileProcessor::pointChanged()
{
const f_cnt_t f_start = static_cast<f_cnt_t>( m_startPointModel.value() * m_sampleBuffer.frames() );
const f_cnt_t f_end = static_cast<f_cnt_t>( m_endPointModel.value() * m_sampleBuffer.frames() );
const f_cnt_t f_loop = static_cast<f_cnt_t>( m_loopPointModel.value() * m_sampleBuffer.frames() );
const auto f_start = static_cast<f_cnt_t>(m_startPointModel.value() * m_sampleBuffer.frames());
const auto f_end = static_cast<f_cnt_t>(m_endPointModel.value() * m_sampleBuffer.frames());
const auto f_loop = static_cast<f_cnt_t>(m_loopPointModel.value() * m_sampleBuffer.frames());

m_nextPlayStartPoint = f_start;
m_nextPlayBackwards = false;
Expand Down Expand Up @@ -479,7 +479,7 @@ AudioFileProcessorView::AudioFileProcessorView( Instrument * _instrument,

// loop button group

PixmapButton * m_loopOffButton = new PixmapButton( this );
auto m_loopOffButton = new PixmapButton(this);
m_loopOffButton->setCheckable( true );
m_loopOffButton->move( 190, 105 );
m_loopOffButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
Expand All @@ -488,8 +488,7 @@ AudioFileProcessorView::AudioFileProcessorView( Instrument * _instrument,
"loop_off_off" ) );
m_loopOffButton->setToolTip(tr("Disable loop"));


PixmapButton * m_loopOnButton = new PixmapButton( this );
auto m_loopOnButton = new PixmapButton(this);
m_loopOnButton->setCheckable( true );
m_loopOnButton->move( 190, 124 );
m_loopOnButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
Expand All @@ -498,7 +497,7 @@ AudioFileProcessorView::AudioFileProcessorView( Instrument * _instrument,
"loop_on_off" ) );
m_loopOnButton->setToolTip(tr("Enable loop"));

PixmapButton * m_loopPingPongButton = new PixmapButton( this );
auto m_loopPingPongButton = new PixmapButton(this);
m_loopPingPongButton->setCheckable( true );
m_loopPingPongButton->move( 216, 124 );
m_loopPingPongButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
Expand Down Expand Up @@ -645,9 +644,9 @@ void AudioFileProcessorView::paintEvent( QPaintEvent * )

p.drawPixmap( 0, 0, *s_artwork );

AudioFileProcessor * a = castModel<AudioFileProcessor>();
auto a = castModel<AudioFileProcessor>();

QString file_name = "";
QString file_name = "";
int idx = a->m_sampleBuffer.audioFile().length();

p.setFont( pointSize<8>( font() ) );
Expand Down Expand Up @@ -702,7 +701,7 @@ void AudioFileProcessorView::openAudioFile()

void AudioFileProcessorView::modelChanged()
{
AudioFileProcessor * a = castModel<AudioFileProcessor>();
auto a = castModel<AudioFileProcessor>();
connect( &a->m_sampleBuffer, SIGNAL( sampleUpdated() ),
this, SLOT( sampleUpdated() ) );
m_ampKnob->setModel( &a->m_ampModel );
Expand Down
10 changes: 5 additions & 5 deletions plugins/BassBooster/BassBoosterControlDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,22 @@ BassBoosterControlDialog::BassBoosterControlDialog( BassBoosterControls* control
setPalette( pal );
setFixedSize( 120, 60 );

QVBoxLayout * tl = new QVBoxLayout( this );
auto tl = new QVBoxLayout(this);
tl->addSpacing( 4 );

QHBoxLayout * l = new QHBoxLayout;
auto l = new QHBoxLayout;

Knob * freqKnob = new Knob( knobBright_26, this);
auto freqKnob = new Knob(knobBright_26, this);
freqKnob->setModel( &controls->m_freqModel );
freqKnob->setLabel( tr( "FREQ" ) );
freqKnob->setHintText( tr( "Frequency:" ) , "Hz" );

Knob * gainKnob = new Knob( knobBright_26, this );
auto gainKnob = new Knob(knobBright_26, this);
gainKnob->setModel( &controls->m_gainModel );
gainKnob->setLabel( tr( "GAIN" ) );
gainKnob->setHintText( tr( "Gain:" ) , "" );

Knob * ratioKnob = new Knob( knobBright_26, this );
auto ratioKnob = new Knob(knobBright_26, this);
ratioKnob->setModel( &controls->m_ratioModel );
ratioKnob->setLabel( tr( "RATIO" ) );
ratioKnob->setHintText( tr( "Ratio:" ) , "" );
Expand Down
8 changes: 3 additions & 5 deletions plugins/BitInvader/BitInvader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,8 @@ BSynth::~BSynth()

sample_t BSynth::nextStringSample( float sample_length )
{
float sample_step =
static_cast<float>( sample_length / ( sample_rate / nph->frequency() ) );
auto sample_step = static_cast<float>(sample_length / (sample_rate / nph->frequency()));


// check overflow
while (sample_realindex >= sample_length) {
sample_realindex -= sample_length;
Expand Down Expand Up @@ -299,7 +297,7 @@ void BitInvader::playNote( NotePlayHandle * _n,
const fpp_t frames = _n->framesLeftForCurrentPeriod();
const f_cnt_t offset = _n->noteOffset();

BSynth * ps = static_cast<BSynth *>( _n->m_pluginData );
auto ps = static_cast<BSynth*>(_n->m_pluginData);
for( fpp_t frame = offset; frame < frames + offset; ++frame )
{
const sample_t cur = ps->nextStringSample( m_graph.length() );
Expand Down Expand Up @@ -472,7 +470,7 @@ BitInvaderView::BitInvaderView( Instrument * _instrument,

void BitInvaderView::modelChanged()
{
BitInvader * b = castModel<BitInvader>();
auto b = castModel<BitInvader>();

m_graph->setModel( &b->m_graph );
m_sampleLengthKnob->setModel( &b->m_sampleLength );
Expand Down
32 changes: 16 additions & 16 deletions plugins/Bitcrush/BitcrushControlDialog.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -46,34 +46,34 @@ BitcrushControlDialog::BitcrushControlDialog( BitcrushControls * controls ) :
setFixedSize( 181, 128 );

// labels
QLabel * inLabel = new QLabel( tr( "IN" ), this );
auto inLabel = new QLabel(tr("IN"), this);
inLabel->move( 24, 15 );
QLabel * outLabel = new QLabel( tr( "OUT" ), this );

auto outLabel = new QLabel(tr("OUT"), this);
outLabel->move( 139, 15 );

// input knobs
Knob * inGain = new Knob( knobBright_26, this );
auto inGain = new Knob(knobBright_26, this);
inGain->move( 16, 32 );
inGain->setModel( & controls->m_inGain );
inGain->setLabel( tr( "GAIN" ) );
inGain->setHintText( tr( "Input gain:" ) , " dBFS" );
Knob * inNoise = new Knob( knobBright_26, this );

auto inNoise = new Knob(knobBright_26, this);
inNoise->move( 14, 76 );
inNoise->setModel( & controls->m_inNoise );
inNoise->setLabel( tr( "NOISE" ) );
inNoise->setHintText( tr( "Input noise:" ) , "%" );


// output knobs
Knob * outGain = new Knob( knobBright_26, this );
auto outGain = new Knob(knobBright_26, this);
outGain->move( 138, 32 );
outGain->setModel( & controls->m_outGain );
outGain->setLabel( tr( "GAIN" ) );
outGain->setHintText( tr( "Output gain:" ) , " dBFS" );
Knob * outClip = new Knob( knobBright_26, this );

auto outClip = new Knob(knobBright_26, this);
outClip->move( 138, 76 );
outClip->setModel( & controls->m_outClip );
outClip->setLabel( tr( "CLIP" ) );
Expand All @@ -82,33 +82,33 @@ BitcrushControlDialog::BitcrushControlDialog( BitcrushControls * controls ) :


// leds
LedCheckBox * rateEnabled = new LedCheckBox( "", this, tr( "Rate enabled" ), LedCheckBox::Green );
auto rateEnabled = new LedCheckBox("", this, tr("Rate enabled"), LedCheckBox::Green);
rateEnabled->move( 64, 14 );
rateEnabled->setModel( & controls->m_rateEnabled );
rateEnabled->setToolTip(tr("Enable sample-rate crushing"));
LedCheckBox * depthEnabled = new LedCheckBox( "", this, tr( "Depth enabled" ), LedCheckBox::Green );

auto depthEnabled = new LedCheckBox("", this, tr("Depth enabled"), LedCheckBox::Green);
depthEnabled->move( 101, 14 );
depthEnabled->setModel( & controls->m_depthEnabled );
depthEnabled->setToolTip(tr("Enable bit-depth crushing"));


// rate crushing knobs
Knob * rate = new Knob( knobBright_26, this );
auto rate = new Knob(knobBright_26, this);
rate->move( 59, 32 );
rate->setModel( & controls->m_rate );
rate->setLabel( tr( "FREQ" ) );
rate->setHintText( tr( "Sample rate:" ) , " Hz" );
Knob * stereoDiff = new Knob( knobBright_26, this );

auto stereoDiff = new Knob(knobBright_26, this);
stereoDiff->move( 72, 76 );
stereoDiff->setModel( & controls->m_stereoDiff );
stereoDiff->setLabel( tr( "STEREO" ) );
stereoDiff->setHintText( tr( "Stereo difference:" ) , "%" );


// depth crushing knob
Knob * levels = new Knob( knobBright_26, this );
auto levels = new Knob(knobBright_26, this);
levels->move( 92, 32 );
levels->setModel( & controls->m_levels );
levels->setLabel( tr( "QUANT" ) );
Expand Down
32 changes: 16 additions & 16 deletions plugins/CarlaBase/Carla.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ CarlaInstrument::CarlaInstrument(InstrumentTrack* const instrumentTrack, const D
fDescriptor->activate(fHandle);

// we need a play-handle which cares for calling play()
InstrumentPlayHandle * iph = new InstrumentPlayHandle( this, instrumentTrack );
Engine::audioEngine()->addPlayHandle( iph );
auto iph = new InstrumentPlayHandle(this, instrumentTrack);
Engine::audioEngine()->addPlayHandle( iph );

#if CARLA_VERSION_HEX >= CARLA_MIN_PARAM_VERSION
// text filter completion
Expand Down Expand Up @@ -625,8 +625,8 @@ CarlaInstrumentView::CarlaInstrumentView(CarlaInstrument* const instrument, QWid
pal.setBrush(backgroundRole(), instrument->kIsPatchbay ? PLUGIN_NAME::getIconPixmap("artwork-patchbay") : PLUGIN_NAME::getIconPixmap("artwork-rack"));
setPalette(pal);

QHBoxLayout* l = new QHBoxLayout(this);
l->setContentsMargins( 20, 180, 10, 10 );
auto l = new QHBoxLayout(this);
l->setContentsMargins( 20, 180, 10, 10 );
l->setSpacing(3);
l->setAlignment(Qt::AlignTop);

Expand Down Expand Up @@ -750,8 +750,8 @@ CarlaParamsView::CarlaParamsView(CarlaInstrumentView* const instrumentView, QWid
m_curOutColumn(0),
m_curOutRow(0)
{
QWidget* centralWidget = new QWidget(this);
QVBoxLayout* verticalLayout = new QVBoxLayout(centralWidget);
auto centralWidget = new QWidget(this);
auto verticalLayout = new QVBoxLayout(centralWidget);

// -- Toolbar
m_toolBarLayout = new QHBoxLayout();
Expand Down Expand Up @@ -794,9 +794,9 @@ CarlaParamsView::CarlaParamsView(CarlaInstrumentView* const instrumentView, QWid
m_toolBarLayout->addWidget(m_groupFilterCombo);

// -- Input params
QFrame* inputFrame = new QFrame(this);
QVBoxLayout* inputLayout = new QVBoxLayout(inputFrame);
QLabel* inputLabel = new QLabel("Input parameters", inputFrame);
auto inputFrame = new QFrame(this);
auto inputLayout = new QVBoxLayout(inputFrame);
auto inputLabel = new QLabel("Input parameters", inputFrame);

m_inputScrollArea = new QScrollArea(inputFrame);
m_inputScrollAreaWidgetContent = new QWidget();
Expand All @@ -820,9 +820,9 @@ CarlaParamsView::CarlaParamsView(CarlaInstrumentView* const instrumentView, QWid
inputLayout->addWidget(m_inputScrollArea);

// -- Output params
QFrame* outputFrame = new QFrame(this);
QVBoxLayout* outputLayout = new QVBoxLayout(outputFrame);
QLabel* outputLabel = new QLabel("Output parameters", outputFrame);
auto outputFrame = new QFrame(this);
auto outputLayout = new QVBoxLayout(outputFrame);
auto outputLabel = new QLabel("Output parameters", outputFrame);

m_outputScrollArea = new QScrollArea(outputFrame);
m_outputScrollAreaWidgetContent = new QWidget();
Expand All @@ -846,7 +846,7 @@ CarlaParamsView::CarlaParamsView(CarlaInstrumentView* const instrumentView, QWid
outputLayout->addWidget(m_outputScrollArea);

// -- QSplitter
QSplitter* splitter = new QSplitter(Qt::Vertical, this);
auto splitter = new QSplitter(Qt::Vertical, this);

// -- Add layout and widgets.
verticalLayout->addLayout(m_toolBarLayout);
Expand All @@ -866,8 +866,8 @@ CarlaParamsView::CarlaParamsView(CarlaInstrumentView* const instrumentView, QWid
#endif

// -- Sub window
CarlaParamsSubWindow* win = new CarlaParamsSubWindow(getGUI()->mainWindow()->workspace()->viewport(), Qt::SubWindow |
Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint);
auto win = new CarlaParamsSubWindow(getGUI()->mainWindow()->workspace()->viewport(),
Qt::SubWindow | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint);
m_carlaInstrumentView->m_paramsSubWindow = getGUI()->mainWindow()->workspace()->addSubWindow(win);
m_carlaInstrumentView->m_paramsSubWindow->setSizePolicy(
QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
Expand Down Expand Up @@ -976,7 +976,7 @@ void CarlaParamsView::filterKnobs()
}

// Add spacer so all knobs go to top
QSpacerItem* verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
auto verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
m_inputScrollAreaLayout->addItem(verticalSpacer, m_curRow+1, 0, 1, 1);
}

Expand Down
Loading

0 comments on commit 0b27497

Please sign in to comment.