From a8223e1aa5114a6b79644191f98a2439a4df4787 Mon Sep 17 00:00:00 2001 From: Davy Date: Wed, 19 Jun 2019 10:27:49 +0200 Subject: [PATCH] SF2 extension issue if uppercase Fix #53 + changed some "NULL" into "nullptr" (c++11 standards) Former-commit-id: 25acea76beaa0c311d8a4d4e3f8bf0dda942ec9c [formerly 6b89d7d585a969453c2c349b837371c7c9248dbc] Former-commit-id: 0ada5e42c215136a2b1aac3c31f326ca8a871101 Former-commit-id: 8b44ba5d390a9b0a952d52cc9a32fe7a6be0a882 [formerly 5cd9be84721f769efd477296d24c48fef0d771e3] Former-commit-id: 275149bc1dc104cf74a8be3a53f333c523c8ed3f --- sources/clavier/pianokeybd.cpp | 2 +- sources/context/audiodevice.cpp | 16 +++++++------- sources/context/contextmanager.cpp | 18 +++++++-------- sources/context/mididevice.cpp | 4 ++-- sources/context/recentfilemanager.cpp | 2 +- sources/core/input/abstractinput.cpp | 2 +- sources/core/input/sfark/sfarkextractor1.cpp | 2 +- sources/core/input/sfark/sfarkextractor2.cpp | 2 +- sources/core/input/sfark/sfarkglobal.cpp | 16 +++++++------- sources/core/output/abstractoutput.cpp | 2 +- sources/core/sound.cpp | 2 +- sources/core/soundfontmanager.cpp | 2 +- sources/dialogs/modalprogressdialog.h | 2 +- sources/editor/editor.cpp | 2 +- .../editor/graphics/graphicsrectangleitem.cpp | 2 +- sources/editor/graphics/graphicsviewrange.cpp | 6 ++--- sources/editor/graphics/graphique.cpp | 12 +++++----- sources/editor/graphics/graphiquefourier.cpp | 2 +- .../graphfilterfrequencies.cpp | 2 +- .../toolfrequencypeaks_gui.cpp | 2 +- .../global_settings/graphparamglobal.cpp | 2 +- .../mixture_creation/toolmixturecreation.cpp | 2 +- sources/editor/widgets/editortoolbar.cpp | 1 - sources/lib/rtmidi/RtMidi.cpp | 22 +++++++++---------- sources/lib/sf3/sfont.cpp | 2 +- sources/lib/sfarklib/sfklCoding.cpp | 2 +- sources/mainwindow/widgetshowhistorycell.cpp | 2 +- sources/repository/browser/filtertag.cpp | 4 ++-- sources/repository/daily/showsoundfonts.cpp | 2 +- sources/repository/daily/soundfontcell.cpp | 2 +- sources/repository/repositorymanager.cpp | 4 ++-- .../repository/widgets/fivestarswidget.cpp | 2 +- sources/sound_engine/circularbuffer.cpp | 2 +- .../elements/calibrationsinus.cpp | 4 ++-- sources/sound_engine/soundengine.cpp | 4 ++-- sources/sound_engine/synth.cpp | 16 +++++++------- 36 files changed, 86 insertions(+), 87 deletions(-) diff --git a/sources/clavier/pianokeybd.cpp b/sources/clavier/pianokeybd.cpp index 2f963d0a..1a86f4be 100644 --- a/sources/clavier/pianokeybd.cpp +++ b/sources/clavier/pianokeybd.cpp @@ -24,7 +24,7 @@ PianoKeybd::PianoKeybd(QWidget *parent, const int startKey, const int numKeys) : QGraphicsView(parent), m_rotation(0), - m_scene(NULL) + m_scene(nullptr) { initialize(); initScene(startKey, numKeys); diff --git a/sources/context/audiodevice.cpp b/sources/context/audiodevice.cpp index e62560c3..afb391ff 100644 --- a/sources/context/audiodevice.cpp +++ b/sources/context/audiodevice.cpp @@ -70,10 +70,10 @@ int standardProcess(const void* inputBuffer, void* outputBuffer, return 0; } -AudioDevice::AudioDevice(ConfManager *configuration) : QObject(NULL), +AudioDevice::AudioDevice(ConfManager *configuration) : QObject(nullptr), _isStandardRunning(false), - _standardStream(NULL), - _jack_client(NULL), + _standardStream(nullptr), + _jack_client(nullptr), _configuration(configuration), _initialized(false) { @@ -288,7 +288,7 @@ void AudioDevice::openJackConnection(int bufferSize) printf("no physical playback ports\n"); return; } - bool mono = ports[1] == NULL; + bool mono = ports[1] == nullptr; // Création ports de sortie if (mono) @@ -297,7 +297,7 @@ void AudioDevice::openJackConnection(int bufferSize) _output_port_L = jack_port_register(_jack_client, "output mono", JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0); - _output_port_R = NULL; + _output_port_R = nullptr; if (!_output_port_L) { printf("no more JACK ports available\n"); @@ -371,7 +371,7 @@ void AudioDevice::openStandardConnection(int deviceType, int numIndex, int buffe outputParameters.suggestedLatency = qMin(0.04, pdi->defaultLowOutputLatency); else outputParameters.suggestedLatency = qMin(0.2, pdi->defaultLowOutputLatency); - outputParameters.hostApiSpecificStreamInfo = NULL; + outputParameters.hostApiSpecificStreamInfo = nullptr; // Ouverture du flux PaError err = Pa_OpenStream(&_standardStream, @@ -409,14 +409,14 @@ void AudioDevice::closeConnections() Pa_StopStream(_standardStream); Pa_CloseStream(_standardStream); _isStandardRunning = false; - _standardStream = NULL; + _standardStream = nullptr; } #ifndef Q_OS_WIN if (_jack_client) { jack_client_close(_jack_client); - _jack_client = NULL; + _jack_client = nullptr; } #endif } diff --git a/sources/context/contextmanager.cpp b/sources/context/contextmanager.cpp index 3a30363a..f2f9dc6f 100644 --- a/sources/context/contextmanager.cpp +++ b/sources/context/contextmanager.cpp @@ -25,7 +25,7 @@ #include "contextmanager.h" #include "synth.h" -ContextManager * ContextManager::s_instance = NULL; +ContextManager * ContextManager::s_instance = nullptr; ConfManager * ContextManager::configuration() { @@ -79,17 +79,17 @@ MidiDevice * ContextManager::midi() void ContextManager::kill() { delete s_instance; - s_instance = NULL; + s_instance = nullptr; } ContextManager::ContextManager() : - _configuration(NULL), - _keyName(NULL), - _recentFile(NULL), - _theme(NULL), - _translation(NULL), - _audio(NULL), - _midi(NULL) + _configuration(nullptr), + _keyName(nullptr), + _recentFile(nullptr), + _theme(nullptr), + _translation(nullptr), + _audio(nullptr), + _midi(nullptr) { // Build the context diff --git a/sources/context/mididevice.cpp b/sources/context/mididevice.cpp index d4b6d0cb..502d1eef 100644 --- a/sources/context/mididevice.cpp +++ b/sources/context/mididevice.cpp @@ -72,7 +72,7 @@ void midiCallback(double deltatime, std::vector< unsigned char > *message, void } MidiDevice::MidiDevice(ConfManager * configuration, Synth *synth) : - _keyboard(NULL), + _keyboard(nullptr), _configuration(configuration), _synth(synth), _isSustainOn(false) @@ -93,7 +93,7 @@ MidiDevice::MidiDevice(ConfManager * configuration, Synth *synth) : catch (std::exception &error) { Q_UNUSED(error) - _midiin = NULL; + _midiin = nullptr; } if (_midiin) { diff --git a/sources/context/recentfilemanager.cpp b/sources/context/recentfilemanager.cpp index 6ac32ff8..cf6fddc7 100644 --- a/sources/context/recentfilemanager.cpp +++ b/sources/context/recentfilemanager.cpp @@ -30,7 +30,7 @@ int RecentFileManager::MAX_SF2_FILES = 10; -RecentFileManager::RecentFileManager(ConfManager * configuration) : QObject(NULL), +RecentFileManager::RecentFileManager(ConfManager * configuration) : QObject(nullptr), _configuration(configuration) { // Load recent files diff --git a/sources/core/input/abstractinput.cpp b/sources/core/input/abstractinput.cpp index c0511f41..4937563f 100644 --- a/sources/core/input/abstractinput.cpp +++ b/sources/core/input/abstractinput.cpp @@ -36,7 +36,7 @@ AbstractInput::AbstractInput() : QObject(), _futureWatcher(new QFutureWatcher()), - _sm(NULL), + _sm(nullptr), _fileName(""), _isSuccess(false), _error(trUtf8("not processed yet")), diff --git a/sources/core/input/sfark/sfarkextractor1.cpp b/sources/core/input/sfark/sfarkextractor1.cpp index 88583445..55e3db9d 100644 --- a/sources/core/input/sfark/sfarkextractor1.cpp +++ b/sources/core/input/sfark/sfarkextractor1.cpp @@ -2283,7 +2283,7 @@ qint32 SfArkExtractor1::SfarkBeginExtract(const void * sfontName) qint32 SfArkExtractor1::loadSfarkHeader() { - unsigned char * fileHdrStartPtr = NULL; + unsigned char * fileHdrStartPtr = nullptr; unsigned char * filename; quint32 bytesToProcess; int result; diff --git a/sources/core/input/sfark/sfarkextractor2.cpp b/sources/core/input/sfark/sfarkextractor2.cpp index 43167eff..593e650c 100644 --- a/sources/core/input/sfark/sfarkextractor2.cpp +++ b/sources/core/input/sfark/sfarkextractor2.cpp @@ -169,7 +169,7 @@ void CloseOutputFile() #else typedef FILE* HANDLE; -#define INVALID_HANDLE_VALUE (NULL) +#define INVALID_HANDLE_VALUE (nullptr) #define CREATEFILE(filename) fopen(filename, "wb") #define OPENFILE(filename) fopen(filename, "rb") diff --git a/sources/core/input/sfark/sfarkglobal.cpp b/sources/core/input/sfark/sfarkglobal.cpp index 3f66127a..27d84074 100644 --- a/sources/core/input/sfark/sfarkglobal.cpp +++ b/sources/core/input/sfark/sfarkglobal.cpp @@ -26,8 +26,8 @@ #include "sfarkglobal.h" SfArkInfo::SfArkInfo() : - WorkBuffer1(NULL), - WorkBuffer2(NULL), + WorkBuffer1(nullptr), + WorkBuffer2(nullptr), InputFileHandle(-1), OutputFileHandle(-1), FileUncompSize(0), @@ -65,11 +65,11 @@ SfArkInfo::~SfArkInfo() SfArkInfo_v1::SfArkInfo_v1() : PartFileHandle(-1), - OutbufPtr(NULL), - DecompBuf(NULL), - AppFontName(NULL), - PackItemArray(NULL), - CurPackItemArray(NULL), + OutbufPtr(nullptr), + DecompBuf(nullptr), + AppFontName(nullptr), + PackItemArray(nullptr), + CurPackItemArray(nullptr), VarDecodeDWord(0), VarDecodeByteCnt(0), EncodeCnt(0), @@ -85,7 +85,7 @@ PackItem::PackItem() : EncodeCnt(0), BitShiftAmt(0) { - u.NextItemArray = NULL; + u.NextItemArray = nullptr; u.Data1 = 0; } diff --git a/sources/core/output/abstractoutput.cpp b/sources/core/output/abstractoutput.cpp index 5faa04d0..97719257 100644 --- a/sources/core/output/abstractoutput.cpp +++ b/sources/core/output/abstractoutput.cpp @@ -34,7 +34,7 @@ AbstractOutput::AbstractOutput() : QObject(), _futureWatcher(new QFutureWatcher()), - _sm(NULL), + _sm(nullptr), _fileName(""), _isSuccess(false), _error(trUtf8("not processed yet")), diff --git a/sources/core/sound.cpp b/sources/core/sound.cpp index 7ef0ab7a..d26d1412 100644 --- a/sources/core/sound.cpp +++ b/sources/core/sound.cpp @@ -31,7 +31,7 @@ #include #include "contextmanager.h" -QWidget * Sound::_parent = NULL; +QWidget * Sound::_parent = nullptr; // Constructeur / destructeur Sound::Sound(QString filename, bool tryFindRootkey) diff --git a/sources/core/soundfontmanager.cpp b/sources/core/soundfontmanager.cpp index bcfd0d5d..50a61156 100644 --- a/sources/core/soundfontmanager.cpp +++ b/sources/core/soundfontmanager.cpp @@ -749,7 +749,7 @@ bool SoundfontManager::isEdited(int indexSf2) if (_soundfonts->getSoundfont(indexSf2) == nullptr) return false; return this->_undoRedo->getEdition(indexSf2) != _soundfonts->getSoundfont(indexSf2)->_numEdition || - !this->getQstr(EltID(elementSf2, indexSf2), champ_filenameInitial).endsWith(".sf2"); + !this->getQstr(EltID(elementSf2, indexSf2), champ_filenameInitial).toLower().endsWith(".sf2"); } // Récupération liste de champs et valeurs de bags diff --git a/sources/dialogs/modalprogressdialog.h b/sources/dialogs/modalprogressdialog.h index 004fe62c..76caf4a3 100644 --- a/sources/dialogs/modalprogressdialog.h +++ b/sources/dialogs/modalprogressdialog.h @@ -38,7 +38,7 @@ class ModalProgressDialog : public QProgressDialog QProgressDialog(labelText, cancelButtonText, minimum, maximum, parent, flags) { this->setWindowModality(Qt::WindowModal); - this->setCancelButton(NULL); + this->setCancelButton(nullptr); this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint & ~Qt::WindowCloseButtonHint); this->reset(); } diff --git a/sources/editor/editor.cpp b/sources/editor/editor.cpp index 490b7f46..233b3bb0 100644 --- a/sources/editor/editor.cpp +++ b/sources/editor/editor.cpp @@ -111,7 +111,7 @@ void Editor::onSelectionChanged(IdList ids) return; // Find the view to display and update it - Page * currentPage = NULL; + Page * currentPage = nullptr; switch (ids[0].typeElement) { case elementSf2: diff --git a/sources/editor/graphics/graphicsrectangleitem.cpp b/sources/editor/graphics/graphicsrectangleitem.cpp index 40bd0c51..cfa25689 100644 --- a/sources/editor/graphics/graphicsrectangleitem.cpp +++ b/sources/editor/graphics/graphicsrectangleitem.cpp @@ -29,7 +29,7 @@ #include #include "contextmanager.h" -SoundfontManager * GraphicsRectangleItem::s_sf2 = NULL; +SoundfontManager * GraphicsRectangleItem::s_sf2 = nullptr; GraphicsRectangleItem::GraphicsRectangleItem(EltID id, QGraphicsItem *parent) : QGraphicsRectItem(parent), _id(id), diff --git a/sources/editor/graphics/graphicsviewrange.cpp b/sources/editor/graphics/graphicsviewrange.cpp index d7891267..57a3f203 100644 --- a/sources/editor/graphics/graphicsviewrange.cpp +++ b/sources/editor/graphics/graphicsviewrange.cpp @@ -48,9 +48,9 @@ const double GraphicsViewRange::OFFSET = -0.5; GraphicsViewRange::GraphicsViewRange(QWidget *parent) : QGraphicsView(parent), _scene(new QGraphicsScene(OFFSET, OFFSET, WIDTH, WIDTH)), - _legendItem(NULL), - _legendItem2(NULL), - _zoomLine(NULL), + _legendItem(nullptr), + _legendItem2(nullptr), + _zoomLine(nullptr), _dontRememberScroll(false), _keyTriggered(-1), _buttonPressed(Qt::NoButton), diff --git a/sources/editor/graphics/graphique.cpp b/sources/editor/graphics/graphique.cpp index ff089d35..10ddea70 100644 --- a/sources/editor/graphics/graphique.cpp +++ b/sources/editor/graphics/graphique.cpp @@ -40,13 +40,13 @@ Graphique::Graphique(QWidget * parent) : QCustomPlot(parent), _posXinit(.5), _posYinit(.5), _bFromExt(false), - _qScrollX(NULL), - _spinStart(NULL), - _spinEnd(NULL), + _qScrollX(nullptr), + _spinStart(nullptr), + _spinEnd(nullptr), _filterEventEnabled(true), - _textMultipleSelection(NULL), - _textPositionL(NULL), - _textPositionR(NULL), + _textMultipleSelection(nullptr), + _textPositionL(nullptr), + _textPositionR(nullptr), _sampleRate(0) { // Graphe des données diff --git a/sources/editor/graphics/graphiquefourier.cpp b/sources/editor/graphics/graphiquefourier.cpp index b53c9002..87b51799 100644 --- a/sources/editor/graphics/graphiquefourier.cpp +++ b/sources/editor/graphics/graphiquefourier.cpp @@ -29,7 +29,7 @@ #include GraphiqueFourier::GraphiqueFourier(QWidget * parent) : QCustomPlot(parent), - _menu(NULL) + _menu(nullptr) { // Configuration du graphe this->addGraph(); diff --git a/sources/editor/tools/frequency_filter/graphfilterfrequencies.cpp b/sources/editor/tools/frequency_filter/graphfilterfrequencies.cpp index b5e6e06a..b903584d 100644 --- a/sources/editor/tools/frequency_filter/graphfilterfrequencies.cpp +++ b/sources/editor/tools/frequency_filter/graphfilterfrequencies.cpp @@ -30,7 +30,7 @@ const int GraphFilterFrequencies::POINT_NUMBER = 201; GraphFilterFrequencies::GraphFilterFrequencies(QWidget * parent) : QCustomPlot(parent), flagEdit(false), raideurExp(50.0), - labelCoord(NULL), + labelCoord(nullptr), previousX(-1) { this->setBackground(this->palette().color(QPalette::Base)); diff --git a/sources/editor/tools/frequency_peaks/toolfrequencypeaks_gui.cpp b/sources/editor/tools/frequency_peaks/toolfrequencypeaks_gui.cpp index d87e38cb..151ae0e5 100644 --- a/sources/editor/tools/frequency_peaks/toolfrequencypeaks_gui.cpp +++ b/sources/editor/tools/frequency_peaks/toolfrequencypeaks_gui.cpp @@ -45,7 +45,7 @@ class RunnableTask: public QRunnable QList keys; QList corrections; SoundfontManager * sm = SoundfontManager::getInstance(); - GraphiqueFourier graphTmp(NULL); + GraphiqueFourier graphTmp(nullptr); graphTmp.setData(sm->getData(_id, champ_sampleData16), sm->get(_id, champ_dwSampleRate).dwValue); graphTmp.setPos(sm->get(_id, champ_dwStartLoop).dwValue, sm->get(_id, champ_dwEndLoop).dwValue, frequencies, factors, keys, corrections, false); diff --git a/sources/editor/tools/global_settings/graphparamglobal.cpp b/sources/editor/tools/global_settings/graphparamglobal.cpp index 1cd43234..59b2f484 100644 --- a/sources/editor/tools/global_settings/graphparamglobal.cpp +++ b/sources/editor/tools/global_settings/graphparamglobal.cpp @@ -33,7 +33,7 @@ GraphParamGlobal::GraphParamGlobal(QWidget * parent) : QCustomPlot(parent), raideurExp(50.0), yMin(0.), yMax(1.), xMin(0), xMax(140), - labelCoord(NULL), + labelCoord(nullptr), previousX(-1) { this->setBackground(this->palette().color(QPalette::Base)); diff --git a/sources/editor/tools/mixture_creation/toolmixturecreation.cpp b/sources/editor/tools/mixture_creation/toolmixturecreation.cpp index 5a13e348..87937733 100644 --- a/sources/editor/tools/mixture_creation/toolmixturecreation.cpp +++ b/sources/editor/tools/mixture_creation/toolmixturecreation.cpp @@ -205,7 +205,7 @@ void ToolMixtureCreation::onElementProcessed(EltID idSmpl, int key, int minKey, if (_currentStep >= _steps) { delete _waitingDialog; - _waitingDialog = NULL; + _waitingDialog = nullptr; if (_canceled) { SoundfontManager::getInstance()->revertNewEditing(); diff --git a/sources/editor/widgets/editortoolbar.cpp b/sources/editor/widgets/editortoolbar.cpp index 617c377d..6f3597cb 100644 --- a/sources/editor/widgets/editortoolbar.cpp +++ b/sources/editor/widgets/editortoolbar.cpp @@ -70,7 +70,6 @@ EditorToolBar::EditorToolBar(QWidget * parent) : QToolBar(parent), this->addSeparator(); _actionUndo = new StyledAction(trUtf8("Cancel"), ":/icons/edit-undo.svg", this); -// _actionUndo->setShortcut(Qt::CTRL + Qt::Key_Z); connect(_actionUndo, SIGNAL(clicked()), this, SLOT(onUndo())); this->addWidget(_actionUndo); diff --git a/sources/lib/rtmidi/RtMidi.cpp b/sources/lib/rtmidi/RtMidi.cpp index 07e23168..71d08203 100644 --- a/sources/lib/rtmidi/RtMidi.cpp +++ b/sources/lib/rtmidi/RtMidi.cpp @@ -686,7 +686,7 @@ CFStringRef EndpointName( MIDIEndpointRef endpoint, bool isExternal ) CFStringRef str; // Begin with the endpoint's name. - str = NULL; + str = nullptr; MIDIObjectGetStringProperty( endpoint, kMIDIPropertyName, &str ); if ( str != NULL ) { CFStringAppend( result, str ); @@ -701,7 +701,7 @@ CFStringRef EndpointName( MIDIEndpointRef endpoint, bool isExternal ) if ( CFStringGetLength( result ) == 0 ) { // endpoint name has zero length -- try the entity - str = NULL; + str = nullptr; MIDIObjectGetStringProperty( entity, kMIDIPropertyName, &str ); if ( str != NULL ) { CFStringAppend( result, str ); @@ -714,7 +714,7 @@ CFStringRef EndpointName( MIDIEndpointRef endpoint, bool isExternal ) if ( device == 0 ) return result; - str = NULL; + str = nullptr; MIDIObjectGetStringProperty( device, kMIDIPropertyName, &str ); if ( CFStringGetLength( result ) == 0 ) { CFRelease( result ); @@ -758,7 +758,7 @@ static CFStringRef ConnectedEndpointName( MIDIEndpointRef endpoint ) int i; // Does the endpoint have connections? - CFDataRef connections = NULL; + CFDataRef connections = nullptr; int nConnected = 0; bool anyStrings = false; err = MIDIObjectGetDataProperty( endpoint, kMIDIPropertyConnectionUniqueID, &connections ); @@ -780,7 +780,7 @@ static CFStringRef ConnectedEndpointName( MIDIEndpointRef endpoint ) str = EndpointName( (MIDIEndpointRef)(connObject), true ); } else { // Connected to an external device (10.2) (or something else, catch- - str = NULL; + str = nullptr; MIDIObjectGetStringProperty( connObject, kMIDIPropertyName, &str ); } if ( str != NULL ) { @@ -2519,8 +2519,8 @@ void MidiInJack :: initialize( const std::string& clientName ) apiData_ = (void *) data; data->rtMidiIn = &inputData_; - data->port = NULL; - data->client = NULL; + data->port = nullptr; + data->client = nullptr; this->clientName = clientName; connect(); @@ -2646,7 +2646,7 @@ void MidiInJack :: closePort() if ( data->port == NULL ) return; jack_port_unregister( data->client, data->port ); - data->port = NULL; + data->port = nullptr; } //*********************************************************************// @@ -2687,8 +2687,8 @@ void MidiOutJack :: initialize( const std::string& clientName ) JackMidiData *data = new JackMidiData; apiData_ = (void *) data; - data->port = NULL; - data->client = NULL; + data->port = nullptr; + data->client = nullptr; this->clientName = clientName; connect(); @@ -2822,7 +2822,7 @@ void MidiOutJack :: closePort() if ( data->port == NULL ) return; jack_port_unregister( data->client, data->port ); - data->port = NULL; + data->port = nullptr; } void MidiOutJack :: sendMessage( std::vector *message ) diff --git a/sources/lib/sf3/sfont.cpp b/sources/lib/sf3/sfont.cpp index 1901b108..cba4574c 100644 --- a/sources/lib/sf3/sfont.cpp +++ b/sources/lib/sf3/sfont.cpp @@ -1080,7 +1080,7 @@ int SoundFont::writeCompressedSample(Sample* s) vorbis_comment_init(&vc); vorbis_analysis_init(&vd, &vi); vorbis_block_init(&vd, &vb); - srand(time(NULL)); + srand(time(nullptr)); ogg_stream_init(&os, _oggSerial == std::numeric_limits::max() ? rand() : (int)_oggSerial); ogg_packet header; diff --git a/sources/lib/sfarklib/sfklCoding.cpp b/sources/lib/sfarklib/sfklCoding.cpp index d7f2ffde..ff69a54a 100644 --- a/sources/lib/sfarklib/sfklCoding.cpp +++ b/sources/lib/sfarklib/sfklCoding.cpp @@ -109,7 +109,7 @@ typedef struct const char LicenseExt[] = ".license.txt"; // File extension for license file const char NotesExt[] = ".txt"; // File extension for notes file -static BYTE *Zbuf1 = NULL, *Zbuf2 = NULL; +static BYTE *Zbuf1 = NULL, *Zbuf2 = nullptr; // Data per block, passed to ProcessNextBlock() typedef struct diff --git a/sources/mainwindow/widgetshowhistorycell.cpp b/sources/mainwindow/widgetshowhistorycell.cpp index 0ff57ee8..68d905aa 100644 --- a/sources/mainwindow/widgetshowhistorycell.cpp +++ b/sources/mainwindow/widgetshowhistorycell.cpp @@ -28,7 +28,7 @@ #include #include "contextmanager.h" -WidgetShowHistoryCell::Icons * WidgetShowHistoryCell::s_icons = NULL; +WidgetShowHistoryCell::Icons * WidgetShowHistoryCell::s_icons = nullptr; WidgetShowHistoryCell::WidgetShowHistoryCell(QWidget *parent) : QWidget(parent), diff --git a/sources/repository/browser/filtertag.cpp b/sources/repository/browser/filtertag.cpp index 512e79a6..af1a0a44 100644 --- a/sources/repository/browser/filtertag.cpp +++ b/sources/repository/browser/filtertag.cpp @@ -32,7 +32,7 @@ FilterTag::FilterTag(QWidget *parent) : QWidget(parent), ui(new Ui::FilterTag), - _completer(NULL) + _completer(nullptr) { ui->setupUi(this); ui->tagArea->setLayout(new FlowLayout(0)); @@ -49,7 +49,7 @@ void FilterTag::setPossibleTags(QStringList tags) _possibleTags = tags; if (_completer != NULL) { - ui->lineEdit->setCompleter(NULL); + ui->lineEdit->setCompleter(nullptr); delete _completer; } diff --git a/sources/repository/daily/showsoundfonts.cpp b/sources/repository/daily/showsoundfonts.cpp index da1fff3f..bcb688de 100644 --- a/sources/repository/daily/showsoundfonts.cpp +++ b/sources/repository/daily/showsoundfonts.cpp @@ -35,7 +35,7 @@ ShowSoundfonts::ShowSoundfonts(QWidget *parent) : QWidget(parent), ui(new Ui::ShowSoundfonts), - _urlReaderJson(NULL), + _urlReaderJson(nullptr), _soundfontListOk(false), _lastWidth(-1) { diff --git a/sources/repository/daily/soundfontcell.cpp b/sources/repository/daily/soundfontcell.cpp index 28d530f1..87a30118 100644 --- a/sources/repository/daily/soundfontcell.cpp +++ b/sources/repository/daily/soundfontcell.cpp @@ -29,7 +29,7 @@ #include "contextmanager.h" #include "repositorymanager.h" -SoundfontCell::IconContainer * SoundfontCell::s_icons = NULL; +SoundfontCell::IconContainer * SoundfontCell::s_icons = nullptr; SoundfontCell::SoundfontCell(SoundfontInformation* soundfontInfo, QWidget *parent) : QWidget(parent), diff --git a/sources/repository/repositorymanager.cpp b/sources/repository/repositorymanager.cpp index 6bdd5ddc..c75ad94b 100644 --- a/sources/repository/repositorymanager.cpp +++ b/sources/repository/repositorymanager.cpp @@ -36,7 +36,7 @@ //const QString RepositoryManager::BASE_URL = "http://localhost/polyphone-soundfonts/fr/api/soundfonts/"; const QString RepositoryManager::BASE_URL = "https://www.polyphone-soundfonts.com/en/api/soundfonts/"; -RepositoryManager * RepositoryManager::s_instance = NULL; +RepositoryManager * RepositoryManager::s_instance = nullptr; RepositoryManager * RepositoryManager::getInstance() { @@ -50,7 +50,7 @@ void RepositoryManager::kill() if (s_instance != NULL) { delete s_instance; - s_instance = NULL; + s_instance = nullptr; } } diff --git a/sources/repository/widgets/fivestarswidget.cpp b/sources/repository/widgets/fivestarswidget.cpp index bec84a4e..cbbe6dbd 100644 --- a/sources/repository/widgets/fivestarswidget.cpp +++ b/sources/repository/widgets/fivestarswidget.cpp @@ -27,7 +27,7 @@ #include "contextmanager.h" #include -FiveStarsWidget::IconContainer * FiveStarsWidget::s_icons = NULL; +FiveStarsWidget::IconContainer * FiveStarsWidget::s_icons = nullptr; FiveStarsWidget::FiveStarsWidget(QWidget *parent) : QWidget(parent), diff --git a/sources/sound_engine/circularbuffer.cpp b/sources/sound_engine/circularbuffer.cpp index 2d90c400..f4ce5a94 100644 --- a/sources/sound_engine/circularbuffer.cpp +++ b/sources/sound_engine/circularbuffer.cpp @@ -25,7 +25,7 @@ #include "circularbuffer.h" -CircularBuffer::CircularBuffer(int minBuffer, int maxBuffer) : QObject(NULL), +CircularBuffer::CircularBuffer(int minBuffer, int maxBuffer) : QObject(nullptr), _minBuffer(minBuffer), _maxBuffer(maxBuffer), _bufferSize(4 * maxBuffer), diff --git a/sources/sound_engine/elements/calibrationsinus.cpp b/sources/sound_engine/elements/calibrationsinus.cpp index c76684a9..77e90785 100644 --- a/sources/sound_engine/elements/calibrationsinus.cpp +++ b/sources/sound_engine/elements/calibrationsinus.cpp @@ -26,12 +26,12 @@ #include "qmath.h" CalibrationSinus::CalibrationSinus() : - _sinus(NULL), + _sinus(nullptr), _pitch(0), _currentPitch(-1), _level(0), _currentLevel(0), - _buf(NULL) + _buf(nullptr) { initBuffer(1024); } diff --git a/sources/sound_engine/soundengine.cpp b/sources/sound_engine/soundengine.cpp index 5dcfb8f9..bbddae81 100644 --- a/sources/sound_engine/soundengine.cpp +++ b/sources/sound_engine/soundengine.cpp @@ -289,8 +289,8 @@ void SoundEngine::setStereoInstance(bool isStereo) { // Mise à jour voix -1 et -2 _mutexVoices.lock(); - Voice * voice1 = NULL; - Voice * voice2 = NULL; + Voice * voice1 = nullptr; + Voice * voice2 = nullptr; for (int i = 0; i < _listVoices.size(); i++) { if (_listVoices.at(i)->getNote() == -1) diff --git a/sources/sound_engine/synth.cpp b/sources/sound_engine/synth.cpp index c64fb983..5d45bbfd 100644 --- a/sources/sound_engine/synth.cpp +++ b/sources/sound_engine/synth.cpp @@ -30,16 +30,16 @@ #include "soundfontmanager.h" // Constructeur, destructeur -Synth::Synth(ConfManager *configuration) : QObject(NULL), +Synth::Synth(ConfManager *configuration) : QObject(nullptr), _sf2(SoundfontManager::getInstance()), m_gain(0), m_choLevel(0), m_choDepth(0), m_choFrequency(0), m_clipCoef(1), - m_recordFile(NULL), + m_recordFile(nullptr), m_isRecording(true), - _fTmpSumRev1(NULL), - _fTmpSumRev2(NULL), - _dataWav(NULL) + _fTmpSumRev1(nullptr), + _fTmpSumRev2(nullptr), + _dataWav(nullptr) { // Création des buffers et sound engines @@ -463,7 +463,7 @@ void Synth::startNewRecord(QString fileName) else { delete m_recordFile; - m_recordFile = NULL; + m_recordFile = nullptr; } m_mutexRecord.unlock(); } @@ -480,10 +480,10 @@ void Synth::endRecord() m_recordStream << m_recordLength; // Fermeture - m_recordStream.setDevice(NULL); + m_recordStream.setDevice(nullptr); m_recordFile->close(); delete m_recordFile; - m_recordFile = NULL; + m_recordFile = nullptr; m_isRecording = false; }