Macro cleanup (#6095)

Summary:

* `NULL` -> `nullptr`
* `gui` -> Function `getGUI()`
* `pluginFactory` -> Function `getPluginFactory()`
* `assert` (redefinition) -> using `NDEBUG` instead, which standard `assert` respects.
* `powf` (C stdlib symbol clash) -> removed and all expansions replaced with calls to `std::pow`.
* `exp10` (nonstandard function symbol clash) -> removed and all expansions replaced with calls to `std::pow`.
* `PATH_DEV_DSP` -> File-scope QString of identical name and value.
* `VST_SNC_SHM_KEY_FILE` -> constexpr char* with identical name and value.
* `MM_ALLOC` and `MM_FREE` -> Functions with identical name and implementation.
* `INVAL`, `OUTVAL`, etc. for automation nodes -> Functions with identical names and implementations.
* BandLimitedWave.h: All integer constant macros replaced with constexpr ints of same name and value.
* `FAST_RAND_MAX` -> constexpr int of same name and value.
* `QSTR_TO_STDSTR` -> Function with identical name and equivalent implementation.
* `CCONST` -> constexpr function template with identical name and implementation.
* `F_OPEN_UTF8` -> Function with identical name and equivalent implementation.
* `LADSPA_PATH_SEPARATOR` -> constexpr char with identical name and value.
* `UI_CTRL_KEY` -> constexpr char* with identical name and value.
* `ALIGN_SIZE` -> Renamed to `LMMS_ALIGN_SIZE` and converted from a macro to a constexpr size_t.
* `JACK_MIDI_BUFFER_MAX` -> constexpr size_t with identical name and value.
* versioninfo.h: `PLATFORM`, `MACHINE` and `COMPILER_VERSION` -> prefixed with `LMMS_BUILDCONF_` and converted from macros to constexpr char* literals.
* Header guard _OSCILLOSCOPE -> renamed to OSCILLOSCOPE_H
* Header guard _TIME_DISPLAY_WIDGET -> renamed to TIME_DISPLAY_WIDGET_H
* C-style typecasts in DrumSynth.cpp have been replaced with `static_cast`.
* constexpr numerical constants are initialized with assignment notation instead of curly brace intializers.
* In portsmf, `Alg_seq::operator[]` will throw an exception instead of returning null if the operator index is out of range.

Additionally, in many places, global constants that were declared as `const T foo = bar;` were changed from const to constexpr, leaving them const and making them potentially evaluable at compile time.

Some macros that only appeared in single source files and were unused in those files have been removed entirely.
This commit is contained in:
Levin Oehlmann
2021-09-30 18:01:27 +02:00
committed by GitHub
parent 32b454fbec
commit f742710758
291 changed files with 1807 additions and 1762 deletions

View File

@@ -40,8 +40,8 @@ Plugin::Descriptor PLUGIN_EXPORT amplifier_plugin_descriptor =
0x0100,
Plugin::Effect,
new PluginPixmapLoader("logo"),
NULL,
NULL,
nullptr,
nullptr,
} ;
}

View File

@@ -39,8 +39,8 @@ Plugin::Descriptor PLUGIN_EXPORT bassbooster_plugin_descriptor =
0x0100,
Plugin::Effect,
new PluginPixmapLoader("logo"),
NULL,
NULL,
nullptr,
nullptr,
} ;
}

View File

@@ -46,8 +46,8 @@ Plugin::Descriptor PLUGIN_EXPORT bitcrush_plugin_descriptor =
0x0100,
Plugin::Effect,
new PluginPixmapLoader( "logo" ),
NULL,
NULL,
nullptr,
nullptr,
};
}
@@ -58,7 +58,7 @@ BitcrushEffect::BitcrushEffect( Model * parent, const Descriptor::SubPluginFeatu
m_sampleRate( Engine::audioEngine()->processingSampleRate() ),
m_filter( m_sampleRate )
{
m_buffer = MM_ALLOC( sampleFrame, Engine::audioEngine()->framesPerPeriod() * OS_RATE );
m_buffer = MM_ALLOC<sampleFrame>( Engine::audioEngine()->framesPerPeriod() * OS_RATE );
m_filter.setLowpass( m_sampleRate * ( CUTOFF_RATIO * OS_RATIO ) );
m_needsUpdate = true;

View File

@@ -41,8 +41,8 @@ Plugin::Descriptor PLUGIN_EXPORT compressor_plugin_descriptor =
0x0100,
Plugin::Effect,
new PluginPixmapLoader("logo"),
NULL,
NULL,
nullptr,
nullptr,
} ;
}

View File

@@ -297,7 +297,7 @@ CompressorControlDialog::CompressorControlDialog(CompressorControls* controls) :
lookaheadButton->setCheckable(true);
lookaheadButton->setModel(&controls->m_lookaheadModel);
connect(gui->mainWindow(), SIGNAL(periodicUpdate()), this, SLOT(updateDisplay()));
connect(getGUI()->mainWindow(), SIGNAL(periodicUpdate()), this, SLOT(updateDisplay()));
connect(&m_controls->m_peakmodeModel, SIGNAL(dataChanged()), this, SLOT(peakmodeChanged()));
connect(&m_controls->m_stereoLinkModel, SIGNAL(dataChanged()), this, SLOT(stereoLinkChanged()));

View File

@@ -41,8 +41,8 @@ Plugin::Descriptor PLUGIN_EXPORT crossovereq_plugin_descriptor =
0x0100,
Plugin::Effect,
new PluginPixmapLoader( "logo" ),
NULL,
NULL,
nullptr,
nullptr,
};
}
@@ -60,9 +60,9 @@ CrossoverEQEffect::CrossoverEQEffect( Model* parent, const Descriptor::SubPlugin
m_hp4( m_sampleRate ),
m_needsUpdate( true )
{
m_tmp1 = MM_ALLOC( sampleFrame, Engine::audioEngine()->framesPerPeriod() );
m_tmp2 = MM_ALLOC( sampleFrame, Engine::audioEngine()->framesPerPeriod() );
m_work = MM_ALLOC( sampleFrame, Engine::audioEngine()->framesPerPeriod() );
m_tmp1 = MM_ALLOC<sampleFrame>( Engine::audioEngine()->framesPerPeriod() );
m_tmp2 = MM_ALLOC<sampleFrame>( Engine::audioEngine()->framesPerPeriod() );
m_work = MM_ALLOC<sampleFrame>( Engine::audioEngine()->framesPerPeriod() );
}
CrossoverEQEffect::~CrossoverEQEffect()

View File

@@ -40,8 +40,8 @@ Plugin::Descriptor PLUGIN_EXPORT delay_plugin_descriptor =
0x0100,
Plugin::Effect,
new PluginPixmapLoader("logo"),
NULL,
NULL,
nullptr,
nullptr,
} ;

View File

@@ -41,8 +41,8 @@ Plugin::Descriptor PLUGIN_EXPORT dualfilter_plugin_descriptor =
0x0100,
Plugin::Effect,
new PluginPixmapLoader( "logo" ),
NULL,
NULL,
nullptr,
nullptr,
} ;
}

View File

@@ -118,7 +118,7 @@ EqControlsDialog::EqControlsDialog( EqControls *controls ) :
freqKnob->setHintText( tr( "Frequency:" ), "Hz" );
// adds the Number Active buttons
PixmapButton * activeButton = new PixmapButton( this, NULL );
PixmapButton * activeButton = new PixmapButton( this, nullptr );
activeButton->setCheckable(true);
activeButton->setModel( m_parameterWidget->getBandModels( i )->active );
@@ -151,38 +151,38 @@ EqControlsDialog::EqControlsDialog( EqControls *controls ) :
outSpecButton->move( 302, 240 );
//hp filter type
PixmapButton * hp12Button = new PixmapButton( this , NULL );
PixmapButton * hp12Button = new PixmapButton( this , nullptr );
hp12Button->setModel( m_parameterWidget->getBandModels( 0 )->hp12 );
hp12Button->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "12dB" ) );
hp12Button->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "12dBoff" ) );
hp12Button->move( 79, 298 );
PixmapButton * hp24Button = new PixmapButton( this , NULL );
PixmapButton * hp24Button = new PixmapButton( this , nullptr );
hp24Button->setModel(m_parameterWidget->getBandModels( 0 )->hp24 );
hp24Button->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "24dB" ) );
hp24Button->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "24dBoff" ) );
hp24Button->move( 79 , 328 );
PixmapButton * hp48Button = new PixmapButton( this , NULL );
PixmapButton * hp48Button = new PixmapButton( this , nullptr );
hp48Button->setModel( m_parameterWidget->getBandModels(0)->hp48 );
hp48Button->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "48dB" ) );
hp48Button->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "48dBoff" ) );
hp48Button->move( 79, 358 );
//LP filter type
PixmapButton * lp12Button = new PixmapButton( this , NULL );
PixmapButton * lp12Button = new PixmapButton( this , nullptr );
lp12Button->setModel( m_parameterWidget->getBandModels( 7 )->lp12 );
lp12Button->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "12dB" ) );
lp12Button->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "12dBoff" ) );
lp12Button->move( 387, 298 );
PixmapButton * lp24Button = new PixmapButton( this , NULL );
PixmapButton * lp24Button = new PixmapButton( this , nullptr );
lp24Button->setModel( m_parameterWidget->getBandModels( 7 )->lp24 );
lp24Button->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "24dB" ) );
lp24Button->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "24dBoff" ) );
lp24Button->move( 387, 328 );
PixmapButton * lp48Button = new PixmapButton( this , NULL );
PixmapButton * lp48Button = new PixmapButton( this , nullptr );
lp48Button->setModel( m_parameterWidget->getBandModels( 7 )->lp48 );
lp48Button->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "48dB" ) );
lp48Button->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "48dBoff" ) );

View File

@@ -44,8 +44,8 @@ Plugin::Descriptor PLUGIN_EXPORT eq_plugin_descriptor =
0x0100,
Plugin::Effect,
new PluginPixmapLoader("logo"),
NULL,
NULL,
nullptr,
nullptr,
} ;
}

View File

@@ -47,7 +47,7 @@ public:
resize( 23, 80 );
m_lPeak = lPeak;
m_rPeak = rPeak;
connect( gui->mainWindow(), SIGNAL( periodicUpdate() ), this, SLOT( updateVuMeters() ) );
connect( getGUI()->mainWindow(), SIGNAL( periodicUpdate() ), this, SLOT( updateVuMeters() ) );
m_model = model;
setPeak_L( 0 );
setPeak_R( 0 );
@@ -61,7 +61,7 @@ public:
resize( 23, 116 );
m_lPeak = lPeak;
m_rPeak = rPeak;
connect( gui->mainWindow(), SIGNAL( periodicUpdate() ), this, SLOT( updateVuMeters() ) );
connect( getGUI()->mainWindow(), SIGNAL( periodicUpdate() ), this, SLOT( updateVuMeters() ) );
m_model = model;
setPeak_L( 0 );
setPeak_R( 0 );

View File

@@ -178,7 +178,7 @@ EqSpectrumView::EqSpectrumView(EqAnalyser *b, QWidget *_parent) :
m_periodicalUpdate( false )
{
setFixedSize( 450, 200 );
connect( gui->mainWindow(), SIGNAL( periodicUpdate() ), this, SLOT( periodicalUpdate() ) );
connect( getGUI()->mainWindow(), SIGNAL( periodicUpdate() ), this, SLOT( periodicalUpdate() ) );
setAttribute( Qt::WA_TranslucentBackground, true );
m_skipBands = MAX_BANDS * 0.5;
float totalLength = log10( 20000 );

View File

@@ -40,8 +40,8 @@ Plugin::Descriptor PLUGIN_EXPORT flanger_plugin_descriptor =
0x0100,
Plugin::Effect,
new PluginPixmapLoader("logo"),
NULL,
NULL,
nullptr,
nullptr,
} ;

View File

@@ -60,7 +60,7 @@ Plugin::Descriptor PLUGIN_EXPORT freeboy_plugin_descriptor =
0x0100,
Plugin::Instrument,
new PluginPixmapLoader( "logo" ),
NULL,
nullptr,
} ;
}
@@ -556,7 +556,7 @@ FreeBoyInstrumentView::FreeBoyInstrumentView( Instrument * _instrument,
m_bassKnob->move( 5 + 3*32, 58 );
ToolTip::add( m_bassKnob, tr( "Bass" ) );
m_ch1SweepDirButton = new PixmapButton( this, NULL );
m_ch1SweepDirButton = new PixmapButton( this, nullptr );
m_ch1SweepDirButton->setCheckable( true );
m_ch1SweepDirButton->move( 167, 108 );
m_ch1SweepDirButton->setActiveGraphic(
@@ -565,7 +565,7 @@ FreeBoyInstrumentView::FreeBoyInstrumentView( Instrument * _instrument,
PLUGIN_NAME::getIconPixmap( "btn_up" ) );
ToolTip::add( m_ch1SweepDirButton, tr( "Sweep direction" ) );
m_ch1VolSweepDirButton = new PixmapButton( this, NULL );
m_ch1VolSweepDirButton = new PixmapButton( this, nullptr );
m_ch1VolSweepDirButton->setCheckable( true );
m_ch1VolSweepDirButton->move( 207, 108 );
m_ch1VolSweepDirButton->setActiveGraphic(
@@ -599,7 +599,7 @@ FreeBoyInstrumentView::FreeBoyInstrumentView( Instrument * _instrument,
PLUGIN_NAME::getIconPixmap( "btn_down" ) );
ToolTip::add( m_ch4VolSweepDirButton, tr( "Volume sweep direction" ) );
m_ch4ShiftRegWidthButton = new PixmapButton( this, NULL );
m_ch4ShiftRegWidthButton = new PixmapButton( this, nullptr );
m_ch4ShiftRegWidthButton->setCheckable( true );
m_ch4ShiftRegWidthButton->move( 207, 171 );
m_ch4ShiftRegWidthButton->setActiveGraphic(
@@ -611,28 +611,28 @@ FreeBoyInstrumentView::FreeBoyInstrumentView( Instrument * _instrument,
m_ch1So1Button = new PixmapButton( this, NULL );
m_ch1So1Button = new PixmapButton( this, nullptr );
m_ch1So1Button->setCheckable( true );
m_ch1So1Button->move( 208, 51 );
m_ch1So1Button->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "btn_on" ) );
m_ch1So1Button->setInactiveGraphic( PLUGIN_NAME::getIconPixmap("btn_off") );
ToolTip::add( m_ch1So1Button, tr( "Channel 1 to SO1 (Right)" ) );
m_ch2So1Button = new PixmapButton( this, NULL );
m_ch2So1Button = new PixmapButton( this, nullptr );
m_ch2So1Button->setCheckable( true );
m_ch2So1Button->move( 208, 51 + 12 );
m_ch2So1Button->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "btn_on" ) );
m_ch2So1Button->setInactiveGraphic( PLUGIN_NAME::getIconPixmap("btn_off") );
ToolTip::add( m_ch2So1Button, tr( "Channel 2 to SO1 (Right)" ) );
m_ch3So1Button = new PixmapButton( this, NULL );
m_ch3So1Button = new PixmapButton( this, nullptr );
m_ch3So1Button->setCheckable( true );
m_ch3So1Button->move( 208, 51 + 2*12 );
m_ch3So1Button->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "btn_on" ) );
m_ch3So1Button->setInactiveGraphic( PLUGIN_NAME::getIconPixmap("btn_off") );
ToolTip::add( m_ch3So1Button, tr( "Channel 3 to SO1 (Right)" ) );
m_ch4So1Button = new PixmapButton( this, NULL );
m_ch4So1Button = new PixmapButton( this, nullptr );
m_ch4So1Button->setCheckable( true );
m_ch4So1Button->setChecked( false );
m_ch4So1Button->move( 208, 51 + 3*12 );
@@ -640,28 +640,28 @@ FreeBoyInstrumentView::FreeBoyInstrumentView( Instrument * _instrument,
m_ch4So1Button->setInactiveGraphic( PLUGIN_NAME::getIconPixmap("btn_off") );
ToolTip::add( m_ch4So1Button, tr( "Channel 4 to SO1 (Right)" ) );
m_ch1So2Button = new PixmapButton( this, NULL );
m_ch1So2Button = new PixmapButton( this, nullptr );
m_ch1So2Button->setCheckable( true );
m_ch1So2Button->move( 148, 51 );
m_ch1So2Button->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "btn_on" ) );
m_ch1So2Button->setInactiveGraphic( PLUGIN_NAME::getIconPixmap("btn_off") );
ToolTip::add( m_ch1So2Button, tr( "Channel 1 to SO2 (Left)" ) );
m_ch2So2Button = new PixmapButton( this, NULL );
m_ch2So2Button = new PixmapButton( this, nullptr );
m_ch2So2Button->setCheckable( true );
m_ch2So2Button->move( 148, 51 + 12 );
m_ch2So2Button->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "btn_on" ) );
m_ch2So2Button->setInactiveGraphic( PLUGIN_NAME::getIconPixmap("btn_off") );
ToolTip::add( m_ch2So2Button, tr( "Channel 2 to SO2 (Left)" ) );
m_ch3So2Button = new PixmapButton( this, NULL );
m_ch3So2Button = new PixmapButton( this, nullptr );
m_ch3So2Button->setCheckable( true );
m_ch3So2Button->move( 148, 51 + 2*12 );
m_ch3So2Button->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "btn_on" ) );
m_ch3So2Button->setInactiveGraphic( PLUGIN_NAME::getIconPixmap("btn_off") );
ToolTip::add( m_ch3So2Button, tr( "Channel 3 to SO2 (Left)" ) );
m_ch4So2Button = new PixmapButton( this, NULL );
m_ch4So2Button = new PixmapButton( this, nullptr );
m_ch4So2Button->setCheckable( true );
m_ch4So2Button->setChecked( false );
m_ch4So2Button->move( 148, 51 + 3*12 );

View File

@@ -69,7 +69,7 @@ Plugin::Descriptor PLUGIN_EXPORT gigplayer_plugin_descriptor =
Plugin::Instrument,
new PluginPixmapLoader( "logo" ),
"gig",
NULL,
nullptr,
} ;
}
@@ -79,8 +79,8 @@ Plugin::Descriptor PLUGIN_EXPORT gigplayer_plugin_descriptor =
GigInstrument::GigInstrument( InstrumentTrack * _instrument_track ) :
Instrument( _instrument_track, &gigplayer_plugin_descriptor ),
m_instance( NULL ),
m_instrument( NULL ),
m_instance( nullptr ),
m_instrument( nullptr ),
m_filename( "" ),
m_bankNum( 0, 0, 999, this, tr( "Bank" ) ),
m_patchNum( 0, 0, 127, this, tr( "Patch" ) ),
@@ -165,7 +165,7 @@ AutomatableModel * GigInstrument::childModel( const QString & _modelName )
qCritical() << "requested unknown model " << _modelName;
return NULL;
return nullptr;
}
@@ -184,15 +184,15 @@ void GigInstrument::freeInstance()
QMutexLocker synthLock( &m_synthMutex );
QMutexLocker notesLock( &m_notesMutex );
if( m_instance != NULL )
if( m_instance != nullptr )
{
delete m_instance;
m_instance = NULL;
m_instance = nullptr;
// If we're changing instruments, we got to make sure that we
// remove all pointers to the old samples and don't try accessing
// that instrument again
m_instrument = NULL;
m_instrument = nullptr;
m_notes.clear();
}
}
@@ -217,7 +217,7 @@ void GigInstrument::openFile( const QString & _gigFile, bool updateTrackName )
}
catch( ... )
{
m_instance = NULL;
m_instance = nullptr;
m_filename = "";
}
}
@@ -249,7 +249,7 @@ QString GigInstrument::getCurrentPatchName()
{
QMutexLocker locker( &m_synthMutex );
if( m_instance == NULL )
if( m_instance == nullptr )
{
return "";
}
@@ -259,7 +259,7 @@ QString GigInstrument::getCurrentPatchName()
gig::Instrument * pInstrument = m_instance->gig.GetFirstInstrument();
while( pInstrument != NULL )
while( pInstrument != nullptr )
{
int iBank = pInstrument->MIDIBank;
int iProg = pInstrument->MIDIProgram;
@@ -330,7 +330,7 @@ void GigInstrument::play( sampleFrame * _working_buffer )
m_synthMutex.lock();
m_notesMutex.lock();
if( m_instance == NULL || m_instrument == NULL )
if( m_instance == nullptr || m_instrument == nullptr )
{
m_synthMutex.unlock();
m_notesMutex.unlock();
@@ -379,7 +379,7 @@ void GigInstrument::play( sampleFrame * _working_buffer )
// Delete if the ADSR for a sample is complete for normal
// notes, or if a release sample, then if we've reached
// the end of the sample
if( sample->sample == NULL || sample->adsr.done() ||
if( sample->sample == nullptr || sample->adsr.done() ||
( it->isRelease == true &&
sample->pos >= sample->sample->SamplesTotal - 1 ) )
{
@@ -417,7 +417,7 @@ void GigInstrument::play( sampleFrame * _working_buffer )
for( QList<GigSample>::iterator sample = it->samples.begin();
sample != it->samples.end(); ++sample )
{
if( sample->sample == NULL || sample->region == NULL )
if( sample->sample == nullptr || sample->region == nullptr )
{
continue;
}
@@ -504,7 +504,7 @@ void GigInstrument::play( sampleFrame * _working_buffer )
_working_buffer[i][1] *= m_gain.value();
}
instrumentTrack()->processAudioBuffer( _working_buffer, frames, NULL );
instrumentTrack()->processAudioBuffer( _working_buffer, frames, nullptr );
}
@@ -512,7 +512,7 @@ void GigInstrument::play( sampleFrame * _working_buffer )
void GigInstrument::loadSample( GigSample& sample, sampleFrame* sampleData, f_cnt_t samples )
{
if( sampleData == NULL || samples < 1 )
if( sampleData == nullptr || samples < 1 )
{
return;
}
@@ -523,7 +523,7 @@ void GigInstrument::loadSample( GigSample& sample, sampleFrame* sampleData, f_cn
f_cnt_t loopStart = 0;
f_cnt_t loopLength = 0;
if( sample.region->pSampleLoops != NULL )
if( sample.region->pSampleLoops != nullptr )
{
for( uint32_t i = 0; i < sample.region->SampleLoops; ++i )
{
@@ -733,7 +733,7 @@ void GigInstrument::addSamples( GigNote & gignote, bool wantReleaseSample )
gig::Region* pRegion = m_instrument->GetFirstRegion();
while( pRegion != NULL )
while( pRegion != nullptr )
{
Dimension dim = getDimensions( pRegion, gignote.velocity, wantReleaseSample );
gig::DimensionRegion * pDimRegion = pRegion->GetDimensionRegionByValue( dim.DimValues );
@@ -750,7 +750,7 @@ void GigInstrument::addSamples( GigNote & gignote, bool wantReleaseSample )
gignote.release = dim.release;
}
if( pSample != NULL && pSample->SamplesTotal != 0 )
if( pSample != nullptr && pSample->SamplesTotal != 0 )
{
int keyLow = pRegion->KeyRange.low;
int keyHigh = pRegion->KeyRange.high;
@@ -791,7 +791,7 @@ Dimension GigInstrument::getDimensions( gig::Region * pRegion, int velocity, boo
{
Dimension dim;
if( pRegion == NULL )
if( pRegion == nullptr )
{
return dim;
}
@@ -873,11 +873,11 @@ void GigInstrument::getInstrument()
QMutexLocker locker( &m_synthMutex );
if( m_instance != NULL )
if( m_instance != nullptr )
{
gig::Instrument * pInstrument = m_instance->gig.GetFirstInstrument();
while( pInstrument != NULL )
while( pInstrument != nullptr )
{
int iBank = pInstrument->MIDIBank;
int iProg = pInstrument->MIDIProgram;
@@ -1049,7 +1049,7 @@ void GigInstrumentView::showFileDialog()
{
GigInstrument * k = castModel<GigInstrument>();
FileDialog ofd( NULL, tr( "Open GIG file" ) );
FileDialog ofd( nullptr, tr( "Open GIG file" ) );
ofd.setFileMode( FileDialog::ExistingFiles );
QStringList types;
@@ -1101,10 +1101,10 @@ void GigInstrumentView::showPatchDialog()
GigSample::GigSample( gig::Sample * pSample, gig::DimensionRegion * pDimRegion,
float attenuation, int interpolation, float desiredFreq )
: sample( pSample ), region( pDimRegion ), attenuation( attenuation ),
pos( 0 ), interpolation( interpolation ), srcState( NULL ),
pos( 0 ), interpolation( interpolation ), srcState( nullptr ),
sampleFreq( 0 ), freqFactor( 1 )
{
if( sample != NULL && region != NULL )
if( sample != nullptr && region != nullptr )
{
// Note: we don't create the libsamplerate object here since we always
// also call the copy constructor when appending to the end of the
@@ -1134,7 +1134,7 @@ GigSample::GigSample( gig::Sample * pSample, gig::DimensionRegion * pDimRegion,
GigSample::~GigSample()
{
if( srcState != NULL )
if( srcState != nullptr )
{
src_delete( srcState );
}
@@ -1146,7 +1146,7 @@ GigSample::~GigSample()
GigSample::GigSample( const GigSample& g )
: sample( g.sample ), region( g.region ), attenuation( g.attenuation ),
adsr( g.adsr ), pos( g.pos ), interpolation( g.interpolation ),
srcState( NULL ), sampleFreq( g.sampleFreq ), freqFactor( g.freqFactor )
srcState( nullptr ), sampleFreq( g.sampleFreq ), freqFactor( g.freqFactor )
{
// On the copy, we want to create the object
updateSampleRate();
@@ -1163,11 +1163,11 @@ GigSample& GigSample::operator=( const GigSample& g )
adsr = g.adsr;
pos = g.pos;
interpolation = g.interpolation;
srcState = NULL;
srcState = nullptr;
sampleFreq = g.sampleFreq;
freqFactor = g.freqFactor;
if( g.srcState != NULL )
if( g.srcState != nullptr )
{
updateSampleRate();
}
@@ -1180,7 +1180,7 @@ GigSample& GigSample::operator=( const GigSample& g )
void GigSample::updateSampleRate()
{
if( srcState != NULL )
if( srcState != nullptr )
{
src_delete( srcState );
}
@@ -1188,7 +1188,7 @@ void GigSample::updateSampleRate()
int error = 0;
srcState = src_new( interpolation, DEFAULT_CHANNELS, &error );
if( srcState == NULL || error != 0 )
if( srcState == nullptr || error != 0 )
{
qCritical( "error while creating libsamplerate data structure in GigSample" );
}
@@ -1200,7 +1200,7 @@ void GigSample::updateSampleRate()
bool GigSample::convertSampleRate( sampleFrame & oldBuf, sampleFrame & newBuf,
f_cnt_t oldSize, f_cnt_t newSize, float freq_factor, f_cnt_t& used )
{
if( srcState == NULL )
if( srcState == nullptr )
{
return false;
}
@@ -1264,7 +1264,7 @@ ADSR::ADSR( gig::DimensionRegion * region, int sampleRate )
attackPosition( 0 ), attackLength( 0 ), decayLength( 0 ),
releasePosition( 0 ), releaseLength( 0 )
{
if( region != NULL )
if( region != nullptr )
{
// Parameters from GIG file
preattack = 1.0 * region->EG1PreAttack / 1000; // EG1PreAttack is 0-1000 permille

View File

@@ -66,7 +66,7 @@ PatchesDialog::PatchesDialog( QWidget * pParent, Qt::WindowFlags wflags )
// Setup UI struct...
setupUi( this );
m_pSynth = NULL;
m_pSynth = nullptr;
m_iChan = 0;
m_iBank = 0;
m_iProg = 0;
@@ -130,7 +130,7 @@ void PatchesDialog::setup( GigInstance * pSynth, int iChan,
setWindowTitle( chanName + " - GIG patches" );
// set m_pSynth to NULL so we don't trigger any progChanged events
m_pSynth = NULL;
m_pSynth = nullptr;
// Load bank list from actual synth stack...
m_bankListView->setSortingEnabled( false );
@@ -142,7 +142,7 @@ void PatchesDialog::setup( GigInstance * pSynth, int iChan,
//fluid_preset_t preset;
QTreeWidgetItem * pBankItem = NULL;
QTreeWidgetItem * pBankItem = nullptr;
// Currently just use zero as the only bank
int iBankDefault = -1;
@@ -215,8 +215,8 @@ bool PatchesDialog::validateForm()
{
bool bValid = true;
bValid = bValid && ( m_bankListView->currentItem() != NULL );
bValid = bValid && ( m_progListView->currentItem() != NULL );
bValid = bValid && ( m_bankListView->currentItem() != nullptr );
bValid = bValid && ( m_progListView->currentItem() != nullptr );
return bValid;
}
@@ -227,7 +227,7 @@ bool PatchesDialog::validateForm()
// Realize a bank-program selection preset.
void PatchesDialog::setBankProg( int iBank, int iProg )
{
if( m_pSynth == NULL )
if( m_pSynth == nullptr )
{
return;
}
@@ -295,7 +295,7 @@ QTreeWidgetItem * PatchesDialog::findBankItem( int iBank )
}
else
{
return NULL;
return nullptr;
}
}
@@ -317,7 +317,7 @@ QTreeWidgetItem *PatchesDialog::findProgItem( int iProg )
}
else
{
return NULL;
return nullptr;
}
}
@@ -327,14 +327,14 @@ QTreeWidgetItem *PatchesDialog::findProgItem( int iProg )
// Bank change slot.
void PatchesDialog::bankChanged()
{
if( m_pSynth == NULL )
if( m_pSynth == nullptr )
{
return;
}
QTreeWidgetItem * pBankItem = m_bankListView->currentItem();
if( pBankItem == NULL )
if( pBankItem == nullptr )
{
return;
}
@@ -344,7 +344,7 @@ void PatchesDialog::bankChanged()
// Clear up the program listview.
m_progListView->setSortingEnabled( false );
m_progListView->clear();
QTreeWidgetItem * pProgItem = NULL;
QTreeWidgetItem * pProgItem = nullptr;
gig::Instrument * pInstrument = m_pSynth->gig.GetFirstInstrument();
@@ -386,7 +386,7 @@ void PatchesDialog::bankChanged()
// Program change slot.
void PatchesDialog::progChanged( QTreeWidgetItem * curr, QTreeWidgetItem * prev )
{
if( m_pSynth == NULL || curr == NULL )
if( m_pSynth == nullptr || curr == nullptr )
{
return;
}

View File

@@ -34,9 +34,9 @@ Plugin::Descriptor PLUGIN_EXPORT hydrogenimport_plugin_descriptor =
"frank mather",
0x0100,
Plugin::ImportFilter,
NULL,
NULL,
NULL,
nullptr,
nullptr,
nullptr,
} ;
}

View File

@@ -18,7 +18,7 @@ public:
virtual PluginView * instantiateView( QWidget * )
{
return( NULL );
return( nullptr );
}
private:
virtual bool tryImport( TrackContainer* tc );

View File

@@ -38,8 +38,8 @@
LadspaControlDialog::LadspaControlDialog( LadspaControls * _ctl ) :
EffectControlDialog( _ctl ),
m_effectLayout( NULL ),
m_stereoLink( NULL )
m_effectLayout( nullptr ),
m_stereoLink( nullptr )
{
QVBoxLayout * mainLay = new QVBoxLayout( this );
@@ -133,7 +133,7 @@ void LadspaControlDialog::updateEffectView( LadspaControls * _ctl )
m_effectLayout->addWidget( grouper );
}
if( _ctl->m_processors > 1 && m_stereoLink != NULL )
if( _ctl->m_processors > 1 && m_stereoLink != nullptr )
{
m_stereoLink->setModel( &_ctl->m_stereoLinkModel );
}

View File

@@ -60,7 +60,7 @@ Plugin::Descriptor PLUGIN_EXPORT ladspaeffect_plugin_descriptor =
0x0100,
Plugin::Effect,
new PluginPixmapLoader("logo"),
NULL,
nullptr,
new LadspaSubPluginFeatures( Plugin::Effect )
} ;
@@ -70,12 +70,12 @@ Plugin::Descriptor PLUGIN_EXPORT ladspaeffect_plugin_descriptor =
LadspaEffect::LadspaEffect( Model * _parent,
const Descriptor::SubPluginFeatures::Key * _key ) :
Effect( &ladspaeffect_plugin_descriptor, _parent, _key ),
m_controls( NULL ),
m_controls( nullptr ),
m_maxSampleRate( 0 ),
m_key( LadspaSubPluginFeatures::subPluginKeyToLadspaKey( _key ) )
{
Ladspa2LMMS * manager = Engine::getLADSPAManager();
if( manager->getDescription( m_key ) == NULL )
if( manager->getDescription( m_key ) == nullptr )
{
Engine::getSong()->collectError(tr( "Unknown LADSPA plugin %1 requested." ).arg(
m_key.second ) );
@@ -108,7 +108,7 @@ void LadspaEffect::changeSampleRate()
m_controls->saveState( dataFile, dataFile.content() );
LadspaControls * controls = m_controls;
m_controls = NULL;
m_controls = nullptr;
m_pluginMutex.lock();
pluginDestruction();
@@ -139,7 +139,7 @@ bool LadspaEffect::processAudioBuffer( sampleFrame * _buf,
}
int frames = _frames;
sampleFrame * o_buf = NULL;
sampleFrame * o_buf = nullptr;
QVarLengthArray<sample_t> sBuf(_frames * DEFAULT_CHANNELS);
if( m_maxSampleRate < Engine::audioEngine()->processingSampleRate() )
@@ -194,7 +194,7 @@ bool LadspaEffect::processAudioBuffer( sampleFrame * _buf,
break;
}
case CONTROL_RATE_INPUT:
if( pp->control == NULL )
if( pp->control == nullptr )
{
break;
}
@@ -254,7 +254,7 @@ bool LadspaEffect::processAudioBuffer( sampleFrame * _buf,
}
}
if( o_buf != NULL )
if( o_buf != nullptr )
{
sampleBack( _buf, o_buf, m_maxSampleRate );
}
@@ -302,8 +302,8 @@ void LadspaEffect::pluginInstantiation()
int inputch = 0;
int outputch = 0;
LADSPA_Data * inbuf [2];
inbuf[0] = NULL;
inbuf[1] = NULL;
inbuf[0] = nullptr;
inbuf[1] = nullptr;
for( ch_cnt_t proc = 0; proc < processorCount(); proc++ )
{
multi_proc_t ports;
@@ -314,8 +314,8 @@ void LadspaEffect::pluginInstantiation()
p->name = manager->getPortName( m_key, port );
p->proc = proc;
p->port_id = port;
p->control = NULL;
p->buffer = NULL;
p->control = nullptr;
p->buffer = nullptr;
// Determine the port's category.
if( manager->isPortAudio( m_key, port ) )
@@ -324,7 +324,7 @@ void LadspaEffect::pluginInstantiation()
manager->isPortInput( m_key, port ) )
{
p->rate = CHANNEL_IN;
p->buffer = MM_ALLOC( LADSPA_Data, Engine::audioEngine()->framesPerPeriod() );
p->buffer = MM_ALLOC<LADSPA_Data>( Engine::audioEngine()->framesPerPeriod() );
inbuf[ inputch ] = p->buffer;
inputch++;
}
@@ -339,24 +339,24 @@ void LadspaEffect::pluginInstantiation()
}
else
{
p->buffer = MM_ALLOC( LADSPA_Data, Engine::audioEngine()->framesPerPeriod() );
p->buffer = MM_ALLOC<LADSPA_Data>( Engine::audioEngine()->framesPerPeriod() );
m_inPlaceBroken = true;
}
}
else if( manager->isPortInput( m_key, port ) )
{
p->rate = AUDIO_RATE_INPUT;
p->buffer = MM_ALLOC( LADSPA_Data, Engine::audioEngine()->framesPerPeriod() );
p->buffer = MM_ALLOC<LADSPA_Data>( Engine::audioEngine()->framesPerPeriod() );
}
else
{
p->rate = AUDIO_RATE_OUTPUT;
p->buffer = MM_ALLOC( LADSPA_Data, Engine::audioEngine()->framesPerPeriod() );
p->buffer = MM_ALLOC<LADSPA_Data>( Engine::audioEngine()->framesPerPeriod() );
}
}
else
{
p->buffer = MM_ALLOC( LADSPA_Data, 1 );
p->buffer = MM_ALLOC<LADSPA_Data>( 1 );
if( manager->isPortInput( m_key, port ) )
{
@@ -475,7 +475,7 @@ void LadspaEffect::pluginInstantiation()
// Instantiate the processing units.
m_descriptor = manager->getDescriptor( m_key );
if( m_descriptor == NULL )
if( m_descriptor == nullptr )
{
QMessageBox::warning( 0, "Effect",
"Can't get LADSPA descriptor function: " + m_key.second,
@@ -483,7 +483,7 @@ void LadspaEffect::pluginInstantiation()
setOkay( false );
return;
}
if( m_descriptor->run == NULL )
if( m_descriptor->run == nullptr )
{
QMessageBox::warning( 0, "Effect",
"Plugin has no processor: " + m_key.second,
@@ -494,7 +494,7 @@ void LadspaEffect::pluginInstantiation()
{
LADSPA_Handle effect = manager->instantiate( m_key,
m_maxSampleRate );
if( effect == NULL )
if( effect == nullptr )
{
QMessageBox::warning( 0, "Effect",
"Can't get LADSPA instance: " + m_key.second,

View File

@@ -54,9 +54,9 @@ Plugin::Descriptor PLUGIN_EXPORT midiexport_plugin_descriptor =
"Hyunjin Song <tteu.ingog/at/gmail.com>",
0x0100,
Plugin::ExportFilter,
NULL,
NULL,
NULL,
nullptr,
nullptr,
nullptr,
} ;
}

View File

@@ -70,9 +70,9 @@ Plugin::Descriptor PLUGIN_EXPORT midiimport_plugin_descriptor =
"Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>",
0x0100,
Plugin::ImportFilter,
NULL,
NULL,
NULL,
nullptr,
nullptr,
nullptr,
} ;
}
@@ -103,10 +103,10 @@ bool MidiImport::tryImport( TrackContainer* tc )
}
#ifdef LMMS_HAVE_FLUIDSYNTH
if( gui != NULL &&
if( getGUI() != nullptr &&
ConfigManager::inst()->sf2File().isEmpty() )
{
QMessageBox::information( gui->mainWindow(),
QMessageBox::information( getGUI()->mainWindow(),
tr( "Setup incomplete" ),
tr( "You have not set up a default soundfont in "
"the settings dialog (Edit->Settings). "
@@ -116,9 +116,9 @@ bool MidiImport::tryImport( TrackContainer* tc )
"settings dialog and try again." ) );
}
#else
if( gui )
if( getGUI() != nullptr )
{
QMessageBox::information( gui->mainWindow(),
QMessageBox::information( getGUI()->mainWindow(),
tr( "Setup incomplete" ),
tr( "You did not compile LMMS with support for "
"SoundFont2 player, which is used to add default "
@@ -153,8 +153,8 @@ class smfMidiCC
public:
smfMidiCC() :
at( NULL ),
ap( NULL ),
at( nullptr ),
ap( nullptr ),
lastPos( 0 )
{ }
@@ -181,8 +181,8 @@ public:
void clear()
{
at = NULL;
ap = NULL;
at = nullptr;
ap = nullptr;
lastPos = 0;
}
@@ -213,9 +213,9 @@ class smfMidiChannel
public:
smfMidiChannel() :
it( NULL ),
p( NULL ),
it_inst( NULL ),
it( nullptr ),
p( nullptr ),
it_inst( nullptr ),
isSF2( false ),
hasNotes( false )
{ }
@@ -307,7 +307,7 @@ bool MidiImport::readSMF( TrackContainer* tc )
const int MIDI_CC_COUNT = 128 + 1; // 0-127 (128) + pitch bend
const int preTrackSteps = 2;
QProgressDialog pd( TrackContainer::tr( "Importing MIDI-file..." ),
TrackContainer::tr( "Cancel" ), 0, preTrackSteps, gui->mainWindow() );
TrackContainer::tr( "Cancel" ), 0, preTrackSteps, getGUI()->mainWindow() );
pd.setWindowTitle( TrackContainer::tr( "Please wait..." ) );
pd.setWindowModality(Qt::WindowModal);
pd.setMinimumDuration( 0 );
@@ -499,7 +499,7 @@ bool MidiImport::readSMF( TrackContainer* tc )
if( ccid <= 128 )
{
double cc = evt->get_real_value();
AutomatableModel * objModel = NULL;
AutomatableModel * objModel = nullptr;
switch( ccid )
{
@@ -539,9 +539,9 @@ bool MidiImport::readSMF( TrackContainer* tc )
}
else
{
if( ccs[ccid].at == NULL ) {
if( ccs[ccid].at == nullptr ) {
ccs[ccid].create( tc, trackName + " > " + (
objModel != NULL ?
objModel != nullptr ?
objModel->displayName() :
QString("CC %1").arg(ccid) ) );
}

View File

@@ -42,7 +42,7 @@ public:
virtual PluginView * instantiateView( QWidget * )
{
return( NULL );
return( nullptr );
}

View File

@@ -2,6 +2,4 @@
#include "allegro.h"
Alg_error alg_read(std::istream &file, Alg_seq_ptr new_seq,
double *offset_ptr = NULL);
Alg_error alg_read(std::istream &file, Alg_seq_ptr new_seq, double *offset_ptr = nullptr);

View File

@@ -207,12 +207,12 @@ Alg_parameters *Alg_parameters::remove_key(Alg_parameters **list,
if (STREQL((*list)->parm.attr_name(), name)) {
Alg_parameters_ptr p = *list;
*list = p->next;
p->next = NULL;
p->next = nullptr;
return p; // caller should free this pointer
}
list = &((*list)->next);
}
return NULL;
return nullptr;
}
@@ -225,7 +225,7 @@ Alg_parameter_ptr Alg_parameters::find(Alg_attribute attr)
return &(temp->parm);
}
}
return NULL;
return nullptr;
}
@@ -287,7 +287,7 @@ void Alg_event::set_string_value(const char *a, const char *value)
parm.set_attr(attr);
parm.s = value;
set_parameter(&parm);
parm.s = NULL; // do this to prevent string from being freed
parm.s = nullptr; // do this to prevent string from being freed
}
@@ -416,7 +416,7 @@ bool Alg_event::has_attribute(const char *a)
Alg_note* note = (Alg_note *) this;
Alg_attribute attr = symbol_table.insert_string(a);
Alg_parameter_ptr parm = note->parameters->find(attr);
return parm != NULL;
return parm != nullptr;
}
@@ -491,7 +491,7 @@ const char *Alg_event::get_atom_value(const char *a, const char *value)
if (parm) return parm->a;
// if default is a string, convert to an atom (unique
// string in symbol table) and return it
return (value == NULL ? NULL :
return (value == nullptr ? nullptr :
symbol_table.insert_string(value));
}
@@ -1246,7 +1246,7 @@ void Alg_time_map::insert_beats(double start, double len)
Alg_track::Alg_track(Alg_time_map *map, bool seconds)
{
type = 't';
time_map = NULL;
time_map = nullptr;
units_are_seconds = seconds;
set_time_map(map);
}
@@ -1267,7 +1267,7 @@ Alg_event_ptr Alg_track::copy_event(Alg_event_ptr event)
Alg_track::Alg_track(Alg_track &track)
{
type = 't';
time_map = NULL;
time_map = nullptr;
for (int i = 0; i < track.length(); i++) {
append(copy_event(track.events[i]));
}
@@ -1280,7 +1280,7 @@ Alg_track::Alg_track(Alg_event_list_ref event_list, Alg_time_map_ptr map,
bool units_are_seconds)
{
type = 't';
time_map = NULL;
time_map = nullptr;
for (int i = 0; i < event_list.length(); i++) {
append(copy_event(event_list[i]));
}
@@ -1628,7 +1628,7 @@ void Alg_track::unserialize_track()
// (although order shouldn't matter)
Alg_parameters_ptr *list = &note->parameters;
for (j = 0; j < param_num; j++) {
*list = new Alg_parameters(NULL);
*list = new Alg_parameters(nullptr);
unserialize_parameter(&((*list)->parm));
list = &((*list)->next);
}
@@ -1677,7 +1677,7 @@ void Alg_track::unserialize_parameter(Alg_parameter_ptr parm_ptr)
void Alg_track::set_time_map(Alg_time_map *map)
{
if (time_map) time_map->dereference();
if (map == NULL) {
if (map == nullptr) {
time_map = new Alg_time_map(); // new default map
time_map->reference();
} else {
@@ -2628,7 +2628,7 @@ void Alg_tracks::reset()
delete tracks[i];
}
if (tracks) delete [] tracks;
tracks = NULL;
tracks = nullptr;
len = 0;
maxlen = 0;
}
@@ -2880,8 +2880,7 @@ Alg_event_ptr const &Alg_seq::operator[](int i)
}
tr++;
}
assert(false); // out of bounds
return NULL;
throw std::out_of_range{"Alg_seq::operator[] - Index out of range."};
}
//#pragma warning(default: 4715)
@@ -2954,7 +2953,7 @@ Alg_seq_ptr Alg_seq::cut(double start, double len, bool all)
{
double dur = get_dur();
// fix parameters to fall within existing sequence
if (start > dur) return NULL; // nothing to cut
if (start > dur) return nullptr; // nothing to cut
if (start < 0) start = 0; // can't start before sequence starts
if (start + len > dur) // can't cut after end:
len = dur - start;
@@ -3059,7 +3058,7 @@ Alg_track_ptr Alg_seq::copy_track(int track_num, double t, double len, bool all)
Alg_seq *Alg_seq::copy(double start, double len, bool all)
{
// fix parameters to fall within existing sequence
if (start > get_dur()) return NULL; // nothing to copy
if (start > get_dur()) return nullptr; // nothing to copy
if (start < 0) start = 0; // can't copy before sequence starts
if (start + len > get_dur()) // can't copy after end:
len = get_dur() - start;
@@ -3445,7 +3444,7 @@ Alg_event_ptr Alg_iterator::next(bool *note_on, void **cookie_ptr,
bool on;
double when;
if (!remove_next(events_ptr, index, on, cookie, offset, when)) {
return NULL;
return nullptr;
}
if (note_on) *note_on = on;
Alg_event_ptr event = (*events_ptr)[index];

View File

@@ -78,7 +78,7 @@ class Alg_atoms {
public:
Alg_atoms() {
maxlen = len = 0;
atoms = NULL;
atoms = nullptr;
}
// Note: the code is possibly more correct and faster without the
// following destructor, which will only run after the program takes
@@ -250,7 +250,7 @@ public:
// 'r' = real (double), 'l' = logical (bool), 'i' = integer (long),
// 'a' = atom (char *), a unique string stored in Alg_seq
// get the string value
const char *get_string_value(const char *attr, const char *value = NULL);
const char *get_string_value(const char *attr, const char *value = nullptr);
// get the real value
double get_real_value(const char *attr, double value = 0.0);
// get the logical value
@@ -258,7 +258,7 @@ public:
// get the integer value
long get_integer_value(const char *attr, long value = 0);
// get the atom value
const char *get_atom_value(const char *attr, const char *value = NULL);
const char *get_atom_value(const char *attr, const char *value = nullptr);
void delete_attribute(const char *attr); // delete an attribute/value pair
// (ignore if no matching attribute/value pair exists)
@@ -299,7 +299,7 @@ public:
float loud; // dynamic corresponding to MIDI velocity
double dur; // duration in seconds (normally to release point)
Alg_parameters_ptr parameters; // attribute/value pair list
Alg_note() { type = 'n'; parameters = NULL; }
Alg_note() { type = 'n'; parameters = nullptr; }
void show();
} *Alg_note_ptr;
@@ -342,7 +342,7 @@ public:
}
Alg_events() {
maxlen = len = 0;
events = NULL;
events = nullptr;
last_note_off = 0;
in_use = false;
}
@@ -394,7 +394,7 @@ public:
// particularly fast on an Alg_seq.
virtual Alg_event_ptr const &operator[](int i);
Alg_event_list() { sequence_number = 0;
beat_dur = 0.0; real_dur = 0.0; events_owner = NULL; type = 'e'; }
beat_dur = 0.0; real_dur = 0.0; events_owner = nullptr; type = 'e'; }
Alg_event_list(Alg_track *owner);
char get_type() { return type; }
@@ -457,7 +457,7 @@ public:
}
Alg_beats() {
maxlen = len = 0;
beats = NULL;
beats = nullptr;
expand();
beats[0].time = 0;
beats[0].beat = 0;
@@ -531,8 +531,8 @@ class Serial_buffer {
long len;
public:
Serial_buffer() {
buffer = NULL;
ptr = NULL;
buffer = nullptr;
ptr = nullptr;
len = 0;
}
virtual ~Serial_buffer() { }
@@ -658,8 +658,8 @@ public:
assert(i >= 0 && i < len);
return events[i];
}
Alg_track() { units_are_seconds = false; time_map = NULL;
set_time_map(NULL); type = 't'; }
Alg_track() { units_are_seconds = false; time_map = nullptr;
set_time_map(nullptr); type = 't'; }
// initialize empty track with a time map
Alg_track(Alg_time_map *map, bool seconds);
@@ -671,7 +671,7 @@ public:
bool units_are_seconds);
virtual ~Alg_track() { // note: do not call set_time_map(NULL)!
if (time_map) time_map->dereference();
time_map = NULL; }
time_map = nullptr; }
// Returns a buffer containing a serialization of the
// file. It will be an ASCII representation unless text is true.
@@ -686,7 +686,7 @@ public:
// If the track is really an Alg_seq and you need to access an
// Alg_seq method, coerce to an Alg_seq with this function:
Alg_seq_ptr to_alg_seq() {
return (get_type() == 's' ? (Alg_seq_ptr) this : NULL); }
return (get_type() == 's' ? (Alg_seq_ptr) this : nullptr); }
// Are we using beats or seconds?
bool get_units_are_seconds() { return units_are_seconds; }
@@ -858,7 +858,7 @@ private:
public:
Alg_time_sigs() {
maxlen = len = 0;
time_sigs = NULL;
time_sigs = nullptr;
}
Alg_time_sig &operator[](int i) { // fetch a time signature
assert(i >= 0 && i < len);
@@ -898,7 +898,7 @@ public:
long length() { return len; }
Alg_tracks() {
maxlen = len = 0;
tracks = NULL;
tracks = nullptr;
}
~Alg_tracks();
// Append a track to tracks. This Alg_tracks becomes the owner of track.
@@ -959,7 +959,7 @@ public:
seq = s;
note_off_flag = note_off;
maxlen = len = 0;
pending_events = NULL;
pending_events = nullptr;
}
// Normally, iteration is over the events in the one sequence used
// to instatiate the iterator (see above), but with this method, you
@@ -969,12 +969,12 @@ public:
// before merging/sorting. You should call begin_seq() for each
// sequence to be included in the iteration unless you call begin()
// (see below).
void begin_seq(Alg_seq_ptr s, void *cookie = NULL, double offset = 0.0);
void begin_seq(Alg_seq_ptr s, void *cookie = nullptr, double offset = 0.0);
~Alg_iterator();
// Prepare to enumerate events in order. If note_off_flag is true, then
// iteration_next will merge note-off events into the sequence. If you
// call begin(), you should not normally call begin_seq(). See above.
void begin(void *cookie = NULL) { begin_seq(seq, cookie); }
void begin(void *cookie = nullptr) { begin_seq(seq, cookie); }
// return next event (or NULL). If iteration_begin was called with
// note_off_flag = true, and if note_on is not NULL, then *note_on
// is set to true when the result value represents a note-on or update.
@@ -984,8 +984,8 @@ public:
// cookie corresponding to the event is stored at that address
// If end_time is 0, iterate through the entire sequence, but if
// end_time is non_zero, stop iterating at the last event before end_time
Alg_event_ptr next(bool *note_on = NULL, void **cookie_ptr = NULL,
double *offset_ptr = NULL, double end_time = 0);
Alg_event_ptr next(bool *note_on = nullptr, void **cookie_ptr = nullptr,
double *offset_ptr = nullptr, double end_time = 0);
// Sometimes, the caller wants to receive note-off events for a subset
// of the notes, typically the notes that are played and need to be
// turned off. In this case, when a note is turned on, the client
@@ -1027,9 +1027,9 @@ public:
Alg_seq(Alg_track_ptr track) { seq_from_track(*track); }
void seq_from_track(Alg_track_ref tr);
// create from file:
Alg_seq(std::istream &file, bool smf, double *offset_ptr = NULL);
Alg_seq(std::istream &file, bool smf, double *offset_ptr = nullptr);
// create from filename
Alg_seq(const char *filename, bool smf, double *offset_ptr = NULL);
Alg_seq(const char *filename, bool smf, double *offset_ptr = nullptr);
virtual ~Alg_seq();
int get_read_error() { return error; }
void serialize(void **buffer, long *bytes);

View File

@@ -167,7 +167,7 @@ bool Alg_reader::parse()
double new_pitch = 0.0;
bool new_key_flag = false; // "K" syntax
int new_key = 0;
Alg_parameters_ptr attributes = NULL;
Alg_parameters_ptr attributes = nullptr;
if (line_parser.peek() == '#') {
// look for #track
line_parser.get_nonspace_quoted(field);
@@ -299,7 +299,7 @@ bool Alg_reader::parse()
if (parse_attribute(field, &parm)) { // enter attribute-value pair
attributes = new Alg_parameters(attributes);
attributes->parm = parm;
parm.s = NULL; // protect string from deletion by destructor
parm.s = nullptr; // protect string from deletion by destructor
}
} else {
parse_error(field, 0, "Unknown field");
@@ -397,7 +397,7 @@ bool Alg_reader::parse()
seq->add_event(new_upd, track_num);
Alg_parameters_ptr p = attributes;
attributes = attributes->next;
p->parm.s = NULL; // so we don't delete the string
p->parm.s = nullptr; // so we don't delete the string
delete p;
}
}
@@ -588,7 +588,7 @@ struct loud_lookup_struct {
int val;
} loud_lookup[] = { {"FFF", 127}, {"FF", 120}, {"F", 110}, {"MF", 100},
{"MP", 90}, {"P", 80}, {"PP", 70}, {"PPP", 60},
{NULL, 0} };
{nullptr, 0} };
double Alg_reader::parse_loud(string &field)

View File

@@ -41,7 +41,7 @@ public:
Alg_midifile_reader(istream &f, Alg_seq_ptr new_seq) {
file = &f;
note_list = NULL;
note_list = nullptr;
seq = new_seq;
channel_offset_per_track = 0;
channel_offset_per_port = 16;
@@ -137,7 +137,7 @@ void Alg_midifile_reader::Mf_endtrack()
// note: track is already part of seq, so do not add it here
// printf("finished track, length %d number %d\n", track->len, track_num / 100);
channel_offset += seq->channel_offset_per_track;
track = NULL;
track = nullptr;
double now = get_time();
if (seq->get_beat_dur() < now) seq->set_beat_dur(now);
meta_channel = -1;
@@ -255,7 +255,7 @@ void Alg_midifile_reader::update(int chan, int key, Alg_parameter_ptr param)
update->parameter = *param;
// prevent the destructor from destroying the string twice!
// the new Update takes the string from param
if (param->attr_type() == 's') param->s = NULL;
if (param->attr_type() == 's') param->s = nullptr;
track->append(update);
}

View File

@@ -80,7 +80,7 @@ private:
Alg_smf_write::Alg_smf_write(Alg_seq_ptr a_seq)
{
out_file = NULL;
out_file = nullptr;
// at 100bpm (a nominal tempo value), we would like a division
// to represent 1ms of time. So
@@ -124,19 +124,19 @@ Alg_smf_write::~Alg_smf_write()
event_queue* push(event_queue *queue, event_queue *event)
{
// printf("push: %.6g, %c, %d\n", event->time, event->type, event->index);
if (queue == NULL) {
event->next = NULL;
if (queue == nullptr) {
event->next = nullptr;
return event;
}
event_queue *marker1 = NULL;
event_queue *marker1 = nullptr;
event_queue *marker2 = queue;
while (marker2 != NULL && marker2->time <= event->time) {
while (marker2 != nullptr && marker2->time <= event->time) {
marker1 = marker2;
marker2 = marker2->next;
}
event->next = marker2;
if (marker1 != NULL) {
if (marker1 != nullptr) {
marker1->next=event;
return queue;
} else return event;
@@ -415,17 +415,17 @@ void Alg_smf_write::write_track(int i)
{
int j = 0; // note index
Alg_events &notes = seq->track_list[i];
event_queue *pending = NULL;
event_queue *pending = nullptr;
if (notes.length() > 0) {
pending = new event_queue('n', TICK_TIME(notes[j]->time, 0), 0, NULL);
pending = new event_queue('n', TICK_TIME(notes[j]->time, 0), 0, nullptr);
}
if (i == 0) { // track 0 may have tempo and timesig info
if (seq->get_time_map()->last_tempo_flag || seq->get_time_map()->beats.len > 0) {
pending = push(pending, new event_queue('c', 0.0, 0, NULL));
pending = push(pending, new event_queue('c', 0.0, 0, nullptr));
}
if (seq->time_sig.length() > 0) {
pending = push(pending, new event_queue('s',
TICK_TIME(seq->time_sig[0].beat, 0), 0, NULL));
TICK_TIME(seq->time_sig[0].beat, 0), 0, nullptr));
}
}
while (pending) {
@@ -436,7 +436,7 @@ void Alg_smf_write::write_track(int i)
if (n->is_note()) {
write_note(n, true);
pending = push(pending, new event_queue('o',
TICK_TIME(n->time + n->dur, -1), current->index, NULL));
TICK_TIME(n->time + n->dur, -1), current->index, nullptr));
} else if (n->is_update()) {
Alg_update_ptr u = (Alg_update_ptr) n;
write_update(u);

View File

@@ -56,7 +56,7 @@ Alg_event_ptr Alg_seq::write_track_name(ostream &file, int n,
// find a name and write it, return a pointer to it so the track
// writer knows what update (if any) to skip
{
Alg_event_ptr e = NULL; // e is the result, default is NULL
Alg_event_ptr e = nullptr; // e is the result, default is NULL
file << "#track " << n;
const char *attr = symbol_table.insert_string(
n == 0 ? "seqnames" : "tracknames");

View File

@@ -446,7 +446,7 @@ Midifile_reader::Midifile_reader()
void Midifile_reader::finalize()
{
if (Msgbuff) Mf_free(Msgbuff, Msgsize);
Msgbuff = NULL;
Msgbuff = nullptr;
}

View File

@@ -18,7 +18,7 @@ void trace(char *format, ...)
_vsnprintf_s(msg, 256, _TRUNCATE, format, args);
va_end(args);
#ifdef _DEBUG
_CrtDbgReport(_CRT_WARN, NULL, NULL, NULL, msg);
_CrtDbgReport(_CRT_WARN, nullptr, nullptr, nullptr, msg);
#else
printf(msg);
#endif

View File

@@ -39,8 +39,8 @@ Plugin::Descriptor PLUGIN_EXPORT multitapecho_plugin_descriptor =
0x0100,
Plugin::Effect,
new PluginPixmapLoader( "logo" ),
NULL,
NULL,
nullptr,
nullptr,
} ;
}
@@ -54,7 +54,7 @@ MultitapEchoEffect::MultitapEchoEffect( Model* parent, const Descriptor::SubPlug
m_sampleRate( Engine::audioEngine()->processingSampleRate() ),
m_sampleRatio( 1.0f / m_sampleRate )
{
m_work = MM_ALLOC( sampleFrame, Engine::audioEngine()->framesPerPeriod() );
m_work = MM_ALLOC<sampleFrame>( Engine::audioEngine()->framesPerPeriod() );
m_buffer.reset();
m_stages = static_cast<int>( m_controls.m_stages.value() );
updateFilters( 0, 19 );

View File

@@ -149,7 +149,7 @@ void MultitapEchoControls::lpSamplesChanged( int begin, int end )
const float * samples = m_lpGraph.samples();
for( int i = begin; i <= end; ++i )
{
m_effect->m_lpFreq[i] = 20.0f * exp10( samples[i] );
m_effect->m_lpFreq[i] = 20.0f * std::pow(10.f, samples[i] );
}
m_effect->updateFilters( begin, end );
}

View File

@@ -75,7 +75,7 @@ Plugin::Descriptor PLUGIN_EXPORT opulenz_plugin_descriptor =
Plugin::Instrument,
new PluginPixmapLoader( "logo" ),
"sbi",
NULL,
nullptr,
};
// necessary for getting instance out of shared lib
@@ -413,7 +413,7 @@ void OpulenzInstrument::play( sampleFrame * _working_buffer )
emulatorMutex.unlock();
// Throw the data to the track...
instrumentTrack()->processAudioBuffer( _working_buffer, frameCount, NULL );
instrumentTrack()->processAudioBuffer( _working_buffer, frameCount, nullptr );
}
@@ -693,7 +693,7 @@ OpulenzInstrumentView::OpulenzInstrumentView( Instrument * _instrument,
knobname->move(xpos,ypos);
#define BUTTON_GEN(buttname, tooltip, xpos, ypos) \
buttname = new PixmapButton( this, NULL );\
buttname = new PixmapButton( this, nullptr );\
buttname->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "led_on" ) );\
buttname->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "led_off" ) );\
buttname->setCheckable( true );\
@@ -701,7 +701,7 @@ OpulenzInstrumentView::OpulenzInstrumentView( Instrument * _instrument,
buttname->move( xpos, ypos );
#define WAVEBUTTON_GEN(buttname, tooltip, xpos, ypos, icon_on, icon_off, buttgroup) \
buttname = new PixmapButton( this, NULL );\
buttname = new PixmapButton( this, nullptr );\
buttname->setActiveGraphic( PLUGIN_NAME::getIconPixmap( icon_on ) ); \
buttname->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( icon_off ) ); \
ToolTip::add( buttname, tr( tooltip ) );\

View File

@@ -40,8 +40,8 @@ Plugin::Descriptor PLUGIN_EXPORT reverbsc_plugin_descriptor =
0x0123,
Plugin::Effect,
new PluginPixmapLoader( "logo" ),
NULL,
NULL,
nullptr,
nullptr,
} ;
}

View File

@@ -83,8 +83,8 @@ Plugin::Descriptor PLUGIN_EXPORT sid_plugin_descriptor =
0x0100,
Plugin::Instrument,
new PluginPixmapLoader( "logo" ),
NULL,
NULL,
nullptr,
nullptr,
} ;
}
@@ -503,19 +503,19 @@ SidInstrumentView::SidInstrumentView( Instrument * _instrument,
m_cutKnob->setHintText( tr( "Cutoff frequency:" ), " Hz" );
m_cutKnob->move( 7 + 2*28, 64 );
PixmapButton * hp_btn = new PixmapButton( this, NULL );
PixmapButton * hp_btn = new PixmapButton( this, nullptr );
hp_btn->move( 140, 77 );
hp_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "hpred" ) );
hp_btn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "hp" ) );
ToolTip::add( hp_btn, tr( "High-pass filter ") );
PixmapButton * bp_btn = new PixmapButton( this, NULL );
PixmapButton * bp_btn = new PixmapButton( this, nullptr );
bp_btn->move( 164, 77 );
bp_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "bpred" ) );
bp_btn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "bp" ) );
ToolTip::add( bp_btn, tr( "Band-pass filter ") );
PixmapButton * lp_btn = new PixmapButton( this, NULL );
PixmapButton * lp_btn = new PixmapButton( this, nullptr );
lp_btn->move( 185, 77 );
lp_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "lpred" ) );
lp_btn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "lp" ) );
@@ -526,20 +526,20 @@ SidInstrumentView::SidInstrumentView( Instrument * _instrument,
m_passBtnGrp->addButton( bp_btn );
m_passBtnGrp->addButton( lp_btn );
m_offButton = new PixmapButton( this, NULL );
m_offButton = new PixmapButton( this, nullptr );
m_offButton->setCheckable( true );
m_offButton->move( 207, 77 );
m_offButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "3offred" ) );
m_offButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "3off" ) );
ToolTip::add( m_offButton, tr( "Voice 3 off ") );
PixmapButton * mos6581_btn = new PixmapButton( this, NULL );
PixmapButton * mos6581_btn = new PixmapButton( this, nullptr );
mos6581_btn->move( 170, 59 );
mos6581_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "6581red" ) );
mos6581_btn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "6581" ) );
ToolTip::add( mos6581_btn, tr( "MOS6581 SID ") );
PixmapButton * mos8580_btn = new PixmapButton( this, NULL );
PixmapButton * mos8580_btn = new PixmapButton( this, nullptr );
mos8580_btn->move( 207, 59 );
mos8580_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "8580red" ) );
mos8580_btn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "8580" ) );
@@ -575,7 +575,7 @@ SidInstrumentView::SidInstrumentView( Instrument * _instrument,
crsk->setHintText( tr("Coarse:"), " semitones" );
crsk->move( 147, 114 + i*50 );
PixmapButton * pulse_btn = new PixmapButton( this, NULL );
PixmapButton * pulse_btn = new PixmapButton( this, nullptr );
pulse_btn->move( 187, 101 + i*50 );
pulse_btn->setActiveGraphic(
PLUGIN_NAME::getIconPixmap( "pulsered" ) );
@@ -583,7 +583,7 @@ SidInstrumentView::SidInstrumentView( Instrument * _instrument,
PLUGIN_NAME::getIconPixmap( "pulse" ) );
ToolTip::add( pulse_btn, tr( "Pulse wave" ) );
PixmapButton * triangle_btn = new PixmapButton( this, NULL );
PixmapButton * triangle_btn = new PixmapButton( this, nullptr );
triangle_btn->move( 168, 101 + i*50 );
triangle_btn->setActiveGraphic(
PLUGIN_NAME::getIconPixmap( "trianglered" ) );
@@ -591,7 +591,7 @@ SidInstrumentView::SidInstrumentView( Instrument * _instrument,
PLUGIN_NAME::getIconPixmap( "triangle" ) );
ToolTip::add( triangle_btn, tr( "Triangle wave" ) );
PixmapButton * saw_btn = new PixmapButton( this, NULL );
PixmapButton * saw_btn = new PixmapButton( this, nullptr );
saw_btn->move( 207, 101 + i*50 );
saw_btn->setActiveGraphic(
PLUGIN_NAME::getIconPixmap( "sawred" ) );
@@ -599,7 +599,7 @@ SidInstrumentView::SidInstrumentView( Instrument * _instrument,
PLUGIN_NAME::getIconPixmap( "saw" ) );
ToolTip::add( saw_btn, tr( "Saw wave" ) );
PixmapButton * noise_btn = new PixmapButton( this, NULL );
PixmapButton * noise_btn = new PixmapButton( this, nullptr );
noise_btn->move( 226, 101 + i*50 );
noise_btn->setActiveGraphic(
PLUGIN_NAME::getIconPixmap( "noisered" ) );
@@ -615,7 +615,7 @@ SidInstrumentView::SidInstrumentView( Instrument * _instrument,
wfbg->addButton( saw_btn );
wfbg->addButton( noise_btn );
PixmapButton * sync_btn = new PixmapButton( this, NULL );
PixmapButton * sync_btn = new PixmapButton( this, nullptr );
sync_btn->setCheckable( true );
sync_btn->move( 207, 134 + i*50 );
sync_btn->setActiveGraphic(
@@ -624,7 +624,7 @@ SidInstrumentView::SidInstrumentView( Instrument * _instrument,
PLUGIN_NAME::getIconPixmap( "sync" ) );
ToolTip::add( sync_btn, tr( "Sync" ) );
PixmapButton * ringMod_btn = new PixmapButton( this, NULL );
PixmapButton * ringMod_btn = new PixmapButton( this, nullptr );
ringMod_btn->setCheckable( true );
ringMod_btn->move( 170, 116 + i*50 );
ringMod_btn->setActiveGraphic(
@@ -633,7 +633,7 @@ SidInstrumentView::SidInstrumentView( Instrument * _instrument,
PLUGIN_NAME::getIconPixmap( "ring" ) );
ToolTip::add( ringMod_btn, tr( "Ring modulation" ) );
PixmapButton * filter_btn = new PixmapButton( this, NULL );
PixmapButton * filter_btn = new PixmapButton( this, nullptr );
filter_btn->setCheckable( true );
filter_btn->move( 207, 116 + i*50 );
filter_btn->setActiveGraphic(
@@ -642,7 +642,7 @@ SidInstrumentView::SidInstrumentView( Instrument * _instrument,
PLUGIN_NAME::getIconPixmap( "filter" ) );
ToolTip::add( filter_btn, tr( "Filtered" ) );
PixmapButton * test_btn = new PixmapButton( this, NULL );
PixmapButton * test_btn = new PixmapButton( this, nullptr );
test_btn->setCheckable( true );
test_btn->move( 170, 134 + i*50 );
test_btn->setActiveGraphic(

View File

@@ -47,8 +47,8 @@ extern "C" {
0x0112,
Plugin::Effect,
new PluginPixmapLoader("logo"),
NULL,
NULL,
nullptr,
nullptr,
};
}

View File

@@ -77,15 +77,15 @@ SaProcessor::SaProcessor(const SaControls *controls) :
SaProcessor::~SaProcessor()
{
if (m_fftPlanL != NULL) {fftwf_destroy_plan(m_fftPlanL);}
if (m_fftPlanR != NULL) {fftwf_destroy_plan(m_fftPlanR);}
if (m_spectrumL != NULL) {fftwf_free(m_spectrumL);}
if (m_spectrumR != NULL) {fftwf_free(m_spectrumR);}
if (m_fftPlanL != nullptr) {fftwf_destroy_plan(m_fftPlanL);}
if (m_fftPlanR != nullptr) {fftwf_destroy_plan(m_fftPlanR);}
if (m_spectrumL != nullptr) {fftwf_free(m_spectrumL);}
if (m_spectrumR != nullptr) {fftwf_free(m_spectrumR);}
m_fftPlanL = NULL;
m_fftPlanR = NULL;
m_spectrumL = NULL;
m_spectrumR = NULL;
m_fftPlanL = nullptr;
m_fftPlanR = nullptr;
m_spectrumL = nullptr;
m_spectrumR = nullptr;
}
@@ -396,10 +396,10 @@ void SaProcessor::reallocateBuffers()
QMutexLocker data_lock(&m_dataAccess);
// destroy old FFT plan and free the result buffer
if (m_fftPlanL != NULL) {fftwf_destroy_plan(m_fftPlanL);}
if (m_fftPlanR != NULL) {fftwf_destroy_plan(m_fftPlanR);}
if (m_spectrumL != NULL) {fftwf_free(m_spectrumL);}
if (m_spectrumR != NULL) {fftwf_free(m_spectrumR);}
if (m_fftPlanL != nullptr) {fftwf_destroy_plan(m_fftPlanL);}
if (m_fftPlanR != nullptr) {fftwf_destroy_plan(m_fftPlanR);}
if (m_spectrumL != nullptr) {fftwf_free(m_spectrumL);}
if (m_spectrumR != nullptr) {fftwf_free(m_spectrumR);}
// allocate new space, create new plan and resize containers
m_fftWindow.resize(new_in_size, 1.0);
@@ -413,7 +413,7 @@ void SaProcessor::reallocateBuffers()
m_fftPlanL = fftwf_plan_dft_r2c_1d(new_fft_size, m_filteredBufferL.data(), m_spectrumL, FFTW_MEASURE);
m_fftPlanR = fftwf_plan_dft_r2c_1d(new_fft_size, m_filteredBufferR.data(), m_spectrumR, FFTW_MEASURE);
if (m_fftPlanL == NULL || m_fftPlanR == NULL)
if (m_fftPlanL == nullptr || m_fftPlanR == nullptr)
{
#ifdef SA_DEBUG
std::cerr << "Analyzer: failed to create new FFT plan!" << std::endl;

View File

@@ -52,7 +52,7 @@ SaSpectrumView::SaSpectrumView(SaControls *controls, SaProcessor *processor, QWi
setMinimumSize(360, 170);
setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
connect(gui->mainWindow(), SIGNAL(periodicUpdate()), this, SLOT(periodicUpdate()));
connect(getGUI()->mainWindow(), SIGNAL(periodicUpdate()), this, SLOT(periodicUpdate()));
m_displayBufferL.resize(m_processor->binCount(), 0);
m_displayBufferR.resize(m_processor->binCount(), 0);
@@ -398,8 +398,8 @@ QPainterPath SaSpectrumView::makePath(std::vector<float> &displayBuffer, float r
// Draw background, grid and associated frequency and amplitude labels.
void SaSpectrumView::drawGrid(QPainter &painter)
{
std::vector<std::pair<int, std::string>> *freqTics = NULL;
std::vector<std::pair<float, std::string>> *ampTics = NULL;
std::vector<std::pair<int, std::string>> *freqTics = nullptr;
std::vector<std::pair<float, std::string>> *ampTics = nullptr;
float pos = 0;
float label_width = 24;
float label_height = 15;

View File

@@ -49,7 +49,7 @@ SaWaterfallView::SaWaterfallView(SaControls *controls, SaProcessor *processor, Q
setMinimumSize(300, 150);
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
connect(gui->mainWindow(), SIGNAL(periodicUpdate()), this, SLOT(periodicUpdate()));
connect(getGUI()->mainWindow(), SIGNAL(periodicUpdate()), this, SLOT(periodicUpdate()));
m_displayTop = 1;
m_displayBottom = height() -2;

View File

@@ -49,7 +49,7 @@ VectorView::VectorView(VecControls *controls, LocklessRingBuffer<sampleFrame> *i
setMinimumSize(200, 200);
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
connect(gui->mainWindow(), SIGNAL(periodicUpdate()), this, SLOT(periodicUpdate()));
connect(getGUI()->mainWindow(), SIGNAL(periodicUpdate()), this, SLOT(periodicUpdate()));
m_displayBuffer.resize(sizeof qRgb(0,0,0) * m_displaySize * m_displaySize, 0);

View File

@@ -38,8 +38,8 @@ extern "C" {
0x0100,
Plugin::Effect,
new PluginPixmapLoader("logo"),
NULL,
NULL,
nullptr,
nullptr,
};
}

View File

@@ -47,7 +47,7 @@ Plugin::Descriptor PLUGIN_EXPORT vsteffect_plugin_descriptor =
0x0200,
Plugin::Effect,
new PluginPixmapLoader("logo"),
NULL,
nullptr,
new VstSubPluginFeatures( Plugin::Effect )
} ;
@@ -126,8 +126,8 @@ bool VstEffect::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames )
void VstEffect::openPlugin( const QString & _plugin )
{
TextFloat * tf = NULL;
if( gui )
TextFloat * tf = nullptr;
if( getGUI() != nullptr )
{
tf = TextFloat::displayMessage(
VstPlugin::tr( "Loading plugin" ),

View File

@@ -43,10 +43,10 @@
VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) :
EffectControlDialog( _ctl ),
m_pluginWidget( NULL ),
m_pluginWidget( nullptr ),
m_plugin( NULL ),
tbLabel( NULL )
m_plugin( nullptr ),
tbLabel( nullptr )
{
QGridLayout * l = new QGridLayout( this );
l->setContentsMargins( 10, 10, 10, 10 );
@@ -55,8 +55,8 @@ VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) :
bool embed_vst = false;
if( _ctl != NULL && _ctl->m_effect != NULL &&
_ctl->m_effect->m_plugin != NULL )
if( _ctl != nullptr && _ctl->m_effect != nullptr &&
_ctl->m_effect->m_plugin != nullptr )
{
m_plugin = _ctl->m_effect->m_plugin;
embed_vst = m_plugin->embedMethod() != "none";
@@ -248,7 +248,7 @@ VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) :
void VstEffectControlDialog::paintEvent( QPaintEvent * )
{
if( m_plugin != NULL && tbLabel != NULL )
if( m_plugin != nullptr && tbLabel != nullptr )
{
tbLabel->setText( tr( "Effect by: " ) + m_plugin->vendorString() +
tr( "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />" ) +

View File

@@ -38,9 +38,9 @@
VstEffectControls::VstEffectControls( VstEffect * _eff ) :
EffectControls( _eff ),
m_effect( _eff ),
m_subWindow( NULL ),
knobFModel( NULL ),
ctrHandle( NULL ),
m_subWindow( nullptr ),
knobFModel( nullptr ),
ctrHandle( nullptr ),
lastPosInMenu (0),
m_vstGuiVisible ( true )
// m_presetLabel ( NULL )
@@ -53,7 +53,7 @@ VstEffectControls::VstEffectControls( VstEffect * _eff ) :
VstEffectControls::~VstEffectControls()
{
delete ctrHandle;
ctrHandle = NULL;
ctrHandle = nullptr;
}
@@ -64,7 +64,7 @@ void VstEffectControls::loadSettings( const QDomElement & _this )
//m_effect->closePlugin();
//m_effect->openPlugin( _this.attribute( "plugin" ) );
m_effect->m_pluginMutex.lock();
if( m_effect->m_plugin != NULL )
if( m_effect->m_plugin != nullptr )
{
m_vstGuiVisible = _this.attribute( "guivisible" ).toInt();
@@ -105,7 +105,7 @@ void VstEffectControls::setParameter( Model * action )
{
int knobUNID = action->displayName().toInt();
if ( m_effect->m_plugin != NULL ) {
if ( m_effect->m_plugin != nullptr ) {
m_effect->m_plugin->setParam( knobUNID, knobFModel[knobUNID]->value() );
}
}
@@ -117,10 +117,10 @@ void VstEffectControls::saveSettings( QDomDocument & _doc, QDomElement & _this )
{
_this.setAttribute( "plugin", m_effect->m_key.attributes["file"] );
m_effect->m_pluginMutex.lock();
if( m_effect->m_plugin != NULL )
if( m_effect->m_plugin != nullptr )
{
m_effect->m_plugin->saveSettings( _doc, _this );
if (knobFModel != NULL) {
if (knobFModel != nullptr) {
const QMap<QString, QString> & dump = m_effect->m_plugin->parameterDump();
paramCount = dump.size();
char paramStr[35];
@@ -141,7 +141,7 @@ void VstEffectControls::saveSettings( QDomDocument & _doc, QDomElement & _this )
int VstEffectControls::controlCount()
{
return m_effect->m_plugin != NULL ? 1 : 0;
return m_effect->m_plugin != nullptr ? 1 : 0;
}
@@ -158,10 +158,10 @@ EffectControlDialog *VstEffectControls::createView()
void VstEffectControls::managePlugin( void )
{
if ( m_effect->m_plugin != NULL && m_subWindow == NULL ) {
if ( m_effect->m_plugin != nullptr && m_subWindow == nullptr ) {
manageVSTEffectView * tt = new manageVSTEffectView( m_effect, this);
ctrHandle = (QObject *)tt;
} else if (m_subWindow != NULL) {
} else if (m_subWindow != nullptr) {
if (m_subWindow->widget()->isVisible() == false ) {
m_scrollArea->show();
m_subWindow->show();
@@ -179,7 +179,7 @@ void VstEffectControls::managePlugin( void )
void VstEffectControls::savePreset( void )
{
if ( m_effect->m_plugin != NULL ) {
if ( m_effect->m_plugin != nullptr ) {
m_effect->m_plugin->savePreset( );
/* bool converted;
QString str = m_vi->m_plugin->currentProgramName().section("/", 0, 0);
@@ -197,7 +197,7 @@ void VstEffectControls::updateMenu( void )
{
// get all presets -
if ( m_effect->m_plugin != NULL )
if ( m_effect->m_plugin != nullptr )
{
m_effect->m_plugin->loadProgramNames();
///QWidget::update();
@@ -231,7 +231,7 @@ void VstEffectControls::updateMenu( void )
void VstEffectControls::openPreset( void )
{
if ( m_effect->m_plugin != NULL ) {
if ( m_effect->m_plugin != nullptr ) {
m_effect->m_plugin->openPreset( );
bool converted;
QString str = m_effect->m_plugin->currentProgramName().section("/", 0, 0);
@@ -248,7 +248,7 @@ void VstEffectControls::openPreset( void )
void VstEffectControls::rollPreset( void )
{
if ( m_effect->m_plugin != NULL ) {
if ( m_effect->m_plugin != nullptr ) {
m_effect->m_plugin->rotateProgram( 1 );
bool converted;
QString str = m_effect->m_plugin->currentProgramName().section("/", 0, 0);
@@ -264,7 +264,7 @@ void VstEffectControls::rollPreset( void )
void VstEffectControls::rolrPreset( void )
{
if ( m_effect->m_plugin != NULL ) {
if ( m_effect->m_plugin != nullptr ) {
m_effect->m_plugin->rotateProgram( -1 );
bool converted;
QString str = m_effect->m_plugin->currentProgramName().section("/", 0, 0);
@@ -282,7 +282,7 @@ void VstEffectControls::selPreset( void )
QAction *action = qobject_cast<QAction *>(sender());
if (action)
if ( m_effect->m_plugin != NULL ) {
if ( m_effect->m_plugin != nullptr ) {
lastPosInMenu = action->data().toInt();
m_effect->m_plugin->setProgram( lastPosInMenu );
//QWidget::update();
@@ -308,7 +308,7 @@ manageVSTEffectView::manageVSTEffectView( VstEffect * _eff, VstEffectControls *
m_vi->m_scrollArea = new QScrollArea( widget );
l = new QGridLayout( widget );
m_vi->m_subWindow = gui->mainWindow()->addWindowedWidget(NULL, Qt::SubWindow |
m_vi->m_subWindow = getGUI()->mainWindow()->addWindowedWidget(nullptr, Qt::SubWindow |
Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint);
m_vi->m_subWindow->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
m_vi->m_subWindow->setFixedSize( 960, 300);
@@ -353,7 +353,7 @@ manageVSTEffectView::manageVSTEffectView( VstEffect * _eff, VstEffectControls *
vstKnobs = new CustomTextKnob *[ m_vi->paramCount ];
bool hasKnobModel = true;
if (m_vi->knobFModel == NULL) {
if (m_vi->knobFModel == nullptr) {
m_vi->knobFModel = new FloatModel *[ m_vi->paramCount ];
hasKnobModel = false;
}
@@ -479,7 +479,7 @@ void manageVSTEffectView::setParameter( Model * action )
{
int knobUNID = action->displayName().toInt();
if ( m_effect->m_plugin != NULL ) {
if ( m_effect->m_plugin != nullptr ) {
m_effect->m_plugin->setParam( knobUNID, m_vi2->knobFModel[knobUNID]->value() );
syncParameterText();
}
@@ -520,7 +520,7 @@ void manageVSTEffectView::syncParameterText()
manageVSTEffectView::~manageVSTEffectView()
{
if( m_vi2->knobFModel != NULL )
if( m_vi2->knobFModel != nullptr )
{
for( int i = 0; i < m_vi2->paramCount; i++ )
{
@@ -529,34 +529,34 @@ manageVSTEffectView::~manageVSTEffectView()
}
}
if( vstKnobs != NULL )
if( vstKnobs != nullptr )
{
delete [] vstKnobs;
vstKnobs = NULL;
vstKnobs = nullptr;
}
if( m_vi2->knobFModel != NULL )
if( m_vi2->knobFModel != nullptr )
{
delete [] m_vi2->knobFModel;
m_vi2->knobFModel = NULL;
m_vi2->knobFModel = nullptr;
}
if( m_vi2->m_scrollArea != NULL )
if( m_vi2->m_scrollArea != nullptr )
{
delete m_vi2->m_scrollArea;
m_vi2->m_scrollArea = NULL;
m_vi2->m_scrollArea = nullptr;
}
if( m_vi2->m_subWindow != NULL )
if( m_vi2->m_subWindow != nullptr )
{
m_vi2->m_subWindow->setAttribute( Qt::WA_DeleteOnClose );
m_vi2->m_subWindow->close();
if( m_vi2->m_subWindow != NULL )
if( m_vi2->m_subWindow != nullptr )
{
delete m_vi2->m_subWindow;
}
m_vi2->m_subWindow = NULL;
m_vi2->m_subWindow = nullptr;
}
//delete m_vi2->m_subWindow;
//m_vi2->m_subWindow = NULL;

View File

@@ -370,7 +370,7 @@ class ExprFrontData
public:
ExprFrontData(int last_func_samples):
m_rand_vec(SimpleRandom::generator()),
m_integ_func(NULL),
m_integ_func(nullptr),
m_last_func(last_func_samples)
{}
~ExprFrontData()
@@ -670,7 +670,7 @@ size_t find_occurances(const std::string& haystack, const char* const needle)
void ExprFront::setIntegrate(const unsigned int* const frameCounter, const unsigned int sample_rate)
{
if (m_data->m_integ_func == NULL)
if (m_data->m_integ_func == nullptr)
{
const unsigned int ointeg = find_occurances(m_data->m_expression_string,"integrate");
if ( ointeg > 0 )

View File

@@ -55,7 +55,7 @@ extern "C" {
Plugin::Descriptor PLUGIN_EXPORT xpressive_plugin_descriptor = { STRINGIFY(
PLUGIN_NAME), "Xpressive", QT_TRANSLATE_NOOP("PluginBrowser",
"Mathematical expression parser"), "Orr Dvori", 0x0100,
Plugin::Instrument, new PluginPixmapLoader("logo"), NULL, NULL };
Plugin::Instrument, new PluginPixmapLoader("logo"), nullptr, nullptr };
}
@@ -202,7 +202,7 @@ void Xpressive::playNote(NotePlayHandle* nph, sampleFrame* working_buffer) {
m_A2=m_parameterA2.value();
m_A3=m_parameterA3.value();
if (nph->totalFramesPlayed() == 0 || nph->m_pluginData == NULL) {
if (nph->totalFramesPlayed() == 0 || nph->m_pluginData == nullptr) {
ExprFront *exprO1 = new ExprFront(m_outputExpression[0].constData(),Engine::audioEngine()->processingSampleRate());//give the "last" function a whole second
ExprFront *exprO2 = new ExprFront(m_outputExpression[1].constData(),Engine::audioEngine()->processingSampleRate());
@@ -315,37 +315,37 @@ XpressiveView::XpressiveView(Instrument * _instrument, QWidget * _parent) :
PixmapButton * m_o2Btn;
PixmapButton * m_helpBtn;
m_w1Btn = new PixmapButton(this, NULL);
m_w1Btn = new PixmapButton(this, nullptr);
m_w1Btn->move(3, ROW_BTN);
m_w1Btn->setActiveGraphic(PLUGIN_NAME::getIconPixmap("w1_active"));
m_w1Btn->setInactiveGraphic(PLUGIN_NAME::getIconPixmap("w1_inactive"));
ToolTip::add(m_w1Btn, tr("Select oscillator W1"));
m_w2Btn = new PixmapButton(this, NULL);
m_w2Btn = new PixmapButton(this, nullptr);
m_w2Btn->move(26, ROW_BTN);
m_w2Btn->setActiveGraphic(PLUGIN_NAME::getIconPixmap("w2_active"));
m_w2Btn->setInactiveGraphic(PLUGIN_NAME::getIconPixmap("w2_inactive"));
ToolTip::add(m_w2Btn, tr("Select oscillator W2"));
m_w3Btn = new PixmapButton(this, NULL);
m_w3Btn = new PixmapButton(this, nullptr);
m_w3Btn->move(49, ROW_BTN);
m_w3Btn->setActiveGraphic(PLUGIN_NAME::getIconPixmap("w3_active"));
m_w3Btn->setInactiveGraphic(PLUGIN_NAME::getIconPixmap("w3_inactive"));
ToolTip::add(m_w3Btn, tr("Select oscillator W3"));
m_o1Btn = new PixmapButton(this, NULL);
m_o1Btn = new PixmapButton(this, nullptr);
m_o1Btn->move(79, ROW_BTN);
m_o1Btn->setActiveGraphic(PLUGIN_NAME::getIconPixmap("o1_active"));
m_o1Btn->setInactiveGraphic(PLUGIN_NAME::getIconPixmap("o1_inactive"));
ToolTip::add(m_o1Btn, tr("Select output O1"));
m_o2Btn = new PixmapButton(this, NULL);
m_o2Btn = new PixmapButton(this, nullptr);
m_o2Btn->move(101, ROW_BTN);
m_o2Btn->setActiveGraphic(PLUGIN_NAME::getIconPixmap("o2_active"));
m_o2Btn->setInactiveGraphic(PLUGIN_NAME::getIconPixmap("o2_inactive"));
ToolTip::add(m_o2Btn, tr("Select output O2"));
m_helpBtn = new PixmapButton(this, NULL);
m_helpBtn = new PixmapButton(this, nullptr);
m_helpBtn->move(133, ROW_BTN);
m_helpBtn->setActiveGraphic(PLUGIN_NAME::getIconPixmap("help_active"));
m_helpBtn->setInactiveGraphic(PLUGIN_NAME::getIconPixmap("help_inactive"));
@@ -873,7 +873,7 @@ XpressiveHelpView::XpressiveHelpView():QTextEdit(s_helpText)
{
setWindowTitle ( "Xpressive Help" );
setTextInteractionFlags ( Qt::TextSelectableByKeyboard | Qt::TextSelectableByMouse );
gui->mainWindow()->addWindowedWidget( this );
getGUI()->mainWindow()->addWindowedWidget( this );
parentWidget()->setAttribute( Qt::WA_DeleteOnClose, false );
parentWidget()->setWindowIcon( PLUGIN_NAME::getIconPixmap( "logo" ) );
parentWidget()->setFixedSize( 300, 500);

View File

@@ -65,7 +65,7 @@ Plugin::Descriptor PLUGIN_EXPORT audiofileprocessor_plugin_descriptor =
Plugin::Instrument,
new PluginPixmapLoader( "logo" ),
"wav,ogg,ds,spx,au,voc,aif,aiff,flac,raw",
NULL,
nullptr,
} ;
}
@@ -446,14 +446,14 @@ void audioFileProcessor::pointChanged( void )
QPixmap * AudioFileProcessorView::s_artwork = NULL;
QPixmap * AudioFileProcessorView::s_artwork = nullptr;
AudioFileProcessorView::AudioFileProcessorView( Instrument * _instrument,
QWidget * _parent ) :
InstrumentViewFixedSize( _instrument, _parent )
{
if( s_artwork == NULL )
if( s_artwork == nullptr )
{
s_artwork = new QPixmap( PLUGIN_NAME::getIconPixmap(
"artwork" ) );
@@ -1148,7 +1148,7 @@ void AudioFileProcessorWaveView::slideSamplePointByFrames( knobType _point, f_cn
case start:
break;
}
if( a_knob == NULL )
if( a_knob == nullptr )
{
return;
}

View File

@@ -60,8 +60,8 @@ Plugin::Descriptor PLUGIN_EXPORT bitinvader_plugin_descriptor =
0x0100,
Plugin::Instrument,
new PluginPixmapLoader( "logo" ),
NULL,
NULL,
nullptr,
nullptr,
} ;
}
@@ -278,7 +278,7 @@ QString bitInvader::nodeName() const
void bitInvader::playNote( NotePlayHandle * _n,
sampleFrame * _working_buffer )
{
if ( _n->totalFramesPlayed() == 0 || _n->m_pluginData == NULL )
if ( _n->totalFramesPlayed() == 0 || _n->m_pluginData == nullptr )
{
float factor;

View File

@@ -126,9 +126,9 @@ static const char* host_ui_open_file(NativeHostHandle, bool isDir, const char* t
static QByteArray retStr;
const QFileDialog::Options options(isDir ? QFileDialog::ShowDirsOnly : 0x0);
retStr = QFileDialog::getOpenFileName(QApplication::activeWindow(), title, "", filter, NULL, options).toUtf8();
retStr = QFileDialog::getOpenFileName(QApplication::activeWindow(), title, "", filter, nullptr, options).toUtf8();
return retStr.isEmpty() ? NULL : retStr.constData();
return retStr.isEmpty() ? nullptr : retStr.constData();
}
static const char* host_ui_save_file(NativeHostHandle, bool isDir, const char* title, const char* filter)
@@ -136,9 +136,9 @@ static const char* host_ui_save_file(NativeHostHandle, bool isDir, const char* t
static QByteArray retStr;
const QFileDialog::Options options(isDir ? QFileDialog::ShowDirsOnly : 0x0);
retStr = QFileDialog::getSaveFileName(QApplication::activeWindow(), title, "", filter, NULL, options).toUtf8();
retStr = QFileDialog::getSaveFileName(QApplication::activeWindow(), title, "", filter, nullptr, options).toUtf8();
return retStr.isEmpty() ? NULL : retStr.constData();
return retStr.isEmpty() ? nullptr : retStr.constData();
}
// -----------------------------------------------------------------------
@@ -146,13 +146,13 @@ static const char* host_ui_save_file(NativeHostHandle, bool isDir, const char* t
CarlaInstrument::CarlaInstrument(InstrumentTrack* const instrumentTrack, const Descriptor* const descriptor, const bool isPatchbay)
: Instrument(instrumentTrack, descriptor),
kIsPatchbay(isPatchbay),
fHandle(NULL),
fHandle(nullptr),
fDescriptor(isPatchbay ? carla_get_native_patchbay_plugin() : carla_get_native_rack_plugin()),
fMidiEventCount(0),
m_paramModels()
{
fHost.handle = this;
fHost.uiName = NULL;
fHost.uiName = nullptr;
fHost.uiParentId = 0;
// carla/resources contains PyQt scripts required for launch
@@ -182,9 +182,9 @@ CarlaInstrument::CarlaInstrument(InstrumentTrack* const instrumentTrack, const D
fTimeInfo.bbt.valid = true; // always valid
fHandle = fDescriptor->instantiate(&fHost);
Q_ASSERT(fHandle != NULL);
Q_ASSERT(fHandle != nullptr);
if (fHandle != NULL && fDescriptor->activate != NULL)
if (fHandle != nullptr && fDescriptor->activate != nullptr)
fDescriptor->activate(fHandle);
// we need a play-handle which cares for calling play()
@@ -216,28 +216,28 @@ CarlaInstrument::~CarlaInstrument()
{
Engine::audioEngine()->removePlayHandlesOfTypes(instrumentTrack(), PlayHandle::TypeNotePlayHandle | PlayHandle::TypeInstrumentPlayHandle);
if (fHost.resourceDir != NULL)
if (fHost.resourceDir != nullptr)
{
std::free((char*)fHost.resourceDir);
fHost.resourceDir = NULL;
fHost.resourceDir = nullptr;
}
if (fHost.uiName != NULL)
if (fHost.uiName != nullptr)
{
std::free((char*)fHost.uiName);
fHost.uiName = NULL;
fHost.uiName = nullptr;
}
if (fHandle == NULL)
if (fHandle == nullptr)
return;
if (fDescriptor->deactivate != NULL)
if (fDescriptor->deactivate != nullptr)
fDescriptor->deactivate(fHandle);
if (fDescriptor->cleanup != NULL)
if (fDescriptor->cleanup != nullptr)
fDescriptor->cleanup(fHandle);
fHandle = NULL;
fHandle = nullptr;
#if CARLA_VERSION_HEX >= CARLA_MIN_PARAM_VERSION
clearParamModels();
@@ -349,12 +349,12 @@ QString CarlaInstrument::nodeName() const
void CarlaInstrument::saveSettings(QDomDocument& doc, QDomElement& parent)
{
if (fHandle == NULL || fDescriptor->get_state == NULL)
if (fHandle == nullptr || fDescriptor->get_state == nullptr)
return;
char* const state = fDescriptor->get_state(fHandle);
if (state == NULL)
if (state == nullptr)
return;
QDomDocument carlaDoc("carla");
@@ -479,7 +479,7 @@ void CarlaInstrument::updateParamModel(uint32_t index)
void CarlaInstrument::loadSettings(const QDomElement& elem)
{
if (fHandle == NULL || fDescriptor->set_state == NULL)
if (fHandle == nullptr || fDescriptor->set_state == nullptr)
return;
QDomDocument carlaDoc("carla");
@@ -500,9 +500,9 @@ void CarlaInstrument::play(sampleFrame* workingBuffer)
std::memset(workingBuffer, 0, sizeof(sample_t)*bufsize*DEFAULT_CHANNELS);
if (fHandle == NULL)
if (fHandle == nullptr)
{
instrumentTrack()->processAudioBuffer(workingBuffer, bufsize, NULL);
instrumentTrack()->processAudioBuffer(workingBuffer, bufsize, nullptr);
return;
}
@@ -551,7 +551,7 @@ void CarlaInstrument::play(sampleFrame* workingBuffer)
workingBuffer[i][1] = buf2[i];
}
instrumentTrack()->processAudioBuffer(workingBuffer, bufsize, NULL);
instrumentTrack()->processAudioBuffer(workingBuffer, bufsize, nullptr);
}
bool CarlaInstrument::handleMidiEvent(const MidiEvent& event, const TimePos&, f_cnt_t offset)
@@ -604,7 +604,7 @@ CarlaInstrumentView::CarlaInstrumentView(CarlaInstrument* const instrument, QWid
: InstrumentViewFixedSize(instrument, parent),
fHandle(instrument->fHandle),
fDescriptor(instrument->fDescriptor),
fTimerId(fHandle != NULL && fDescriptor->ui_idle != NULL ? startTimer(30) : 0),
fTimerId(fHandle != nullptr && fDescriptor->ui_idle != nullptr ? startTimer(30) : 0),
m_carlaInstrument(instrument),
m_parent(parent),
m_paramsSubWindow(nullptr),
@@ -671,7 +671,7 @@ CarlaInstrumentView::~CarlaInstrumentView()
void CarlaInstrumentView::toggleUI(bool visible)
{
if (fHandle != NULL && fDescriptor->ui_show != NULL) {
if (fHandle != nullptr && fDescriptor->ui_show != nullptr) {
// TODO: remove when fixed upstream
// change working path to location of carla.dll to avoid conflict with lmms
#if defined(CARLA_OS_WIN32) || defined(CARLA_OS_WIN64)
@@ -846,9 +846,9 @@ CarlaParamsView::CarlaParamsView(CarlaInstrumentView* const instrumentView, QWid
verticalLayout->addWidget(splitter);
// -- Sub window
CarlaParamsSubWindow* win = new CarlaParamsSubWindow(gui->mainWindow()->workspace()->viewport(), Qt::SubWindow |
CarlaParamsSubWindow* win = new CarlaParamsSubWindow(getGUI()->mainWindow()->workspace()->viewport(), Qt::SubWindow |
Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint);
m_carlaInstrumentView->m_paramsSubWindow = gui->mainWindow()->workspace()->addSubWindow(win);
m_carlaInstrumentView->m_paramsSubWindow = getGUI()->mainWindow()->workspace()->addSubWindow(win);
m_carlaInstrumentView->m_paramsSubWindow->setSizePolicy(
QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
m_carlaInstrumentView->m_paramsSubWindow->setMinimumHeight(200);

View File

@@ -41,8 +41,8 @@ Plugin::Descriptor PLUGIN_EXPORT carlapatchbay_plugin_descriptor =
CARLA_VERSION_HEX,
Plugin::Instrument,
new PluginPixmapLoader( "logo" ),
NULL,
NULL,
nullptr,
nullptr,
} ;
PLUGIN_EXPORT Plugin* lmms_plugin_main(Model* m, void*)

View File

@@ -41,8 +41,8 @@ Plugin::Descriptor PLUGIN_EXPORT carlarack_plugin_descriptor =
CARLA_VERSION_HEX,
Plugin::Instrument,
new PluginPixmapLoader( "logo" ),
NULL,
NULL,
nullptr,
nullptr,
} ;
PLUGIN_EXPORT Plugin* lmms_plugin_main(Model* m, void*)

View File

@@ -44,8 +44,8 @@ Plugin::Descriptor PLUGIN_EXPORT dynamicsprocessor_plugin_descriptor =
0x0100,
Plugin::Effect,
new PluginPixmapLoader("logo"),
NULL,
NULL,
nullptr,
nullptr,
} ;
}
@@ -77,12 +77,12 @@ dynProcEffect::~dynProcEffect()
inline void dynProcEffect::calcAttack()
{
m_attCoeff = exp10( ( DNF_LOG / ( m_dpControls.m_attackModel.value() * 0.001 ) ) / Engine::audioEngine()->processingSampleRate() );
m_attCoeff = std::pow(10.f, ( DNF_LOG / ( m_dpControls.m_attackModel.value() * 0.001 ) ) / Engine::audioEngine()->processingSampleRate() );
}
inline void dynProcEffect::calcRelease()
{
m_relCoeff = exp10( ( -DNF_LOG / ( m_dpControls.m_releaseModel.value() * 0.001 ) ) / Engine::audioEngine()->processingSampleRate() );
m_relCoeff = std::pow(10.f, ( -DNF_LOG / ( m_dpControls.m_releaseModel.value() * 0.001 ) ) / Engine::audioEngine()->processingSampleRate() );
}

View File

@@ -51,8 +51,8 @@ Plugin::Descriptor PLUGIN_EXPORT kicker_plugin_descriptor =
0x0100,
Plugin::Instrument,
new PluginPixmapLoader( "logo" ),
NULL,
NULL,
nullptr,
nullptr,
} ;
}

View File

@@ -55,8 +55,8 @@ Plugin::Descriptor PLUGIN_EXPORT ladspabrowser_plugin_descriptor =
0x0100,
Plugin::Tool,
new PluginPixmapLoader("logo"),
NULL,
NULL,
nullptr,
nullptr,
} ;
@@ -72,7 +72,7 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model * _parent, void * _data )
ladspaBrowser::ladspaBrowser() :
ToolPlugin( &ladspabrowser_plugin_descriptor, NULL )
ToolPlugin( &ladspabrowser_plugin_descriptor, nullptr )
{
}

View File

@@ -89,8 +89,8 @@ Plugin::Descriptor PLUGIN_EXPORT lb302_plugin_descriptor =
0x0100,
Plugin::Instrument,
new PluginPixmapLoader( "logo" ),
NULL,
NULL,
nullptr,
nullptr,
};
}
@@ -790,7 +790,7 @@ void lb302Synth::play( sampleFrame * _working_buffer )
const fpp_t frames = Engine::audioEngine()->framesPerPeriod();
process( _working_buffer, frames );
instrumentTrack()->processAudioBuffer( _working_buffer, frames, NULL );
instrumentTrack()->processAudioBuffer( _working_buffer, frames, nullptr );
// release_frame = 0; //removed for issue # 1432
}
@@ -801,7 +801,7 @@ void lb302Synth::deleteNotePluginData( NotePlayHandle * _n )
//printf("GONE\n");
if( m_playingNote == _n )
{
m_playingNote = NULL;
m_playingNote = nullptr;
}
}

View File

@@ -51,8 +51,8 @@ Plugin::Descriptor PLUGIN_EXPORT monstro_plugin_descriptor =
0x0100,
Plugin::Instrument,
new PluginPixmapLoader( "logo" ),
NULL,
NULL,
nullptr,
nullptr,
} ;
}
@@ -1036,7 +1036,7 @@ void MonstroInstrument::playNote( NotePlayHandle * _n,
const fpp_t frames = _n->framesLeftForCurrentPeriod();
const f_cnt_t offset = _n->noteOffset();
if ( _n->totalFramesPlayed() == 0 || _n->m_pluginData == NULL )
if ( _n->totalFramesPlayed() == 0 || _n->m_pluginData == nullptr )
{
_n->m_pluginData = new MonstroSynth( this, _n );
}
@@ -1434,14 +1434,14 @@ void MonstroInstrument::updateSamplerate()
void MonstroInstrument::updateSlope1()
{
const float slope = m_env1Slope.value();
m_slope[0] = exp10( slope * -1.0f );
m_slope[0] = std::pow(10.f, slope * -1.0f );
}
void MonstroInstrument::updateSlope2()
{
const float slope = m_env2Slope.value();
m_slope[1] = exp10( slope * -1.0f );
m_slope[1] = std::pow(10.f, slope * -1.0f );
}
@@ -1461,13 +1461,13 @@ MonstroView::MonstroView( Instrument * _instrument,
// "tab buttons"
PixmapButton * m_opViewButton = new PixmapButton( this, NULL );
PixmapButton * m_opViewButton = new PixmapButton( this, nullptr );
m_opViewButton -> move( 0,0 );
m_opViewButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "opview_active" ) );
m_opViewButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "opview_inactive" ) );
ToolTip::add( m_opViewButton, tr( "Operators view" ) );
PixmapButton * m_matViewButton = new PixmapButton( this, NULL );
PixmapButton * m_matViewButton = new PixmapButton( this, nullptr );
m_matViewButton -> move( 125,0 );
m_matViewButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "matview_active" ) );
m_matViewButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "matview_inactive" ) );
@@ -1722,25 +1722,25 @@ QWidget * MonstroView::setupOperatorsView( QWidget * _parent )
makeknob( m_env2SlopeKnob, KNOBCOL7, E2ROW, tr( "Slope" ), "", "envKnob" )
// mod selector
PixmapButton * m_mixButton = new PixmapButton( view, NULL );
PixmapButton * m_mixButton = new PixmapButton( view, nullptr );
m_mixButton -> move( 225, 185 );
m_mixButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "mix_active" ) );
m_mixButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "mix_inactive" ) );
ToolTip::add( m_mixButton, tr( "Mix osc 2 with osc 3" ) );
PixmapButton * m_amButton = new PixmapButton( view, NULL );
PixmapButton * m_amButton = new PixmapButton( view, nullptr );
m_amButton -> move( 225, 185 + 15 );
m_amButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "am_active" ) );
m_amButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "am_inactive" ) );
ToolTip::add( m_amButton, tr( "Modulate amplitude of osc 3 by osc 2" ) );
PixmapButton * m_fmButton = new PixmapButton( view, NULL );
PixmapButton * m_fmButton = new PixmapButton( view, nullptr );
m_fmButton -> move( 225, 185 + 15*2 );
m_fmButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "fm_active" ) );
m_fmButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "fm_inactive" ) );
ToolTip::add( m_fmButton, tr( "Modulate frequency of osc 3 by osc 2" ) );
PixmapButton * m_pmButton = new PixmapButton( view, NULL );
PixmapButton * m_pmButton = new PixmapButton( view, nullptr );
m_pmButton -> move( 225, 185 + 15*3 );
m_pmButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "pm_active" ) );
m_pmButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "pm_inactive" ) );

View File

@@ -59,7 +59,7 @@
name ->setFixedSize( 20, 20 );
#define maketinyled( name, x, y, ttip ) \
name = new PixmapButton( view, NULL ); \
name = new PixmapButton( view, nullptr ); \
name -> setCheckable( true ); \
name -> move( x, y ); \
name -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "tinyled_on" ) ); \

View File

@@ -50,8 +50,8 @@ Plugin::Descriptor PLUGIN_EXPORT nes_plugin_descriptor =
0x0100,
Plugin::Instrument,
new PluginPixmapLoader( "logo" ),
NULL,
NULL,
nullptr,
nullptr,
} ;
}
@@ -558,7 +558,7 @@ void NesInstrument::playNote( NotePlayHandle * n, sampleFrame * workingBuffer )
const fpp_t frames = n->framesLeftForCurrentPeriod();
const f_cnt_t offset = n->noteOffset();
if ( n->totalFramesPlayed() == 0 || n->m_pluginData == NULL )
if ( n->totalFramesPlayed() == 0 || n->m_pluginData == nullptr )
{
NesObject * nes = new NesObject( this, Engine::audioEngine()->processingSampleRate(), n );
n->m_pluginData = nes;
@@ -727,7 +727,7 @@ void NesInstrument::updateFreq3()
QPixmap * NesInstrumentView::s_artwork = NULL;
QPixmap * NesInstrumentView::s_artwork = nullptr;
NesInstrumentView::NesInstrumentView( Instrument * instrument, QWidget * parent ) :
@@ -736,7 +736,7 @@ NesInstrumentView::NesInstrumentView( Instrument * instrument, QWidget * parent
setAutoFillBackground( true );
QPalette pal;
if( s_artwork == NULL )
if( s_artwork == nullptr )
{
s_artwork = new QPixmap( PLUGIN_NAME::getIconPixmap( "artwork" ) );
}

View File

@@ -45,7 +45,7 @@
name ->setFixedSize( 29, 29 );
#define makenesled( name, x, y, ttip ) \
name = new PixmapButton( this, NULL ); \
name = new PixmapButton( this, nullptr ); \
name -> setCheckable( true ); \
name -> move( x, y ); \
name -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "nesled_on" ) ); \
@@ -53,7 +53,7 @@
ToolTip::add( name, ttip );
#define makedcled( name, x, y, ttip, active ) \
PixmapButton * name = new PixmapButton( this, NULL ); \
PixmapButton * name = new PixmapButton( this, nullptr ); \
name -> move( x, y ); \
name -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( active ) ); \
name -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "nesdc_off" ) ); \

View File

@@ -57,14 +57,14 @@ Plugin::Descriptor PLUGIN_EXPORT organic_plugin_descriptor =
0x0100,
Plugin::Instrument,
new PluginPixmapLoader( "logo" ),
NULL,
NULL,
nullptr,
nullptr,
} ;
}
QPixmap * organicInstrumentView::s_artwork = NULL;
float * organicInstrument::s_harmonics = NULL;
QPixmap * organicInstrumentView::s_artwork = nullptr;
float * organicInstrument::s_harmonics = nullptr;
/***********************************************************************
*
@@ -114,7 +114,7 @@ organicInstrument::organicInstrument( InstrumentTrack * _instrument_track ) :
m_osc[6]->m_harmonic = log2f( 5.0f ); // .
m_osc[7]->m_harmonic = log2f( 6.0f ); // .*/
if( s_harmonics == NULL )
if( s_harmonics == nullptr )
{
s_harmonics = new float[ NUM_HARMONICS ];
s_harmonics[0] = log2f( 0.5f );
@@ -230,7 +230,7 @@ void organicInstrument::playNote( NotePlayHandle * _n,
const fpp_t frames = _n->framesLeftForCurrentPeriod();
const f_cnt_t offset = _n->noteOffset();
if( _n->totalFramesPlayed() == 0 || _n->m_pluginData == NULL )
if( _n->totalFramesPlayed() == 0 || _n->m_pluginData == nullptr )
{
Oscillator * oscs_l[NUM_OSCILLATORS];
Oscillator * oscs_r[NUM_OSCILLATORS];
@@ -418,7 +418,7 @@ public:
organicInstrumentView::organicInstrumentView( Instrument * _instrument,
QWidget * _parent ) :
InstrumentViewFixedSize( _instrument, _parent ),
m_oscKnobs( NULL )
m_oscKnobs( nullptr )
{
organicInstrument * oi = castModel<organicInstrument>();
@@ -455,7 +455,7 @@ organicInstrumentView::organicInstrumentView( Instrument * _instrument,
oi, SLOT( randomiseSettings() ) );
if( s_artwork == NULL )
if( s_artwork == nullptr )
{
s_artwork = new QPixmap( PLUGIN_NAME::getIconPixmap(
"artwork" ) );
@@ -484,7 +484,7 @@ void organicInstrumentView::modelChanged()
m_fx1Knob->setModel( &oi->m_fx1Model );
m_volKnob->setModel( &oi->m_volModel );
if( m_oscKnobs != NULL )
if( m_oscKnobs != nullptr )
{
delete[] m_oscKnobs;
}

View File

@@ -62,7 +62,7 @@ Plugin::Descriptor PLUGIN_EXPORT patman_plugin_descriptor =
Plugin::Instrument,
new PluginPixmapLoader( "logo" ),
"pat",
NULL,
nullptr,
} ;
@@ -395,7 +395,7 @@ void patmanInstrument::selectSample( NotePlayHandle * _n )
const float freq = _n->frequency();
float min_dist = HUGE_VALF;
SampleBuffer* sample = NULL;
SampleBuffer* sample = nullptr;
for( QVector<SampleBuffer *>::iterator it = m_patchSamples.begin(); it != m_patchSamples.end(); ++it )
{
@@ -418,7 +418,7 @@ void patmanInstrument::selectSample( NotePlayHandle * _n )
}
else
{
hdata->sample = new SampleBuffer( NULL, 0 );
hdata->sample = new SampleBuffer( nullptr, 0 );
}
hdata->state = new SampleBuffer::handleState( _n->hasDetuningInfo() );
@@ -444,7 +444,7 @@ PluginView * patmanInstrument::instantiateView( QWidget * _parent )
PatmanView::PatmanView( Instrument * _instrument, QWidget * _parent ) :
InstrumentViewFixedSize( _instrument, _parent ),
m_pi( NULL )
m_pi( nullptr )
{
setAutoFillBackground( true );
QPalette pal;
@@ -453,7 +453,7 @@ PatmanView::PatmanView( Instrument * _instrument, QWidget * _parent ) :
setPalette( pal );
m_openFileButton = new PixmapButton( this, NULL );
m_openFileButton = new PixmapButton( this, nullptr );
m_openFileButton->setObjectName( "openFileButton" );
m_openFileButton->setCursor( QCursor( Qt::PointingHandCursor ) );
m_openFileButton->move( 227, 86 );
@@ -502,7 +502,7 @@ PatmanView::~PatmanView()
void PatmanView::openFile( void )
{
FileDialog ofd( NULL, tr( "Open patch file" ) );
FileDialog ofd( nullptr, tr( "Open patch file" ) );
ofd.setFileMode( FileDialog::ExistingFiles );
QStringList types;

View File

@@ -47,8 +47,8 @@ Plugin::Descriptor PLUGIN_EXPORT peakcontrollereffect_plugin_descriptor =
0x0100,
Plugin::Effect,
new PluginPixmapLoader("logo"),
NULL,
NULL,
nullptr,
nullptr,
} ;
}
@@ -66,7 +66,7 @@ PeakControllerEffect::PeakControllerEffect(
m_effectId( rand() ),
m_peakControls( this ),
m_lastSample( 0 ),
m_autoController( NULL )
m_autoController( nullptr )
{
m_autoController = new PeakController( Engine::getSong(), this );
if( !Engine::getSong()->isLoadingProject() && !PresetPreviewPlayHandle::isPreviewing() )

View File

@@ -65,7 +65,7 @@ patchesDialog::patchesDialog( QWidget *pParent, Qt::WindowFlags wflags )
// Setup UI struct...
setupUi( this );
m_pSynth = NULL;
m_pSynth = nullptr;
m_iChan = 0;
m_iBank = 0;
m_iProg = 0;
@@ -128,7 +128,7 @@ void patchesDialog::setup ( fluid_synth_t * pSynth, int iChan,
setWindowTitle( _chanName + " - Soundfont patches" );
// set m_pSynth to NULL so we don't trigger any progChanged events
m_pSynth = NULL;
m_pSynth = nullptr;
// Load bank list from actual synth stack...
m_bankListView->setSortingEnabled(false);
@@ -139,7 +139,7 @@ void patchesDialog::setup ( fluid_synth_t * pSynth, int iChan,
m_iChan = iChan;
QTreeWidgetItem *pBankItem = NULL;
QTreeWidgetItem *pBankItem = nullptr;
// For all soundfonts (in reversed stack order) fill the available banks...
int cSoundFonts = ::fluid_synth_sfcount(m_pSynth);
for (int i = 0; i < cSoundFonts; i++) {
@@ -209,8 +209,8 @@ bool patchesDialog::validateForm()
{
bool bValid = true;
bValid = bValid && (m_bankListView->currentItem() != NULL);
bValid = bValid && (m_progListView->currentItem() != NULL);
bValid = bValid && (m_bankListView->currentItem() != nullptr);
bValid = bValid && (m_progListView->currentItem() != nullptr);
return bValid;
}
@@ -219,7 +219,7 @@ bool patchesDialog::validateForm()
// Realize a bank-program selection preset.
void patchesDialog::setBankProg ( int iBank, int iProg )
{
if (m_pSynth == NULL)
if (m_pSynth == nullptr)
return;
// just select the synth's program preset...
@@ -278,7 +278,7 @@ QTreeWidgetItem *patchesDialog::findBankItem ( int iBank )
if (iter.hasNext())
return iter.next();
else
return NULL;
return nullptr;
}
@@ -293,7 +293,7 @@ QTreeWidgetItem *patchesDialog::findProgItem ( int iProg )
if (iter.hasNext())
return iter.next();
else
return NULL;
return nullptr;
}
@@ -301,11 +301,11 @@ QTreeWidgetItem *patchesDialog::findProgItem ( int iProg )
// Bank change slot.
void patchesDialog::bankChanged (void)
{
if (m_pSynth == NULL)
if (m_pSynth == nullptr)
return;
QTreeWidgetItem *pBankItem = m_bankListView->currentItem();
if (pBankItem == NULL)
if (pBankItem == nullptr)
return;
int iBankSelected = pBankItem->text(0).toInt();
@@ -313,7 +313,7 @@ void patchesDialog::bankChanged (void)
// Clear up the program listview.
m_progListView->setSortingEnabled(false);
m_progListView->clear();
QTreeWidgetItem *pProgItem = NULL;
QTreeWidgetItem *pProgItem = nullptr;
// For all soundfonts (in reversed stack order) fill the available programs...
int cSoundFonts = ::fluid_synth_sfcount(m_pSynth);
for (int i = 0; i < cSoundFonts && !pProgItem; i++) {
@@ -358,7 +358,7 @@ void patchesDialog::bankChanged (void)
// Program change slot.
void patchesDialog::progChanged (QTreeWidgetItem * _curr, QTreeWidgetItem * _prev)
{
if (m_pSynth == NULL || _curr == NULL)
if (m_pSynth == nullptr || _curr == nullptr)
return;
// Which preview state...

View File

@@ -63,7 +63,7 @@ Plugin::Descriptor PLUGIN_EXPORT sf2player_plugin_descriptor =
Plugin::Instrument,
new PluginPixmapLoader( "logo" ),
"sf2,sf3",
NULL,
nullptr,
} ;
}
@@ -90,9 +90,9 @@ QMutex sf2Instrument::s_fontsMutex;
sf2Instrument::sf2Instrument( InstrumentTrack * _instrument_track ) :
Instrument( _instrument_track, &sf2player_plugin_descriptor ),
m_srcState( NULL ),
m_srcState( nullptr ),
m_synth(nullptr),
m_font( NULL ),
m_font( nullptr ),
m_fontId( 0 ),
m_filename( "" ),
m_lastMidiPitch( -1 ),
@@ -120,7 +120,7 @@ sf2Instrument::sf2Instrument( InstrumentTrack * _instrument_track ) :
#if QT_VERSION_CHECK(FLUIDSYNTH_VERSION_MAJOR, FLUIDSYNTH_VERSION_MINOR, FLUIDSYNTH_VERSION_MICRO) >= QT_VERSION_CHECK(1,1,9)
// Deactivate all audio drivers in fluidsynth
const char *none[] = { NULL };
const char *none[] = { nullptr };
fluid_audio_driver_register( none );
#endif
m_settings = new_fluid_settings();
@@ -197,7 +197,7 @@ sf2Instrument::~sf2Instrument()
freeFont();
delete_fluid_synth( m_synth );
delete_fluid_settings( m_settings );
if( m_srcState != NULL )
if( m_srcState != nullptr )
{
src_delete( m_srcState );
}
@@ -314,7 +314,7 @@ AutomatableModel * sf2Instrument::childModel( const QString & _modelName )
return &m_patchNum;
}
qCritical() << "requested unknown model " << _modelName;
return NULL;
return nullptr;
}
@@ -331,7 +331,7 @@ void sf2Instrument::freeFont()
{
m_synthMutex.lock();
if ( m_font != NULL )
if ( m_font != nullptr )
{
s_fontsMutex.lock();
--(m_font->refCount);
@@ -354,7 +354,7 @@ void sf2Instrument::freeFont()
}
s_fontsMutex.unlock();
m_font = NULL;
m_font = nullptr;
}
m_synthMutex.unlock();
}
@@ -588,13 +588,13 @@ void sf2Instrument::reloadSynth()
if( m_internalSampleRate < Engine::audioEngine()->processingSampleRate() )
{
m_synthMutex.lock();
if( m_srcState != NULL )
if( m_srcState != nullptr )
{
src_delete( m_srcState );
}
int error;
m_srcState = src_new( Engine::audioEngine()->currentQualitySettings().libsrcInterpolation(), DEFAULT_CHANNELS, &error );
if( m_srcState == NULL || error )
if( m_srcState == nullptr || error )
{
qCritical("error while creating libsamplerate data structure in Sf2Instrument::reloadSynth()");
}
@@ -641,7 +641,7 @@ void sf2Instrument::playNote( NotePlayHandle * _n, sampleFrame * )
pluginData->midiNote = midiNote;
pluginData->lastPanning = 0;
pluginData->lastVelocity = _n->midiVelocity( baseVelocity );
pluginData->fluidVoice = NULL;
pluginData->fluidVoice = nullptr;
pluginData->isNew = true;
pluginData->offset = _n->offset();
pluginData->noteOffSent = false;
@@ -749,7 +749,7 @@ void sf2Instrument::play( sampleFrame * _working_buffer )
if( m_playingNotes.isEmpty() )
{
renderFrames( frames, _working_buffer );
instrumentTrack()->processAudioBuffer( _working_buffer, frames, NULL );
instrumentTrack()->processAudioBuffer( _working_buffer, frames, nullptr );
return;
}
@@ -807,7 +807,7 @@ void sf2Instrument::play( sampleFrame * _working_buffer )
{
renderFrames( frames - currentFrame, _working_buffer + currentFrame );
}
instrumentTrack()->processAudioBuffer( _working_buffer, frames, NULL );
instrumentTrack()->processAudioBuffer( _working_buffer, frames, nullptr );
}
@@ -815,7 +815,7 @@ void sf2Instrument::renderFrames( f_cnt_t frames, sampleFrame * buf )
{
m_synthMutex.lock();
if( m_internalSampleRate < Engine::audioEngine()->processingSampleRate() &&
m_srcState != NULL )
m_srcState != nullptr )
{
const fpp_t f = frames * m_internalSampleRate / Engine::audioEngine()->processingSampleRate();
#ifdef __GNUC__
@@ -1135,7 +1135,7 @@ void sf2InstrumentView::showFileDialog()
{
sf2Instrument * k = castModel<sf2Instrument>();
FileDialog ofd( NULL, tr( "Open SoundFont file" ) );
FileDialog ofd( nullptr, tr( "Open SoundFont file" ) );
ofd.setFileMode( FileDialog::ExistingFiles );
QStringList types;

View File

@@ -68,8 +68,8 @@ Plugin::Descriptor PLUGIN_EXPORT sfxr_plugin_descriptor =
0x0100,
Plugin::Instrument,
new PluginPixmapLoader( "logo" ),
NULL,
NULL,
nullptr,
nullptr,
} ;
}
@@ -301,7 +301,7 @@ void SfxrSynth::update( sampleFrame * buffer, const int32_t frameNum )
//ssample*=2.0f*sound_vol;
ssample*=0.025f;
if(buffer!=NULL)
if(buffer!=nullptr)
{
if(ssample>1.0f) ssample=1.0f;
if(ssample<-1.0f) ssample=-1.0f;
@@ -459,7 +459,7 @@ void sfxrInstrument::playNote( NotePlayHandle * _n, sampleFrame * _working_buffe
fpp_t frameNum = _n->framesLeftForCurrentPeriod();
const f_cnt_t offset = _n->noteOffset();
if ( _n->totalFramesPlayed() == 0 || _n->m_pluginData == NULL )
if ( _n->totalFramesPlayed() == 0 || _n->m_pluginData == nullptr )
{
_n->m_pluginData = new SfxrSynth( this );
}
@@ -603,7 +603,7 @@ sfxrInstrumentView::sfxrInstrumentView( Instrument * _instrument,
QWidget * _parent ) :
InstrumentViewFixedSize( _instrument, _parent )
{
srand(time(NULL));
srand(time(nullptr));
setAutoFillBackground( true );
QPalette pal;
pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap( "artwork" ) );

View File

@@ -41,8 +41,8 @@ Plugin::Descriptor PLUGIN_EXPORT stereoenhancer_plugin_descriptor =
0x0100,
Plugin::Effect,
new PluginPixmapLoader("logo"),
NULL,
NULL,
nullptr,
nullptr,
} ;
}

View File

@@ -41,8 +41,8 @@ Plugin::Descriptor PLUGIN_EXPORT stereomatrix_plugin_descriptor =
0x0100,
Plugin::Effect,
new PluginPixmapLoader("logo"),
NULL,
NULL,
nullptr,
nullptr,
} ;
}

View File

@@ -56,8 +56,8 @@ Plugin::Descriptor PLUGIN_EXPORT malletsstk_plugin_descriptor =
0x0100,
Plugin::Instrument,
new PluginPixmapLoader( "logo" ),
NULL,
NULL,
nullptr,
nullptr,
} ;
}
@@ -288,7 +288,7 @@ void malletsInstrument::playNote( NotePlayHandle * _n,
int p = m_presetsModel.value();
const float freq = _n->frequency();
if ( _n->totalFramesPlayed() == 0 || _n->m_pluginData == NULL )
if ( _n->totalFramesPlayed() == 0 || _n->m_pluginData == nullptr )
{
// If newer projects, adjust velocity to within stk's limits
float velocityAdjust =
@@ -415,7 +415,7 @@ malletsInstrumentView::malletsInstrumentView( malletsInstrument * _instrument,
m_spreadKnob->setHintText( tr( "Spread:" ), "" );
// try to inform user about missing Stk-installation
if( _instrument->m_filesMissing && gui != NULL )
if( _instrument->m_filesMissing && getGUI() != nullptr )
{
QMessageBox::information( 0, tr( "Missing files" ),
tr( "Your Stk-installation seems to be "
@@ -641,7 +641,7 @@ malletsSynth::malletsSynth( const StkFloat _pitch,
}
catch( ... )
{
m_voice = NULL;
m_voice = nullptr;
}
m_delay = new StkFloat[256];
@@ -690,7 +690,7 @@ malletsSynth::malletsSynth( const StkFloat _pitch,
}
catch( ... )
{
m_voice = NULL;
m_voice = nullptr;
}
m_delay = new StkFloat[256];
@@ -741,7 +741,7 @@ malletsSynth::malletsSynth( const StkFloat _pitch,
}
catch( ... )
{
m_voice = NULL;
m_voice = nullptr;
}
m_delay = new StkFloat[256];

View File

@@ -92,7 +92,7 @@ public:
inline sample_t nextSampleLeft()
{
if( m_voice == NULL )
if( m_voice == nullptr )
{
return( 0.0f );
}

View File

@@ -56,8 +56,8 @@ Plugin::Descriptor PLUGIN_EXPORT tripleoscillator_plugin_descriptor =
0x0110,
Plugin::Instrument,
new PluginPixmapLoader( "logo" ),
NULL,
NULL,
nullptr,
nullptr,
} ;
}
@@ -312,7 +312,7 @@ QString TripleOscillator::nodeName() const
void TripleOscillator::playNote( NotePlayHandle * _n,
sampleFrame * _working_buffer )
{
if( _n->totalFramesPlayed() == 0 || _n->m_pluginData == NULL )
if( _n->totalFramesPlayed() == 0 || _n->m_pluginData == nullptr )
{
Oscillator * oscs_l[NUM_OF_OSCILLATORS];
Oscillator * oscs_r[NUM_OF_OSCILLATORS];
@@ -453,7 +453,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument,
const int osc_h = 52;
// TODO: clean rewrite using layouts and all that...
PixmapButton * pm_osc1_btn = new PixmapButton( this, NULL );
PixmapButton * pm_osc1_btn = new PixmapButton( this, nullptr );
pm_osc1_btn->move( mod_x, mod1_y );
pm_osc1_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"pm_active" ) );
@@ -461,7 +461,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument,
"pm_inactive" ) );
ToolTip::add( pm_osc1_btn, tr( "Modulate phase of oscillator 1 by oscillator 2" ) );
PixmapButton * am_osc1_btn = new PixmapButton( this, NULL );
PixmapButton * am_osc1_btn = new PixmapButton( this, nullptr );
am_osc1_btn->move( mod_x + 35, mod1_y );
am_osc1_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"am_active" ) );
@@ -469,7 +469,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument,
"am_inactive" ) );
ToolTip::add( am_osc1_btn, tr( "Modulate amplitude of oscillator 1 by oscillator 2" ) );
PixmapButton * mix_osc1_btn = new PixmapButton( this, NULL );
PixmapButton * mix_osc1_btn = new PixmapButton( this, nullptr );
mix_osc1_btn->move( mod_x + 70, mod1_y );
mix_osc1_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"mix_active" ) );
@@ -477,7 +477,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument,
"mix_inactive" ) );
ToolTip::add( mix_osc1_btn, tr( "Mix output of oscillators 1 & 2" ) );
PixmapButton * sync_osc1_btn = new PixmapButton( this, NULL );
PixmapButton * sync_osc1_btn = new PixmapButton( this, nullptr );
sync_osc1_btn->move( mod_x + 105, mod1_y );
sync_osc1_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"sync_active" ) );
@@ -486,7 +486,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument,
ToolTip::add( sync_osc1_btn, tr( "Synchronize oscillator 1 with "
"oscillator 2" ) );
PixmapButton * fm_osc1_btn = new PixmapButton( this, NULL );
PixmapButton * fm_osc1_btn = new PixmapButton( this, nullptr );
fm_osc1_btn->move( mod_x + 140, mod1_y );
fm_osc1_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"fm_active" ) );
@@ -503,7 +503,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument,
PixmapButton * pm_osc2_btn = new PixmapButton( this, NULL );
PixmapButton * pm_osc2_btn = new PixmapButton( this, nullptr );
pm_osc2_btn->move( mod_x, mod2_y );
pm_osc2_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"pm_active" ) );
@@ -511,7 +511,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument,
"pm_inactive" ) );
ToolTip::add( pm_osc2_btn, tr( "Modulate phase of oscillator 2 by oscillator 3" ) );
PixmapButton * am_osc2_btn = new PixmapButton( this, NULL );
PixmapButton * am_osc2_btn = new PixmapButton( this, nullptr );
am_osc2_btn->move( mod_x + 35, mod2_y );
am_osc2_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"am_active" ) );
@@ -519,7 +519,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument,
"am_inactive" ) );
ToolTip::add( am_osc2_btn, tr( "Modulate amplitude of oscillator 2 by oscillator 3" ) );
PixmapButton * mix_osc2_btn = new PixmapButton( this, NULL );
PixmapButton * mix_osc2_btn = new PixmapButton( this, nullptr );
mix_osc2_btn->move( mod_x + 70, mod2_y );
mix_osc2_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"mix_active" ) );
@@ -527,7 +527,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument,
"mix_inactive" ) );
ToolTip::add( mix_osc2_btn, tr("Mix output of oscillators 2 & 3" ) );
PixmapButton * sync_osc2_btn = new PixmapButton( this, NULL );
PixmapButton * sync_osc2_btn = new PixmapButton( this, nullptr );
sync_osc2_btn->move( mod_x + 105, mod2_y );
sync_osc2_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"sync_active" ) );
@@ -535,7 +535,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument,
"sync_inactive" ) );
ToolTip::add( sync_osc2_btn, tr( "Synchronize oscillator 2 with oscillator 3" ) );
PixmapButton * fm_osc2_btn = new PixmapButton( this, NULL );
PixmapButton * fm_osc2_btn = new PixmapButton( this, nullptr );
fm_osc2_btn->move( mod_x + 140, mod2_y );
fm_osc2_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"fm_active" ) );
@@ -605,7 +605,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument,
int btn_y = 96 + i * osc_h;
PixmapButton * sin_wave_btn = new PixmapButton( this, NULL );
PixmapButton * sin_wave_btn = new PixmapButton( this, nullptr );
sin_wave_btn->move( 128, btn_y );
sin_wave_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"sin_shape_active" ) );
@@ -615,7 +615,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument,
tr( "Sine wave" ) );
PixmapButton * triangle_wave_btn =
new PixmapButton( this, NULL );
new PixmapButton( this, nullptr );
triangle_wave_btn->move( 143, btn_y );
triangle_wave_btn->setActiveGraphic(
PLUGIN_NAME::getIconPixmap( "triangle_shape_active" ) );
@@ -624,7 +624,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument,
ToolTip::add( triangle_wave_btn,
tr( "Triangle wave") );
PixmapButton * saw_wave_btn = new PixmapButton( this, NULL );
PixmapButton * saw_wave_btn = new PixmapButton( this, nullptr );
saw_wave_btn->move( 158, btn_y );
saw_wave_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"saw_shape_active" ) );
@@ -633,7 +633,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument,
ToolTip::add( saw_wave_btn,
tr( "Saw wave" ) );
PixmapButton * sqr_wave_btn = new PixmapButton( this, NULL );
PixmapButton * sqr_wave_btn = new PixmapButton( this, nullptr );
sqr_wave_btn->move( 173, btn_y );
sqr_wave_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"square_shape_active" ) );
@@ -643,7 +643,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument,
tr( "Square wave" ) );
PixmapButton * moog_saw_wave_btn =
new PixmapButton( this, NULL );
new PixmapButton( this, nullptr );
moog_saw_wave_btn->move( 188, btn_y );
moog_saw_wave_btn->setActiveGraphic(
PLUGIN_NAME::getIconPixmap( "moog_saw_shape_active" ) );
@@ -652,7 +652,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument,
ToolTip::add( moog_saw_wave_btn,
tr( "Moog-like saw wave" ) );
PixmapButton * exp_wave_btn = new PixmapButton( this, NULL );
PixmapButton * exp_wave_btn = new PixmapButton( this, nullptr );
exp_wave_btn->move( 203, btn_y );
exp_wave_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"exp_shape_active" ) );
@@ -661,7 +661,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument,
ToolTip::add( exp_wave_btn,
tr( "Exponential wave" ) );
PixmapButton * white_noise_btn = new PixmapButton( this, NULL );
PixmapButton * white_noise_btn = new PixmapButton( this, nullptr );
white_noise_btn->move( 218, btn_y );
white_noise_btn->setActiveGraphic(
PLUGIN_NAME::getIconPixmap( "white_noise_shape_active" ) );
@@ -670,7 +670,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument,
ToolTip::add( white_noise_btn,
tr( "White noise" ) );
PixmapButton * uwb = new PixmapButton( this, NULL );
PixmapButton * uwb = new PixmapButton( this, nullptr );
uwb->move( 233, btn_y );
uwb->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"usr_shape_active" ) );
@@ -678,7 +678,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument,
"usr_shape_inactive" ) );
ToolTip::add( uwb, tr( "User-defined wave" ) );
PixmapButton * uwt = new PixmapButton( this, NULL );
PixmapButton * uwt = new PixmapButton( this, nullptr );
uwt->move( 110, btn_y );
uwt->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
"wavetable_active" ) );

View File

@@ -79,7 +79,7 @@ Plugin::Descriptor Q_DECL_EXPORT vestige_plugin_descriptor =
Plugin::Instrument,
new PluginPixmapLoader( "logo" ),
"dll",
NULL,
nullptr,
} ;
}
@@ -121,7 +121,7 @@ public:
return;
}
if ( embedMethod() != "none" ) {
m_pluginSubWindow.reset(new vstSubWin( gui->mainWindow()->workspace() ));
m_pluginSubWindow.reset(new vstSubWin( getGUI()->mainWindow()->workspace() ));
VstPlugin::createUI( m_pluginSubWindow.get() );
m_pluginSubWindow->setWidget(pluginWidget());
} else {
@@ -141,18 +141,18 @@ private:
};
QPixmap * VestigeInstrumentView::s_artwork = NULL;
QPixmap * manageVestigeInstrumentView::s_artwork = NULL;
QPixmap * VestigeInstrumentView::s_artwork = nullptr;
QPixmap * manageVestigeInstrumentView::s_artwork = nullptr;
vestigeInstrument::vestigeInstrument( InstrumentTrack * _instrument_track ) :
Instrument( _instrument_track, &vestige_plugin_descriptor ),
m_plugin( NULL ),
m_plugin( nullptr ),
m_pluginMutex(),
m_subWindow( NULL ),
m_scrollArea( NULL ),
knobFModel( NULL ),
p_subWindow( NULL )
m_subWindow( nullptr ),
m_scrollArea( nullptr ),
knobFModel( nullptr ),
p_subWindow( nullptr )
{
// now we need a play-handle which cares for calling play()
InstrumentPlayHandle * iph = new InstrumentPlayHandle( this, _instrument_track );
@@ -168,14 +168,14 @@ vestigeInstrument::vestigeInstrument( InstrumentTrack * _instrument_track ) :
vestigeInstrument::~vestigeInstrument()
{
if (p_subWindow != NULL) {
if (p_subWindow != nullptr) {
delete p_subWindow;
p_subWindow = NULL;
p_subWindow = nullptr;
}
if (knobFModel != NULL) {
if (knobFModel != nullptr) {
delete []knobFModel;
knobFModel = NULL;
knobFModel = nullptr;
}
Engine::audioEngine()->removePlayHandlesOfTypes( instrumentTrack(),
@@ -197,11 +197,11 @@ void vestigeInstrument::loadSettings( const QDomElement & _this )
loadFile( plugin );
m_pluginMutex.lock();
if( m_plugin != NULL )
if( m_plugin != nullptr )
{
m_plugin->loadSettings( _this );
if (instrumentTrack() != NULL && instrumentTrack()->isPreviewMode())
if (instrumentTrack() != nullptr && instrumentTrack()->isPreviewMode())
{
m_plugin->hideUI();
}
@@ -246,7 +246,7 @@ void vestigeInstrument::setParameter( Model * action )
{
int knobUNID = action->displayName().toInt();
if ( m_plugin != NULL ) {
if ( m_plugin != nullptr ) {
m_plugin->setParam( knobUNID, knobFModel[knobUNID]->value() );
}
}
@@ -274,10 +274,10 @@ void vestigeInstrument::saveSettings( QDomDocument & _doc, QDomElement & _this )
{
_this.setAttribute( "plugin", PathUtil::toShortestRelative(m_pluginDLL) );
m_pluginMutex.lock();
if( m_plugin != NULL )
if( m_plugin != nullptr )
{
m_plugin->saveSettings( _doc, _this );
if (knobFModel != NULL) {
if (knobFModel != nullptr) {
const QMap<QString, QString> & dump = m_plugin->parameterDump();
paramCount = dump.size();
char paramStr[35];
@@ -330,7 +330,7 @@ QString vestigeInstrument::nodeName( void ) const
void vestigeInstrument::loadFile( const QString & _file )
{
m_pluginMutex.lock();
const bool set_ch_name = ( m_plugin != NULL &&
const bool set_ch_name = ( m_plugin != nullptr &&
instrumentTrack()->name() == m_plugin->name() ) ||
instrumentTrack()->name() == InstrumentTrack::tr( "Default preset" ) ||
instrumentTrack()->name() == displayName();
@@ -338,17 +338,17 @@ void vestigeInstrument::loadFile( const QString & _file )
m_pluginMutex.unlock();
// if the same is loaded don't load again (for preview)
if (instrumentTrack() != NULL && instrumentTrack()->isPreviewMode() &&
if (instrumentTrack() != nullptr && instrumentTrack()->isPreviewMode() &&
m_pluginDLL == PathUtil::toShortestRelative( _file ))
return;
if ( m_plugin != NULL )
if ( m_plugin != nullptr )
{
closePlugin();
}
m_pluginDLL = PathUtil::toShortestRelative( _file );
TextFloat * tf = NULL;
if( gui )
TextFloat * tf = nullptr;
if( getGUI() != nullptr )
{
tf = TextFloat::displayMessage(
tr( "Loading plugin" ),
@@ -368,7 +368,7 @@ void vestigeInstrument::loadFile( const QString & _file )
return;
}
if ( !(instrumentTrack() != NULL && instrumentTrack()->isPreviewMode()))
if ( !(instrumentTrack() != nullptr && instrumentTrack()->isPreviewMode()))
{
m_plugin->createUI(nullptr);
m_plugin->showUI();
@@ -395,15 +395,15 @@ void vestigeInstrument::play( sampleFrame * _buf )
const fpp_t frames = Engine::audioEngine()->framesPerPeriod();
if( m_plugin == NULL )
if( m_plugin == nullptr )
{
m_pluginMutex.unlock();
return;
}
m_plugin->process( NULL, _buf );
m_plugin->process( nullptr, _buf );
instrumentTrack()->processAudioBuffer( _buf, frames, NULL );
instrumentTrack()->processAudioBuffer( _buf, frames, nullptr );
m_pluginMutex.unlock();
}
@@ -414,7 +414,7 @@ void vestigeInstrument::play( sampleFrame * _buf )
bool vestigeInstrument::handleMidiEvent( const MidiEvent& event, const TimePos& time, f_cnt_t offset )
{
m_pluginMutex.lock();
if( m_plugin != NULL )
if( m_plugin != nullptr )
{
m_plugin->processMidiEvent( event, offset );
}
@@ -429,7 +429,7 @@ bool vestigeInstrument::handleMidiEvent( const MidiEvent& event, const TimePos&
void vestigeInstrument::closePlugin( void )
{
// disconnect all signals
if( knobFModel != NULL )
if( knobFModel != nullptr )
{
for( int i = 0; i < paramCount; i++ )
{
@@ -437,38 +437,38 @@ void vestigeInstrument::closePlugin( void )
}
}
if( knobFModel != NULL )
if( knobFModel != nullptr )
{
delete [] knobFModel;
knobFModel = NULL;
knobFModel = nullptr;
}
if( m_scrollArea != NULL )
if( m_scrollArea != nullptr )
{
// delete m_scrollArea;
m_scrollArea = NULL;
m_scrollArea = nullptr;
}
if( m_subWindow != NULL )
if( m_subWindow != nullptr )
{
m_subWindow->setAttribute( Qt::WA_DeleteOnClose );
m_subWindow->close();
if( m_subWindow != NULL )
if( m_subWindow != nullptr )
{
delete m_subWindow;
}
m_subWindow = NULL;
m_subWindow = nullptr;
}
if( p_subWindow != NULL )
if( p_subWindow != nullptr )
{
p_subWindow = NULL;
p_subWindow = nullptr;
}
m_pluginMutex.lock();
delete m_plugin;
m_plugin = NULL;
m_plugin = nullptr;
m_pluginMutex.unlock();
}
@@ -488,7 +488,7 @@ VestigeInstrumentView::VestigeInstrumentView( Instrument * _instrument,
InstrumentViewFixedSize( _instrument, _parent ),
lastPosInMenu (0)
{
if( s_artwork == NULL )
if( s_artwork == nullptr )
{
s_artwork = new QPixmap( PLUGIN_NAME::getIconPixmap(
"artwork" ) );
@@ -611,9 +611,9 @@ VestigeInstrumentView::VestigeInstrumentView( Instrument * _instrument,
void VestigeInstrumentView::managePlugin( void )
{
if ( m_vi->m_plugin != NULL && m_vi->m_subWindow == NULL ) {
if ( m_vi->m_plugin != nullptr && m_vi->m_subWindow == nullptr ) {
m_vi->p_subWindow = new manageVestigeInstrumentView( _instrument2, _parent2, m_vi);
} else if (m_vi->m_subWindow != NULL) {
} else if (m_vi->m_subWindow != nullptr) {
if (m_vi->m_subWindow->widget()->isVisible() == false ) {
m_vi->m_scrollArea->show();
m_vi->m_subWindow->show();
@@ -629,7 +629,7 @@ void VestigeInstrumentView::updateMenu( void )
{
// get all presets -
if ( m_vi->m_plugin != NULL )
if ( m_vi->m_plugin != nullptr )
{
m_vi->m_plugin->loadProgramNames();
QWidget::update();
@@ -676,7 +676,7 @@ void VestigeInstrumentView::modelChanged()
void VestigeInstrumentView::openPlugin()
{
FileDialog ofd( NULL, tr( "Open VST plugin" ) );
FileDialog ofd( nullptr, tr( "Open VST plugin" ) );
// set filters
QStringList types;
@@ -704,9 +704,9 @@ void VestigeInstrumentView::openPlugin()
}
Engine::audioEngine()->requestChangeInModel();
if (m_vi->p_subWindow != NULL) {
if (m_vi->p_subWindow != nullptr) {
delete m_vi->p_subWindow;
m_vi->p_subWindow = NULL;
m_vi->p_subWindow = nullptr;
}
m_vi->loadFile( ofd.selectedFiles()[0] );
@@ -725,7 +725,7 @@ void VestigeInstrumentView::openPlugin()
void VestigeInstrumentView::openPreset()
{
if ( m_vi->m_plugin != NULL ) {
if ( m_vi->m_plugin != nullptr ) {
m_vi->m_plugin->openPreset( );
bool converted;
QString str = m_vi->m_plugin->currentProgramName().section("/", 0, 0);
@@ -742,7 +742,7 @@ void VestigeInstrumentView::openPreset()
void VestigeInstrumentView::savePreset()
{
if ( m_vi->m_plugin != NULL )
if ( m_vi->m_plugin != nullptr )
{
m_vi->m_plugin->savePreset( );
/* bool converted;
@@ -760,7 +760,7 @@ void VestigeInstrumentView::savePreset()
void VestigeInstrumentView::nextProgram()
{
if ( m_vi->m_plugin != NULL ) {
if ( m_vi->m_plugin != nullptr ) {
m_vi->m_plugin->rotateProgram( 1 );
bool converted;
QString str = m_vi->m_plugin->currentProgramName().section("/", 0, 0);
@@ -776,7 +776,7 @@ void VestigeInstrumentView::nextProgram()
void VestigeInstrumentView::previousProgram()
{
if ( m_vi->m_plugin != NULL ) {
if ( m_vi->m_plugin != nullptr ) {
m_vi->m_plugin->rotateProgram( -1 );
bool converted;
QString str = m_vi->m_plugin->currentProgramName().section("/", 0, 0);
@@ -794,7 +794,7 @@ void VestigeInstrumentView::selPreset( void )
QAction *action = qobject_cast<QAction *>(sender());
if (action)
if ( m_vi->m_plugin != NULL ) {
if ( m_vi->m_plugin != nullptr ) {
lastPosInMenu = action->data().toInt();
m_vi->m_plugin->setProgram( action->data().toInt() );
QWidget::update();
@@ -806,7 +806,7 @@ void VestigeInstrumentView::selPreset( void )
void VestigeInstrumentView::toggleGUI( void )
{
if( m_vi == NULL || m_vi->m_plugin == NULL )
if( m_vi == nullptr || m_vi->m_plugin == nullptr )
{
return;
}
@@ -819,7 +819,7 @@ void VestigeInstrumentView::toggleGUI( void )
void VestigeInstrumentView::noteOffAll( void )
{
m_vi->m_pluginMutex.lock();
if( m_vi->m_plugin != NULL )
if( m_vi->m_plugin != nullptr )
{
for( int key = 0; key <= MidiMaxKey; ++key )
{
@@ -881,7 +881,7 @@ void VestigeInstrumentView::paintEvent( QPaintEvent * )
p.drawPixmap( 0, 0, *s_artwork );
QString plugin_name = ( m_vi->m_plugin != NULL ) ?
QString plugin_name = ( m_vi->m_plugin != nullptr ) ?
m_vi->m_plugin->name()/* + QString::number(
m_plugin->version() )*/
:
@@ -896,7 +896,7 @@ void VestigeInstrumentView::paintEvent( QPaintEvent * )
p.drawText( 10, 211, tr( "Preset" ) );
// m_pluginMutex.lock();
if( m_vi->m_plugin != NULL )
if( m_vi->m_plugin != nullptr )
{
p.setPen( QColor( 0, 0, 0 ) );
f.setBold( false );
@@ -907,7 +907,7 @@ void VestigeInstrumentView::paintEvent( QPaintEvent * )
p.drawText( 10, 225, m_vi->m_plugin->currentProgramName() );
}
if( m_vi->m_subWindow != NULL )
if( m_vi->m_subWindow != nullptr )
{
m_vi->m_subWindow->setWindowTitle( m_vi->instrumentTrack()->name()
+ tr( " - VST plugin control" ) );
@@ -927,7 +927,7 @@ manageVestigeInstrumentView::manageVestigeInstrumentView( Instrument * _instrume
widget = new QWidget(this);
l = new QGridLayout( this );
m_vi->m_subWindow = gui->mainWindow()->addWindowedWidget(NULL, Qt::SubWindow |
m_vi->m_subWindow = getGUI()->mainWindow()->addWindowedWidget(nullptr, Qt::SubWindow |
Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint);
m_vi->m_subWindow->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::MinimumExpanding );
m_vi->m_subWindow->setFixedWidth( 960 );
@@ -974,7 +974,7 @@ manageVestigeInstrumentView::manageVestigeInstrumentView( Instrument * _instrume
vstKnobs = new CustomTextKnob *[ m_vi->paramCount ];
bool hasKnobModel = true;
if (m_vi->knobFModel == NULL) {
if (m_vi->knobFModel == nullptr) {
m_vi->knobFModel = new FloatModel *[ m_vi->paramCount ];
hasKnobModel = false;
}
@@ -1094,7 +1094,7 @@ void manageVestigeInstrumentView::displayAutomatedOnly( void )
manageVestigeInstrumentView::~manageVestigeInstrumentView()
{
if( m_vi->knobFModel != NULL )
if( m_vi->knobFModel != nullptr )
{
for( int i = 0; i < m_vi->paramCount; i++ )
{
@@ -1103,32 +1103,32 @@ manageVestigeInstrumentView::~manageVestigeInstrumentView()
}
}
if (vstKnobs != NULL) {
if (vstKnobs != nullptr) {
delete []vstKnobs;
vstKnobs = NULL;
vstKnobs = nullptr;
}
if( m_vi->knobFModel != NULL )
if( m_vi->knobFModel != nullptr )
{
delete [] m_vi->knobFModel;
m_vi->knobFModel = NULL;
m_vi->knobFModel = nullptr;
}
if (m_vi->m_scrollArea != NULL) {
if (m_vi->m_scrollArea != nullptr) {
delete m_vi->m_scrollArea;
m_vi->m_scrollArea = NULL;
m_vi->m_scrollArea = nullptr;
}
if ( m_vi->m_subWindow != NULL ) {
if ( m_vi->m_subWindow != nullptr ) {
m_vi->m_subWindow->setAttribute(Qt::WA_DeleteOnClose);
m_vi->m_subWindow->close();
if ( m_vi->m_subWindow != NULL )
if ( m_vi->m_subWindow != nullptr )
delete m_vi->m_subWindow;
m_vi->m_subWindow = NULL;
m_vi->m_subWindow = nullptr;
}
m_vi->p_subWindow = NULL;
m_vi->p_subWindow = nullptr;
}
@@ -1138,7 +1138,7 @@ void manageVestigeInstrumentView::setParameter( Model * action )
{
int knobUNID = action->displayName().toInt();
if ( m_vi->m_plugin != NULL ) {
if ( m_vi->m_plugin != nullptr ) {
m_vi->m_plugin->setParam( knobUNID, m_vi->knobFModel[knobUNID]->value() );
syncParameterText();
}

View File

@@ -52,13 +52,13 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on,
int _x, int _y,
QWidget * _parent ):
QWidget( _parent ),
IntModelView( new nineButtonSelectorModel(0, 8, _default, NULL,
IntModelView( new nineButtonSelectorModel(0, 8, _default, nullptr,
QString(), true ), this )
{
setFixedSize( 50, 50 );
move( _x, _y );
m_button = new PixmapButton( this, NULL );
m_button = new PixmapButton( this, nullptr );
m_button->move( 1, 1 );
m_button->setActiveGraphic( _button0_on );
m_button->setInactiveGraphic( _button0_off );
@@ -67,7 +67,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on,
this, SLOT ( button0Clicked() ) );
m_buttons.append( m_button );
m_button = new PixmapButton( this, NULL );
m_button = new PixmapButton( this, nullptr );
m_button->move( 18, 1 );
m_button->setActiveGraphic( _button1_on );
m_button->setInactiveGraphic( _button1_off );
@@ -76,7 +76,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on,
this, SLOT ( button1Clicked() ) );
m_buttons.append( m_button );
m_button = new PixmapButton( this, NULL );
m_button = new PixmapButton( this, nullptr );
m_button->move( 35, 1 );
m_button->setActiveGraphic( _button2_on );
m_button->setInactiveGraphic( _button2_off );
@@ -85,7 +85,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on,
this, SLOT ( button2Clicked() ) );
m_buttons.append( m_button );
m_button = new PixmapButton( this, NULL );
m_button = new PixmapButton( this, nullptr );
m_button->move( 1, 18 );
m_button->setActiveGraphic( _button3_on );
m_button->setInactiveGraphic( _button3_off );
@@ -94,7 +94,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on,
this, SLOT ( button3Clicked() ) );
m_buttons.append( m_button );
m_button = new PixmapButton( this, NULL );
m_button = new PixmapButton( this, nullptr );
m_button->move( 18, 18 );
m_button->setActiveGraphic( _button4_on );
m_button->setInactiveGraphic( _button4_off );
@@ -103,7 +103,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on,
this, SLOT ( button4Clicked() ) );
m_buttons.append( m_button );
m_button = new PixmapButton( this, NULL );
m_button = new PixmapButton( this, nullptr );
m_button->move( 35, 18 );
m_button->setActiveGraphic( _button5_on );
m_button->setInactiveGraphic( _button5_off );
@@ -112,7 +112,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on,
this, SLOT ( button5Clicked() ) );
m_buttons.append( m_button );
m_button = new PixmapButton( this, NULL );
m_button = new PixmapButton( this, nullptr );
m_button->move( 1, 35 );
m_button->setActiveGraphic( _button6_on );
m_button->setInactiveGraphic( _button6_off );
@@ -121,7 +121,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on,
this, SLOT ( button6Clicked() ) );
m_buttons.append( m_button );
m_button = new PixmapButton( this, NULL );
m_button = new PixmapButton( this, nullptr );
m_button->move( 18, 35 );
m_button->setActiveGraphic( _button7_on );
m_button->setInactiveGraphic( _button7_off );
@@ -130,7 +130,7 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on,
this, SLOT ( button7Clicked() ) );
m_buttons.append( m_button );
m_button = new PixmapButton( this, NULL );
m_button = new PixmapButton( this, nullptr );
m_button->move( 35, 35 );
m_button->setActiveGraphic( _button8_on );
m_button->setInactiveGraphic( _button8_off );

View File

@@ -54,8 +54,8 @@ Plugin::Descriptor PLUGIN_EXPORT vibedstrings_plugin_descriptor =
0x0100,
Plugin::Instrument,
new PluginPixmapLoader( "logo" ),
NULL,
NULL,
nullptr,
nullptr,
};
}
@@ -273,7 +273,7 @@ QString vibed::nodeName() const
void vibed::playNote( NotePlayHandle * _n, sampleFrame * _working_buffer )
{
if ( _n->totalFramesPlayed() == 0 || _n->m_pluginData == NULL )
if ( _n->totalFramesPlayed() == 0 || _n->m_pluginData == nullptr )
{
_n->m_pluginData = new stringContainer( _n->frequency(),
Engine::audioEngine()->processingSampleRate(),

View File

@@ -110,7 +110,7 @@ vibratingString::delayLine * vibratingString::initDelayLine( int _len,
}
else
{
dl->data = NULL;
dl->data = nullptr;
}
dl->pointer = dl->data;

View File

@@ -120,9 +120,9 @@ static bool HEADLESS = false;
class RemoteVstPlugin;
RemoteVstPlugin * __plugin = NULL;
RemoteVstPlugin * __plugin = nullptr;
HWND __MessageHwnd = NULL;
HWND __MessageHwnd = nullptr;
DWORD __processingThreadId = 0;
@@ -135,7 +135,7 @@ std::string GetErrorAsString(DWORD errorMessageID)
LPSTR messageBuffer = nullptr;
size_t size = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, errorMessageID, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&messageBuffer, 0, NULL);
nullptr, errorMessageID, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&messageBuffer, 0, nullptr);
std::string message(messageBuffer, size);
@@ -174,7 +174,7 @@ public:
{
SuspendPlugin suspend( this );
pluginDispatch( effSetSampleRate, 0, 0,
NULL, (float) sampleRate() );
nullptr, (float) sampleRate() );
}
// set given buffer-size for plugin
@@ -377,7 +377,7 @@ private:
bool load( const std::string & _plugin_file );
int pluginDispatch( int cmd, int param1 = 0, int param2 = 0,
void * p = NULL, float f = 0 )
void * p = nullptr, float f = 0 )
{
if( m_plugin )
{
@@ -444,9 +444,9 @@ RemoteVstPlugin::RemoteVstPlugin( key_t _shm_in, key_t _shm_out ) :
RemoteVstPlugin::RemoteVstPlugin( const char * socketPath ) :
RemotePluginClient( socketPath ),
#endif
m_libInst( NULL ),
m_plugin( NULL ),
m_window( NULL ),
m_libInst( nullptr ),
m_plugin( nullptr ),
m_window( nullptr ),
m_windowID( 0 ),
m_windowWidth( 0 ),
m_windowHeight( 0 ),
@@ -455,16 +455,16 @@ RemoteVstPlugin::RemoteVstPlugin( const char * socketPath ) :
m_processing( false ),
m_messageList(),
m_shouldGiveIdle( false ),
m_inputs( NULL ),
m_outputs( NULL ),
m_inputs( nullptr ),
m_outputs( nullptr ),
m_shmValid( false ),
m_midiEvents(),
m_bpm( 0 ),
m_currentSamplePos( 0 ),
m_currentProgram( -1 ),
m_in( NULL ),
m_in( nullptr ),
m_shmID( -1 ),
m_vstSyncData( NULL )
m_vstSyncData( nullptr )
{
__plugin = this;
@@ -492,7 +492,7 @@ RemoteVstPlugin::RemoteVstPlugin( const char * socketPath ) :
#else
m_vstSyncData = RemotePluginClient::getQtVSTshm();
#endif
if( m_vstSyncData == NULL )
if( m_vstSyncData == nullptr )
{
fprintf(stderr, "RemoteVstPlugin.cpp: "
"Failed to initialize shared memory for VST synchronization.\n"
@@ -541,18 +541,18 @@ RemoteVstPlugin::~RemoteVstPlugin()
{
perror( "~RemoteVstPlugin::shmdt" );
}
if( m_vstSyncData != NULL )
if( m_vstSyncData != nullptr )
{
delete m_vstSyncData;
m_vstSyncData = NULL;
m_vstSyncData = nullptr;
}
}
#endif
if( m_libInst != NULL )
if( m_libInst != nullptr )
{
FreeLibrary( m_libInst );
m_libInst = NULL;
m_libInst = nullptr;
}
delete[] m_inputs;
@@ -766,8 +766,8 @@ void RemoteVstPlugin::initEditor()
}
HMODULE hInst = GetModuleHandle( NULL );
if( hInst == NULL )
HMODULE hInst = GetModuleHandle( nullptr );
if( hInst == nullptr )
{
debugMessage( "initEditor(): can't get module handle\n" );
return;
@@ -783,8 +783,8 @@ void RemoteVstPlugin::initEditor()
m_window = CreateWindowEx( WS_EX_APPWINDOW, "LVSL", pluginName(),
dwStyle,
0, 0, 10, 10, NULL, NULL, hInst, NULL );
if( m_window == NULL )
0, 0, 10, 10, nullptr, nullptr, hInst, nullptr );
if( m_window == nullptr )
{
debugMessage( "initEditor(): cannot create editor window\n" );
return;
@@ -839,7 +839,7 @@ void RemoteVstPlugin::hideEditor() {
void RemoteVstPlugin::destroyEditor()
{
if( m_window == NULL )
if( m_window == nullptr )
{
return;
}
@@ -847,7 +847,7 @@ void RemoteVstPlugin::destroyEditor()
pluginDispatch( effEditClose );
// Destroying the window takes some time in Wine 1.8.5
DestroyWindow( m_window );
m_window = NULL;
m_window = nullptr;
}
@@ -855,7 +855,7 @@ void RemoteVstPlugin::destroyEditor()
bool RemoteVstPlugin::load( const std::string & _plugin_file )
{
if( ( m_libInst = LoadLibraryW( toWString(_plugin_file).c_str() ) ) == NULL )
if( ( m_libInst = LoadLibraryW( toWString(_plugin_file).c_str() ) ) == nullptr )
{
DWORD error = GetLastError();
debugMessage( "LoadLibrary failed: " + GetErrorAsString(error) );
@@ -866,24 +866,24 @@ bool RemoteVstPlugin::load( const std::string & _plugin_file )
( audioMasterCallback );
mainEntryPointer mainEntry = (mainEntryPointer)
GetProcAddress( m_libInst, "VSTPluginMain" );
if( mainEntry == NULL )
if( mainEntry == nullptr )
{
mainEntry = (mainEntryPointer)
GetProcAddress( m_libInst, "VstPluginMain" );
}
if( mainEntry == NULL )
if( mainEntry == nullptr )
{
mainEntry = (mainEntryPointer)
GetProcAddress( m_libInst, "main" );
}
if( mainEntry == NULL )
if( mainEntry == nullptr )
{
debugMessage( "could not find entry point\n" );
return false;
}
m_plugin = mainEntry( hostCallback );
if( m_plugin == NULL )
if( m_plugin == nullptr )
{
debugMessage( "mainEntry procedure returned NULL\n" );
return false;
@@ -1181,7 +1181,7 @@ void RemoteVstPlugin::saveChunkToFile( const std::string & _file )
{
if( m_plugin->flags & 32 )
{
void * chunk = NULL;
void * chunk = nullptr;
const int len = pluginDispatch( 23, 0, 0, &chunk );
if( len > 0 )
{
@@ -1312,7 +1312,7 @@ void RemoteVstPlugin::savePreset( const std::string & _file )
unsigned int chunk_size = 0;
sBank * pBank = ( sBank* ) new char[ sizeof( sBank ) ];
char progName[ 128 ] = { 0 };
char* data = NULL;
char* data = nullptr;
const bool chunky = ( m_plugin->flags & ( 1 << 5 ) ) != 0;
bool isPreset = _file.substr( _file.find_last_of( "." ) + 1 ) == "fxp";
int presNameLen = _file.find_last_of( "/" ) + _file.find_last_of( "\\" ) + 2;
@@ -1410,7 +1410,7 @@ void RemoteVstPlugin::savePreset( const std::string & _file )
void RemoteVstPlugin::loadPresetFile( const std::string & _file )
{
void * chunk = NULL;
void * chunk = nullptr;
unsigned int * pLen = new unsigned int[ 1 ];
unsigned int len = 0;
sBank * pBank = (sBank*) new char[ sizeof( sBank ) ];
@@ -1566,8 +1566,8 @@ int RemoteVstPlugin::updateInOutCount()
delete[] m_inputs;
delete[] m_outputs;
m_inputs = NULL;
m_outputs = NULL;
m_inputs = nullptr;
m_outputs = nullptr;
setInputOutputCount( inputCount(), outputCount() );
@@ -1617,7 +1617,7 @@ intptr_t RemoteVstPlugin::hostCallback( AEffect * _effect, int32_t _opcode,
#endif
// workaround for early callbacks by some plugins
if( __plugin && __plugin->m_plugin == NULL )
if( __plugin && __plugin->m_plugin == nullptr )
{
__plugin->m_plugin = _effect;
}
@@ -2074,8 +2074,8 @@ DWORD WINAPI RemoteVstPlugin::processingThread( LPVOID _param )
bool RemoteVstPlugin::setupMessageWindow()
{
HMODULE hInst = GetModuleHandle( NULL );
if( hInst == NULL )
HMODULE hInst = GetModuleHandle( nullptr );
if( hInst == nullptr )
{
__plugin->debugMessage( "setupMessageWindow(): can't get "
"module handle\n" );
@@ -2083,10 +2083,10 @@ bool RemoteVstPlugin::setupMessageWindow()
}
__MessageHwnd = CreateWindowEx( 0, "LVSL", "dummy",
0, 0, 0, 0, 0, NULL, NULL,
hInst, NULL );
0, 0, 0, 0, 0, nullptr, nullptr,
hInst, nullptr );
// install GUI update timer
SetTimer( __MessageHwnd, 1000, 50, NULL );
SetTimer( __MessageHwnd, 1000, 50, nullptr );
return true;
}
@@ -2097,7 +2097,7 @@ bool RemoteVstPlugin::setupMessageWindow()
DWORD WINAPI RemoteVstPlugin::guiEventLoop()
{
MSG msg;
while( GetMessage( &msg, NULL, 0, 0 ) > 0 )
while( GetMessage( &msg, nullptr, 0, 0 ) > 0 )
{
TranslateMessage( &msg );
DispatchMessage( &msg );
@@ -2188,8 +2188,8 @@ int main( int _argc, char * * _argv )
}
#endif
HMODULE hInst = GetModuleHandle( NULL );
if( hInst == NULL )
HMODULE hInst = GetModuleHandle( nullptr );
if( hInst == nullptr )
{
return -1;
}
@@ -2200,10 +2200,10 @@ int main( int _argc, char * * _argv )
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInst;
wc.hIcon = LoadIcon( NULL, IDI_APPLICATION );
wc.hCursor = LoadCursor( NULL, IDC_ARROW );
wc.hbrBackground = NULL;
wc.lpszMenuName = NULL;
wc.hIcon = LoadIcon( nullptr, IDI_APPLICATION );
wc.hCursor = LoadCursor( nullptr, IDC_ARROW );
wc.hbrBackground = nullptr;
wc.lpszMenuName = nullptr;
wc.lpszClassName = "LVSL";
if( !RegisterClass( &wc ) )
@@ -2265,8 +2265,8 @@ int main( int _argc, char * * _argv )
{
return -1;
}
if( CreateThread( NULL, 0, RemoteVstPlugin::processingThread,
__plugin, 0, NULL ) == NULL )
if( CreateThread( nullptr, 0, RemoteVstPlugin::processingThread,
__plugin, 0, nullptr ) == nullptr )
{
__plugin->debugMessage( "could not create "
"processingThread\n" );

View File

@@ -120,7 +120,7 @@ private:
VstPlugin::VstPlugin( const QString & _plugin ) :
m_plugin( PathUtil::toAbsolute(_plugin) ),
m_pluginWindowID( 0 ),
m_embedMethod( gui
m_embedMethod( (getGUI() != nullptr)
? ConfigManager::inst()->vstEmbedMethod()
: "headless" ),
m_version( 0 ),
@@ -243,7 +243,7 @@ void VstPlugin::saveSettings( QDomDocument & _doc, QDomElement & _this )
{
if ( m_embedMethod != "none" )
{
if( pluginWidget() != NULL )
if( pluginWidget() != nullptr )
{
_this.setAttribute( "guivisible", pluginWidget()->isVisible() );
}
@@ -386,13 +386,13 @@ bool VstPlugin::processMessage( const message & _m )
// so this is legal despite MSDN's warning
SetWindowLongPtr( (HWND)(intptr_t) m_pluginWindowID,
GWLP_HWNDPARENT,
(LONG_PTR) gui->mainWindow()->winId() );
(LONG_PTR) getGUI()->mainWindow()->winId() );
#endif
#ifdef LMMS_BUILD_LINUX
XSetTransientForHint( QX11Info::display(),
m_pluginWindowID,
gui->mainWindow()->winId() );
getGUI()->mainWindow()->winId() );
#endif
}
break;
@@ -478,7 +478,7 @@ QWidget *VstPlugin::editor()
void VstPlugin::openPreset( )
{
FileDialog ofd( NULL, tr( "Open Preset" ), "",
FileDialog ofd( nullptr, tr( "Open Preset" ), "",
tr( "Vst Plugin Preset (*.fxp *.fxb)" ) );
ofd.setFileMode( FileDialog::ExistingFiles );
if( ofd.exec () == QDialog::Accepted &&
@@ -558,7 +558,7 @@ void VstPlugin::savePreset( )
QString presName = currentProgramName().isEmpty() ? tr(": default") : currentProgramName();
presName.replace("\"", "'"); // QFileDialog unable to handle double quotes properly
FileDialog sfd( NULL, tr( "Save Preset" ), presName.section(": ", 1, 1) + tr(".fxp"),
FileDialog sfd( nullptr, tr( "Save Preset" ), presName.section(": ", 1, 1) + tr(".fxp"),
tr( "Vst Plugin Preset (*.fxp *.fxb)" ) );
if( p_name != "" ) // remember last directory
@@ -744,7 +744,7 @@ void VstPlugin::createUI( QWidget * parent )
SetWindowLong(pluginHandle, GWL_STYLE, style);
SetParent(pluginHandle, targetHandle);
DWORD threadId = GetWindowThreadProcessId(pluginHandle, NULL);
DWORD threadId = GetWindowThreadProcessId(pluginHandle, nullptr);
DWORD currentThreadId = GetCurrentThreadId();
AttachThreadInput(currentThreadId, threadId, true);

View File

@@ -39,8 +39,8 @@ Plugin::Descriptor VSTBASE_EXPORT vstbase_plugin_descriptor =
"Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>",
0x0100,
Plugin::Library,
NULL,
NULL,
nullptr,
nullptr,
} ;
}

View File

@@ -50,8 +50,8 @@ Plugin::Descriptor PLUGIN_EXPORT watsyn_plugin_descriptor =
0x0100,
Plugin::Instrument,
new PluginPixmapLoader( "logo" ),
NULL,
NULL,
nullptr,
nullptr,
} ;
}
@@ -102,9 +102,9 @@ WatsynObject::~WatsynObject()
void WatsynObject::renderOutput( fpp_t _frames )
{
if( m_abuf == NULL )
if( m_abuf == nullptr )
m_abuf = new sampleFrame[m_fpp];
if( m_bbuf == NULL )
if( m_bbuf == nullptr )
m_bbuf = new sampleFrame[m_fpp];
for( fpp_t frame = 0; frame < _frames; frame++ )
@@ -330,7 +330,7 @@ WatsynInstrument::~WatsynInstrument()
void WatsynInstrument::playNote( NotePlayHandle * _n,
sampleFrame * _working_buffer )
{
if ( _n->totalFramesPlayed() == 0 || _n->m_pluginData == NULL )
if ( _n->totalFramesPlayed() == 0 || _n->m_pluginData == nullptr )
{
WatsynObject * w = new WatsynObject(
&A1_wave[0],
@@ -722,25 +722,25 @@ WatsynView::WatsynView( Instrument * _instrument,
// button groups next.
// graph select buttons
PixmapButton * a1_selectButton = new PixmapButton( this, NULL );
PixmapButton * a1_selectButton = new PixmapButton( this, nullptr );
a1_selectButton -> move( 4, 121 );
a1_selectButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "a1_active" ) );
a1_selectButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "a1_inactive" ) );
ToolTip::add( a1_selectButton, tr( "Select oscillator A1") );
PixmapButton * a2_selectButton = new PixmapButton( this, NULL );
PixmapButton * a2_selectButton = new PixmapButton( this, nullptr );
a2_selectButton -> move( 44, 121 );
a2_selectButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "a2_active" ) );
a2_selectButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "a2_inactive" ) );
ToolTip::add( a2_selectButton, tr( "Select oscillator A2") );
PixmapButton * b1_selectButton = new PixmapButton( this, NULL );
PixmapButton * b1_selectButton = new PixmapButton( this, nullptr );
b1_selectButton -> move( 84, 121 );
b1_selectButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "b1_active" ) );
b1_selectButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "b1_inactive" ) );
ToolTip::add( b1_selectButton, tr( "Select oscillator B1") );
PixmapButton * b2_selectButton = new PixmapButton( this, NULL );
PixmapButton * b2_selectButton = new PixmapButton( this, nullptr );
b2_selectButton -> move( 124, 121 );
b2_selectButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "b2_active" ) );
b2_selectButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "b2_inactive" ) );
@@ -755,25 +755,25 @@ WatsynView::WatsynView( Instrument * _instrument,
m_selectedGraphGroup -> setModel( &w -> m_selectedGraph);
// A-modulation button group
PixmapButton * amod_mixButton = new PixmapButton( this, NULL );
PixmapButton * amod_mixButton = new PixmapButton( this, nullptr );
amod_mixButton -> move( 4, 50 );
amod_mixButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "amix_active" ) );
amod_mixButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "amix_inactive" ) );
ToolTip::add( amod_mixButton, tr( "Mix output of A2 to A1" ) );
PixmapButton * amod_amButton = new PixmapButton( this, NULL );
PixmapButton * amod_amButton = new PixmapButton( this, nullptr );
amod_amButton -> move( 4, 66 );
amod_amButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "aam_active" ) );
amod_amButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "aam_inactive" ) );
ToolTip::add( amod_amButton, tr( "Modulate amplitude of A1 by output of A2" ) );
PixmapButton * amod_rmButton = new PixmapButton( this, NULL );
PixmapButton * amod_rmButton = new PixmapButton( this, nullptr );
amod_rmButton -> move( 4, 82 );
amod_rmButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "arm_active" ) );
amod_rmButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "arm_inactive" ) );
ToolTip::add( amod_rmButton, tr( "Ring modulate A1 and A2" ) );
PixmapButton * amod_pmButton = new PixmapButton( this, NULL );
PixmapButton * amod_pmButton = new PixmapButton( this, nullptr );
amod_pmButton -> move( 4, 98 );
amod_pmButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "apm_active" ) );
amod_pmButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "apm_inactive" ) );
@@ -786,25 +786,25 @@ WatsynView::WatsynView( Instrument * _instrument,
m_aModGroup -> addButton( amod_pmButton );
// B-modulation button group
PixmapButton * bmod_mixButton = new PixmapButton( this, NULL );
PixmapButton * bmod_mixButton = new PixmapButton( this, nullptr );
bmod_mixButton -> move( 44, 50 );
bmod_mixButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "bmix_active" ) );
bmod_mixButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "bmix_inactive" ) );
ToolTip::add( bmod_mixButton, tr( "Mix output of B2 to B1" ) );
PixmapButton * bmod_amButton = new PixmapButton( this, NULL );
PixmapButton * bmod_amButton = new PixmapButton( this, nullptr );
bmod_amButton -> move( 44, 66 );
bmod_amButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "bam_active" ) );
bmod_amButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "bam_inactive" ) );
ToolTip::add( bmod_amButton, tr( "Modulate amplitude of B1 by output of B2" ) );
PixmapButton * bmod_rmButton = new PixmapButton( this, NULL );
PixmapButton * bmod_rmButton = new PixmapButton( this, nullptr );
bmod_rmButton -> move( 44, 82 );
bmod_rmButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "brm_active" ) );
bmod_rmButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "brm_inactive" ) );
ToolTip::add( bmod_rmButton, tr( "Ring modulate B1 and B2" ) );
PixmapButton * bmod_pmButton = new PixmapButton( this, NULL );
PixmapButton * bmod_pmButton = new PixmapButton( this, nullptr );
bmod_pmButton -> move( 44, 98 );
bmod_pmButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "bpm_active" ) );
bmod_pmButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "bpm_inactive" ) );

View File

@@ -44,8 +44,8 @@ Plugin::Descriptor PLUGIN_EXPORT waveshaper_plugin_descriptor =
0x0100,
Plugin::Effect,
new PluginPixmapLoader("logo"),
NULL,
NULL,
nullptr,
nullptr,
} ;
}

View File

@@ -36,14 +36,14 @@
#include "zynaddsubfx/src/Misc/Dump.h"
SYNTH_T* synth = NULL;
SYNTH_T* synth = nullptr;
int LocalZynAddSubFx::s_instanceCount = 0;
LocalZynAddSubFx::LocalZynAddSubFx() :
m_master( NULL ),
m_ioEngine( NULL )
m_master( nullptr ),
m_ioEngine( nullptr )
{
for( int i = 0; i < NumKeys; ++i )
{
@@ -66,7 +66,7 @@ LocalZynAddSubFx::LocalZynAddSubFx() :
synth->oscilsize = config.cfg.OscilSize;
synth->alias();
srand( time( NULL ) );
srand( time( nullptr ) );
denormalkillbuf = new float[synth->buffersize];
for( int i = 0; i < synth->buffersize; ++i )
@@ -195,7 +195,7 @@ void LocalZynAddSubFx::setPresetDir( const std::string & _dir )
void LocalZynAddSubFx::setLmmsWorkingDir( const std::string & _dir )
{
if( config.workingDir != NULL )
if( config.workingDir != nullptr )
{
free( config.workingDir );
}

View File

@@ -62,8 +62,8 @@ public:
sendMessage( IdInitDone );
waitForMessage( IdInitDone );
pthread_mutex_init( &m_guiMutex, NULL );
pthread_create( &m_messageThreadHandle, NULL, messageLoop, this );
pthread_mutex_init( &m_guiMutex, nullptr );
pthread_create( &m_messageThreadHandle, nullptr, messageLoop, this );
}
virtual ~RemoteZynAddSubFx()
@@ -153,7 +153,7 @@ public:
_this->messageLoop();
return NULL;
return nullptr;
}
void guiLoop();
@@ -174,7 +174,7 @@ private:
void RemoteZynAddSubFx::guiLoop()
{
int exitProgram = 0;
MasterUI * ui = NULL;
MasterUI * ui = nullptr;
while( !m_guiExit )
{

View File

@@ -66,7 +66,7 @@ Plugin::Descriptor PLUGIN_EXPORT zynaddsubfx_plugin_descriptor =
Plugin::Instrument,
new PluginPixmapLoader( "logo" ),
"xiz",
NULL,
nullptr,
} ;
}
@@ -110,8 +110,8 @@ ZynAddSubFxInstrument::ZynAddSubFxInstrument(
InstrumentTrack * _instrumentTrack ) :
Instrument( _instrumentTrack, &zynaddsubfx_plugin_descriptor ),
m_hasGUI( false ),
m_plugin( NULL ),
m_remotePlugin( NULL ),
m_plugin( nullptr ),
m_remotePlugin( nullptr ),
m_portamentoModel( 0, 0, 127, 1, this, tr( "Portamento" ) ),
m_filterFreqModel( 64, 0, 127, 1, this, tr( "Filter frequency" ) ),
m_filterQModel( 64, 0, 127, 1, this, tr( "Filter resonance" ) ),
@@ -161,8 +161,8 @@ ZynAddSubFxInstrument::~ZynAddSubFxInstrument()
m_pluginMutex.lock();
delete m_plugin;
delete m_remotePlugin;
m_plugin = NULL;
m_remotePlugin = NULL;
m_plugin = nullptr;
m_remotePlugin = nullptr;
m_pluginMutex.unlock();
}
@@ -338,14 +338,14 @@ void ZynAddSubFxInstrument::play( sampleFrame * _buf )
if (!m_pluginMutex.tryLock(Engine::getSong()->isExporting() ? -1 : 0)) {return;}
if( m_remotePlugin )
{
m_remotePlugin->process( NULL, _buf );
m_remotePlugin->process( nullptr, _buf );
}
else
{
m_plugin->processAudio( _buf );
}
m_pluginMutex.unlock();
instrumentTrack()->processAudioBuffer( _buf, Engine::audioEngine()->framesPerPeriod(), NULL );
instrumentTrack()->processAudioBuffer( _buf, Engine::audioEngine()->framesPerPeriod(), nullptr );
}
@@ -436,8 +436,8 @@ void ZynAddSubFxInstrument::initPlugin()
m_pluginMutex.lock();
delete m_plugin;
delete m_remotePlugin;
m_plugin = NULL;
m_remotePlugin = NULL;
m_plugin = nullptr;
m_remotePlugin = nullptr;
if( m_hasGUI )
{