From 20baf96db345d8740d29fab6527f79cf33c80459 Mon Sep 17 00:00:00 2001 From: Martin Pavelek Date: Sat, 19 Nov 2022 17:16:44 +0100 Subject: [PATCH 01/70] Fix several issues raised at Transifex (#6568) Make strings independent on word order, fix capitalization and typos --- plugins/SpectrumAnalyzer/SaControlsDialog.cpp | 10 ++-- plugins/VstBase/VstPlugin.cpp | 50 ++++++++----------- src/gui/LfoControllerDialog.cpp | 33 +++++------- 3 files changed, 39 insertions(+), 54 deletions(-) diff --git a/plugins/SpectrumAnalyzer/SaControlsDialog.cpp b/plugins/SpectrumAnalyzer/SaControlsDialog.cpp index 4a1cb8a79..c4fc431b1 100644 --- a/plugins/SpectrumAnalyzer/SaControlsDialog.cpp +++ b/plugins/SpectrumAnalyzer/SaControlsDialog.cpp @@ -240,7 +240,7 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) envelopeResolutionKnob->setModel(&controls->m_envelopeResolutionModel); envelopeResolutionKnob->setLabel(tr("Envelope res.")); envelopeResolutionKnob->setToolTip(tr("Increase envelope resolution for better details, decrease for better GUI performance.")); - envelopeResolutionKnob->setHintText(tr("Draw at most"), tr(" envelope points per pixel")); + envelopeResolutionKnob->setHintText(tr("Maximum number of envelope points drawn per pixel:"), ""); advanced_layout->addWidget(envelopeResolutionKnob, 0, 0, 1, 1, Qt::AlignCenter); // Spectrum graph resolution @@ -248,7 +248,7 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) spectrumResolutionKnob->setModel(&controls->m_spectrumResolutionModel); spectrumResolutionKnob->setLabel(tr("Spectrum res.")); spectrumResolutionKnob->setToolTip(tr("Increase spectrum resolution for better details, decrease for better GUI performance.")); - spectrumResolutionKnob->setHintText(tr("Draw at most"), tr(" spectrum points per pixel")); + spectrumResolutionKnob->setHintText(tr("Maximum number of spectrum points drawn per pixel:"), ""); advanced_layout->addWidget(spectrumResolutionKnob, 1, 0, 1, 1, Qt::AlignCenter); // Peak falloff speed @@ -272,7 +272,7 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) waterfallHeightKnob->setModel(&controls->m_waterfallHeightModel); waterfallHeightKnob->setLabel(tr("Waterfall height")); waterfallHeightKnob->setToolTip(tr("Increase to get slower scrolling, decrease to see fast transitions better. Warning: medium CPU usage.")); - waterfallHeightKnob->setHintText(tr("Keep"), tr(" lines")); + waterfallHeightKnob->setHintText(tr("Number of lines to keep:"), ""); advanced_layout->addWidget(waterfallHeightKnob, 0, 2, 1, 1, Qt::AlignCenter); processor->reallocateBuffers(); connect(&controls->m_waterfallHeightModel, &FloatModel::dataChanged, [=] {processor->reallocateBuffers();}); @@ -290,7 +290,7 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) windowOverlapKnob->setModel(&controls->m_windowOverlapModel); windowOverlapKnob->setLabel(tr("Window overlap")); windowOverlapKnob->setToolTip(tr("Increase to prevent missing fast transitions arriving near FFT window edges. Warning: high CPU usage.")); - windowOverlapKnob->setHintText(tr("Each sample processed"), tr(" times")); + windowOverlapKnob->setHintText(tr("Number of times each sample is processed:"), ""); advanced_layout->addWidget(windowOverlapKnob, 0, 3, 1, 1, Qt::AlignCenter); // FFT zero padding @@ -365,4 +365,4 @@ QSize SaControlsDialog::sizeHint() const } -} // namespace lmms::gui \ No newline at end of file +} // namespace lmms::gui diff --git a/plugins/VstBase/VstPlugin.cpp b/plugins/VstBase/VstPlugin.cpp index 488931e6d..700a14ac7 100644 --- a/plugins/VstBase/VstPlugin.cpp +++ b/plugins/VstBase/VstPlugin.cpp @@ -504,20 +504,14 @@ QWidget *VstPlugin::editor() void VstPlugin::openPreset() { - - gui::FileDialog ofd( nullptr, tr( "Open Preset" ), "", - tr( "Vst Plugin Preset (*.fxp *.fxb)" ) ); - ofd.setFileMode( gui::FileDialog::ExistingFiles ); - if( ofd.exec () == QDialog::Accepted && - !ofd.selectedFiles().isEmpty() ) + gui::FileDialog ofd(nullptr, tr("Open Preset"), "", tr("VST Plugin Preset (*.fxp *.fxb)")); + ofd.setFileMode(gui::FileDialog::ExistingFiles); + if (ofd.exec() == QDialog::Accepted && !ofd.selectedFiles().isEmpty()) { lock(); - sendMessage( message( IdLoadPresetFile ). - addString( - QSTR_TO_STDSTR( - QDir::toNativeSeparators( ofd.selectedFiles()[0] ) ) ) - ); - waitForMessage( IdLoadPresetFile, true ); + sendMessage(message(IdLoadPresetFile).addString(QSTR_TO_STDSTR( + QDir::toNativeSeparators(ofd.selectedFiles()[0])))); + waitForMessage(IdLoadPresetFile, true); unlock(); } } @@ -585,32 +579,32 @@ void VstPlugin::savePreset() QString presName = currentProgramName().isEmpty() ? tr(": default") : currentProgramName(); presName.replace("\"", "'"); // QFileDialog unable to handle double quotes properly - gui::FileDialog sfd( nullptr, tr( "Save Preset" ), presName.section(": ", 1, 1) + tr(".fxp"), - tr( "Vst Plugin Preset (*.fxp *.fxb)" ) ); + gui::FileDialog sfd(nullptr, tr("Save Preset"), presName.section(": ", 1, 1) + tr(".fxp"), + tr("VST Plugin Preset (*.fxp *.fxb)")); - if( p_name != "" ) // remember last directory + if (p_name != "") // remember last directory { - sfd.setDirectory( QFileInfo( p_name ).absolutePath() ); + sfd.setDirectory(QFileInfo(p_name).absolutePath()); } - sfd.setAcceptMode( gui::FileDialog::AcceptSave ); - sfd.setFileMode( gui::FileDialog::AnyFile ); - if( sfd.exec () == QDialog::Accepted && - !sfd.selectedFiles().isEmpty() && sfd.selectedFiles()[0] != "" ) + sfd.setAcceptMode(gui::FileDialog::AcceptSave); + sfd.setFileMode(gui::FileDialog::AnyFile); + if (sfd.exec() == QDialog::Accepted && !sfd.selectedFiles().isEmpty() && sfd.selectedFiles()[0] != "") { QString fns = sfd.selectedFiles()[0]; p_name = fns; if ((fns.toUpper().indexOf(tr(".FXP")) == -1) && (fns.toUpper().indexOf(tr(".FXB")) == -1)) + { fns = fns + tr(".fxb"); - else fns = fns.left(fns.length() - 4) + (fns.right( 4 )).toLower(); + } + else + { + fns = fns.left(fns.length() - 4) + (fns.right(4)).toLower(); + } lock(); - sendMessage( message( IdSavePresetFile ). - addString( - QSTR_TO_STDSTR( - QDir::toNativeSeparators( fns ) ) ) - ); - waitForMessage( IdSavePresetFile, true ); + sendMessage(message(IdSavePresetFile).addString(QSTR_TO_STDSTR(QDir::toNativeSeparators(fns)))); + waitForMessage(IdSavePresetFile, true); unlock(); } } @@ -825,4 +819,4 @@ QString VstPlugin::embedMethod() const } -} // namespace lmms \ No newline at end of file +} // namespace lmms diff --git a/src/gui/LfoControllerDialog.cpp b/src/gui/LfoControllerDialog.cpp index 9e58d3e18..64602cd74 100644 --- a/src/gui/LfoControllerDialog.cpp +++ b/src/gui/LfoControllerDialog.cpp @@ -167,31 +167,22 @@ LfoControllerDialog::LfoControllerDialog( Controller * _model, QWidget * _parent m_waveBtnGrp->addButton( m_userWaveBtn ); auto x1 = new PixmapButton(this, nullptr); - x1->move( CD_LFO_MULTIPLIER_X, CD_LFO_SHAPES_Y +7); - x1->setActiveGraphic( embed::getIconPixmap( - "lfo_x1_active" ) ); - x1->setInactiveGraphic( embed::getIconPixmap( - "lfo_x1_inactive" ) ); - x1->setToolTip( - tr( "Mutliply modulation frequency by 1" )); + x1->move(CD_LFO_MULTIPLIER_X, CD_LFO_SHAPES_Y + 7); + x1->setActiveGraphic(embed::getIconPixmap("lfo_x1_active")); + x1->setInactiveGraphic(embed::getIconPixmap("lfo_x1_inactive")); + x1->setToolTip(tr("Multiply modulation frequency by 1")); auto x100 = new PixmapButton(this, nullptr); - x100->move( CD_LFO_MULTIPLIER_X, CD_LFO_SHAPES_Y - 8 ); - x100->setActiveGraphic( embed::getIconPixmap( - "lfo_x100_active" ) ); - x100->setInactiveGraphic( embed::getIconPixmap( - "lfo_x100_inactive" ) ); - x100->setToolTip( - tr( "Mutliply modulation frequency by 100" )); + x100->move(CD_LFO_MULTIPLIER_X, CD_LFO_SHAPES_Y - 8); + x100->setActiveGraphic(embed::getIconPixmap("lfo_x100_active")); + x100->setInactiveGraphic(embed::getIconPixmap("lfo_x100_inactive")); + x100->setToolTip(tr("Multiply modulation frequency by 100")); auto d100 = new PixmapButton(this, nullptr); - d100->move( CD_LFO_MULTIPLIER_X, CD_LFO_SHAPES_Y + 22 ); - d100->setActiveGraphic( embed::getIconPixmap( - "lfo_d100_active" ) ); - d100->setInactiveGraphic( embed::getIconPixmap( - "lfo_d100_inactive" ) ); - d100->setToolTip( - tr( "Divide modulation frequency by 100" )); + d100->move(CD_LFO_MULTIPLIER_X, CD_LFO_SHAPES_Y + 22); + d100->setActiveGraphic(embed::getIconPixmap("lfo_d100_active")); + d100->setInactiveGraphic(embed::getIconPixmap("lfo_d100_inactive")); + d100->setToolTip(tr("Divide modulation frequency by 100")); m_multiplierBtnGrp = new automatableButtonGroup( this ); m_multiplierBtnGrp->addButton( x1 ); From 17aa7dbef5f4b1dbf8c7c335ef6f2a7759600f21 Mon Sep 17 00:00:00 2001 From: saker Date: Sat, 10 Dec 2022 13:48:17 -0500 Subject: [PATCH 02/70] Fix unwanted scrolling when changing track name (#6583) --- src/gui/tracks/TrackLabelButton.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/tracks/TrackLabelButton.cpp b/src/gui/tracks/TrackLabelButton.cpp index b82c8cf6e..3f1b45871 100644 --- a/src/gui/tracks/TrackLabelButton.cpp +++ b/src/gui/tracks/TrackLabelButton.cpp @@ -105,6 +105,7 @@ void TrackLabelButton::renameFinished() { if( !( ConfigManager::inst()->value( "ui", "compacttrackbuttons" ).toInt() ) ) { + m_renameLineEdit->clearFocus(); m_renameLineEdit->hide(); if( m_renameLineEdit->text() != "" ) { From e92561265c573bd781b1f7a683f5639d660d8849 Mon Sep 17 00:00:00 2001 From: Dominic Clark Date: Sun, 18 Dec 2022 18:04:37 +0000 Subject: [PATCH 03/70] Only rebuild translations when ts files change (#6566) --- data/locale/CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/data/locale/CMakeLists.txt b/data/locale/CMakeLists.txt index 4ce666dcf..f7f9071e7 100644 --- a/data/locale/CMakeLists.txt +++ b/data/locale/CMakeLists.txt @@ -29,9 +29,14 @@ FOREACH(_ts_file ${lmms_LOCALES}) ADD_CUSTOM_TARGET(${_ts_target} COMMAND "${QT_LUPDATE_EXECUTABLE}" -locations none -no-obsolete -I ${CMAKE_SOURCE_DIR}/include/ ${LMMS_SRCS} ${LMMS_UIS} ${CMAKE_SOURCE_DIR}/plugins -ts "\"${_ts_file}\"" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) - ADD_CUSTOM_TARGET(${_qm_target} + add_custom_command( + OUTPUT "${_qm_file}" COMMAND "${QT_LRELEASE_EXECUTABLE}" "${_ts_file}" -qm "${_qm_file}" - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + MAIN_DEPENDENCY "${_ts_file}" + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + VERBATIM + ) + add_custom_target("${_qm_target}" DEPENDS "${_qm_file}") LIST(APPEND ts_targets "${_ts_target}") LIST(APPEND qm_targets "${_qm_target}") LIST(APPEND QM_FILES "${_qm_file}") From ff5f092a631af11a241739adb6f0841e29c6a24c Mon Sep 17 00:00:00 2001 From: Dominic Clark Date: Sun, 18 Dec 2022 18:37:53 +0000 Subject: [PATCH 04/70] Show pull request number in version string (#6565) --- CMakeLists.txt | 2 +- cmake/modules/VersionInfo.cmake | 40 +++++++++++++++++++++++++-------- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ad419e2cb..dae43e573 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.8) +CMAKE_MINIMUM_REQUIRED(VERSION 3.9) PROJECT(lmms) diff --git a/cmake/modules/VersionInfo.cmake b/cmake/modules/VersionInfo.cmake index 9571514a6..6f4c371f1 100644 --- a/cmake/modules/VersionInfo.cmake +++ b/cmake/modules/VersionInfo.cmake @@ -3,6 +3,13 @@ IF(GIT_FOUND AND NOT FORCE_VERSION) SET(MAJOR_VERSION 0) SET(MINOR_VERSION 0) SET(PATCH_VERSION 0) + + # If this is a GitHub Actions pull request build, get the pull request + # number from the environment and add it to the build metadata + if("$ENV{GITHUB_REF}" MATCHES "refs/pull/([0-9]+)/merge") + list(APPEND BUILD_METADATA "pr${CMAKE_MATCH_1}") + endif() + # Look for git tag information (e.g. Tagged: "v1.0.0", Untagged: "v1.0.0-123-a1b2c3d") # Untagged format: [latest tag]-[number of commits]-[latest commit hash] EXECUTE_PROCESS( @@ -30,28 +37,43 @@ IF(GIT_FOUND AND NOT FORCE_VERSION) ENDIF() # 1 dash total: Dash in latest tag, no additional commits => pre-release IF(TAG_LIST_LENGTH EQUAL 2) + # Get the pre-release stage LIST(GET TAG_LIST 1 VERSION_STAGE) - SET(FORCE_VERSION "${FORCE_VERSION}-${VERSION_STAGE}") + list(APPEND PRERELEASE_DATA "${VERSION_STAGE}") # 2 dashes: Assume untagged with no dashes in latest tag name => stable + commits ELSEIF(TAG_LIST_LENGTH EQUAL 3) # Get the number of commits and latest commit hash LIST(GET TAG_LIST 1 EXTRA_COMMITS) LIST(GET TAG_LIST 2 COMMIT_HASH) - # Bump the patch version + list(APPEND PRERELEASE_DATA "${EXTRA_COMMITS}") + list(APPEND BUILD_METADATA "${COMMIT_HASH}") + # Bump the patch version, since a pre-release (as specified by the extra + # commits) compares lower than the main version alone MATH(EXPR PATCH_VERSION "${PATCH_VERSION}+1") - # Set the version to MAJOR.MINOR.PATCH-EXTRA_COMMITS+COMMIT_HASH - SET(FORCE_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}") - SET(FORCE_VERSION "${FORCE_VERSION}-${EXTRA_COMMITS}+${COMMIT_HASH}") + # Reassemble the main version using the new patch version + set(FORCE_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}") # 3 dashes: Assume untagged with 1 dash in latest tag name => pre-release + commits ELSEIF(TAG_LIST_LENGTH EQUAL 4) - # Get pre-release stage, number of commits, and latest commit hash + # Get the pre-release stage, number of commits, and latest commit hash LIST(GET TAG_LIST 1 VERSION_STAGE) LIST(GET TAG_LIST 2 EXTRA_COMMITS) LIST(GET TAG_LIST 3 COMMIT_HASH) - # Set the version to MAJOR.MINOR.PATCH-VERSION_STAGE.EXTRA_COMMITS+COMMIT_HASH - SET(FORCE_VERSION "${FORCE_VERSION}-${VERSION_STAGE}") - SET(FORCE_VERSION "${FORCE_VERSION}.${EXTRA_COMMITS}+${COMMIT_HASH}") + list(APPEND PRERELEASE_DATA "${VERSION_STAGE}") + list(APPEND PRERELEASE_DATA "${EXTRA_COMMITS}") + list(APPEND BUILD_METADATA "${COMMIT_HASH}") ENDIF() + + # If there is any pre-release data, append it after a hyphen + if(PRERELEASE_DATA) + string(REPLACE ";" "." PRERELEASE_DATA "${PRERELEASE_DATA}") + set(FORCE_VERSION "${FORCE_VERSION}-${PRERELEASE_DATA}") + endif() + + # If there is any build metadata, append it after a plus + if(BUILD_METADATA) + string(REPLACE ";" "." BUILD_METADATA "${BUILD_METADATA}") + set(FORCE_VERSION "${FORCE_VERSION}+${BUILD_METADATA}") + endif() ENDIF() IF(FORCE_VERSION STREQUAL "internal") From edd759b51176b558f8acb20fc83555fba3ad28dd Mon Sep 17 00:00:00 2001 From: Veratil Date: Sun, 25 Dec 2022 22:13:09 -0600 Subject: [PATCH 05/70] Fix deprecated QString.sprintf with QString.arg --- include/Scale.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/Scale.h b/include/Scale.h index 3a92dd689..96159a53c 100644 --- a/include/Scale.h +++ b/include/Scale.h @@ -47,7 +47,7 @@ public: QString getString() const { if (m_denominator) {return QString::number(m_numerator) + "/" + QString::number(m_denominator);} - else {return QString().sprintf("%.4f", m_cents);} + else {return QString("%1").arg(m_cents, 0, 'f', 4);} } void saveSettings(QDomDocument &doc, QDomElement &element) override; From a876cf9d0058ed4c5e20d9b4cf713eec6a6aa086 Mon Sep 17 00:00:00 2001 From: saker Date: Fri, 30 Dec 2022 17:18:14 -0500 Subject: [PATCH 06/70] clang-tidy: Apply modernize-avoid-c-arrays everywhere (#6564) Co-authored-by: Dominic Clark Co-authored-by: Hyunjin Song --- include/DataFile.h | 8 -- include/InstrumentFunctions.h | 3 +- include/Oscillator.h | 2 +- include/PianoRoll.h | 2 +- include/ProjectRenderer.h | 2 +- plugins/Amplifier/Amplifier.cpp | 16 ++-- plugins/BassBooster/BassBooster.cpp | 2 +- plugins/Bitcrush/Bitcrush.cpp | 40 +++++----- plugins/Compressor/Compressor.cpp | 12 +-- .../Compressor/CompressorControlDialog.cpp | 10 +-- plugins/Delay/DelayEffect.cpp | 2 +- plugins/DualFilter/DualFilter.cpp | 10 +-- .../DynamicsProcessor/DynamicsProcessor.cpp | 10 +-- .../DynamicsProcessorControls.cpp | 2 +- plugins/Eq/EqEffect.cpp | 2 +- plugins/Flanger/FlangerEffect.cpp | 2 +- plugins/FreeBoy/FreeBoy.cpp | 6 +- plugins/LadspaEffect/LadspaEffect.cpp | 32 ++++---- plugins/MidiExport/MidiExport.cpp | 16 ++-- plugins/MidiImport/MidiImport.cpp | 46 ++++++------ plugins/Monstro/Monstro.cpp | 8 +- plugins/OpulenZ/OpulenZ.cpp | 38 +++++----- plugins/Organic/Organic.cpp | 74 +++++++++---------- plugins/Patman/Patman.cpp | 8 +- plugins/ReverbSC/ReverbSC.cpp | 24 +++--- plugins/Sid/SidInstrument.cpp | 44 +++++------ plugins/SpectrumAnalyzer/SaSpectrumView.cpp | 4 +- plugins/StereoEnhancer/StereoEnhancer.cpp | 14 ++-- plugins/TripleOscillator/TripleOscillator.cpp | 12 +-- plugins/Vestige/Vestige.cpp | 34 ++++----- plugins/VstEffect/VstEffectControls.cpp | 44 +++++------ plugins/WaveShaper/WaveShaper.cpp | 8 +- plugins/WaveShaper/WaveShaperControls.cpp | 4 +- plugins/Xpressive/ExprSynth.cpp | 16 ++-- src/core/DataFile.cpp | 32 +++++--- src/core/Instrument.cpp | 2 +- src/core/InstrumentFunctions.cpp | 9 ++- src/core/MixHelpers.cpp | 4 +- src/core/Oscillator.cpp | 8 +- src/core/PathUtil.cpp | 4 +- src/core/Piano.cpp | 2 +- src/core/ProjectRenderer.cpp | 22 +++--- src/core/SampleBuffer.cpp | 2 +- src/core/audio/AudioFileFlac.cpp | 10 +-- src/core/lv2/Lv2Proc.cpp | 10 +-- src/core/midi/MidiAlsaRaw.cpp | 4 +- src/core/midi/MidiAlsaSeq.cpp | 2 +- src/core/midi/MidiClient.cpp | 20 ++--- src/gui/LmmsStyle.cpp | 23 +++--- src/gui/editors/AutomationEditor.cpp | 4 +- src/gui/editors/PianoRoll.cpp | 8 +- src/gui/instrument/PianoView.cpp | 2 +- src/gui/modals/ExportProjectDialog.cpp | 8 +- src/gui/widgets/LedCheckBox.cpp | 2 +- 54 files changed, 369 insertions(+), 366 deletions(-) diff --git a/include/DataFile.h b/include/DataFile.h index 5eb61a932..fb8b2ae3e 100644 --- a/include/DataFile.h +++ b/include/DataFile.h @@ -143,14 +143,6 @@ private: void loadData( const QByteArray & _data, const QString & _sourceFile ); - - struct LMMS_EXPORT typeDescStruct - { - Type m_type; - QString m_name; - } ; - static typeDescStruct s_types[TypeCount]; - QString m_fileName; //!< The origin file name or "" if this DataFile didn't originate from a file QDomElement m_content; QDomElement m_head; diff --git a/include/InstrumentFunctions.h b/include/InstrumentFunctions.h index a349ddf9c..5dcb1114b 100644 --- a/include/InstrumentFunctions.h +++ b/include/InstrumentFunctions.h @@ -52,6 +52,7 @@ class InstrumentFunctionNoteStacking : public Model, public JournallingObject public: static const int MAX_CHORD_POLYPHONY = 13; + static const int NUM_CHORD_TABLES = 95; private: using ChordSemiTones = std::array; @@ -129,7 +130,7 @@ public: ChordSemiTones m_semiTones; }; - static Init s_initTable[]; + static std::array s_initTable; public: static const ChordTable & getInstance() diff --git a/include/Oscillator.h b/include/Oscillator.h index e9f64008c..8727ee39c 100644 --- a/include/Oscillator.h +++ b/include/Oscillator.h @@ -255,7 +255,7 @@ private: static fftwf_plan s_fftPlan; static fftwf_plan s_ifftPlan; static fftwf_complex * s_specBuf; - static float s_sampleBuffer[OscillatorConstants::WAVETABLE_LENGTH]; + static std::array s_sampleBuffer; static void generateSawWaveTable(int bands, sample_t* table, int firstBand = 1); static void generateTriangleWaveTable(int bands, sample_t* table, int firstBand = 1); diff --git a/include/PianoRoll.h b/include/PianoRoll.h index 60cf01e1d..c1973f407 100644 --- a/include/PianoRoll.h +++ b/include/PianoRoll.h @@ -343,7 +343,7 @@ private: static QPixmap * s_toolOpen; static QPixmap* s_toolKnife; - static PianoRollKeyTypes prKeyOrder[]; + static std::array prKeyOrder; static TextFloat * s_textFloat; diff --git a/include/ProjectRenderer.h b/include/ProjectRenderer.h index 75537ed69..2ca20569b 100644 --- a/include/ProjectRenderer.h +++ b/include/ProjectRenderer.h @@ -76,7 +76,7 @@ public: static QString getFileExtensionFromFormat( ExportFileFormats fmt ); - static const FileEncodeDevice fileEncodeDevices[]; + static const std::array fileEncodeDevices; public slots: void startProcessing(); diff --git a/plugins/Amplifier/Amplifier.cpp b/plugins/Amplifier/Amplifier.cpp index 3fb03d3d9..9344807c4 100644 --- a/plugins/Amplifier/Amplifier.cpp +++ b/plugins/Amplifier/Amplifier.cpp @@ -74,7 +74,7 @@ bool AmplifierEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) double outSum = 0.0; const float d = dryLevel(); const float w = wetLevel(); - + const ValueBuffer * volBuf = m_ampControls.m_volumeModel.valueBuffer(); const ValueBuffer * panBuf = m_ampControls.m_panModel.valueBuffer(); const ValueBuffer * leftBuf = m_ampControls.m_leftModel.valueBuffer(); @@ -83,8 +83,8 @@ bool AmplifierEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) for( fpp_t f = 0; f < frames; ++f ) { // qDebug( "offset %d, value %f", f, m_ampControls.m_volumeModel.value( f ) ); - - sample_t s[2] = { buf[f][0], buf[f][1] }; + + auto s = std::array{buf[f][0], buf[f][1]}; // vol knob if( volBuf ) @@ -99,8 +99,8 @@ bool AmplifierEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) } // convert pan values to left/right values - const float pan = panBuf - ? panBuf->value( f ) + const float pan = panBuf + ? panBuf->value( f ) : m_ampControls.m_panModel.value(); const float left1 = pan <= 0 ? 1.0 @@ -111,12 +111,12 @@ bool AmplifierEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) // second stage amplification const float left2 = leftBuf - ? leftBuf->value( f ) + ? leftBuf->value( f ) : m_ampControls.m_leftModel.value(); const float right2 = rightBuf - ? rightBuf->value( f ) + ? rightBuf->value( f ) : m_ampControls.m_rightModel.value(); - + s[0] *= left1 * left2 * 0.01; s[1] *= right1 * right2 * 0.01; diff --git a/plugins/BassBooster/BassBooster.cpp b/plugins/BassBooster/BassBooster.cpp index 77667c121..48e265911 100644 --- a/plugins/BassBooster/BassBooster.cpp +++ b/plugins/BassBooster/BassBooster.cpp @@ -102,7 +102,7 @@ bool BassBoosterEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames m_bbFX.leftFX().setGain( gain ); m_bbFX.rightFX().setGain( gain); - sample_t s[2] = { buf[f][0], buf[f][1] }; + auto s = std::array{buf[f][0], buf[f][1]}; m_bbFX.nextSample( s[0], s[1] ); buf[f][0] = d * buf[f][0] + w * s[0]; diff --git a/plugins/Bitcrush/Bitcrush.cpp b/plugins/Bitcrush/Bitcrush.cpp index 68724eccd..963e970db 100644 --- a/plugins/Bitcrush/Bitcrush.cpp +++ b/plugins/Bitcrush/Bitcrush.cpp @@ -35,8 +35,8 @@ const int OS_RATE = 5; const float OS_RATIO = 1.0f / OS_RATE; const float CUTOFF_RATIO = 0.353553391f; const int SILENCEFRAMES = 10; -const float OS_RESAMPLE [5] = { 0.0001490062883964112, 0.1645978376763992, 0.6705063120704088, - 0.1645978376763992, 0.0001490062883964112 }; +const auto OS_RESAMPLE = std::array{0.0001490062883964112f, 0.1645978376763992f, 0.6705063120704088f, + 0.1645978376763992f, 0.0001490062883964112f }; extern "C" { @@ -65,13 +65,13 @@ BitcrushEffect::BitcrushEffect( Model * parent, const Descriptor::SubPluginFeatu m_buffer = MM_ALLOC( Engine::audioEngine()->framesPerPeriod() * OS_RATE ); m_filter.setLowpass( m_sampleRate * ( CUTOFF_RATIO * OS_RATIO ) ); m_needsUpdate = true; - + m_bitCounterL = 0.0f; m_bitCounterR = 0.0f; - + m_left = 0.0f; m_right = 0.0f; - + m_silenceCounter = 0; } @@ -125,7 +125,7 @@ bool BitcrushEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) m_rateCoeffL = ( m_sampleRate * OS_RATE ) / ( rate - diff ); m_rateCoeffR = ( m_sampleRate * OS_RATE ) / ( rate + diff ); - + m_bitCounterL = 0.0f; m_bitCounterR = 0.0f; } @@ -147,9 +147,9 @@ bool BitcrushEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) m_outClip = dbfsToAmp( m_controls.m_outClip.value() ); } m_needsUpdate = false; - + const float noiseAmt = m_controls.m_inNoise.value() * 0.01f; - + // read input buffer and write it to oversampled buffer if( m_rateEnabled ) // rate crushing enabled so do that { @@ -164,15 +164,15 @@ bool BitcrushEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) if( m_bitCounterL > m_rateCoeffL ) { m_bitCounterL -= m_rateCoeffL; - m_left = m_depthEnabled - ? depthCrush( buf[f][0] * m_inGain + noise( buf[f][0] * noiseAmt ) ) + m_left = m_depthEnabled + ? depthCrush( buf[f][0] * m_inGain + noise( buf[f][0] * noiseAmt ) ) : buf[f][0] * m_inGain + noise( buf[f][0] * noiseAmt ); } if( m_bitCounterR > m_rateCoeffR ) { m_bitCounterR -= m_rateCoeffR; - m_right = m_depthEnabled - ? depthCrush( buf[f][1] * m_inGain + noise( buf[f][1] * noiseAmt ) ) + m_right = m_depthEnabled + ? depthCrush( buf[f][1] * m_inGain + noise( buf[f][1] * noiseAmt ) ) : buf[f][1] * m_inGain + noise( buf[f][1] * noiseAmt ); } } @@ -185,17 +185,17 @@ bool BitcrushEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) for( int o = 0; o < OS_RATE; ++o ) { m_buffer[f * OS_RATE + o][0] = m_depthEnabled - ? depthCrush( buf[f][0] * m_inGain + noise( buf[f][0] * noiseAmt ) ) + ? depthCrush( buf[f][0] * m_inGain + noise( buf[f][0] * noiseAmt ) ) : buf[f][0] * m_inGain + noise( buf[f][0] * noiseAmt ); m_buffer[f * OS_RATE + o][1] = m_depthEnabled - ? depthCrush( buf[f][1] * m_inGain + noise( buf[f][1] * noiseAmt ) ) + ? depthCrush( buf[f][1] * m_inGain + noise( buf[f][1] * noiseAmt ) ) : buf[f][1] * m_inGain + noise( buf[f][1] * noiseAmt ); } } } - + // the oversampled buffer is now written, so filter it to reduce aliasing - + for( int f = 0; f < frames * OS_RATE; ++f ) { if( qMax( qAbs( m_buffer[f][0] ), qAbs( m_buffer[f][1] ) ) >= 1.0e-10f ) @@ -218,10 +218,10 @@ bool BitcrushEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) } } } - - + + // now downsample and write it back to main buffer - + double outSum = 0.0; const float d = dryLevel(); const float w = wetLevel(); @@ -238,7 +238,7 @@ bool BitcrushEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) buf[f][1] = d * buf[f][1] + w * qBound( -m_outClip, rsum, m_outClip ) * m_outGain; outSum += buf[f][0]*buf[f][0] + buf[f][1]*buf[f][1]; } - + checkGate( outSum / frames ); return isRunning(); diff --git a/plugins/Compressor/Compressor.cpp b/plugins/Compressor/Compressor.cpp index 312a40d3d..92123ffd9 100755 --- a/plugins/Compressor/Compressor.cpp +++ b/plugins/Compressor/Compressor.cpp @@ -276,7 +276,7 @@ bool CompressorEffect::processAudioBuffer(sampleFrame* buf, const fpp_t frames) float rOutPeak = 0.0; float lInPeak = 0.0; float rInPeak = 0.0; - + const bool midside = m_compressorControls.m_midsideModel.value(); const bool peakmode = m_compressorControls.m_peakmodeModel.value(); const float inBalance = m_compressorControls.m_inBalanceModel.value(); @@ -292,8 +292,8 @@ bool CompressorEffect::processAudioBuffer(sampleFrame* buf, const fpp_t frames) for(fpp_t f = 0; f < frames; ++f) { - sample_t drySignal[2] = {buf[f][0], buf[f][1]}; - sample_t s[2] = {drySignal[0] * m_inGainVal, drySignal[1] * m_inGainVal}; + auto drySignal = std::array{buf[f][0], buf[f][1]}; + auto s = std::array{drySignal[0] * m_inGainVal, drySignal[1] * m_inGainVal}; // Calculate tilt filters, to bias the sidechain to the low or high frequencies if (m_tiltVal) @@ -512,7 +512,7 @@ bool CompressorEffect::processAudioBuffer(sampleFrame* buf, const fpp_t frames) m_inputBufLoc = 0; } - const float temp[2] = {drySignal[0], drySignal[1]}; + const auto temp = std::array{drySignal[0], drySignal[1]}; s[0] = m_inputBuf[0][m_inputBufLoc]; s[1] = m_inputBuf[1][m_inputBufLoc]; @@ -525,8 +525,8 @@ bool CompressorEffect::processAudioBuffer(sampleFrame* buf, const fpp_t frames) s[1] = drySignal[1]; } - float delayedDrySignal[2] = {s[0], s[1]}; - + auto delayedDrySignal = std::array{s[0], s[1]}; + if (midside)// Convert left/right to mid/side { const float temp = s[0]; diff --git a/plugins/Compressor/CompressorControlDialog.cpp b/plugins/Compressor/CompressorControlDialog.cpp index 2f9fed9c2..8c6f61bec 100755 --- a/plugins/Compressor/CompressorControlDialog.cpp +++ b/plugins/Compressor/CompressorControlDialog.cpp @@ -206,7 +206,7 @@ CompressorControlDialog::CompressorControlDialog(CompressorControls* controls) : peakButton->setActiveGraphic(PLUGIN_NAME::getIconPixmap("peak_sel")); peakButton->setInactiveGraphic(PLUGIN_NAME::getIconPixmap("peak_unsel")); peakButton->setToolTip(tr("Use absolute value of the input")); - + rmsPeakGroup = new automatableButtonGroup(this); rmsPeakGroup->addButton(rmsButton); rmsPeakGroup->addButton(peakButton); @@ -221,7 +221,7 @@ CompressorControlDialog::CompressorControlDialog(CompressorControls* controls) : midSideButton->setActiveGraphic(PLUGIN_NAME::getIconPixmap("midside_sel")); midSideButton->setInactiveGraphic(PLUGIN_NAME::getIconPixmap("midside_unsel")); midSideButton->setToolTip(tr("Compress mid and side audio")); - + leftRightMidSideGroup = new automatableButtonGroup(this); leftRightMidSideGroup->addButton(leftRightButton); leftRightMidSideGroup->addButton(midSideButton); @@ -514,8 +514,8 @@ void CompressorControlDialog::redrawKnee() { m_p.setPen(QPen(m_kneeColor2, 3)); - float prevPoint[2] = {kneePoint1, kneePoint1}; - float newPoint[2] = {0, 0}; + auto prevPoint = std::array{kneePoint1, kneePoint1}; + auto newPoint = std::array{0.f, 0.f}; // Draw knee curve using many straight lines. for (int i = 0; i < COMP_KNEE_LINES; ++i) @@ -542,7 +542,7 @@ void CompressorControlDialog::redrawKnee() m_p.end(); m_p.begin(&m_kneePixmap2); - + m_p.setCompositionMode(QPainter::CompositionMode_Source); m_p.fillRect(0, 0, m_windowSizeX, m_kneeWindowSizeY, QColor("transparent")); m_p.setCompositionMode(QPainter::CompositionMode_SourceOver); diff --git a/plugins/Delay/DelayEffect.cpp b/plugins/Delay/DelayEffect.cpp index 1c6a74b86..6db2f38e3 100644 --- a/plugins/Delay/DelayEffect.cpp +++ b/plugins/Delay/DelayEffect.cpp @@ -91,7 +91,7 @@ bool DelayEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) const float sr = Engine::audioEngine()->processingSampleRate(); const float d = dryLevel(); const float w = wetLevel(); - sample_t dryS[2]; + auto dryS = std::array{}; float lPeak = 0.0; float rPeak = 0.0; float length = m_delayControls.m_delayTimeModel.value(); diff --git a/plugins/DualFilter/DualFilter.cpp b/plugins/DualFilter/DualFilter.cpp index 75a2ab532..e510109e9 100644 --- a/plugins/DualFilter/DualFilter.cpp +++ b/plugins/DualFilter/DualFilter.cpp @@ -134,8 +134,8 @@ bool DualFilterEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames const bool enabled1 = m_dfControls.m_enabled1Model.value(); const bool enabled2 = m_dfControls.m_enabled2Model.value(); - - + + // buffer processing loop for( fpp_t f = 0; f < frames; ++f ) @@ -145,9 +145,9 @@ bool DualFilterEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames const float mix1 = 1.0f - mix2; const float gain1 = *gain1Ptr * 0.01f; const float gain2 = *gain2Ptr * 0.01f; - sample_t s[2] = { 0.0f, 0.0f }; // mix - sample_t s1[2] = { buf[f][0], buf[f][1] }; // filter 1 - sample_t s2[2] = { buf[f][0], buf[f][1] }; // filter 2 + auto s = std::array{0.0f, 0.0f}; // mix + auto s1 = std::array{buf[f][0], buf[f][1]}; // filter 1 + auto s2 = std::array{buf[f][0], buf[f][1]}; // filter 2 // update filter 1 if( enabled1 ) diff --git a/plugins/DynamicsProcessor/DynamicsProcessor.cpp b/plugins/DynamicsProcessor/DynamicsProcessor.cpp index c8ad9a029..54f1f0c50 100644 --- a/plugins/DynamicsProcessor/DynamicsProcessor.cpp +++ b/plugins/DynamicsProcessor/DynamicsProcessor.cpp @@ -105,17 +105,17 @@ bool DynProcEffect::processAudioBuffer( sampleFrame * _buf, // variables for effect int i = 0; - float sm_peak[2] = { 0.0f, 0.0f }; + auto sm_peak = std::array{0.0f, 0.0f}; float gain; double out_sum = 0.0; const float d = dryLevel(); const float w = wetLevel(); - + const int stereoMode = m_dpControls.m_stereomodeModel.value(); const float inputGain = m_dpControls.m_inputModel.value(); const float outputGain = m_dpControls.m_outputModel.value(); - + const float * samples = m_dpControls.m_wavegraphModel.samples(); // debug code @@ -143,7 +143,7 @@ bool DynProcEffect::processAudioBuffer( sampleFrame * _buf, for( fpp_t f = 0; f < _frames; ++f ) { - double s[2] = { _buf[f][0], _buf[f][1] }; + auto s = std::array{_buf[f][0], _buf[f][1]}; // apply input gain s[0] *= inputGain; @@ -211,7 +211,7 @@ bool DynProcEffect::processAudioBuffer( sampleFrame * _buf, gain = samples[199]; }; - s[i] *= gain; + s[i] *= gain; s[i] /= sm_peak[i]; } } diff --git a/plugins/DynamicsProcessor/DynamicsProcessorControls.cpp b/plugins/DynamicsProcessor/DynamicsProcessorControls.cpp index f4bd8c77a..541031a3f 100644 --- a/plugins/DynamicsProcessor/DynamicsProcessorControls.cpp +++ b/plugins/DynamicsProcessor/DynamicsProcessorControls.cpp @@ -116,7 +116,7 @@ void DynProcControls::saveSettings( QDomDocument & _doc, void DynProcControls::setDefaultShape() { - float shp [200] = { }; + auto shp = std::array{}; for ( int i = 0; i<200; i++) { shp[i] = ((float)i + 1.0f) / 200.0f; diff --git a/plugins/Eq/EqEffect.cpp b/plugins/Eq/EqEffect.cpp index be74defba..eb168a9f9 100644 --- a/plugins/Eq/EqEffect.cpp +++ b/plugins/Eq/EqEffect.cpp @@ -71,7 +71,7 @@ bool EqEffect::processAudioBuffer( sampleFrame *buf, const fpp_t frames ) //wet/dry controls const float dry = dryLevel(); const float wet = wetLevel(); - sample_t dryS[2]; + auto dryS = std::array{}; // setup sample exact controls float hpRes = m_eqControls.m_hpResModel.value(); float lowShelfRes = m_eqControls.m_lowShelfResModel.value(); diff --git a/plugins/Flanger/FlangerEffect.cpp b/plugins/Flanger/FlangerEffect.cpp index 982702ebe..562badc0a 100644 --- a/plugins/Flanger/FlangerEffect.cpp +++ b/plugins/Flanger/FlangerEffect.cpp @@ -104,7 +104,7 @@ bool FlangerEffect::processAudioBuffer( sampleFrame *buf, const fpp_t frames ) m_lfo->setOffset( m_flangerControls.m_lfoPhaseModel.value() / 180 * D_PI ); m_lDelay->setFeedback( m_flangerControls.m_feedbackModel.value() ); m_rDelay->setFeedback( m_flangerControls.m_feedbackModel.value() ); - sample_t dryS[2]; + auto dryS = std::array{}; float leftLfo; float rightLfo; for( fpp_t f = 0; f < frames; ++f ) diff --git a/plugins/FreeBoy/FreeBoy.cpp b/plugins/FreeBoy/FreeBoy.cpp index e5ded87ee..0d639d3a6 100644 --- a/plugins/FreeBoy/FreeBoy.cpp +++ b/plugins/FreeBoy/FreeBoy.cpp @@ -311,7 +311,7 @@ void FreeBoyInstrument::playNote( NotePlayHandle * _n, data = 128; papu->write_register( fakeClock(), 0xff1a, data ); - int ch3voldata[4] = { 0, 3, 2, 1 }; + auto ch3voldata = std::array{0, 3, 2, 1}; data = ch3voldata[(int)m_ch3VolumeModel.value()]; data = data<<5; papu->write_register( fakeClock(), 0xff1c, data ); @@ -388,7 +388,7 @@ void FreeBoyInstrument::playNote( NotePlayHandle * _n, int const buf_size = 2048; int framesleft = frames; int datalen = 0; - blip_sample_t buf [buf_size*2]; + auto buf = std::array{}; while( framesleft > 0 ) { int avail = papu->samples_avail(); @@ -401,7 +401,7 @@ void FreeBoyInstrument::playNote( NotePlayHandle * _n, datalen = framesleft>avail?avail:framesleft; datalen = datalen>buf_size?buf_size:datalen; - long count = papu->read_samples( buf, datalen*2)/2; + long count = papu->read_samples(buf.data(), datalen * 2) / 2; for( fpp_t frame = 0; frame < count; ++frame ) { diff --git a/plugins/LadspaEffect/LadspaEffect.cpp b/plugins/LadspaEffect/LadspaEffect.cpp index 572d60cd8..e5d1c5d69 100644 --- a/plugins/LadspaEffect/LadspaEffect.cpp +++ b/plugins/LadspaEffect/LadspaEffect.cpp @@ -130,7 +130,7 @@ void LadspaEffect::changeSampleRate() -bool LadspaEffect::processAudioBuffer( sampleFrame * _buf, +bool LadspaEffect::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ) { m_pluginMutex.lock(); @@ -154,7 +154,7 @@ bool LadspaEffect::processAudioBuffer( sampleFrame * _buf, } // Copy the LMMS audio buffer to the LADSPA input buffer and initialize - // the control ports. + // the control ports. ch_cnt_t channel = 0; for( ch_cnt_t proc = 0; proc < processorCount(); ++proc ) { @@ -164,10 +164,10 @@ bool LadspaEffect::processAudioBuffer( sampleFrame * _buf, switch( pp->rate ) { case CHANNEL_IN: - for( fpp_t frame = 0; + for( fpp_t frame = 0; frame < frames; ++frame ) { - pp->buffer[frame] = + pp->buffer[frame] = _buf[frame][channel]; } ++channel; @@ -181,15 +181,15 @@ bool LadspaEffect::processAudioBuffer( sampleFrame * _buf, } else { - pp->value = static_cast( + pp->value = static_cast( pp->control->value() / pp->scale ); // This only supports control rate ports, so the audio rates are // treated as though they were control rate by setting the // port buffer to all the same value. - for( fpp_t frame = 0; + for( fpp_t frame = 0; frame < frames; ++frame ) { - pp->buffer[frame] = + pp->buffer[frame] = pp->value; } } @@ -200,9 +200,9 @@ bool LadspaEffect::processAudioBuffer( sampleFrame * _buf, { break; } - pp->value = static_cast( + pp->value = static_cast( pp->control->value() / pp->scale ); - pp->buffer[0] = + pp->buffer[0] = pp->value; break; case CHANNEL_OUT: @@ -239,7 +239,7 @@ bool LadspaEffect::processAudioBuffer( sampleFrame * _buf, case CONTROL_RATE_INPUT: break; case CHANNEL_OUT: - for( fpp_t frame = 0; + for( fpp_t frame = 0; frame < frames; ++frame ) { _buf[frame][channel] = d * _buf[frame][channel] + w * pp->buffer[frame]; @@ -303,7 +303,7 @@ void LadspaEffect::pluginInstantiation() int inputch = 0; int outputch = 0; - LADSPA_Data * inbuf [2]; + std::array inbuf; inbuf[0] = nullptr; inbuf[1] = nullptr; for( ch_cnt_t proc = 0; proc < processorCount(); proc++ ) @@ -463,9 +463,9 @@ void LadspaEffect::pluginInstantiation() ports.append( p ); - // For convenience, keep a separate list of the ports that are used + // For convenience, keep a separate list of the ports that are used // to control the processors. - if( p->rate == AUDIO_RATE_INPUT || + if( p->rate == AUDIO_RATE_INPUT || p->rate == CONTROL_RATE_INPUT ) { p->control_id = m_portControls.count(); @@ -479,7 +479,7 @@ void LadspaEffect::pluginInstantiation() m_descriptor = manager->getDescriptor( m_key ); if( m_descriptor == nullptr ) { - QMessageBox::warning( 0, "Effect", + QMessageBox::warning( 0, "Effect", "Can't get LADSPA descriptor function: " + m_key.second, QMessageBox::Ok, QMessageBox::NoButton ); setOkay( false ); @@ -518,8 +518,8 @@ void LadspaEffect::pluginInstantiation() port, pp->buffer ) ) { - QMessageBox::warning( 0, "Effect", - "Failed to connect port: " + m_key.second, + QMessageBox::warning( 0, "Effect", + "Failed to connect port: " + m_key.second, QMessageBox::Ok, QMessageBox::NoButton ); setDontRun( true ); return; diff --git a/plugins/MidiExport/MidiExport.cpp b/plugins/MidiExport/MidiExport.cpp index cbbdc0100..0d18d8ae1 100644 --- a/plugins/MidiExport/MidiExport.cpp +++ b/plugins/MidiExport/MidiExport.cpp @@ -5,7 +5,7 @@ * Copyright (c) 2017 Hyunjin Song * * This file is part of LMMS - https://lmms.io - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License as published by the Free Software Foundation; either @@ -81,7 +81,7 @@ bool MidiExport::tryExport(const TrackContainer::TrackList &tracks, int nTracks = 0; - uint8_t buffer[BUFFER_SIZE]; + auto buffer = std::array{}; uint32_t size; for (const Track* track : tracks) if (track->type() == Track::InstrumentTrack) nTracks++; @@ -89,8 +89,8 @@ bool MidiExport::tryExport(const TrackContainer::TrackList &tracks, // midi header MidiFile::MIDIHeader header(nTracks); - size = header.writeToBuffer(buffer); - midiout.writeRawData((char *)buffer, size); + size = header.writeToBuffer(buffer.data()); + midiout.writeRawData((char *)buffer.data(), size); std::vector>> plists; @@ -139,8 +139,8 @@ bool MidiExport::tryExport(const TrackContainer::TrackList &tracks, } processPatternNotes(midiClip, INT_MAX); writeMidiClipToTrack(mtrack, midiClip); - size = mtrack.writeToBuffer(buffer); - midiout.writeRawData((char *)buffer, size); + size = mtrack.writeToBuffer(buffer.data()); + midiout.writeRawData((char *)buffer.data(), size); } if (track->type() == Track::PatternTrack) @@ -254,8 +254,8 @@ bool MidiExport::tryExport(const TrackContainer::TrackList &tracks, ++itr; } } - size = mtrack.writeToBuffer(buffer); - midiout.writeRawData((char *)buffer, size); + size = mtrack.writeToBuffer(buffer.data()); + midiout.writeRawData((char *)buffer.data(), size); } return true; diff --git a/plugins/MidiImport/MidiImport.cpp b/plugins/MidiImport/MidiImport.cpp index c669b02b7..6a0314966 100644 --- a/plugins/MidiImport/MidiImport.cpp +++ b/plugins/MidiImport/MidiImport.cpp @@ -4,7 +4,7 @@ * Copyright (c) 2005-2014 Tobias Doerffel * * This file is part of LMMS - https://lmms.io - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License as published by the Free Software Foundation; either @@ -152,17 +152,17 @@ public: ap( nullptr ), lastPos( 0 ) { } - + AutomationTrack * at; AutomationClip * ap; TimePos lastPos; - + smfMidiCC & create( TrackContainer* tc, QString tn ) { if( !at ) { - // Keep LMMS responsive, for now the import runs - // in the main thread. This should probably be + // Keep LMMS responsive, for now the import runs + // in the main thread. This should probably be // removed if that ever changes. qApp->processEvents(); at = dynamic_cast( Track::create( Track::AutomationTrack, tc ) ); @@ -195,7 +195,7 @@ public: lastPos = time; time = time - ap->startPosition(); ap->putValue( time, value, false ); - ap->changeLength( TimePos( time.getBar() + 1, 0 ) ); + ap->changeLength( TimePos( time.getBar() + 1, 0 ) ); return *this; } @@ -214,14 +214,14 @@ public: isSF2( false ), hasNotes( false ) { } - + InstrumentTrack * it; MidiClip* p; Instrument * it_inst; - bool isSF2; + bool isSF2; bool hasNotes; QString trackName; - + smfMidiChannel * create( TrackContainer* tc, QString tn ) { if( !it ) { @@ -231,7 +231,7 @@ public: #ifdef LMMS_HAVE_FLUIDSYNTH it_inst = it->loadInstrument( "sf2player" ); - + if( it_inst ) { isSF2 = true; @@ -242,7 +242,7 @@ public: else { it_inst = it->loadInstrument( "patman" ); - } + } #else it_inst = it->loadInstrument( "patman" ); #endif @@ -315,9 +315,9 @@ bool MidiImport::readSMF( TrackContainer* tc ) pd.setMaximum( seq->tracks() + preTrackSteps ); pd.setValue( 1 ); - + // 128 CC + Pitch Bend - smfMidiCC ccs[MIDI_CC_COUNT]; + auto ccs = std::array{}; // channel to CC object for program changes std::unordered_map pcs; @@ -338,9 +338,9 @@ bool MidiImport::readSMF( TrackContainer* tc ) auto timeSigDenominatorPat = new AutomationClip(dt); timeSigDenominatorPat->setDisplayName(tr("Denominator")); timeSigDenominatorPat->addObject(&timeSigMM.denominatorModel()); - + // TODO: adjust these to Time.Sig changes - double beatsPerBar = 4; + double beatsPerBar = 4; double ticksPerBeat = DefaultTicksPerBar / beatsPerBar; // Time-sig changes @@ -389,7 +389,7 @@ bool MidiImport::readSMF( TrackContainer* tc ) if( evt->is_update() ) { - printf("Unhandled SONG update: %d %f %s\n", + printf("Unhandled SONG update: %d %f %s\n", evt->get_type_code(), evt->time, evt->get_attribute() ); } } @@ -451,9 +451,9 @@ bool MidiImport::readSMF( TrackContainer* tc ) noteEvt->get_identifier(), noteEvt->get_loud() * (200.f / 127.f)); // Map from MIDI velocity to LMMS volume ch->addNote( n ); - + } - + else if( evt->is_update() ) { smfMidiChannel * ch = chs[evt->chan].create( tc, trackName ); @@ -499,7 +499,7 @@ bool MidiImport::readSMF( TrackContainer* tc ) double cc = evt->get_real_value(); AutomatableModel * objModel = nullptr; - switch( ccid ) + switch( ccid ) { case 0: if( ch->isSF2 && ch->it_inst ) @@ -540,7 +540,7 @@ bool MidiImport::readSMF( TrackContainer* tc ) if( ccs[ccid].at == nullptr ) { ccs[ccid].create( tc, trackName + " > " + ( objModel != nullptr ? - objModel->displayName() : + objModel->displayName() : QString("CC %1").arg(ccid) ) ); } ccs[ccid].putValue( time, objModel, cc ); @@ -549,7 +549,7 @@ bool MidiImport::readSMF( TrackContainer* tc ) } } else { - printf("Unhandled update: %d %d %f %s\n", (int) evt->chan, + printf("Unhandled update: %d %d %f %s\n", (int) evt->chan, evt->get_type_code(), evt->time, evt->get_attribute() ); } } @@ -557,8 +557,8 @@ bool MidiImport::readSMF( TrackContainer* tc ) } delete seq; - - + + for( auto& c: chs ) { if (c.second.hasNotes) diff --git a/plugins/Monstro/Monstro.cpp b/plugins/Monstro/Monstro.cpp index 51205c660..3a9737fdb 100644 --- a/plugins/Monstro/Monstro.cpp +++ b/plugins/Monstro/Monstro.cpp @@ -653,8 +653,8 @@ inline void MonstroSynth::updateModulators( float * env1, float * env2, float * // frames played before const f_cnt_t tfp = m_nph->totalFramesPlayed(); - float * lfo [2]; - float * env [2]; + auto lfo = std::array{}; + auto env = std::array{}; lfo[0] = lfo1; lfo[1] = lfo2; env[0] = env1; @@ -1694,8 +1694,8 @@ QWidget * MonstroView::setupOperatorsView( QWidget * _parent ) m_lfo2WaveBox -> setGeometry( 127, LFOROW + 7, 42, ComboBox::DEFAULT_HEIGHT ); m_lfo2WaveBox->setFont( pointSize<8>( m_lfo2WaveBox->font() ) ); - maketsknob(m_lfo2AttKnob, LFOCOL4, LFOROW, tr("Attack"), " ms", "lfoKnob") - maketsknob(m_lfo2RateKnob, LFOCOL5, LFOROW, tr("Rate"), " ms", "lfoKnob") + maketsknob(m_lfo2AttKnob, LFOCOL4, LFOROW, tr("Attack"), " ms", "lfoKnob") + maketsknob(m_lfo2RateKnob, LFOCOL5, LFOROW, tr("Rate"), " ms", "lfoKnob") makeknob(m_lfo2PhsKnob, LFOCOL6, LFOROW, tr("Phase"), tr(" deg"), "lfoKnob") maketsknob(m_env1PreKnob, KNOBCOL1, E1ROW, tr("Pre-delay"), " ms", "envKnob") diff --git a/plugins/OpulenZ/OpulenZ.cpp b/plugins/OpulenZ/OpulenZ.cpp index 67349e48b..3a18c1e3f 100644 --- a/plugins/OpulenZ/OpulenZ.cpp +++ b/plugins/OpulenZ/OpulenZ.cpp @@ -92,7 +92,7 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model *m, void * ) QMutex OpulenzInstrument::emulatorMutex; // Weird ordering of voice parameters -const unsigned int adlib_opadd[OPL2_VOICES] = {0x00, 0x01, 0x02, 0x08, 0x09, 0x0A, 0x10, 0x11, 0x12}; +const auto adlib_opadd = std::array{0x00, 0x01, 0x02, 0x08, 0x09, 0x0A, 0x10, 0x11, 0x12}; OpulenzInstrument::OpulenzInstrument( InstrumentTrack * _instrument_track ) : Instrument( _instrument_track, &opulenz_plugin_descriptor ), @@ -371,7 +371,7 @@ bool OpulenzInstrument::handleMidiEvent( const MidiEvent& event, const TimePos& } break; default: -#ifdef LMMS_DEBUG +#ifdef LMMS_DEBUG printf("Midi CC %02x %02x\n", event.controllerNumber(), event.controllerValue() ); #endif break; @@ -534,7 +534,7 @@ void OpulenzInstrument::loadGMPatch() { // Update patch from the models to the chip emulation void OpulenzInstrument::updatePatch() { - unsigned char inst[14] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + auto inst = std::array{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; inst[0] = ( op1_trem_mdl.value() ? 128 : 0 ) + ( op1_vib_mdl.value() ? 64 : 0 ) + ( op1_perc_mdl.value() ? 0 : 32 ) + // NB. This envelope mode is "perc", not "sus" @@ -583,7 +583,7 @@ void OpulenzInstrument::updatePatch() { #endif - loadPatch(inst); + loadPatch(inst.data()); } // Load an SBI file into the knob models @@ -763,7 +763,7 @@ OpulenzInstrumentView::OpulenzInstrumentView( Instrument * _instrument, setPalette( pal ); } OpulenzInstrumentView::~OpulenzInstrumentView() { - // Knobs are QWidgets and our children, so they're + // Knobs are QWidgets and our children, so they're // destroyed automagically } @@ -782,20 +782,20 @@ void OpulenzInstrumentView::updateKnobHints() { // Envelope times in ms: t[0] = 0, t[n] = ( 1<{ + 0.0, 0.2, 0.4, 0.9, 1.8, 3.7, 7.4, 15.0, 30.0, 60.0, 120.0, 240.0, 480.0, - 950.0, 1900.0, 3800.0 + 950.0, 1900.0, 3800.0 }; - const float dr_times[16] = { - 0.0, 1.2, 2.5, 5.0, 10.0, 20.0, 40.0, - 80.0, 160.0, 320.0, 640.0, 1300.0, 2600.0, - 5200.0, 10000.0, 20000.0 + const auto dr_times = std::array{ + 0.0, 1.2, 2.5, 5.0, 10.0, 20.0, 40.0, + 80.0, 160.0, 320.0, 640.0, 1300.0, 2600.0, + 5200.0, 10000.0, 20000.0 }; - - const int fmultipliers[16] = { - -12, 0, 12, 19, 24, 28, 31, 34, 36, 38, 40, 40, 43, 43, 47, 47 + + const auto fmultipliers = std::array{ + -12, 0, 12, 19, 24, 28, 31, 34, 36, 38, 40, 40, 43, 43, 47, 47 }; auto m = castModel(); @@ -863,11 +863,11 @@ void OpulenzInstrumentView::modelChanged() connect( &m->op1_d_mdl, SIGNAL( dataChanged() ), this, SLOT( updateKnobHints() ) ); connect( &m->op2_d_mdl, SIGNAL( dataChanged() ), this, SLOT( updateKnobHints() ) ); - connect( &m->op1_r_mdl, SIGNAL( dataChanged() ), this, SLOT( updateKnobHints() ) ); - connect( &m->op2_r_mdl, SIGNAL( dataChanged() ), this, SLOT( updateKnobHints() ) ); + connect( &m->op1_r_mdl, SIGNAL( dataChanged() ), this, SLOT( updateKnobHints() ) ); + connect( &m->op2_r_mdl, SIGNAL( dataChanged() ), this, SLOT( updateKnobHints() ) ); - connect( &m->op1_mul_mdl, SIGNAL( dataChanged() ), this, SLOT( updateKnobHints() ) ); - connect( &m->op2_mul_mdl, SIGNAL( dataChanged() ), this, SLOT( updateKnobHints() ) ); + connect( &m->op1_mul_mdl, SIGNAL( dataChanged() ), this, SLOT( updateKnobHints() ) ); + connect( &m->op2_mul_mdl, SIGNAL( dataChanged() ), this, SLOT( updateKnobHints() ) ); updateKnobHints(); diff --git a/plugins/Organic/Organic.cpp b/plugins/Organic/Organic.cpp index cd18fc555..6c2cde773 100644 --- a/plugins/Organic/Organic.cpp +++ b/plugins/Organic/Organic.cpp @@ -2,7 +2,7 @@ * Organic.cpp - additive synthesizer for organ-like sounds * * Copyright (c) 2006-2008 Andreas Brandmaier - * + * * This file is part of LMMS - https://lmms.io * * This program is free software; you can redistribute it and/or @@ -71,7 +71,7 @@ float * OrganicInstrument::s_harmonics = nullptr; * * class OrganicInstrument * -* lmms - plugin +* lmms - plugin * ***********************************************************************/ @@ -90,7 +90,7 @@ OrganicInstrument::OrganicInstrument( InstrumentTrack * _instrument_track ) : m_osc[i] = new OscillatorObject( this, i ); m_osc[i]->m_numOscillators = m_numOscillators; - // Connect events + // Connect events connect( &m_osc[i]->m_oscModel, SIGNAL( dataChanged() ), m_osc[i], SLOT ( oscButtonChanged() ) ); connect( &m_osc[i]->m_harmModel, SIGNAL( dataChanged() ), @@ -114,7 +114,7 @@ OrganicInstrument::OrganicInstrument( InstrumentTrack * _instrument_track ) : m_osc[5]->m_harmonic = log2f( 4.0f ); // . m_osc[6]->m_harmonic = log2f( 5.0f ); // . m_osc[7]->m_harmonic = log2f( 6.0f ); // .*/ - + if( s_harmonics == nullptr ) { s_harmonics = new float[ NUM_HARMONICS ]; @@ -142,10 +142,10 @@ OrganicInstrument::OrganicInstrument( InstrumentTrack * _instrument_track ) : m_osc[i]->updateVolume(); m_osc[i]->updateDetuning(); } - + connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ), - this, SLOT( updateAllDetuning() ) ); + this, SLOT( updateAllDetuning() ) ); } @@ -193,7 +193,7 @@ void OrganicInstrument::loadSettings( const QDomElement & _this ) m_osc[i]->m_volModel.loadSettings( _this, "vol" + is ); if( _this.hasAttribute( "detune" + is ) ) { - m_osc[i]->m_detuneModel.setValue( _this.attribute( "detune" ).toInt() * 12 ); + m_osc[i]->m_detuneModel.setValue( _this.attribute( "detune" ).toInt() * 12 ); } else { @@ -201,7 +201,7 @@ void OrganicInstrument::loadSettings( const QDomElement & _this ) } m_osc[i]->m_panModel.loadSettings( _this, "pan" + is ); m_osc[i]->m_oscModel.loadSettings( _this, "wavetype" + is ); - + if( _this.hasAttribute( "newharmonic" + is ) ) { m_osc[i]->m_harmModel.loadSettings( _this, "newharmonic" + is ); @@ -211,7 +211,7 @@ void OrganicInstrument::loadSettings( const QDomElement & _this ) m_osc[i]->m_harmModel.setValue( static_cast( i ) ); } } - + m_volModel.loadSettings( _this, "vol" ); m_fx1Model.loadSettings( _this, "foldback" ); } @@ -230,23 +230,23 @@ 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 == nullptr ) { - Oscillator * oscs_l[NUM_OSCILLATORS]; - Oscillator * oscs_r[NUM_OSCILLATORS]; + auto oscs_l = std::array{}; + auto oscs_r = std::array{}; _n->m_pluginData = new oscPtr; for( int i = m_numOscillators - 1; i >= 0; --i ) { - static_cast( _n->m_pluginData )->phaseOffsetLeft[i] + static_cast( _n->m_pluginData )->phaseOffsetLeft[i] = rand() / ( RAND_MAX + 1.0f ); - static_cast( _n->m_pluginData )->phaseOffsetRight[i] + static_cast( _n->m_pluginData )->phaseOffsetRight[i] = rand() / ( RAND_MAX + 1.0f ); - + // initialise ocillators - + if( i == m_numOscillators - 1 ) { // create left oscillator @@ -287,8 +287,8 @@ void OrganicInstrument::playNote( NotePlayHandle * _n, m_osc[i]->m_volumeRight, oscs_r[i + 1] ); } - - + + } static_cast( _n->m_pluginData )->oscLeft = oscs_l[0]; @@ -303,10 +303,10 @@ void OrganicInstrument::playNote( NotePlayHandle * _n, // -- fx section -- - + // fxKnob is [0;1] float t = m_fx1Model.value(); - + for (int i=0 ; i < frames + offset ; i++) { _working_buffer[i][0] = waveshape( _working_buffer[i][0], t ) * @@ -314,7 +314,7 @@ void OrganicInstrument::playNote( NotePlayHandle * _n, _working_buffer[i][1] = waveshape( _working_buffer[i][1], t ) * m_volModel.value() / 100.0f; } - + // -- -- instrumentTrack()->processAudioBuffer( _working_buffer, frames + offset, _n ); @@ -329,7 +329,7 @@ void OrganicInstrument::deleteNotePluginData( NotePlayHandle * _n ) _n->m_pluginData )->oscLeft ); delete static_cast( static_cast( _n->m_pluginData )->oscRight ); - + delete static_cast( _n->m_pluginData ); } @@ -388,7 +388,7 @@ void OrganicInstrument::updateAllDetuning() int OrganicInstrument::intRand( int min, int max ) { -// int randn = min+int((max-min)*rand()/(RAND_MAX + 1.0)); +// int randn = min+int((max-min)*rand()/(RAND_MAX + 1.0)); // cout << randn << endl; int randn = ( rand() % (max - min) ) + min; return( randn ); @@ -452,7 +452,7 @@ OrganicInstrumentView::OrganicInstrumentView( Instrument * _instrument, "randomise_pressed" ) ); m_randBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "randomise" ) ); - + connect( m_randBtn, SIGNAL ( clicked() ), oi, SLOT( randomiseSettings() ) ); @@ -479,10 +479,10 @@ void OrganicInstrumentView::modelChanged() const float y=91.0f; const float rowHeight = 26.0f; const float x=53.0f; - const float colWidth = 24.0f; + const float colWidth = 24.0f; m_numOscillators = oi->m_numOscillators; - + m_fx1Knob->setModel( &oi->m_fx1Model ); m_volKnob->setModel( &oi->m_volModel ); @@ -490,7 +490,7 @@ void OrganicInstrumentView::modelChanged() { delete[] m_oscKnobs; } - + m_oscKnobs = new OscillatorKnobs[ m_numOscillators ]; // Create knobs, now that we know how many to make @@ -502,7 +502,7 @@ void OrganicInstrumentView::modelChanged() harmKnob->setObjectName( "harmKnob" ); connect( &oi->m_osc[i]->m_harmModel, SIGNAL( dataChanged() ), this, SLOT( updateKnobHint() ) ); - + // setup waveform-knob Knob * oscKnob = new OrganicKnob( this ); oscKnob->move( x + i * colWidth, y ); @@ -510,7 +510,7 @@ void OrganicInstrumentView::modelChanged() this, SLOT( updateKnobHint() ) ); oscKnob->setHintText( tr( "Osc %1 waveform:" ).arg( i + 1 ), QString() ); - + // setup volume-knob auto volKnob = new Knob(knobStyled, this); volKnob->setVolumeKnob( true ); @@ -518,13 +518,13 @@ void OrganicInstrumentView::modelChanged() volKnob->setFixedSize( 21, 21 ); volKnob->setHintText( tr( "Osc %1 volume:" ).arg( i + 1 ), "%" ); - + // setup panning-knob Knob * panKnob = new OrganicKnob( this ); panKnob->move( x + i * colWidth, y + rowHeight*2 ); panKnob->setHintText( tr("Osc %1 panning:").arg( i + 1 ), "" ); - + // setup knob for fine-detuning Knob * detuneKnob = new OrganicKnob( this ); detuneKnob->move( x + i * colWidth, y + rowHeight*3 ); @@ -552,7 +552,7 @@ void OrganicInstrumentView::updateKnobHint() { const float harm = oi->m_osc[i]->m_harmModel.value(); const float wave = oi->m_osc[i]->m_oscModel.value(); - + m_oscKnobs[i].m_harmKnob->setHintText( tr( "Osc %1 harmonic:" ).arg( i + 1 ), " (" + HARMONIC_NAMES[ static_cast( harm ) ] + ")" ); m_oscKnobs[i].m_oscKnob->setHintText( tr( "Osc %1 waveform:" ).arg( i + 1 ), " (" + @@ -575,7 +575,7 @@ OscillatorObject::OscillatorObject( Model * _parent, int _index ) : this, tr( "Osc %1 volume" ).arg( _index + 1 ) ), m_panModel( DefaultPanning, PanningLeft, PanningRight, 1.0f, this, tr( "Osc %1 panning" ).arg( _index + 1 ) ), - m_detuneModel( 0.0f, -1200.0f, 1200.0f, 1.0f, + m_detuneModel( 0.0f, -1200.0f, 1200.0f, 1.0f, this, tr( "Osc %1 fine detuning left" ).arg( _index + 1 ) ) { } @@ -586,7 +586,7 @@ OscillatorObject::OscillatorObject( Model * _parent, int _index ) : void OscillatorObject::oscButtonChanged() { - static Oscillator::WaveShapes shapes[] = + static auto shapes = std::array { Oscillator::SineWave, Oscillator::SawWave, @@ -639,12 +639,12 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model *m, void * ) /* * some notes & ideas for the future of this plugin: - * + * * - 32.692 Hz in the bass to 5919.85 Hz of treble in a Hammond organ * => implement harmonic foldback - * + * m_osc[i].m_oscModel->setInitValue( 0.0f ); - * - randomize preset + * - randomize preset */ diff --git a/plugins/Patman/Patman.cpp b/plugins/Patman/Patman.cpp index 34545f557..a8f75db60 100644 --- a/plugins/Patman/Patman.cpp +++ b/plugins/Patman/Patman.cpp @@ -225,11 +225,11 @@ PatmanInstrument::LoadErrors PatmanInstrument::loadPatch( return( LoadOpen ); } - unsigned char header[239]; + auto header = std::array{}; - if( fread( header, 1, 239, fd ) != 239 || - ( memcmp( header, "GF1PATCH110\0ID#000002", 22 ) - && memcmp( header, "GF1PATCH100\0ID#000002", 22 ) ) ) + if (fread(header.data(), 1, 239, fd ) != 239 || + (memcmp(header.data(), "GF1PATCH110\0ID#000002", 22) + && memcmp(header.data(), "GF1PATCH100\0ID#000002", 22))) { fclose( fd ); return( LoadNotGUS ); diff --git a/plugins/ReverbSC/ReverbSC.cpp b/plugins/ReverbSC/ReverbSC.cpp index a13f7eee8..e8dec8fd7 100644 --- a/plugins/ReverbSC/ReverbSC.cpp +++ b/plugins/ReverbSC/ReverbSC.cpp @@ -62,7 +62,7 @@ ReverbSCEffect::ReverbSCEffect( Model* parent, const Descriptor::SubPluginFeatur sp_dcblock_create(&dcblk[0]); sp_dcblock_create(&dcblk[1]); - + sp_dcblock_init(sp, dcblk[0], Engine::audioEngine()->currentQualitySettings().sampleRateMultiplier() ); sp_dcblock_init(sp, dcblk[1], Engine::audioEngine()->currentQualitySettings().sampleRateMultiplier() ); } @@ -88,7 +88,7 @@ bool ReverbSCEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) SPFLOAT tmpL, tmpR; SPFLOAT dcblkL, dcblkR; - + ValueBuffer * inGainBuf = m_reverbSCControls.m_inputGainModel.valueBuffer(); ValueBuffer * sizeBuf = m_reverbSCControls.m_sizeModel.valueBuffer(); ValueBuffer * colorBuf = m_reverbSCControls.m_colorModel.valueBuffer(); @@ -96,7 +96,7 @@ bool ReverbSCEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) for( fpp_t f = 0; f < frames; ++f ) { - sample_t s[2] = { buf[f][0], buf[f][1] }; + auto s = std::array{buf[f][0], buf[f][1]}; const auto inGain = (SPFLOAT)DB2LIN((inGainBuf ? inGainBuf->values()[f] : m_reverbSCControls.m_inputGainModel.value())); @@ -105,12 +105,12 @@ bool ReverbSCEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) s[0] *= inGain; s[1] *= inGain; - revsc->feedback = (SPFLOAT)(sizeBuf ? - sizeBuf->values()[f] + revsc->feedback = (SPFLOAT)(sizeBuf ? + sizeBuf->values()[f] : m_reverbSCControls.m_sizeModel.value()); - revsc->lpfreq = (SPFLOAT)(colorBuf ? - colorBuf->values()[f] + revsc->lpfreq = (SPFLOAT)(colorBuf ? + colorBuf->values()[f] : m_reverbSCControls.m_colorModel.value()); @@ -128,7 +128,7 @@ bool ReverbSCEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) return isRunning(); } - + void ReverbSCEffect::changeSampleRate() { // Change sr variable in Soundpipe. does not need to be destroyed @@ -144,7 +144,7 @@ void ReverbSCEffect::changeSampleRate() sp_dcblock_create(&dcblk[0]); sp_dcblock_create(&dcblk[1]); - + sp_dcblock_init(sp, dcblk[0], Engine::audioEngine()->currentQualitySettings().sampleRateMultiplier() ); sp_dcblock_init(sp, dcblk[1], Engine::audioEngine()->currentQualitySettings().sampleRateMultiplier() ); mutex.unlock(); @@ -156,9 +156,9 @@ extern "C" // necessary for getting instance out of shared lib PLUGIN_EXPORT Plugin * lmms_plugin_main( Model* parent, void* data ) { - return new ReverbSCEffect( - parent, - static_cast(data) + return new ReverbSCEffect( + parent, + static_cast(data) ); } diff --git a/plugins/Sid/SidInstrument.cpp b/plugins/Sid/SidInstrument.cpp index 73c571b72..6e7473492 100644 --- a/plugins/Sid/SidInstrument.cpp +++ b/plugins/Sid/SidInstrument.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 2008 Csaba Hruska * Attila Herman - * + * * This file is part of LMMS - https://lmms.io * * This program is free software; you can redistribute it and/or @@ -52,22 +52,22 @@ namespace lmms #define SIDWRITEDELAY 9 // lda $xxxx,x 4 cycles, sta $d400,x 5 cycles #define SIDWAVEDELAY 4 // and $xxxx,x 4 cycles extra -unsigned char sidorder[] = +auto sidorder = std::array {0x15,0x16,0x18,0x17, 0x05,0x06,0x02,0x03,0x00,0x01,0x04, 0x0c,0x0d,0x09,0x0a,0x07,0x08,0x0b, 0x13,0x14,0x10,0x11,0x0e,0x0f,0x12}; -static const char *attackTime[16] = { "2 ms", "8 ms", "16 ms", "24 ms", +static auto attackTime = std::array{ "2 ms", "8 ms", "16 ms", "24 ms", "38 ms", "56 ms", "68 ms", "80 ms", "100 ms", "250 ms", "500 ms", "800 ms", "1 s", "3 s", "5 s", "8 s" }; -static const char *decRelTime[16] = { "6 ms", "24 ms", "48 ms", "72 ms", +static auto decRelTime = std::array{ "6 ms", "24 ms", "48 ms", "72 ms", "114 ms", "168 ms", "204 ms", "240 ms", "300 ms", "750 ms", "1.5 s", "2.4 s", "3 s", "9 s", "15 s", "24 s" }; // release time time in ms -static const int relTime[16] = { 6, 24, 48, 72, 114, 168, 204, 240, 300, 750, +static const auto relTime = std::array{ 6, 24, 48, 72, 114, 168, 204, 240, 300, 750, 1500, 2400, 3000, 9000, 15000, 24000 }; @@ -118,11 +118,11 @@ VoiceObject::VoiceObject( Model * _parent, int _idx ) : SidInstrument::SidInstrument( InstrumentTrack * _instrument_track ) : Instrument( _instrument_track, &sid_plugin_descriptor ), - // filter + // filter m_filterFCModel( 1024.0f, 0.0f, 2047.0f, 1.0f, this, tr( "Cutoff frequency" ) ), m_filterResonanceModel( 8.0f, 0.0f, 15.0f, 1.0f, this, tr( "Resonance" ) ), m_filterModeModel( LowPass, 0, NumFilterTypes-1, this, tr( "Filter type" )), - + // misc m_voice3OffModel( false, this, tr( "Voice 3 off" ) ), m_volumeModel( 15.0f, 0.0f, 15.0f, 1.0f, this, tr( "Volume" ) ), @@ -167,11 +167,11 @@ void SidInstrument::saveSettings( QDomDocument & _doc, _doc, _this, "test" + is ); } - // filter + // filter m_filterFCModel.saveSettings( _doc, _this, "filterFC" ); m_filterResonanceModel.saveSettings( _doc, _this, "filterResonance" ); m_filterModeModel.saveSettings( _doc, _this, "filterMode" ); - + // misc m_voice3OffModel.saveSettings( _doc, _this, "voice3Off" ); m_volumeModel.saveSettings( _doc, _this, "volume" ); @@ -200,12 +200,12 @@ void SidInstrument::loadSettings( const QDomElement & _this ) m_voice[i]->m_filteredModel.loadSettings( _this, "filtered" + is ); m_voice[i]->m_testModel.loadSettings( _this, "test" + is ); } - - // filter + + // filter m_filterFCModel.loadSettings( _this, "filterFC" ); m_filterResonanceModel.loadSettings( _this, "filterResonance" ); m_filterModeModel.loadSettings( _this, "filterMode" ); - + // misc m_voice3OffModel.loadSettings( _this, "voice3Off" ); m_volumeModel.loadSettings( _this, "volume" ); @@ -318,7 +318,7 @@ void SidInstrument::playNote( NotePlayHandle * _n, int delta_t = clockrate * frames / samplerate + 4; // avoid variable length array for msvc compat auto buf = reinterpret_cast(_working_buffer + offset); - unsigned char sidreg[NUMSIDREGS]; + auto sidreg = std::array{}; for (auto& reg : sidreg) { @@ -354,7 +354,7 @@ void SidInstrument::playNote( NotePlayHandle * _n, sidreg[base+1] = (data16>>8)&0x00FF; // pw data16 = (int)m_voice[i]->m_pulseWidthModel.value(); - + sidreg[base+2] = data16&0x00FF; sidreg[base+3] = (data16>>8)&0x000F; // control: wave form, (test), ringmod, sync, gate @@ -363,7 +363,7 @@ void SidInstrument::playNote( NotePlayHandle * _n, data8 += m_voice[i]->m_ringModModel.value()?4:0; data8 += m_voice[i]->m_testModel.value()?8:0; switch( m_voice[i]->m_waveFormModel.value() ) - { + { default: break; case VoiceObject::NoiseWave: data8 += 128; break; case VoiceObject::SquareWave: data8 += 64; break; @@ -394,7 +394,7 @@ void SidInstrument::playNote( NotePlayHandle * _n, data16 = (int)m_filterFCModel.value(); sidreg[21] = data16&0x0007; sidreg[22] = (data16>>3)&0x00FF; - + // res, filt ex,3,2,1 data16 = (int)m_filterResonanceModel.value(); data8 = (data16&0x000F)<<4; @@ -409,7 +409,7 @@ void SidInstrument::playNote( NotePlayHandle * _n, data8 += m_voice3OffModel.value()?128:0; switch( m_filterModeModel.value() ) - { + { default: break; case LowPass: data8 += 16; break; case BandPass: data8 += 32; break; @@ -417,8 +417,8 @@ void SidInstrument::playNote( NotePlayHandle * _n, } sidreg[24] = data8&0x00FF; - - int num = sid_fillbuffer(sidreg, sid,delta_t,buf, frames); + + int num = sid_fillbuffer(sidreg.data(), sid, delta_t, buf, frames); if(num!=frames) printf("!!!Not enough samples\n"); @@ -544,7 +544,7 @@ SidInstrumentView::SidInstrumentView( Instrument * _instrument, m_sidTypeBtnGrp->addButton( mos6581_btn ); m_sidTypeBtnGrp->addButton( mos8580_btn ); - for( int i = 0; i < 3; i++ ) + for( int i = 0; i < 3; i++ ) { Knob *ak = new sidKnob( this ); ak->setHintText( tr("Attack:"), "" ); @@ -674,7 +674,7 @@ void SidInstrumentView::updateKnobHint() m_releaseModel.value()] ) + ")" ); m_voiceKnobs[i].m_relKnob->setToolTip( decRelTime[(int)k->m_voice[i]->m_releaseModel.value()]); - + m_voiceKnobs[i].m_pwKnob->setHintText( tr( "Pulse width:" )+ " ", " (" + QString::number( (double)k->m_voice[i]-> m_pulseWidthModel.value() / 40.95 ) + "%)" ); @@ -758,7 +758,7 @@ void SidInstrumentView::modelChanged() connect(&voice->m_sustainModel, SIGNAL(dataChanged()), this, SLOT(updateKnobToolTip())); connect(&voice->m_coarseModel, SIGNAL(dataChanged()), this, SLOT(updateKnobToolTip())); } - + connect( &k->m_volumeModel, SIGNAL( dataChanged() ), this, SLOT( updateKnobToolTip() ) ); connect( &k->m_filterResonanceModel, SIGNAL( dataChanged() ), diff --git a/plugins/SpectrumAnalyzer/SaSpectrumView.cpp b/plugins/SpectrumAnalyzer/SaSpectrumView.cpp index 8c3d7a82d..0d9c2af87 100644 --- a/plugins/SpectrumAnalyzer/SaSpectrumView.cpp +++ b/plugins/SpectrumAnalyzer/SaSpectrumView.cpp @@ -648,8 +648,8 @@ std::vector> SaSpectrumView::makeLogFreqTics(int low { std::vector> result; int i, j; - int a[] = {10, 20, 50}; // sparse series multipliers - int b[] = {14, 30, 70}; // additional (denser) series + auto a = std::array{10, 20, 50}; // sparse series multipliers + auto b = std::array{14, 30, 70}; // additional (denser) series // generate main steps (powers of 10); use the series to specify smaller steps for (i = 1; i <= high; i *= 10) diff --git a/plugins/StereoEnhancer/StereoEnhancer.cpp b/plugins/StereoEnhancer/StereoEnhancer.cpp index 1351ab885..01e55f2de 100644 --- a/plugins/StereoEnhancer/StereoEnhancer.cpp +++ b/plugins/StereoEnhancer/StereoEnhancer.cpp @@ -85,15 +85,15 @@ StereoEnhancerEffect::~StereoEnhancerEffect() bool StereoEnhancerEffect::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ) { - + // This appears to be used for determining whether or not to continue processing - // audio with this effect + // audio with this effect double out_sum = 0.0; - + float width; int frameIndex = 0; - - + + if( !isEnabled() || !isRunning() ) { return( false ); @@ -104,7 +104,7 @@ bool StereoEnhancerEffect::processAudioBuffer( sampleFrame * _buf, for( fpp_t f = 0; f < _frames; ++f ) { - + // copy samples into the delay buffer m_delayBuffer[m_currFrame][0] = _buf[f][0]; m_delayBuffer[m_currFrame][1] = _buf[f][1]; @@ -122,7 +122,7 @@ bool StereoEnhancerEffect::processAudioBuffer( sampleFrame * _buf, } //sample_t s[2] = { _buf[f][0], _buf[f][1] }; //Vanilla - sample_t s[2] = { _buf[f][0], m_delayBuffer[frameIndex][1] }; //Chocolate + auto s = std::array{_buf[f][0], m_delayBuffer[frameIndex][1]}; //Chocolate m_seFX.nextSample( s[0], s[1] ); diff --git a/plugins/TripleOscillator/TripleOscillator.cpp b/plugins/TripleOscillator/TripleOscillator.cpp index bbc95683b..25baea208 100644 --- a/plugins/TripleOscillator/TripleOscillator.cpp +++ b/plugins/TripleOscillator/TripleOscillator.cpp @@ -21,7 +21,7 @@ * Boston, MA 02110-1301 USA. * */ - + #include @@ -81,10 +81,10 @@ OscillatorObject::OscillatorObject( Model * _parent, int _idx ) : m_fineRightModel( 0.0f, -100.0f, 100.0f, 1.0f, this, tr( "Osc %1 fine detuning right" ).arg( _idx + 1 ) ), m_phaseOffsetModel( 0.0f, 0.0f, 360.0f, 1.0f, this, - tr( "Osc %1 phase-offset" ).arg( _idx+1 ) ), + tr( "Osc %1 phase-offset" ).arg( _idx+1 ) ), m_stereoPhaseDetuningModel( 0.0f, 0.0f, 360.0f, 1.0f, this, tr( "Osc %1 stereo phase-detuning" ).arg( _idx+1 ) ), - m_waveShapeModel( Oscillator::SineWave, 0, + m_waveShapeModel( Oscillator::SineWave, 0, Oscillator::NumWaveShapes-1, this, tr( "Osc %1 wave shape" ).arg( _idx+1 ) ), m_modulationAlgoModel( Oscillator::SignalMix, 0, @@ -220,7 +220,7 @@ void OscillatorObject::updateUseWaveTable() } - + TripleOscillator::TripleOscillator( InstrumentTrack * _instrument_track ) : Instrument( _instrument_track, &tripleoscillator_plugin_descriptor ) @@ -310,8 +310,8 @@ void TripleOscillator::playNote( NotePlayHandle * _n, { if( _n->totalFramesPlayed() == 0 || _n->m_pluginData == nullptr ) { - Oscillator * oscs_l[NUM_OF_OSCILLATORS]; - Oscillator * oscs_r[NUM_OF_OSCILLATORS]; + auto oscs_l = std::array{}; + auto oscs_r = std::array{}; for( int i = NUM_OF_OSCILLATORS - 1; i >= 0; --i ) { diff --git a/plugins/Vestige/Vestige.cpp b/plugins/Vestige/Vestige.cpp index 593712c14..eab3693b8 100644 --- a/plugins/Vestige/Vestige.cpp +++ b/plugins/Vestige/Vestige.cpp @@ -221,16 +221,16 @@ void VestigeInstrument::loadSettings( const QDomElement & _this ) const QMap & dump = m_plugin->parameterDump(); paramCount = dump.size(); - char paramStr[35]; + auto paramStr = std::array{}; knobFModel = new FloatModel *[ paramCount ]; QStringList s_dumpValues; for( int i = 0; i < paramCount; i++ ) { - sprintf( paramStr, "param%d", i ); - s_dumpValues = dump[ paramStr ].split( ":" ); + sprintf(paramStr.data(), "param%d", i); + s_dumpValues = dump[paramStr.data()].split(":"); knobFModel[i] = new FloatModel( 0.0f, 0.0f, 1.0f, 0.01f, this, QString::number(i) ); - knobFModel[i]->loadSettings( _this, paramStr ); + knobFModel[i]->loadSettings(_this, paramStr.data()); if( !( knobFModel[ i ]->isAutomated() || knobFModel[ i ]->controllerConnection() ) ) { @@ -286,12 +286,12 @@ void VestigeInstrument::saveSettings( QDomDocument & _doc, QDomElement & _this ) if (knobFModel != nullptr) { const QMap & dump = m_plugin->parameterDump(); paramCount = dump.size(); - char paramStr[35]; + auto paramStr = std::array{}; for( int i = 0; i < paramCount; i++ ) { if (knobFModel[i]->isAutomated() || knobFModel[i]->controllerConnection()) { - sprintf( paramStr, "param%d", i); - knobFModel[i]->saveSettings( _doc, _this, paramStr ); + sprintf(paramStr.data(), "param%d", i); + knobFModel[i]->saveSettings(_doc, _this, paramStr.data()); } /* QDomElement me = _doc.createElement( paramStr ); @@ -938,7 +938,7 @@ ManageVestigeInstrumentView::ManageVestigeInstrumentView( Instrument * _instrume using ::operator|; #endif - + m_vi = m_vi2; m_vi->m_scrollArea = new QScrollArea( this ); widget = new QWidget(this); @@ -996,13 +996,13 @@ ManageVestigeInstrumentView::ManageVestigeInstrumentView( Instrument * _instrume hasKnobModel = false; } - char paramStr[35]; + auto paramStr = std::array{}; QStringList s_dumpValues; for( int i = 0; i < m_vi->paramCount; i++ ) { - sprintf( paramStr, "param%d", i); - s_dumpValues = dump[ paramStr ].split( ":" ); + sprintf(paramStr.data(), "param%d", i); + s_dumpValues = dump[paramStr.data()].split(":"); vstKnobs[ i ] = new CustomTextKnob( knobBright_26, this, s_dumpValues.at( 1 ) ); vstKnobs[ i ]->setDescription( s_dumpValues.at( 1 ) + ":" ); @@ -1010,9 +1010,9 @@ ManageVestigeInstrumentView::ManageVestigeInstrumentView( Instrument * _instrume if( !hasKnobModel ) { - sprintf( paramStr, "%d", i); - m_vi->knobFModel[ i ] = new FloatModel( LocaleHelper::toFloat(s_dumpValues.at(2)), - 0.0f, 1.0f, 0.01f, castModel(), paramStr ); + sprintf(paramStr.data(), "%d", i); + m_vi->knobFModel[i] = new FloatModel(LocaleHelper::toFloat(s_dumpValues.at(2)), + 0.0f, 1.0f, 0.01f, castModel(), paramStr.data()); } FloatModel * model = m_vi->knobFModel[i]; @@ -1063,7 +1063,7 @@ void ManageVestigeInstrumentView::closeWindow() void ManageVestigeInstrumentView::syncPlugin( void ) { - char paramStr[35]; + auto paramStr = std::array{}; QStringList s_dumpValues; const QMap & dump = m_vi->m_plugin->parameterDump(); float f_value; @@ -1074,8 +1074,8 @@ void ManageVestigeInstrumentView::syncPlugin( void ) // those auto-setted values are not jurnaled, tracked for undo / redo if( !( m_vi->knobFModel[ i ]->isAutomated() || m_vi->knobFModel[ i ]->controllerConnection() ) ) { - sprintf( paramStr, "param%d", i ); - s_dumpValues = dump[ paramStr ].split( ":" ); + sprintf(paramStr.data(), "param%d", i); + s_dumpValues = dump[paramStr.data()].split(":"); f_value = LocaleHelper::toFloat(s_dumpValues.at(2)); m_vi->knobFModel[ i ]->setAutomatedValue( f_value ); m_vi->knobFModel[ i ]->setInitValue( f_value ); diff --git a/plugins/VstEffect/VstEffectControls.cpp b/plugins/VstEffect/VstEffectControls.cpp index f35a1c00d..e73530a09 100644 --- a/plugins/VstEffect/VstEffectControls.cpp +++ b/plugins/VstEffect/VstEffectControls.cpp @@ -83,16 +83,16 @@ void VstEffectControls::loadSettings( const QDomElement & _this ) const QMap & dump = m_effect->m_plugin->parameterDump(); paramCount = dump.size(); - char paramStr[35]; + auto paramStr = std::array{}; knobFModel = new FloatModel *[ paramCount ]; QStringList s_dumpValues; for( int i = 0; i < paramCount; i++ ) { - sprintf( paramStr, "param%d", i ); - s_dumpValues = dump[ paramStr ].split( ":" ); + sprintf(paramStr.data(), "param%d", i); + s_dumpValues = dump[paramStr.data()].split(":"); knobFModel[i] = new FloatModel( 0.0f, 0.0f, 1.0f, 0.01f, this, QString::number(i) ); - knobFModel[i]->loadSettings( _this, paramStr ); + knobFModel[i]->loadSettings(_this, paramStr.data()); if( !( knobFModel[ i ]->isAutomated() || knobFModel[ i ]->controllerConnection() ) ) @@ -134,12 +134,12 @@ void VstEffectControls::saveSettings( QDomDocument & _doc, QDomElement & _this ) if (knobFModel != nullptr) { const QMap & dump = m_effect->m_plugin->parameterDump(); paramCount = dump.size(); - char paramStr[35]; + auto paramStr = std::array{}; for( int i = 0; i < paramCount; i++ ) { if (knobFModel[i]->isAutomated() || knobFModel[i]->controllerConnection()) { - sprintf( paramStr, "param%d", i); - knobFModel[i]->saveSettings( _doc, _this, paramStr ); + sprintf(paramStr.data(), "param%d", i); + knobFModel[i]->saveSettings(_doc, _this, paramStr.data()); } } } @@ -173,7 +173,7 @@ void VstEffectControls::managePlugin() auto tt = new gui::ManageVSTEffectView(m_effect, this); ctrHandle = (QObject *)tt; } else if (m_subWindow != nullptr) { - if (m_subWindow->widget()->isVisible() == false ) { + if (m_subWindow->widget()->isVisible() == false ) { m_scrollArea->show(); m_subWindow->show(); } else { @@ -371,13 +371,13 @@ ManageVSTEffectView::ManageVSTEffectView( VstEffect * _eff, VstEffectControls * hasKnobModel = false; } - char paramStr[35]; + auto paramStr = std::array{}; QStringList s_dumpValues; for( int i = 0; i < m_vi->paramCount; i++ ) { - sprintf( paramStr, "param%d", i); - s_dumpValues = dump[ paramStr ].split( ":" ); + sprintf(paramStr.data(), "param%d", i); + s_dumpValues = dump[paramStr.data()].split(":"); vstKnobs[ i ] = new CustomTextKnob( knobBright_26, widget, s_dumpValues.at( 1 ) ); vstKnobs[ i ]->setDescription( s_dumpValues.at( 1 ) + ":" ); @@ -385,9 +385,9 @@ ManageVSTEffectView::ManageVSTEffectView( VstEffect * _eff, VstEffectControls * if( !hasKnobModel ) { - sprintf( paramStr, "%d", i); - m_vi->knobFModel[ i ] = new FloatModel( LocaleHelper::toFloat(s_dumpValues.at(2)), - 0.0f, 1.0f, 0.01f, _eff, paramStr ); + sprintf(paramStr.data(), "%d", i); + m_vi->knobFModel[i] = new FloatModel(LocaleHelper::toFloat(s_dumpValues.at(2)), + 0.0f, 1.0f, 0.01f, _eff, paramStr.data()); } FloatModel * model = m_vi->knobFModel[i]; @@ -439,7 +439,7 @@ void ManageVSTEffectView::closeWindow() void ManageVSTEffectView::syncPlugin() { - char paramStr[35]; + auto paramStr = std::array{}; QStringList s_dumpValues; const QMap & dump = m_effect->m_plugin->parameterDump(); float f_value; @@ -451,8 +451,8 @@ void ManageVSTEffectView::syncPlugin() if( !( m_vi2->knobFModel[ i ]->isAutomated() || m_vi2->knobFModel[ i ]->controllerConnection() ) ) { - sprintf( paramStr, "param%d", i ); - s_dumpValues = dump[ paramStr ].split( ":" ); + sprintf(paramStr.data(), "param%d", i); + s_dumpValues = dump[paramStr.data()].split(":"); f_value = LocaleHelper::toFloat(s_dumpValues.at(2)); m_vi2->knobFModel[ i ]->setAutomatedValue( f_value ); m_vi2->knobFModel[ i ]->setInitValue( f_value ); @@ -477,7 +477,7 @@ void ManageVSTEffectView::displayAutomatedOnly() { vstKnobs[ i ]->hide(); m_displayAutomatedOnly->setText( "All" ); - } else { + } else { vstKnobs[ i ]->show(); m_displayAutomatedOnly->setText( "Automated" ); } @@ -534,7 +534,7 @@ void ManageVSTEffectView::syncParameterText() ManageVSTEffectView::~ManageVSTEffectView() { if( m_vi2->knobFModel != nullptr ) - { + { for( int i = 0; i < m_vi2->paramCount; i++ ) { delete m_vi2->knobFModel[ i ]; @@ -553,18 +553,18 @@ ManageVSTEffectView::~ManageVSTEffectView() delete [] m_vi2->knobFModel; m_vi2->knobFModel = nullptr; } - + if( m_vi2->m_scrollArea != nullptr ) { delete m_vi2->m_scrollArea; m_vi2->m_scrollArea = nullptr; } - + if( m_vi2->m_subWindow != nullptr ) { m_vi2->m_subWindow->setAttribute( Qt::WA_DeleteOnClose ); m_vi2->m_subWindow->close(); - + if( m_vi2->m_subWindow != nullptr ) { delete m_vi2->m_subWindow; diff --git a/plugins/WaveShaper/WaveShaper.cpp b/plugins/WaveShaper/WaveShaper.cpp index edbcb0ad8..94845e672 100644 --- a/plugins/WaveShaper/WaveShaper.cpp +++ b/plugins/WaveShaper/WaveShaper.cpp @@ -96,7 +96,7 @@ bool WaveShaperEffect::processAudioBuffer( sampleFrame * _buf, for( fpp_t f = 0; f < _frames; ++f ) { - float s[2] = { _buf[f][0], _buf[f][1] }; + auto s = std::array{_buf[f][0], _buf[f][1]}; // apply input gain s[0] *= *inputPtr; @@ -114,7 +114,7 @@ bool WaveShaperEffect::processAudioBuffer( sampleFrame * _buf, for( i=0; i <= 1; ++i ) { const int lookup = static_cast( qAbs( s[i] ) * 200.0f ); - const float frac = fraction( qAbs( s[i] ) * 200.0f ); + const float frac = fraction( qAbs( s[i] ) * 200.0f ); const float posneg = s[i] < 0 ? -1.0f : 1.0f; if( lookup < 1 ) @@ -122,8 +122,8 @@ bool WaveShaperEffect::processAudioBuffer( sampleFrame * _buf, s[i] = frac * samples[0] * posneg; } else if( lookup < 200 ) - { - s[i] = linearInterpolate( samples[ lookup - 1 ], + { + s[i] = linearInterpolate( samples[ lookup - 1 ], samples[ lookup ], frac ) * posneg; } diff --git a/plugins/WaveShaper/WaveShaperControls.cpp b/plugins/WaveShaper/WaveShaperControls.cpp index 40e20055a..a03abc2ef 100644 --- a/plugins/WaveShaper/WaveShaperControls.cpp +++ b/plugins/WaveShaper/WaveShaperControls.cpp @@ -69,7 +69,7 @@ void WaveShaperControls::loadSettings( const QDomElement & _this ) //load input, output knobs m_inputModel.loadSettings( _this, "inputGain" ); m_outputModel.loadSettings( _this, "outputGain" ); - + m_clipModel.loadSettings( _this, "clipInput" ); //load waveshape @@ -105,7 +105,7 @@ void WaveShaperControls::saveSettings( QDomDocument & _doc, void WaveShaperControls::setDefaultShape() { - float shp [200] = { }; + auto shp = std::array{}; for ( int i = 0; i<200; i++) { shp[i] = ((float)i + 1.0f) / 200.0f; diff --git a/plugins/Xpressive/ExprSynth.cpp b/plugins/Xpressive/ExprSynth.cpp index 47b778ae0..991e0d3e6 100644 --- a/plugins/Xpressive/ExprSynth.cpp +++ b/plugins/Xpressive/ExprSynth.cpp @@ -214,7 +214,7 @@ struct WaveValueFunctionInterpolate : public exprtk::ifunction const T *m_vec; const std::size_t m_size; }; -static const unsigned int random_data[257]={ +static const auto random_data = std::array{ 0xd76a33ec, 0x4a767724, 0xb34ebd08 ,0xf4024196, 0x17b426e2, 0x8dc6389a, 0x1b5dcb93 ,0xa771bd3f, 0x078d502e, 0x8980988a, 0x1f64f846 ,0xb5b48ed7, @@ -526,14 +526,14 @@ ExprFront::ExprFront(const char * expr, int last_func_samples) try { m_data = new ExprFrontData(last_func_samples); - + m_data->m_expression_string = expr; m_data->m_symbol_table.add_pi(); - + m_data->m_symbol_table.add_constant("e", F_E); m_data->m_symbol_table.add_constant("seed", SimpleRandom::generator() & max_float_integer_mask); - + m_data->m_symbol_table.add_function("sinew", sin_wave_func); m_data->m_symbol_table.add_function("squarew", square_wave_func); m_data->m_symbol_table.add_function("trianglew", triangle_wave_func); @@ -577,7 +577,7 @@ bool ExprFront::compile() sstore.disable_all_assignment_ops(); sstore.disable_all_control_structures(); parser_t parser(sstore); - + m_valid=parser.compile(m_data->m_expression_string, m_data->m_expression); } catch(...) @@ -600,7 +600,7 @@ float ExprFront::evaluate() WARN_EXPRTK; } return 0; - + } bool ExprFront::add_variable(const char* name, float& ref) { @@ -757,7 +757,7 @@ void ExprSynth::renderOutput(fpp_t frames, sampleFrame *buf) const float new_freq = m_nph->frequency(); const float freq_inc = (new_freq - m_frequency) / frames; const bool is_released = m_nph->isReleased(); - + expression_t *o1_rawExpr = &(m_exprO1->getData()->m_expression); expression_t *o2_rawExpr = &(m_exprO2->getData()->m_expression); LastSampleFunction * last_func1 = &m_exprO1->getData()->m_last_func; @@ -791,7 +791,7 @@ void ExprSynth::renderOutput(fpp_t frames, sampleFrame *buf) } else { - + if (o2_valid) { o1_rawExpr = o2_rawExpr; diff --git a/src/core/DataFile.cpp b/src/core/DataFile.cpp index 635c4c6a4..b6b9452f5 100644 --- a/src/core/DataFile.cpp +++ b/src/core/DataFile.cpp @@ -89,19 +89,27 @@ const std::vector DataFile::UPGRADE_VERSIONS = { "1.2.0-rc3" , "1.3.0" }; -DataFile::typeDescStruct - DataFile::s_types[DataFile::TypeCount] = +namespace { - { DataFile::UnknownType, "unknown" }, - { DataFile::SongProject, "song" }, - { DataFile::SongProjectTemplate, "songtemplate" }, - { DataFile::InstrumentTrackSettings, "instrumenttracksettings" }, - { DataFile::DragNDropData, "dnddata" }, - { DataFile::ClipboardData, "clipboard-data" }, - { DataFile::JournalData, "journaldata" }, - { DataFile::EffectSettings, "effectsettings" }, - { DataFile::MidiClip, "midiclip" } -} ; + struct TypeDescStruct + { + DataFile::Type m_type; + QString m_name; + }; + + const auto s_types = std::array + { + TypeDescStruct{ DataFile::UnknownType, "unknown" }, + TypeDescStruct{ DataFile::SongProject, "song" }, + TypeDescStruct{ DataFile::SongProjectTemplate, "songtemplate" }, + TypeDescStruct{ DataFile::InstrumentTrackSettings, "instrumenttracksettings" }, + TypeDescStruct{ DataFile::DragNDropData, "dnddata" }, + TypeDescStruct{ DataFile::ClipboardData, "clipboard-data" }, + TypeDescStruct{ DataFile::JournalData, "journaldata" }, + TypeDescStruct{ DataFile::EffectSettings, "effectsettings" }, + TypeDescStruct{ DataFile::MidiClip, "midiclip" } + }; +} diff --git a/src/core/Instrument.cpp b/src/core/Instrument.cpp index a7d3f73e8..dde260fdc 100644 --- a/src/core/Instrument.cpp +++ b/src/core/Instrument.cpp @@ -90,7 +90,7 @@ bool Instrument::isFromTrack( const Track * _track ) const static int countZeroCrossings(sampleFrame *buf, fpp_t start, fpp_t frames) { // zero point crossing counts of all channels - int zeroCrossings[DEFAULT_CHANNELS] = {0}; + auto zeroCrossings = std::array{}; // maximum zero point crossing of all channels int maxZeroCrossings = 0; diff --git a/src/core/InstrumentFunctions.cpp b/src/core/InstrumentFunctions.cpp index 4a5e29bd7..06e56666c 100644 --- a/src/core/InstrumentFunctions.cpp +++ b/src/core/InstrumentFunctions.cpp @@ -34,9 +34,10 @@ namespace lmms { - -InstrumentFunctionNoteStacking::ChordTable::Init InstrumentFunctionNoteStacking::ChordTable::s_initTable[] = -{ +std::array + InstrumentFunctionNoteStacking::ChordTable::s_initTable = + std::array +{{ { QT_TRANSLATE_NOOP( "InstrumentFunctionNoteStacking", "octave" ), { 0, -1 } }, { QT_TRANSLATE_NOOP( "InstrumentFunctionNoteStacking", "Major" ), { 0, 4, 7, -1 } }, { QT_TRANSLATE_NOOP( "InstrumentFunctionNoteStacking", "Majb5" ), { 0, 4, 6, -1 } }, @@ -139,7 +140,7 @@ InstrumentFunctionNoteStacking::ChordTable::Init InstrumentFunctionNoteStacking: { QT_TRANSLATE_NOOP( "InstrumentFunctionNoteStacking", "5" ), { 0, 7, -1 } }, { QT_TRANSLATE_NOOP( "InstrumentFunctionNoteStacking", "Phrygian dominant" ), { 0, 1, 4, 5, 7, 8, 10, -1 } }, { QT_TRANSLATE_NOOP( "InstrumentFunctionNoteStacking", "Persian" ), { 0, 1, 4, 5, 6, 8, 11, -1 } } -} ; +}}; diff --git a/src/core/MixHelpers.cpp b/src/core/MixHelpers.cpp index 2b2b5952f..02f3d8775 100644 --- a/src/core/MixHelpers.cpp +++ b/src/core/MixHelpers.cpp @@ -281,7 +281,7 @@ struct AddMultipliedStereoOp dst[1] += src[1] * m_coeffs[1]; } - float m_coeffs[2]; + std::array m_coeffs; } ; @@ -309,7 +309,7 @@ struct MultiplyAndAddMultipliedOp dst[1] = dst[1]*m_coeffs[0] + src[1]*m_coeffs[1]; } - float m_coeffs[2]; + std::array m_coeffs; } ; diff --git a/src/core/Oscillator.cpp b/src/core/Oscillator.cpp index 86a50c814..189dede6e 100644 --- a/src/core/Oscillator.cpp +++ b/src/core/Oscillator.cpp @@ -178,7 +178,7 @@ void Oscillator::generateFromFFT(int bands, sample_t* table) //ifft fftwf_execute(s_ifftPlan); //normalize and copy to result buffer - normalize(s_sampleBuffer, table, OscillatorConstants::WAVETABLE_LENGTH, 2*OscillatorConstants::WAVETABLE_LENGTH + 1); + normalize(s_sampleBuffer.data(), table, OscillatorConstants::WAVETABLE_LENGTH, 2*OscillatorConstants::WAVETABLE_LENGTH + 1); } void Oscillator::generateAntiAliasUserWaveTable(SampleBuffer *sampleBuffer) @@ -205,15 +205,15 @@ sample_t Oscillator::s_waveTables fftwf_plan Oscillator::s_fftPlan; fftwf_plan Oscillator::s_ifftPlan; fftwf_complex * Oscillator::s_specBuf; -float Oscillator::s_sampleBuffer[OscillatorConstants::WAVETABLE_LENGTH]; +std::array Oscillator::s_sampleBuffer; void Oscillator::createFFTPlans() { Oscillator::s_specBuf = ( fftwf_complex * ) fftwf_malloc( ( OscillatorConstants::WAVETABLE_LENGTH * 2 + 1 ) * sizeof( fftwf_complex ) ); - Oscillator::s_fftPlan = fftwf_plan_dft_r2c_1d(OscillatorConstants::WAVETABLE_LENGTH, s_sampleBuffer, s_specBuf, FFTW_MEASURE ); - Oscillator::s_ifftPlan = fftwf_plan_dft_c2r_1d(OscillatorConstants::WAVETABLE_LENGTH, s_specBuf, s_sampleBuffer, FFTW_MEASURE); + Oscillator::s_fftPlan = fftwf_plan_dft_r2c_1d(OscillatorConstants::WAVETABLE_LENGTH, s_sampleBuffer.data(), s_specBuf, FFTW_MEASURE ); + Oscillator::s_ifftPlan = fftwf_plan_dft_c2r_1d(OscillatorConstants::WAVETABLE_LENGTH, s_specBuf, s_sampleBuffer.data(), FFTW_MEASURE); // initialize s_specBuf content to zero, since the values are used in a condition inside generateFromFFT() for (int i = 0; i < OscillatorConstants::WAVETABLE_LENGTH * 2 + 1; i++) { diff --git a/src/core/PathUtil.cpp b/src/core/PathUtil.cpp index 299993673..03ec465a9 100644 --- a/src/core/PathUtil.cpp +++ b/src/core/PathUtil.cpp @@ -9,7 +9,7 @@ namespace lmms::PathUtil { - Base relativeBases[] = { Base::ProjectDir, Base::FactorySample, Base::UserSample, Base::UserVST, Base::Preset, + auto relativeBases = std::array{ Base::ProjectDir, Base::FactorySample, Base::UserSample, Base::UserVST, Base::Preset, Base::UserLADSPA, Base::DefaultLADSPA, Base::UserSoundfont, Base::DefaultSoundfont, Base::UserGIG, Base::DefaultGIG, Base::LocalDir }; @@ -121,7 +121,7 @@ namespace lmms::PathUtil //Check if it's a factory sample QString factoryPath = baseLocation(Base::FactorySample) + input; QFileInfo factoryInfo(factoryPath); - if (factoryInfo.exists()) { assumedBase = Base::FactorySample; } + if (factoryInfo.exists()) { assumedBase = Base::FactorySample; } //Check if it's a VST QString vstPath = baseLocation(Base::UserVST) + input; diff --git a/src/core/Piano.cpp b/src/core/Piano.cpp index 21ef7217d..0f59dd905 100644 --- a/src/core/Piano.cpp +++ b/src/core/Piano.cpp @@ -47,7 +47,7 @@ namespace lmms /*! The black / white order of keys as they appear on the keyboard. */ -static const Piano::KeyTypes KEY_ORDER[] = +static const auto KEY_ORDER = std::array { // C CIS D DIS Piano::WhiteKey, Piano::BlackKey, Piano::WhiteKey, Piano::BlackKey, diff --git a/src/core/ProjectRenderer.cpp b/src/core/ProjectRenderer.cpp index ca553003d..da6c729c8 100644 --- a/src/core/ProjectRenderer.cpp +++ b/src/core/ProjectRenderer.cpp @@ -39,18 +39,18 @@ namespace lmms { -const ProjectRenderer::FileEncodeDevice ProjectRenderer::fileEncodeDevices[] = +const std::array ProjectRenderer::fileEncodeDevices { - { ProjectRenderer::WaveFile, + FileEncodeDevice{ ProjectRenderer::WaveFile, QT_TRANSLATE_NOOP( "ProjectRenderer", "WAV (*.wav)" ), ".wav", &AudioFileWave::getInst }, - { ProjectRenderer::FlacFile, + FileEncodeDevice{ ProjectRenderer::FlacFile, QT_TRANSLATE_NOOP("ProjectRenderer", "FLAC (*.flac)"), ".flac", &AudioFileFlac::getInst }, - { ProjectRenderer::OggFile, + FileEncodeDevice{ ProjectRenderer::OggFile, QT_TRANSLATE_NOOP( "ProjectRenderer", "OGG (*.ogg)" ), ".ogg", #ifdef LMMS_HAVE_OGGVORBIS @@ -59,7 +59,7 @@ const ProjectRenderer::FileEncodeDevice ProjectRenderer::fileEncodeDevices[] = nullptr #endif }, - { ProjectRenderer::MP3File, + FileEncodeDevice{ ProjectRenderer::MP3File, QT_TRANSLATE_NOOP( "ProjectRenderer", "MP3 (*.mp3)" ), ".mp3", #ifdef LMMS_HAVE_MP3LAME @@ -71,7 +71,7 @@ const ProjectRenderer::FileEncodeDevice ProjectRenderer::fileEncodeDevices[] = // Insert your own file-encoder infos here. // Maybe one day the user can add own encoders inside the program. - { ProjectRenderer::NumFileFormats, nullptr, nullptr, nullptr } + FileEncodeDevice{ ProjectRenderer::NumFileFormats, nullptr, nullptr, nullptr } } ; @@ -224,8 +224,8 @@ void ProjectRenderer::updateConsoleProgress() { const int cols = 50; static int rot = 0; - char buf[80]; - char prog[cols+1]; + auto buf = std::array{}; + auto prog = std::array{}; for( int i = 0; i < cols; ++i ) { @@ -234,12 +234,12 @@ void ProjectRenderer::updateConsoleProgress() prog[cols] = 0; const auto activity = (const char*)"|/-\\"; - memset( buf, 0, sizeof( buf ) ); - sprintf( buf, "\r|%s| %3d%% %c ", prog, m_progress, + std::fill(buf.begin(), buf.end(), 0); + sprintf(buf.data(), "\r|%s| %3d%% %c ", prog.data(), m_progress, activity[rot] ); rot = ( rot+1 ) % 4; - fprintf( stderr, "%s", buf ); + fprintf( stderr, "%s", buf.data() ); fflush( stderr ); } diff --git a/src/core/SampleBuffer.cpp b/src/core/SampleBuffer.cpp index 92f3e2156..677366fdb 100644 --- a/src/core/SampleBuffer.cpp +++ b/src/core/SampleBuffer.cpp @@ -1067,7 +1067,7 @@ void SampleBuffer::visualize( float maxData = -1; float minData = 1; - float rmsData[2] = {0, 0}; + auto rmsData = std::array{}; // Find maximum and minimum samples within range for (int i = 0; i < fpp && frame + i <= last; ++i) diff --git a/src/core/audio/AudioFileFlac.cpp b/src/core/audio/AudioFileFlac.cpp index 4e40257cd..6af063683 100644 --- a/src/core/audio/AudioFileFlac.cpp +++ b/src/core/audio/AudioFileFlac.cpp @@ -96,7 +96,7 @@ void AudioFileFlac::writeBuffer(surroundSampleFrame const* _ab, fpp_t const fram if (depth == OutputSettings::Depth_24Bit || depth == OutputSettings::Depth_32Bit) // Float encoding { - std::unique_ptr buf{ new sample_t[frames*channels()] }; + auto buf = std::vector(frames * channels()); for(fpp_t frame = 0; frame < frames; ++frame) { for(ch_cnt_t channel=0; channel(buf.get()),frames); + sf_writef_float(m_sf, static_cast(buf.data()), frames); } else // integer PCM encoding { - std::unique_ptr buf{ new int_sample_t[frames*channels()] }; - convertToS16(_ab, frames, master_gain, buf.get(), !isLittleEndian()); - sf_writef_short(m_sf, static_cast(buf.get()), frames); + auto buf = std::vector(frames * channels()); + convertToS16(_ab, frames, master_gain, buf.data(), !isLittleEndian()); + sf_writef_short(m_sf, static_cast(buf.data()), frames); } } diff --git a/src/core/lv2/Lv2Proc.cpp b/src/core/lv2/Lv2Proc.cpp index f319f3b57..cbb4be2d2 100644 --- a/src/core/lv2/Lv2Proc.cpp +++ b/src/core/lv2/Lv2Proc.cpp @@ -65,8 +65,8 @@ Plugin::PluginTypes Lv2Proc::check(const LilvPlugin *plugin, { unsigned maxPorts = lilv_plugin_get_num_ports(plugin); enum { inCount, outCount, maxCount }; - unsigned audioChannels[maxCount] = { 0, 0 }; // audio input and output count - unsigned midiChannels[maxCount] = { 0, 0 }; // MIDI input and output count + auto audioChannels = std::array{}; // audio input and output count + auto midiChannels = std::array{}; // MIDI input and output count const char* pluginUri = lilv_node_as_uri(lilv_plugin_get_uri(plugin)); //qDebug() << "Checking plugin" << pluginUri << "..."; @@ -247,11 +247,11 @@ void Lv2Proc::copyModelsFromCore() ev.time.frames(Engine::framesPerTick()) + ev.offset; uint32_t type = Engine::getLv2Manager()-> uridCache()[Lv2UridCache::Id::midi_MidiEvent]; - uint8_t buf[4]; - std::size_t bufsize = writeToByteSeq(ev.ev, buf, sizeof(buf)); + auto buf = std::array{}; + std::size_t bufsize = writeToByteSeq(ev.ev, buf.data(), buf.size()); if(bufsize) { - lv2_evbuf_write(&iter, atomStamp, type, bufsize, buf); + lv2_evbuf_write(&iter, atomStamp, type, bufsize, buf.data()); } } } diff --git a/src/core/midi/MidiAlsaRaw.cpp b/src/core/midi/MidiAlsaRaw.cpp index 04ef5c1ce..23364fc01 100644 --- a/src/core/midi/MidiAlsaRaw.cpp +++ b/src/core/midi/MidiAlsaRaw.cpp @@ -105,7 +105,7 @@ void MidiAlsaRaw::sendByte( unsigned char c ) void MidiAlsaRaw::run() { - unsigned char buf[128]; + auto buf = std::array{}; //int cnt = 0; while( m_quit == false ) { @@ -149,7 +149,7 @@ void MidiAlsaRaw::run() { continue; } - err = snd_rawmidi_read( m_input, buf, sizeof( buf ) ); + err = snd_rawmidi_read(m_input, buf.data(), buf.size()); if( err == -EAGAIN ) { continue; diff --git a/src/core/midi/MidiAlsaSeq.cpp b/src/core/midi/MidiAlsaSeq.cpp index b770d914c..760840c77 100644 --- a/src/core/midi/MidiAlsaSeq.cpp +++ b/src/core/midi/MidiAlsaSeq.cpp @@ -241,7 +241,7 @@ void MidiAlsaSeq::applyPortMode( MidiPort * _port ) m_seqMutex.lock(); // determine port-capabilities - unsigned int caps[2] = { 0, 0 }; + auto caps = std::array{}; switch( _port->mode() ) { diff --git a/src/core/midi/MidiClient.cpp b/src/core/midi/MidiClient.cpp index 5b008c54b..78691de6f 100644 --- a/src/core/midi/MidiClient.cpp +++ b/src/core/midi/MidiClient.cpp @@ -105,10 +105,10 @@ void MidiClientRaw::parseData( const unsigned char c ) /* 'Process' system real-time messages */ /*********************************************************************/ /* There are not too many real-time messages that are of interest here. - * They can occur anywhere, even in the middle of a noteon message! + * They can occur anywhere, even in the middle of a noteon message! * Real-time range: 0xF8 .. 0xFF * Note: Real-time does not affect (running) status. - */ + */ if( c >= 0xF8 ) { if( c == MidiSystemReset ) @@ -124,13 +124,13 @@ void MidiClientRaw::parseData( const unsigned char c ) /* 'Process' system common messages (again, just skip them) */ /*********************************************************************/ /* There are no system common messages that are of interest here. - * System common range: 0xF0 .. 0xF7 + * System common range: 0xF0 .. 0xF7 */ if( c > 0xF0 ) { /* MIDI spec say: To ignore a non-real-time message, just discard all * data up to the next status byte. And our parser will ignore data - * that is received without a valid status. + * that is received without a valid status. * Note: system common cancels running status. */ m_midiParseData.m_status = 0; return; @@ -186,14 +186,14 @@ void MidiClientRaw::parseData( const unsigned char c ) /*********************************************************************/ /* Send the event */ /*********************************************************************/ - /* The event is ready-to-go. About 'running status': - * + /* The event is ready-to-go. About 'running status': + * * The MIDI protocol has a built-in compression mechanism. If several * similar events are sent in-a-row, for example note-ons, then the * event type is only sent once. For this case, the last event type * (status) is remembered. * We simply keep the status as it is, just reset the parameter counter. - * If another status byte comes in, it will overwrite the status. + * If another status byte comes in, it will overwrite the status. */ m_midiParseData.m_midiEvent.setType(static_cast(m_midiParseData.m_status)); m_midiParseData.m_midiEvent.setChannel(m_midiParseData.m_channel); @@ -224,7 +224,7 @@ void MidiClientRaw::parseData( const unsigned char c ) m_midiParseData.m_midiEvent.setPitchBend((m_midiParseData.m_buffer[1] * 128) | m_midiParseData.m_buffer[0]); break; - default: + default: // Unlikely return; } @@ -271,7 +271,7 @@ void MidiClientRaw::processOutEvent(const MidiEvent& event, const TimePos&, cons // Taken from Nagano Daisuke's USB-MIDI driver -static const unsigned char REMAINS_F0F6[] = +static const auto REMAINS_F0F6 = std::array { 0, /* 0xF0 */ 2, /* 0XF1 */ @@ -282,7 +282,7 @@ static const unsigned char REMAINS_F0F6[] = 1 /* 0XF6 */ } ; -static const unsigned char REMAINS_80E0[] = +static const auto REMAINS_80E0 = std::array { 3, /* 0x8X Note Off */ 3, /* 0x9X Note On */ diff --git a/src/gui/LmmsStyle.cpp b/src/gui/LmmsStyle.cpp index 64c1c1614..060a97811 100644 --- a/src/gui/LmmsStyle.cpp +++ b/src/gui/LmmsStyle.cpp @@ -23,6 +23,7 @@ * */ +#include #include #include @@ -71,7 +72,7 @@ QLinearGradient getGradient( const QColor & _col, const QRectF & _rect ) QLinearGradient darken( const QLinearGradient & _gradient ) { QGradientStops stops = _gradient.stops(); - for (auto& stop : stops) + for (auto& stop : stops) { QColor color = stop.second; stop.second = color.lighter(133); @@ -216,8 +217,8 @@ void LmmsStyle::drawPrimitive( PrimitiveElement element, int a50 = static_cast( a100 * .6 ); int a25 = static_cast( a100 * .33 ); - QLine lines[4]; - QPoint points[4]; + auto lines = std::array{}; + auto points = std::array{}; // black inside lines // 50% @@ -231,7 +232,7 @@ void LmmsStyle::drawPrimitive( PrimitiveElement element, rect.left() + 1, rect.bottom() - 2); lines[3] = QLine(rect.right() - 1, rect.top() + 2, rect.right() - 1, rect.bottom() - 2); - painter->drawLines(lines, 4); + painter->drawLines(lines.data(), 4); // black inside dots black.setAlpha(a50); @@ -240,7 +241,7 @@ void LmmsStyle::drawPrimitive( PrimitiveElement element, points[1] = QPoint(rect.left() + 2, rect.bottom() - 2); points[2] = QPoint(rect.right() - 2, rect.top() + 2); points[3] = QPoint(rect.right() - 2, rect.bottom() - 2); - painter->drawPoints(points, 4); + painter->drawPoints(points.data(), 4); // outside lines - shadow @@ -251,7 +252,7 @@ void LmmsStyle::drawPrimitive( PrimitiveElement element, rect.right() - 2, rect.top()); lines[1] = QLine(rect.left(), rect.top() + 2, rect.left(), rect.bottom() - 2); - painter->drawLines(lines, 2); + painter->drawLines(lines.data(), 2); // outside corner dots - shadow // 75% @@ -259,7 +260,7 @@ void LmmsStyle::drawPrimitive( PrimitiveElement element, painter->setPen(QPen(shadow, 0)); points[0] = QPoint(rect.left() + 1, rect.top() + 1); points[1] = QPoint(rect.right() - 1, rect.top() + 1); - painter->drawPoints(points, 2); + painter->drawPoints(points.data(), 2); // outside end dots - shadow // 50% @@ -269,7 +270,7 @@ void LmmsStyle::drawPrimitive( PrimitiveElement element, points[1] = QPoint(rect.left(), rect.top() + 1); points[2] = QPoint(rect.right() - 1, rect.top()); points[3] = QPoint(rect.left(), rect.bottom() - 1); - painter->drawPoints(points, 4); + painter->drawPoints(points.data(), 4); // outside lines - highlight @@ -280,7 +281,7 @@ void LmmsStyle::drawPrimitive( PrimitiveElement element, rect.right() - 2, rect.bottom()); lines[1] = QLine(rect.right(), rect.top() + 2, rect.right(), rect.bottom() - 2); - painter->drawLines(lines, 2); + painter->drawLines(lines.data(), 2); // outside corner dots - highlight // 75% @@ -288,7 +289,7 @@ void LmmsStyle::drawPrimitive( PrimitiveElement element, painter->setPen(QPen(highlight, 0)); points[0] = QPoint(rect.left() + 1, rect.bottom() - 1); points[1] = QPoint(rect.right() - 1, rect.bottom() - 1); - painter->drawPoints(points, 2); + painter->drawPoints(points.data(), 2); // outside end dots - highlight // 50% @@ -298,7 +299,7 @@ void LmmsStyle::drawPrimitive( PrimitiveElement element, points[1] = QPoint(rect.right(), rect.bottom() - 1); points[2] = QPoint(rect.left() + 1, rect.bottom()); points[3] = QPoint(rect.right(), rect.top() + 1); - painter->drawPoints(points, 4); + painter->drawPoints(points.data(), 4); } else { diff --git a/src/gui/editors/AutomationEditor.cpp b/src/gui/editors/AutomationEditor.cpp index e296301ec..db56557a4 100644 --- a/src/gui/editors/AutomationEditor.cpp +++ b/src/gui/editors/AutomationEditor.cpp @@ -968,8 +968,8 @@ void AutomationEditor::paintEvent(QPaintEvent * pe ) { if( m_y_auto ) { - int y[] = { grid_bottom, TOP_MARGIN + font_height / 2 }; - float level[] = { m_minLevel, m_maxLevel }; + auto y = std::array{grid_bottom, TOP_MARGIN + font_height / 2}; + auto level = std::array{m_minLevel, m_maxLevel}; for( int i = 0; i < 2; ++i ) { const QString & label = m_clip->firstObject() diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 92c5ba72a..5f294d6e8 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -129,7 +129,7 @@ QPixmap* PianoRoll::s_toolKnife = nullptr; TextFloat * PianoRoll::s_textFloat = nullptr; -static QString s_noteStrings[12] = {"C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"}; +static std::array s_noteStrings {"C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"}; static QString getNoteString(int key) { @@ -137,7 +137,7 @@ static QString getNoteString(int key) } // used for drawing of piano -PianoRoll::PianoRollKeyTypes PianoRoll::prKeyOrder[] = +std::array PianoRoll::prKeyOrder { PR_WHITE_KEY_SMALL, PR_BLACK_KEY, PR_WHITE_KEY_BIG, PR_BLACK_KEY, PR_WHITE_KEY_SMALL, PR_WHITE_KEY_SMALL, PR_BLACK_KEY, PR_WHITE_KEY_BIG, @@ -369,10 +369,10 @@ PianoRoll::PianoRoll() : // Set up note length model m_noteLenModel.addItem( tr( "Last note" ), std::make_unique( "edit_draw" ) ); - const QString pixmaps[] = { "whole", "half", "quarter", "eighth", + const auto pixmaps = std::array{"whole", "half", "quarter", "eighth", "sixteenth", "thirtysecond", "triplethalf", "tripletquarter", "tripleteighth", - "tripletsixteenth", "tripletthirtysecond" } ; + "tripletsixteenth", "tripletthirtysecond"}; for( int i = 0; i < NUM_EVEN_LENGTHS; ++i ) { diff --git a/src/gui/instrument/PianoView.cpp b/src/gui/instrument/PianoView.cpp index a64b22095..7478c8204 100644 --- a/src/gui/instrument/PianoView.cpp +++ b/src/gui/instrument/PianoView.cpp @@ -62,7 +62,7 @@ namespace lmms::gui /*! The scale of C Major - white keys only. */ -Keys WhiteKeys[] = +auto WhiteKeys = std::array { Key_C, Key_D, Key_E, Key_F, Key_G, Key_A, Key_H } ; diff --git a/src/gui/modals/ExportProjectDialog.cpp b/src/gui/modals/ExportProjectDialog.cpp index 7671e031e..1f937c374 100644 --- a/src/gui/modals/ExportProjectDialog.cpp +++ b/src/gui/modals/ExportProjectDialog.cpp @@ -79,14 +79,14 @@ ExportProjectDialog::ExportProjectDialog( const QString & _file_name, cbIndex++; } } - + int const MAX_LEVEL=8; for(int i=0; i<=MAX_LEVEL; ++i) { QString info=""; if ( i==0 ){ info = tr( "( Fastest - biggest )" ); } else if ( i==MAX_LEVEL ){ info = tr( "( Slowest - smallest )" ); } - + compLevelCB->addItem( QString::number(i)+" "+info, QVariant(i/static_cast(MAX_LEVEL)) @@ -159,8 +159,8 @@ void ExportProjectDialog::startExport() static_cast(interpolationCB->currentIndex()), static_cast(oversamplingCB->currentIndex()) ); - const int samplerates[5] = { 44100, 48000, 88200, 96000, 192000 }; - const bitrate_t bitrates[6] = { 64, 128, 160, 192, 256, 320 }; + const auto samplerates = std::array{44100, 48000, 88200, 96000, 192000}; + const auto bitrates = std::array{64, 128, 160, 192, 256, 320}; bool useVariableBitRate = checkBoxVariableBitRate->isChecked(); diff --git a/src/gui/widgets/LedCheckBox.cpp b/src/gui/widgets/LedCheckBox.cpp index f31d03b2c..1be072815 100644 --- a/src/gui/widgets/LedCheckBox.cpp +++ b/src/gui/widgets/LedCheckBox.cpp @@ -35,7 +35,7 @@ namespace lmms::gui { -static const QString names[LedCheckBox::NumColors] = +static const auto names = std::array { "led_yellow", "led_green", "led_red" } ; From 757146cc6870dac64e3aec73b6b1a5a4df9daad8 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 31 Dec 2022 14:38:48 +0100 Subject: [PATCH 07/70] Move Flanger class declarations into namespace lmms --- plugins/Flanger/FlangerEffect.cpp | 3 +++ plugins/Flanger/FlangerEffect.h | 9 +++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/Flanger/FlangerEffect.cpp b/plugins/Flanger/FlangerEffect.cpp index 562badc0a..9f7200f0e 100644 --- a/plugins/Flanger/FlangerEffect.cpp +++ b/plugins/Flanger/FlangerEffect.cpp @@ -24,6 +24,9 @@ #include "FlangerEffect.h" #include "Engine.h" +#include "MonoDelay.h" +#include "Noise.h" +#include "QuadratureLfo.h" #include "embed.h" #include "plugin_export.h" diff --git a/plugins/Flanger/FlangerEffect.h b/plugins/Flanger/FlangerEffect.h index 45dd5cafd..8428d89a3 100644 --- a/plugins/Flanger/FlangerEffect.h +++ b/plugins/Flanger/FlangerEffect.h @@ -28,17 +28,14 @@ #include "Effect.h" #include "FlangerControls.h" -#include "MonoDelay.h" -#include "Noise.h" -#include "QuadratureLfo.h" + +namespace lmms +{ class MonoDelay; class Noise; class QuadratureLfo; -namespace lmms -{ - class FlangerEffect : public Effect { From 2f28c2bcc24ebd4c9fbfd37c2b363817c779598b Mon Sep 17 00:00:00 2001 From: localhost-127 <77588653+localhost-127@users.noreply.github.com> Date: Sun, 1 Jan 2023 11:49:40 +0530 Subject: [PATCH 08/70] Fix recording not possible with MIDI keyboard in PianoRoll (#6593) Co-authored-by: volumie --- src/core/Song.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/Song.cpp b/src/core/Song.cpp index 7ecccf56d..ab4ac940b 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -116,7 +116,7 @@ Song::Song() : /* connect( &m_masterPitchModel, SIGNAL(dataChanged()), this, SLOT(masterPitchChanged()));*/ - qRegisterMetaType( "Note" ); + qRegisterMetaType( "lmms::Note" ); setType( SongContainer ); for (auto& scale : m_scales) {scale = std::make_shared();} From bf00a675cced4653f663bbf292a6d13b14512009 Mon Sep 17 00:00:00 2001 From: Hyunjin Song Date: Sun, 1 Jan 2023 18:53:30 +0900 Subject: [PATCH 09/70] Fix broken "Display playback cursor in AudioFileProcessor" (#6601) Adds missing `lmms` namespace for `f_cnt_t` to qRegisterMetaType. --- plugins/AudioFileProcessor/AudioFileProcessor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/AudioFileProcessor/AudioFileProcessor.cpp b/plugins/AudioFileProcessor/AudioFileProcessor.cpp index 8126d4c08..2e2d7163b 100644 --- a/plugins/AudioFileProcessor/AudioFileProcessor.cpp +++ b/plugins/AudioFileProcessor/AudioFileProcessor.cpp @@ -550,7 +550,7 @@ AudioFileProcessorView::AudioFileProcessorView( Instrument * _instrument, connect( castModel(), SIGNAL( isPlaying( lmms::f_cnt_t ) ), m_waveView, SLOT( isPlaying( lmms::f_cnt_t ) ) ); - qRegisterMetaType( "f_cnt_t" ); + qRegisterMetaType( "lmms::f_cnt_t" ); setAcceptDrops( true ); } @@ -1287,4 +1287,4 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main(Model * model, void *) } -} // namespace lmms \ No newline at end of file +} // namespace lmms From 6c7d2da9c4953e75c1d7eea9c1204cfd0d267314 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 1 Jan 2023 11:09:31 +0100 Subject: [PATCH 10/70] Fix AM pitch shift compatibility with 1.2 projects (#6554) and shorten some of the upgrade code --- src/core/DataFile.cpp | 95 ++++++++++++++++++++++--------------------- 1 file changed, 49 insertions(+), 46 deletions(-) diff --git a/src/core/DataFile.cpp b/src/core/DataFile.cpp index b6b9452f5..2e7b21e8b 100644 --- a/src/core/DataFile.cpp +++ b/src/core/DataFile.cpp @@ -1322,44 +1322,32 @@ void DataFile::upgrade_1_3_0() // Effect name changes QDomElement attribute = attributes.item( k ).toElement(); - if( attribute.attribute( "name" ) == "file" && - ( attribute.attribute( "value" ) == "calf" || - attribute.attribute( "value" ) == "calf.so" ) ) + const QString attrName = attribute.attribute("name"); + const QString attrVal = attribute.attribute("value"); + const QString plugin = attrName == "plugin" ? attrVal : ""; + + static const std::map pluginNames = { + {"Sidechaincompressor", "SidechainCompressor"}, + {"Sidechaingate", "SidechainGate"}, + {"Multibandcompressor", "MultibandCompressor"}, + {"Multibandgate", "MultibandGate"}, + {"Multibandlimiter", "MultibandLimiter"}, + }; + + if (attrName == "file" && (attrVal == "calf" || attrVal == "calf.so" )) { attribute.setAttribute( "value", "veal" ); } - else if( attribute.attribute( "name" ) == "plugin" && - attribute.attribute( "value" ) == "Sidechaincompressor" ) + + const auto newName = pluginNames.find(plugin); + if (newName != pluginNames.end()) { - attribute.setAttribute( "value", "SidechainCompressor" ); - } - else if( attribute.attribute( "name" ) == "plugin" && - attribute.attribute( "value" ) == "Sidechaingate" ) - { - attribute.setAttribute( "value", "SidechainGate" ); - } - else if( attribute.attribute( "name" ) == "plugin" && - attribute.attribute( "value" ) == "Multibandcompressor" ) - { - attribute.setAttribute( "value", "MultibandCompressor" ); - } - else if( attribute.attribute( "name" ) == "plugin" && - attribute.attribute( "value" ) == "Multibandgate" ) - { - attribute.setAttribute( "value", "MultibandGate" ); - } - else if( attribute.attribute( "name" ) == "plugin" && - attribute.attribute( "value" ) == "Multibandlimiter" ) - { - attribute.setAttribute( "value", "MultibandLimiter" ); + attribute.setAttribute("value", newName->second); } // Handle port changes - if( attribute.attribute( "name" ) == "plugin" && - ( attribute.attribute( "value" ) == "MultibandLimiter" || - attribute.attribute( "value" ) == "MultibandCompressor" || - attribute.attribute( "value" ) == "MultibandGate" ) ) + if (plugin == "MultibandLimiter" || plugin == "MultibandCompressor" || plugin == "MultibandGate") { auto fn = [&](QDomElement& port, int num, QList&, QList& removeList) { @@ -1380,8 +1368,7 @@ void DataFile::upgrade_1_3_0() iterate_ladspa_ports(effect, fn); } - if( attribute.attribute( "name" ) == "plugin" && - ( attribute.attribute( "value" ) == "Pulsator" ) ) + else if (plugin == "Pulsator") { auto fn = [&](QDomElement& port, int num, QList& addList, QList& removeList) { @@ -1424,9 +1411,7 @@ void DataFile::upgrade_1_3_0() iterate_ladspa_ports(effect, fn); } - - if( attribute.attribute( "name" ) == "plugin" && - ( attribute.attribute( "value" ) == "VintageDelay" ) ) + else if (plugin == "VintageDelay") { auto fn = [&](QDomElement& port, int num, QList& addList, QList& ) { @@ -1463,23 +1448,20 @@ void DataFile::upgrade_1_3_0() iterate_ladspa_ports(effect, fn); } - if( attribute.attribute( "name" ) == "plugin" && - ( ( attribute.attribute( "value" ) == "Equalizer5Band" ) - || ( attribute.attribute( "value" ) == "Equalizer8Band" ) - || ( attribute.attribute( "value" ) == "Equalizer12Band" ) ) ) + else if (plugin == "Equalizer5Band" || plugin == "Equalizer8Band" || plugin == "Equalizer12Band") { // NBand equalizers got 4 q nobs inserted. We need to shift everything else... // HOWEVER: 5 band eq has only 2 q nobs inserted (no LS/HS filters) - bool band5 = ( attribute.attribute( "value" ) == "Equalizer5Band" ); + bool band5 = plugin == "Equalizer5Band"; auto fn = [&](QDomElement& port, int num, QList& addList, QList& ) { if(num == 4) { // don't modify port 4, but some other ones: int zoom_port; - if(attribute.attribute( "value" ) == "Equalizer5Band") + if (plugin == "Equalizer5Band") zoom_port = 36; - else if(attribute.attribute( "value" ) == "Equalizer8Band") + else if (plugin == "Equalizer8Band") zoom_port = 48; else // 12 band zoom_port = 64; @@ -1560,8 +1542,7 @@ void DataFile::upgrade_1_3_0() iterate_ladspa_ports(effect, fn); } - if( attribute.attribute( "name" ) == "plugin" && - attribute.attribute( "value" ) == "Saturator" ) + else if (plugin == "Saturator") { auto fn = [&](QDomElement& port, int num, QList&, QList& ) { @@ -1588,8 +1569,7 @@ void DataFile::upgrade_1_3_0() iterate_ladspa_ports(effect, fn); } - if( attribute.attribute( "name" ) == "plugin" && - attribute.attribute( "value" ) == "StereoTools" ) + else if (plugin == "StereoTools") { auto fn = [&](QDomElement& port, int num, QList&, QList& ) { @@ -1605,6 +1585,29 @@ void DataFile::upgrade_1_3_0() }; iterate_ladspa_ports(effect, fn); } + + else if (plugin == "amPitchshift") + { + auto fn = [&](QDomElement& port, int num, QList&, QList& removeList) + { + switch (num) + { + case 0: + port.setTagName("port01"); + break; + case 1: + port.setTagName("port03"); + break; + case 10: + port.setTagName("port11"); + break; + case 11: + port.setTagName("port13"); + break; + } + }; + iterate_ladspa_ports(effect, fn); + } } } } From 2f2ba41f2830c5a111957b875a464218e199f29c Mon Sep 17 00:00:00 2001 From: Lost Robot <34612565+LostRobotMusic@users.noreply.github.com> Date: Sun, 1 Jan 2023 02:28:30 -0800 Subject: [PATCH 11/70] Microtonality for SF2Player (#6580) Co-authored-by: Hyunjin Song --- CMakeLists.txt | 2 +- include/InstrumentTrack.h | 5 +++ plugins/Sf2Player/Sf2Player.cpp | 61 ++++++++++++++++++++++++++++----- plugins/Sf2Player/Sf2Player.h | 2 +- 4 files changed, 59 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dae43e573..2d5730bdf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -495,7 +495,7 @@ ENDIF() # check for Fluidsynth IF(WANT_SF2) - find_package(FluidSynth 1.0.7) + find_package(FluidSynth 1.1.0) if(FluidSynth_FOUND) SET(LMMS_HAVE_FLUIDSYNTH TRUE) SET(STATUS_FLUIDSYNTH "OK") diff --git a/include/InstrumentTrack.h b/include/InstrumentTrack.h index 90cd25814..129969292 100644 --- a/include/InstrumentTrack.h +++ b/include/InstrumentTrack.h @@ -224,6 +224,11 @@ public: return &m_mixerChannelModel; } + BoolModel* useMasterPitchModel() + { + return &m_useMasterPitchModel; + } + void setPreviewMode( const bool ); bool isPreviewMode() const diff --git a/plugins/Sf2Player/Sf2Player.cpp b/plugins/Sf2Player/Sf2Player.cpp index bd9788bf1..ab3729f7d 100644 --- a/plugins/Sf2Player/Sf2Player.cpp +++ b/plugins/Sf2Player/Sf2Player.cpp @@ -181,6 +181,15 @@ Sf2Instrument::Sf2Instrument( InstrumentTrack * _instrument_track ) : connect( &m_chorusLevel, SIGNAL( dataChanged() ), this, SLOT( updateChorus() ) ); connect( &m_chorusSpeed, SIGNAL( dataChanged() ), this, SLOT( updateChorus() ) ); connect( &m_chorusDepth, SIGNAL( dataChanged() ), this, SLOT( updateChorus() ) ); + + // Microtuning + connect(Engine::getSong(), &Song::scaleListChanged, this, &Sf2Instrument::updateTuning); + connect(Engine::getSong(), &Song::keymapListChanged, this, &Sf2Instrument::updateTuning); + connect(instrumentTrack()->microtuner()->enabledModel(), &Model::dataChanged, this, &Sf2Instrument::updateTuning, Qt::DirectConnection); + connect(instrumentTrack()->microtuner()->scaleModel(), &Model::dataChanged, this, &Sf2Instrument::updateTuning, Qt::DirectConnection); + connect(instrumentTrack()->microtuner()->keymapModel(), &Model::dataChanged, this, &Sf2Instrument::updateTuning, Qt::DirectConnection); + connect(instrumentTrack()->microtuner()->keyRangeImportModel(), &Model::dataChanged, this, &Sf2Instrument::updateTuning, Qt::DirectConnection); + connect(instrumentTrack()->baseNoteModel(), &Model::dataChanged, this, &Sf2Instrument::updateTuning, Qt::DirectConnection); auto iph = new InstrumentPlayHandle(this, _instrument_track); Engine::audioEngine()->addPlayHandle( iph ); @@ -537,6 +546,38 @@ void Sf2Instrument::updateChorus() +void Sf2Instrument::updateTuning() +{ + if (instrumentTrack()->microtuner()->enabledModel()->value()) + { + auto centArray = std::array{}; + double lowestHz = pow(2., -69. / 12.) * 440.;// Frequency of MIDI note 0, which is approximately 8.175798916 Hz + for (int i = 0; i < 128; ++i) + { + // Get desired Hz of note + double noteHz = instrumentTrack()->microtuner()->keyToFreq(i, DefaultBaseKey); + // Convert Hz to cents + centArray[i] = noteHz == 0. ? 0. : 1200. * log2(noteHz / lowestHz); + } + + fluid_synth_activate_key_tuning(m_synth, 0, 0, "", centArray.data(), true); + for (int chan = 0; chan < 16; chan++) + { + fluid_synth_activate_tuning(m_synth, chan, 0, 0, true); + } + } + else + { + fluid_synth_activate_key_tuning(m_synth, 0, 0, "", nullptr, true); + for (int chan = 0; chan < 16; chan++) + { + fluid_synth_activate_tuning(m_synth, chan, 0, 0, true); + } + } +} + + + void Sf2Instrument::reloadSynth() { double tempRate; @@ -604,6 +645,7 @@ void Sf2Instrument::reloadSynth() updateReverbOn(); updateChorusOn(); updateGain(); + updateTuning(); // Reset last MIDI pitch properties, which will be set to the correct values // upon playing the next note @@ -622,18 +664,19 @@ void Sf2Instrument::playNote( NotePlayHandle * _n, sampleFrame * ) } const f_cnt_t tfp = _n->totalFramesPlayed(); + + int masterPitch = instrumentTrack()->useMasterPitchModel()->value() ? Engine::getSong()->masterPitch() : 0; + int baseNote = instrumentTrack()->baseNoteModel()->value(); + int midiNote = _n->midiKey() - baseNote + DefaultBaseKey + masterPitch; - if( tfp == 0 ) + // out of range? + if (midiNote < 0 || midiNote >= 128) { - const float LOG440 = 2.643452676f; + return; + } - int midiNote = (int)floor( 12.0 * ( log2( _n->unpitchedFrequency() ) - LOG440 ) - 4.0 ); - - // out of range? - if( midiNote <= 0 || midiNote >= 128 ) - { - return; - } + if (tfp == 0) + { const int baseVelocity = instrumentTrack()->midiPort()->baseVelocity(); auto pluginData = new Sf2PluginData; diff --git a/plugins/Sf2Player/Sf2Player.h b/plugins/Sf2Player/Sf2Player.h index 7cad284c0..5a88d0f95 100644 --- a/plugins/Sf2Player/Sf2Player.h +++ b/plugins/Sf2Player/Sf2Player.h @@ -111,7 +111,7 @@ public slots: void updateChorusOn(); void updateChorus(); void updateGain(); - + void updateTuning(); private: static QMutex s_fontsMutex; From 79def0c3b544826ceb7c72fbd3dd9e602c75a058 Mon Sep 17 00:00:00 2001 From: PrestonXPitzer Date: Wed, 23 Nov 2022 12:18:48 -0500 Subject: [PATCH 12/70] Changed Whitespace removed whitespace in Piano.cpp and Piano.h to comply with LMMS coding convetions --- include/Piano.h | 12 ++++++------ src/core/Piano.cpp | 32 ++++++++++++++++---------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/include/Piano.h b/include/Piano.h index 01a20046d..531bb65a6 100644 --- a/include/Piano.h +++ b/include/Piano.h @@ -44,17 +44,17 @@ public: BlackKey } ; - Piano( InstrumentTrack* track ); + Piano(InstrumentTrack* track); - void setKeyState( int key, bool state ); + void setKeyState(int key, bool state); - bool isKeyPressed( int key ) const + bool isKeyPressed(int key) const { return m_pressedKeys[key]; } - void handleKeyPress( int key, int midiVelocity = -1 ); - void handleKeyRelease( int key ); + void handleKeyPress(int key, int midiVelocity = -1); + void handleKeyRelease(int key); InstrumentTrack* instrumentTrack() const { @@ -75,7 +75,7 @@ public: static const unsigned int NumBlackKeys = 53; private: - static bool isValidKey( int key ) + static bool isValidKey(int key) { return key >= 0 && key < NumKeys; } diff --git a/src/core/Piano.cpp b/src/core/Piano.cpp index 0f59dd905..82323526e 100644 --- a/src/core/Piano.cpp +++ b/src/core/Piano.cpp @@ -62,10 +62,10 @@ static const auto KEY_ORDER = std::array * * \param _it the InstrumentTrack window to attach to */ -Piano::Piano( InstrumentTrack* track ) : - Model( nullptr ), /*!< base class ctor */ - m_instrumentTrack( track ), - m_midiEvProc( track ) /*!< the InstrumentTrack Model */ +Piano::Piano(InstrumentTrack* track) : + Model(nullptr), /*!< base class ctor */ + m_instrumentTrack(track), + m_midiEvProc(track) /*!< the InstrumentTrack Model */ { } @@ -74,9 +74,9 @@ Piano::Piano( InstrumentTrack* track ) : * \param key the key number to change * \param state the state to set the key to */ -void Piano::setKeyState( int key, bool state ) +void Piano::setKeyState(int key, bool state) { - if( isValidKey( key ) ) + if (isValidKey(key)) { m_pressedKeys[key] = state; @@ -91,15 +91,15 @@ void Piano::setKeyState( int key, bool state ) * * \param key the key being pressed */ -void Piano::handleKeyPress( int key, int midiVelocity ) +void Piano::handleKeyPress(int key, int midiVelocity) { - if( midiVelocity == -1 ) + if (midiVelocity == -1) { midiVelocity = m_instrumentTrack->midiPort()->baseVelocity(); } - if( isValidKey( key ) ) + if (isValidKey(key)) { - m_midiEvProc->processInEvent( MidiEvent( MidiNoteOn, -1, key, midiVelocity ) ); + m_midiEvProc->processInEvent(MidiEvent(MidiNoteOn, -1, key, midiVelocity)); m_pressedKeys[key] = true; } } @@ -112,18 +112,18 @@ void Piano::handleKeyPress( int key, int midiVelocity ) * * \param key the key being releassed */ -void Piano::handleKeyRelease( int key ) +void Piano::handleKeyRelease(int key) { - if( isValidKey( key ) ) + if (isValidKey(key)) { - m_midiEvProc->processInEvent( MidiEvent( MidiNoteOff, -1, key, 0 ) ); + m_midiEvProc->processInEvent(MidiEvent(MidiNoteOff, -1, key, 0)); m_pressedKeys[key] = false; } } -bool Piano::isBlackKey( int key ) +bool Piano::isBlackKey(int key) { int keyCode = key % KeysPerOctave; @@ -131,9 +131,9 @@ bool Piano::isBlackKey( int key ) } -bool Piano::isWhiteKey( int key ) +bool Piano::isWhiteKey(int key) { - return !isBlackKey( key ); + return !isBlackKey(key); } From d95c89760aad13a2b3b12ff5210effe4aea81e15 Mon Sep 17 00:00:00 2001 From: Dominic Clark Date: Mon, 2 Jan 2023 23:42:46 +0000 Subject: [PATCH 13/70] Support ZynAddSubFx with MSVC (#6561) --- .github/workflows/build.yml | 4 +- CMakeLists.txt | 7 ++ cmake/modules/PluginList.cmake | 1 - include/IoHelper.h | 6 +- plugins/ZynAddSubFx/CMakeLists.txt | 110 ++++++++++------------ plugins/ZynAddSubFx/LocalZynAddSubFx.cpp | 50 ++++++---- plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp | 60 ++++-------- plugins/ZynAddSubFx/ThreadShims.h | 9 ++ plugins/ZynAddSubFx/zynaddsubfx | 2 +- tests/scripted/check-namespace | 6 +- 10 files changed, 120 insertions(+), 135 deletions(-) create mode 100644 plugins/ZynAddSubFx/ThreadShims.h diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b51857402..007842b82 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -225,8 +225,8 @@ jobs: --triplet=${{ matrix.arch }}-windows ` --host-triplet=${{ matrix.arch }}-windows ` --recurse ` - fftw3 fluidsynth[sndfile] libsamplerate libsndfile libstk lilv lv2 ` - portaudio sdl2 + fftw3 fltk fluidsynth[sndfile] libsamplerate libsndfile libstk ` + lilv lv2 portaudio sdl2 - name: Set up build environment uses: ilammy/msvc-dev-cmd@d8610e2b41c6d0f0c3b4c46dad8df0fd826c68e1 with: diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d5730bdf..c5de064a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -486,6 +486,13 @@ ENDIF(WANT_JACK) FIND_PACKAGE(FFTW COMPONENTS fftw3f REQUIRED) # check for FLTK +set(FLTK_SKIP_OPENGL TRUE) +set(FLTK_SKIP_FORMS TRUE) +set(FLTK_SKIP_IMAGES TRUE) +set(FLTK_SKIP_MATH TRUE) +if(MINGW_PREFIX) + set(FLTK_SKIP_FLUID TRUE) +endif() FIND_PACKAGE(FLTK) IF(FLTK_FOUND) SET(STATUS_ZYN "OK") diff --git a/cmake/modules/PluginList.cmake b/cmake/modules/PluginList.cmake index 151c5bd66..fe98a64b4 100644 --- a/cmake/modules/PluginList.cmake +++ b/cmake/modules/PluginList.cmake @@ -100,7 +100,6 @@ ENDIF() IF(MSVC) SET(MSVC_INCOMPATIBLE_PLUGINS LadspaEffect - ZynAddSubFx ) message(WARNING "Compiling with MSVC. The following plugins are not available: ${MSVC_INCOMPATIBLE_PLUGINS}") LIST(REMOVE_ITEM PLUGIN_LIST ${MSVC_INCOMPATIBLE_PLUGINS}) diff --git a/include/IoHelper.h b/include/IoHelper.h index c7d65c917..96d6aa144 100644 --- a/include/IoHelper.h +++ b/include/IoHelper.h @@ -47,7 +47,7 @@ namespace lmms #ifdef _WIN32 -std::wstring toWString(const std::string& s) +inline std::wstring toWString(const std::string& s) { std::wstring ret; int len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, s.data(), @@ -64,7 +64,7 @@ std::wstring toWString(const std::string& s) #endif -FILE* F_OPEN_UTF8(std::string const& fname, const char* mode){ +inline FILE* F_OPEN_UTF8(std::string const& fname, const char* mode){ #ifdef LMMS_BUILD_WIN32 return _wfopen(toWString(fname).data(), toWString(mode).data()); #else @@ -73,7 +73,7 @@ FILE* F_OPEN_UTF8(std::string const& fname, const char* mode){ } -int fileToDescriptor(FILE* f, bool closeFile = true) +inline int fileToDescriptor(FILE* f, bool closeFile = true) { int fh; if (f == nullptr) {return -1;} diff --git a/plugins/ZynAddSubFx/CMakeLists.txt b/plugins/ZynAddSubFx/CMakeLists.txt index b184162a3..3369a7938 100644 --- a/plugins/ZynAddSubFx/CMakeLists.txt +++ b/plugins/ZynAddSubFx/CMakeLists.txt @@ -1,5 +1,12 @@ +if(NOT FLTK_FOUND) + return() +endif() + INCLUDE(BuildPlugin) +find_package(Threads REQUIRED) +find_package(ZLIB REQUIRED) + set(CMAKE_POSITION_INDEPENDENT_CODE ON) # definitions for ZynAddSubFX @@ -11,40 +18,20 @@ ELSE() ADD_DEFINITIONS(-DOS_WINDOWS) ENDIF() -# do not conflict with LMMS' Controller class -ADD_DEFINITIONS(-DController=ZynController) - # use asm optimizations when on x86 or x86_64 -IF(LMMS_HOST_X86 OR LMMS_HOST_X86_64) +if(NOT MSVC AND (LMMS_HOST_X86 OR LMMS_HOST_X86_64)) ADD_DEFINITIONS(-DASM_F2I_YES) -ENDIF(LMMS_HOST_X86 OR LMMS_HOST_X86_64) +endif() # build ZynAddSubFX with full optimizations -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wno-write-strings -Wno-deprecated-declarations -fpermissive") +if(NOT MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wno-write-strings -Wno-deprecated-declarations -fpermissive") +endif() IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND NOT "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "6.0.0") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-misleading-indentation") ENDIF() -IF(LMMS_BUILD_WIN32) - # link system-libraries - ADD_DEFINITIONS(-DPTW32_STATIC_LIB) - # fix X11 headers errors caused by bug with mingw + c++11 (enable -std=gnu++0x) - SET(CMAKE_CXX_EXTENSIONS ON) -ENDIF(LMMS_BUILD_WIN32) - -SET(FLTK_SKIP_OPENGL TRUE) -SET(FLTK_SKIP_FORMS TRUE) -SET(FLTK_SKIP_IMAGES TRUE) -SET(FLTK_SKIP_MATH TRUE) -IF(MINGW_PREFIX) - SET(FLTK_SKIP_FLUID TRUE) -ENDIF() - -IF(NOT FLTK_FOUND) - RETURN() -ENDIF() - IF(MINGW_PREFIX) SET(FLTK_FLUID_EXECUTABLE "${MINGW_PREFIX}/bin/fluid") ENDIF() @@ -57,13 +44,15 @@ IF(NOT EXISTS ${FLTK_FLUID_EXECUTABLE}) ENDIF() ENDIF() -INCLUDE_DIRECTORIES("${FLTK_INCLUDE_DIR}" - "${CMAKE_CURRENT_SOURCE_DIR}" - ${FFTW3F_INCLUDE_DIRS} - "${CMAKE_CURRENT_BINARY_DIR}" - "${CMAKE_BINARY_DIR}") - -include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/zynaddsubfx/src/UI) +include_directories( + "${FLTK_INCLUDE_DIR}" + "${CMAKE_CURRENT_SOURCE_DIR}" + ${FFTW3F_INCLUDE_DIRS} + "${CMAKE_CURRENT_BINARY_DIR}" + "${CMAKE_BINARY_DIR}" + "${CMAKE_SOURCE_DIR}/src/3rdparty/mingw-std-threads" + "${CMAKE_CURRENT_SOURCE_DIR}/zynaddsubfx/src/UI" +) ADD_DEFINITIONS(-DPLUGINVERSION) # removes exit confirmation dialogs etc. in MasterUI.fl add_subdirectory(zynaddsubfx/src/Nio) @@ -116,24 +105,23 @@ SET(zynaddsubfx_core_SRCS zynaddsubfx/src/Synth/PADnote.cpp zynaddsubfx/src/Synth/Resonance.cpp zynaddsubfx/src/Synth/SUBnote.cpp - ) +) +add_library(ZynAddSubFxCoreObjs OBJECT LocalZynAddSubFx.cpp ${zynaddsubfx_core_SRCS}) +add_library(ZynAddSubFxCore INTERFACE) +target_sources(ZynAddSubFxCore INTERFACE + $ + $ +) -IF(LMMS_BUILD_LINUX) - ADD_LIBRARY(ZynAddSubFxCore MODULE LocalZynAddSubFx.cpp ${zynaddsubfx_core_SRCS}) -ELSE() - ADD_LIBRARY(ZynAddSubFxCore SHARED LocalZynAddSubFx.cpp ${zynaddsubfx_core_SRCS}) -ENDIF() -TARGET_LINK_LIBRARIES(ZynAddSubFxCore zynaddsubfx_nio ${FFTW3F_LIBRARIES} ${QT_LIBRARIES} -lz -lpthread) - -TARGET_LINK_LIBRARIES(ZynAddSubFxCore Qt5::Widgets Qt5::Xml) - -IF(LMMS_BUILD_WIN32) - TARGET_LINK_LIBRARIES(ZynAddSubFxCore -lws2_32) - INSTALL(TARGETS ZynAddSubFxCore RUNTIME DESTINATION "${PLUGIN_DIR}") -ELSE(LMMS_BUILD_WIN32) - INSTALL(TARGETS ZynAddSubFxCore LIBRARY DESTINATION "${PLUGIN_DIR}") -ENDIF(LMMS_BUILD_WIN32) +target_link_libraries(ZynAddSubFxCore INTERFACE + ${FFTW3F_LIBRARIES} + ${QT_LIBRARIES} + Qt5::Widgets + Qt5::Xml + Threads::Threads + ZLIB::ZLIB +) LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/..") IF(LMMS_BUILD_LINUX) @@ -144,10 +132,11 @@ ELSE() SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${PLUGIN_DIR}") ENDIF() BUILD_PLUGIN(zynaddsubfx ZynAddSubFx.cpp ZynAddSubFx.h MOCFILES ZynAddSubFx.h EMBEDDED_RESOURCES artwork.png logo.png) -TARGET_LINK_LIBRARIES(zynaddsubfx -lZynAddSubFxCore) -ADD_DEPENDENCIES(zynaddsubfx ZynAddSubFxCore) +target_link_libraries(zynaddsubfx ZynAddSubFxCore) -IF(WIN32) +if(MSVC) + set(WINRC "${CMAKE_CURRENT_BINARY_DIR}/zynaddsubfx.rc") +elseif(WIN32) SET(WINRC "${CMAKE_CURRENT_BINARY_DIR}/zynaddsubfxrc.obj") ADD_CUSTOM_COMMAND(OUTPUT "${WINRC}" COMMAND "${CMAKE_RC_COMPILER}" @@ -155,14 +144,19 @@ IF(WIN32) "-o\"${CMAKE_CURRENT_BINARY_DIR}/zynaddsubfxrc.obj\"" "-i\"${CMAKE_CURRENT_BINARY_DIR}/zynaddsubfx.rc\"" DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/zynaddsubfx.rc") -ENDIF(WIN32) +endif() # Use libraries in non-standard directories (e.g., another version of Qt) SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) ADD_SUBDIRECTORY("${LMMS_SOURCE_DIR}/src/common" common) -ADD_EXECUTABLE(RemoteZynAddSubFx RemoteZynAddSubFx.cpp ${LMMS_COMMON_SRCS} "${WINRC}") +add_executable(RemoteZynAddSubFx + RemoteZynAddSubFx.cpp + ${LMMS_COMMON_SRCS} + "${WINRC}" + $ +) INSTALL(TARGETS RemoteZynAddSubFx RUNTIME DESTINATION "${PLUGIN_DIR}") # Needed to deploy dependencies of RemoteZynAddSubFx SET_PROPERTY(GLOBAL APPEND PROPERTY PLUGINS_BUILT "RemoteZynAddSubFx") @@ -182,8 +176,7 @@ IF(FLTK_CONFIG AND NOT (LMMS_BUILD_APPLE OR LMMS_BUILD_WIN32)) STRING(REPLACE " " ";" FLTK_FILTERED_LDFLAGS ${FLTK_FILTERED_LDFLAGS}) LIST(REMOVE_ITEM FLTK_FILTERED_LDFLAGS -lX11) ENDIF() -TARGET_LINK_LIBRARIES(RemoteZynAddSubFx zynaddsubfx_gui -lZynAddSubFxCore ${FLTK_FILTERED_LDFLAGS} -lpthread ) -ADD_DEPENDENCIES(RemoteZynAddSubFx ZynAddSubFxCore) +target_link_libraries(RemoteZynAddSubFx ZynAddSubFxCore ${FLTK_FILTERED_LDFLAGS}) if(LMMS_HAVE_LIBRT) target_link_libraries(RemoteZynAddSubFx rt) @@ -199,13 +192,6 @@ ENDIF(LMMS_BUILD_WIN32) IF(LMMS_BUILD_WIN32) - add_custom_command( - TARGET ZynAddSubFxCore - POST_BUILD - COMMAND "${STRIP_COMMAND}" "$" - VERBATIM - COMMAND_EXPAND_LISTS - ) add_custom_command( TARGET RemoteZynAddSubFx POST_BUILD diff --git a/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp b/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp index f09cb6662..83ef3e9a2 100644 --- a/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp +++ b/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp @@ -22,19 +22,25 @@ * */ -#include +#include "LocalZynAddSubFx.h" -#include "zynaddsubfx/src/Misc/Util.h" -#include #include -#include "LocalZynAddSubFx.h" +#include "lmmsconfig.h" + +#ifdef LMMS_BUILD_WIN32 +# include +# include "IoHelper.h" +#else +# include +#endif #include "MidiEvent.h" #include "zynaddsubfx/src/Nio/NulEngine.h" #include "zynaddsubfx/src/Misc/Master.h" #include "zynaddsubfx/src/Misc/Part.h" +#include "zynaddsubfx/src/Misc/Util.h" // Global variable in zynaddsubfx/src/globals.h SYNTH_T* synth = nullptr; @@ -53,14 +59,6 @@ LocalZynAddSubFx::LocalZynAddSubFx() : { if( s_instanceCount == 0 ) { -#ifdef LMMS_BUILD_WIN32 -#ifndef __WINPTHREADS_VERSION - // (non-portable) initialization of statically linked pthread library - pthread_win32_process_attach_np(); - pthread_win32_thread_attach_np(); -#endif -#endif // LMMS_BUILD_WIN32 - initConfig(); synth = new SYNTH_T; @@ -143,14 +141,20 @@ void LocalZynAddSubFx::loadXML( const std::string & _filename ) { char * f = strdup( _filename.c_str() ); - pthread_mutex_lock( &m_master->mutex ); - m_master->defaults(); - m_master->loadXML( f ); - pthread_mutex_unlock( &m_master->mutex ); + { + const auto lock = std::lock_guard{m_master->mutex}; + m_master->defaults(); + m_master->loadXML( f ); + } m_master->applyparameters(); +#ifdef LMMS_BUILD_WIN32 + _wunlink(toWString(_filename).c_str()); +#else unlink( f ); +#endif + free( f ); } @@ -161,10 +165,11 @@ void LocalZynAddSubFx::loadPreset( const std::string & _filename, int _part ) { char * f = strdup( _filename.c_str() ); - pthread_mutex_lock( &m_master->mutex ); - m_master->part[_part]->defaultsinstrument(); - m_master->part[_part]->loadXMLinstrument( f ); - pthread_mutex_unlock( &m_master->mutex ); + { + const auto lock = std::lock_guard{m_master->mutex}; + m_master->part[_part]->defaultsinstrument(); + m_master->part[_part]->loadXMLinstrument( f ); + } m_master->applyparameters(); @@ -262,8 +267,13 @@ void LocalZynAddSubFx::processMidiEvent( const MidiEvent& event ) void LocalZynAddSubFx::processAudio( sampleFrame * _out ) { +#ifdef _MSC_VER + const auto outputl = static_cast(_alloca(synth->buffersize * sizeof(float))); + const auto outputr = static_cast(_alloca(synth->buffersize * sizeof(float))); +#else float outputl[synth->buffersize]; float outputr[synth->buffersize]; +#endif m_master->GetAudioOutSamples( synth->buffersize, synth->samplerate, outputl, outputr ); diff --git a/plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp b/plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp index 4c69beed0..c4d6b71a1 100644 --- a/plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp +++ b/plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp @@ -22,17 +22,19 @@ * */ +#include "RemoteZynAddSubFx.h" + #include #ifdef LMMS_BUILD_WIN32 #include #endif #include +#include "ThreadShims.h" #undef CursorShape // is, by mistake, not undefed in FL #include "RemotePluginClient.h" -#include "RemoteZynAddSubFx.h" #include "LocalZynAddSubFx.h" #include "zynaddsubfx/src/Nio/Nio.h" @@ -60,12 +62,12 @@ public: sendMessage( IdInitDone ); waitForMessage( IdInitDone ); - pthread_mutex_init( &m_guiMutex, nullptr ); - pthread_create( &m_messageThreadHandle, nullptr, messageLoop, this ); + m_messageThread = std::thread{&RemoteZynAddSubFx::messageLoop, this}; } ~RemoteZynAddSubFx() override { + m_messageThread.join(); Nio::stop(); } @@ -84,9 +86,8 @@ public: message m; while( ( m = receiveMessage() ).id != IdQuit ) { - pthread_mutex_lock( &m_master->mutex ); + const auto lock = std::lock_guard{m_master->mutex}; processMessage( m ); - pthread_mutex_unlock( &m_master->mutex ); } m_guiExit = true; } @@ -102,9 +103,10 @@ public: case IdHideUI: case IdLoadSettingsFromFile: case IdLoadPresetFile: - pthread_mutex_lock( &m_guiMutex ); - m_guiMessages.push( _m ); - pthread_mutex_unlock( &m_guiMutex ); + { + const auto lock = std::lock_guard{m_guiMutex}; + m_guiMessages.push( _m ); + } break; case IdSaveSettingsToFile: @@ -144,22 +146,13 @@ public: LocalZynAddSubFx::processAudio( _out ); } - static void * messageLoop( void * _arg ) - { - auto _this = static_cast(_arg); - - _this->messageLoop(); - - return nullptr; - } - void guiLoop(); private: const int m_guiSleepTime; - pthread_t m_messageThreadHandle; - pthread_mutex_t m_guiMutex; + std::thread m_messageThread; + std::mutex m_guiMutex; std::queue m_guiMessages; bool m_guiExit; @@ -189,12 +182,11 @@ void RemoteZynAddSubFx::guiLoop() } if( exitProgram == 1 ) { - pthread_mutex_lock( &m_master->mutex ); + const auto lock = std::lock_guard{m_master->mutex}; sendMessage( IdHideUI ); exitProgram = 0; - pthread_mutex_unlock( &m_master->mutex ); } - pthread_mutex_lock( &m_guiMutex ); + const auto lock = std::lock_guard{m_guiMutex}; while( m_guiMessages.size() ) { RemotePluginClient::message m = m_guiMessages.front(); @@ -219,9 +211,8 @@ void RemoteZynAddSubFx::guiLoop() { ui->refresh_master_ui(); } - pthread_mutex_lock( &m_master->mutex ); + const auto lock = std::lock_guard{m_master->mutex}; sendMessage( IdLoadSettingsFromFile ); - pthread_mutex_unlock( &m_master->mutex ); break; } @@ -235,9 +226,8 @@ void RemoteZynAddSubFx::guiLoop() ui->updatepanel(); ui->refresh_master_ui(); } - pthread_mutex_lock( &m_master->mutex ); + const auto lock = std::lock_guard{m_master->mutex}; sendMessage( IdLoadPresetFile ); - pthread_mutex_unlock( &m_master->mutex ); break; } @@ -245,7 +235,6 @@ void RemoteZynAddSubFx::guiLoop() break; } } - pthread_mutex_unlock( &m_guiMutex ); } Fl::flush(); @@ -271,15 +260,6 @@ int main( int _argc, char * * _argv ) const auto pollParentThread = PollParentThread{}; #endif -#ifdef LMMS_BUILD_WIN32 -#ifndef __WINPTHREADS_VERSION - // (non-portable) initialization of statically linked pthread library - pthread_win32_process_attach_np(); - pthread_win32_thread_attach_np(); -#endif -#endif // LMMS_BUILD_WIN32 - - #ifdef SYNC_WITH_SHM_FIFO RemoteZynAddSubFx * remoteZASF = new RemoteZynAddSubFx( _argv[1], _argv[2] ); @@ -291,14 +271,6 @@ int main( int _argc, char * * _argv ) delete remoteZASF; - -#ifdef LMMS_BUILD_WIN32 -#ifndef __WINPTHREADS_VERSION - pthread_win32_thread_detach_np(); - pthread_win32_process_detach_np(); -#endif -#endif // LMMS_BUILD_WIN32 - return 0; } diff --git a/plugins/ZynAddSubFx/ThreadShims.h b/plugins/ZynAddSubFx/ThreadShims.h new file mode 100644 index 000000000..843b50fb5 --- /dev/null +++ b/plugins/ZynAddSubFx/ThreadShims.h @@ -0,0 +1,9 @@ +#include +#include +#include + +#if defined(__MINGW32__) && !defined(_GLIBCXX_HAS_GTHREADS) +# include +# include +# include +#endif diff --git a/plugins/ZynAddSubFx/zynaddsubfx b/plugins/ZynAddSubFx/zynaddsubfx index b9855dbe1..551e816a6 160000 --- a/plugins/ZynAddSubFx/zynaddsubfx +++ b/plugins/ZynAddSubFx/zynaddsubfx @@ -1 +1 @@ -Subproject commit b9855dbe16424edc528a6796ddbc50b1042482c7 +Subproject commit 551e816a6334fd190c74ce971378063b2757b47b diff --git a/tests/scripted/check-namespace b/tests/scripted/check-namespace index 5f71505b2..a816f0d7b 100755 --- a/tests/scripted/check-namespace +++ b/tests/scripted/check-namespace @@ -77,7 +77,9 @@ exclude_files = re.compile( 'plugins/MidiExport/MidiFile.hpp|' 'plugins/ReverbSC/[a-z]|' 'plugins/Sf2Player/fluidsynthshims.h|' - '/portsmf/' + '/portsmf/|' + # only forward to headers that are not ours: + 'plugins/ZynAddSubFx/ThreadShims.h' ) files = [Path(f) for f in result.stdout.splitlines() if not exclude_files.search(f)] @@ -131,7 +133,7 @@ for cur_file in files: if cur_file.is_file(): cur_text = cur_file.read_text(errors='replace') - if str(cur_file) not in known_no_namespace_lmms: + if cur_file.as_posix() not in known_no_namespace_lmms: namespace_pattern.search(cur_text) or error(cur_file, None, f'File has no namespace lmms') header_guard = str(cur_file).endswith('.h') From fe6df8dbafdbb09a5a02c4e163f4979508dbec91 Mon Sep 17 00:00:00 2001 From: Dalton Messmer Date: Mon, 2 Jan 2023 19:51:32 -0500 Subject: [PATCH 14/70] Add namespace prefix to include guards --- include/AboutDialog.h | 6 ++---- include/ActionGroup.h | 5 ++--- include/AudioAlsa.h | 4 ++-- include/AudioAlsaSetupWidget.h | 4 ++-- include/AudioDevice.h | 4 ++-- include/AudioDeviceSetupWidget.h | 4 ++-- include/AudioDummy.h | 4 ++-- include/AudioEngine.h | 4 ++-- include/AudioEngineProfiler.h | 4 ++-- include/AudioEngineWorkerThread.h | 4 ++-- include/AudioFileDevice.h | 4 ++-- include/AudioFileFlac.h | 8 ++++---- include/AudioFileMP3.h | 4 ++-- include/AudioFileOgg.h | 4 ++-- include/AudioFileWave.h | 4 ++-- include/AudioJack.h | 4 ++-- include/AudioOss.h | 4 ++-- include/AudioPort.h | 4 ++-- include/AudioPortAudio.h | 4 ++-- include/AudioPulseAudio.h | 4 ++-- include/AudioSampleRecorder.h | 4 ++-- include/AudioSdl.h | 4 ++-- include/AudioSndio.h | 8 ++++---- include/AudioSoundIo.h | 4 ++-- include/AutomatableButton.h | 5 ++--- include/AutomatableModel.h | 4 ++-- include/AutomatableModelView.h | 4 ++-- include/AutomatableSlider.h | 5 ++--- include/AutomationClip.h | 4 ++-- include/AutomationClipView.h | 4 ++-- include/AutomationEditor.h | 4 ++-- include/AutomationNode.h | 4 ++-- include/AutomationTrack.h | 4 ++-- include/AutomationTrackView.h | 4 ++-- include/BandLimitedWave.h | 4 ++-- include/BasicFilters.h | 5 ++--- include/BufferManager.h | 4 ++-- include/CPULoadWidget.h | 5 ++--- include/CaptionMenu.h | 5 ++--- include/Clip.h | 4 ++-- include/ClipView.h | 4 ++-- include/Clipboard.h | 4 ++-- include/ColorChooser.h | 7 +++---- include/ComboBox.h | 5 ++--- include/ComboBoxModel.h | 4 ++-- include/ConfigManager.h | 5 ++--- include/ControlLayout.h | 6 +++--- include/Controller.h | 6 ++---- include/ControllerConnection.h | 6 ++---- include/ControllerConnectionDialog.h | 5 ++--- include/ControllerDialog.h | 4 ++-- include/ControllerRackView.h | 4 ++-- include/ControllerView.h | 4 ++-- include/Controls.h | 8 +++----- include/CustomTextKnob.h | 4 ++-- include/DataFile.h | 5 ++--- include/Delay.h | 7 +++---- include/DeprecationHelper.h | 6 +++--- include/DetuningHelper.h | 4 ++-- include/DrumSynth.h | 7 +++---- include/DspEffectLibrary.h | 5 ++--- include/DummyEffect.h | 4 ++-- include/DummyInstrument.h | 4 ++-- include/DummyPlugin.h | 4 ++-- include/Editor.h | 4 ++-- include/Effect.h | 4 ++-- include/EffectChain.h | 5 ++--- include/EffectControlDialog.h | 4 ++-- include/EffectControls.h | 4 ++-- include/EffectRackView.h | 4 ++-- include/EffectSelectDialog.h | 4 ++-- include/EffectView.h | 4 ++-- include/Engine.h | 7 ++----- include/EnvelopeAndLfoParameters.h | 4 ++-- include/EnvelopeAndLfoView.h | 4 ++-- include/ExportFilter.h | 4 ++-- include/ExportProjectDialog.h | 5 ++--- include/FadeButton.h | 5 ++--- include/Fader.h | 5 ++--- include/FifoBuffer.h | 4 ++-- include/FileBrowser.h | 5 ++--- include/FileDialog.h | 7 +++---- include/Graph.h | 5 ++--- include/GroupBox.h | 5 ++--- include/GuiApplication.h | 6 +++--- include/ImportFilter.h | 4 ++-- include/InlineAutomation.h | 4 ++-- include/Instrument.h | 4 ++-- include/InstrumentFunctionViews.h | 4 ++-- include/InstrumentFunctions.h | 4 ++-- include/InstrumentMidiIOView.h | 4 ++-- include/InstrumentMiscView.h | 4 ++-- include/InstrumentPlayHandle.h | 4 ++-- include/InstrumentSoundShaping.h | 4 ++-- include/InstrumentSoundShapingView.h | 4 ++-- include/InstrumentTrack.h | 4 ++-- include/InstrumentTrackView.h | 4 ++-- include/InstrumentTrackWindow.h | 4 ++-- include/InstrumentView.h | 5 ++--- include/IoHelper.h | 4 ++-- include/JournallingObject.h | 5 ++--- include/Keymap.h | 4 ++-- include/Knob.h | 5 ++--- include/Ladspa2LMMS.h | 6 ++---- include/LadspaBase.h | 4 ++-- include/LadspaControl.h | 4 ++-- include/LadspaControlView.h | 4 ++-- include/LadspaManager.h | 5 ++--- include/LcdFloatSpinBox.h | 5 ++--- include/LcdSpinBox.h | 5 ++--- include/LcdWidget.h | 5 ++--- include/LedCheckBox.h | 5 ++--- include/LeftRightNav.h | 6 +++--- include/LfoController.h | 6 +++--- include/LinkedModelGroupViews.h | 8 +++----- include/LinkedModelGroups.h | 8 +++----- include/LmmsPalette.h | 6 ++---- include/LmmsStyle.h | 5 ++--- include/LocaleHelper.h | 6 +++--- include/LocklessAllocator.h | 4 ++-- include/LocklessList.h | 4 ++-- include/LocklessRingBuffer.h | 6 +++--- include/Lv2Basics.h | 9 ++++----- include/Lv2ControlBase.h | 7 ++++--- include/Lv2Evbuf.h | 8 ++++---- include/Lv2Features.h | 6 +++--- include/Lv2Manager.h | 6 +++--- include/Lv2Options.h | 6 +++--- include/Lv2Ports.h | 7 ++++--- include/Lv2Proc.h | 7 ++++--- include/Lv2SubPluginFeatures.h | 4 ++-- include/Lv2UridCache.h | 7 ++++--- include/Lv2UridMap.h | 7 ++++--- include/Lv2ViewBase.h | 8 ++++---- include/MainApplication.h | 6 +++--- include/MainWindow.h | 4 ++-- include/MemoryHelper.h | 6 ++---- include/MemoryManager.h | 4 ++-- include/MeterDialog.h | 4 ++-- include/MeterModel.h | 4 ++-- include/MicroTimer.h | 6 +++--- include/Microtuner.h | 4 ++-- include/MicrotunerConfig.h | 5 ++--- include/Midi.h | 4 ++-- include/MidiAlsaRaw.h | 4 ++-- include/MidiAlsaSeq.h | 5 ++--- include/MidiApple.h | 5 ++--- include/MidiCCRackView.h | 4 ++-- include/MidiClient.h | 5 ++--- include/MidiClip.h | 5 ++--- include/MidiClipView.h | 14 +++++++------- include/MidiController.h | 4 ++-- include/MidiDummy.h | 4 ++-- include/MidiEvent.h | 4 ++-- include/MidiEventProcessor.h | 4 ++-- include/MidiEventToByteSeq.h | 6 +++--- include/MidiJack.h | 6 +++--- include/MidiOss.h | 5 ++--- include/MidiPort.h | 4 ++-- include/MidiPortMenu.h | 4 ++-- include/MidiSetupWidget.h | 5 ++--- include/MidiSndio.h | 6 +++--- include/MidiWinMM.h | 5 ++--- include/MixHelpers.h | 5 ++--- include/Mixer.h | 24 ++++++++++++------------ include/MixerLine.h | 6 +++--- include/MixerLineLcdSpinBox.h | 4 ++-- include/MixerView.h | 6 +++--- include/Model.h | 5 ++--- include/ModelView.h | 5 ++--- include/ModelVisitor.h | 6 +++--- include/NStateButton.h | 5 ++--- include/Note.h | 4 ++-- include/NotePlayHandle.h | 4 ++-- include/Oscillator.h | 4 ++-- include/OscillatorConstants.h | 8 ++++---- include/Oscilloscope.h | 7 +++---- include/OutputSettings.h | 5 ++--- include/PathUtil.h | 4 ++-- include/PatternClip.h | 5 ++--- include/PatternClipView.h | 6 ++---- include/PatternEditor.h | 6 ++---- include/PatternStore.h | 5 ++--- include/PatternTrack.h | 6 ++---- include/PatternTrackView.h | 6 ++---- include/PeakController.h | 4 ++-- include/PerfLog.h | 4 ++-- include/Piano.h | 5 ++--- include/PianoRoll.h | 4 ++-- include/PianoView.h | 4 ++-- include/Pitch.h | 4 ++-- include/PixmapButton.h | 5 ++--- include/PlayHandle.h | 4 ++-- include/Plugin.h | 4 ++-- include/PluginBrowser.h | 6 ++---- include/PluginFactory.h | 6 +++--- include/PluginIssue.h | 7 +++---- include/PluginView.h | 4 ++-- include/PositionLine.h | 4 ++-- include/PresetPreviewPlayHandle.h | 4 ++-- include/ProjectJournal.h | 5 ++--- include/ProjectNotes.h | 5 ++--- include/ProjectRenderer.h | 4 ++-- include/ProjectVersion.h | 5 ++--- include/QuadratureLfo.h | 6 +++--- include/RaiiHelpers.h | 7 ++++--- include/RecentProjectsMenu.h | 6 +++--- include/RemotePlugin.h | 6 +++--- include/RemotePluginBase.h | 6 +++--- include/RemotePluginClient.h | 6 +++--- include/RenameDialog.h | 6 ++---- include/RenderManager.h | 4 ++-- include/RingBuffer.h | 5 ++--- include/RmsHelper.h | 4 ++-- include/RowTableView.h | 4 ++-- include/Rubberband.h | 6 ++---- include/SampleBuffer.h | 5 ++--- include/SampleClip.h | 6 +++--- include/SampleClipView.h | 6 ++---- include/SamplePlayHandle.h | 4 ++-- include/SampleRecordHandle.h | 5 ++--- include/SampleTrack.h | 7 +++---- include/SampleTrackView.h | 6 +++--- include/SampleTrackWindow.h | 9 +++------ include/Scale.h | 4 ++-- include/SendButtonIndicator.h | 7 ++++--- include/SerializingObject.h | 5 ++--- include/SetupDialog.h | 5 ++--- include/SharedMemory.h | 7 ++++--- include/SideBar.h | 4 ++-- include/SideBarWidget.h | 4 ++-- include/Song.h | 4 ++-- include/SongEditor.h | 6 ++---- include/StepRecorder.h | 6 +++--- include/StepRecorderWidget.h | 6 +++--- include/StringPairDrag.h | 4 ++-- include/SubWindow.h | 5 +++-- include/SweepOscillator.h | 4 ++-- include/TabBar.h | 5 ++--- include/TabButton.h | 5 ++--- include/TabWidget.h | 5 ++--- include/TemplatesMenu.h | 7 ++++--- include/TempoSyncKnob.h | 4 ++-- include/TempoSyncKnobModel.h | 4 ++-- include/TextFloat.h | 5 ++--- include/ThreadableJob.h | 4 ++-- include/TimeDisplayWidget.h | 6 +++--- include/TimeLineWidget.h | 5 ++--- include/TimePos.h | 6 ++---- include/ToolButton.h | 6 ++---- include/ToolPlugin.h | 4 ++-- include/ToolPluginView.h | 4 ++-- include/Track.h | 4 ++-- include/TrackContainer.h | 4 ++-- include/TrackContainerView.h | 5 ++--- include/TrackContentWidget.h | 4 ++-- include/TrackLabelButton.h | 5 ++--- include/TrackOperationsWidget.h | 4 ++-- include/TrackRenameLineEdit.h | 5 ++--- include/TrackView.h | 7 ++----- include/ValueBuffer.h | 4 ++-- include/VersionedSaveDialog.h | 7 +++---- include/VstSyncController.h | 4 ++-- include/VstSyncData.h | 4 ++-- include/aeffectx.h | 1 - include/base64.h | 4 ++-- include/debug.h | 5 ++--- include/denormals.h | 9 ++++----- include/embed.h | 4 ++-- include/endian_handling.h | 4 ++-- include/fft_helpers.h | 5 ++--- include/gui_templates.h | 5 ++--- include/interpolation.h | 5 ++--- include/lmms_basics.h | 5 ++--- include/lmms_math.h | 1 - include/panning.h | 4 ++-- include/panning_constants.h | 4 ++-- include/shared_object.h | 4 ++-- include/versioninfo.h | 4 ++-- include/volume.h | 4 ++-- 280 files changed, 645 insertions(+), 761 deletions(-) diff --git a/include/AboutDialog.h b/include/AboutDialog.h index c7d65023f..bb0c509a9 100644 --- a/include/AboutDialog.h +++ b/include/AboutDialog.h @@ -22,9 +22,8 @@ * */ - -#ifndef ABOUT_DIALOG_H -#define ABOUT_DIALOG_H +#ifndef LMMS_GUI_ABOUT_DIALOG_H +#define LMMS_GUI_ABOUT_DIALOG_H #include @@ -43,4 +42,3 @@ public: } // namespace lmms::gui #endif - diff --git a/include/ActionGroup.h b/include/ActionGroup.h index 0fe9d78ed..80a6d523e 100644 --- a/include/ActionGroup.h +++ b/include/ActionGroup.h @@ -22,9 +22,8 @@ * */ - -#ifndef ACTION_GROUP_H -#define ACTION_GROUP_H +#ifndef LMMS_GUI_ACTION_GROUP_H +#define LMMS_GUI_ACTION_GROUP_H #include diff --git a/include/AudioAlsa.h b/include/AudioAlsa.h index f96dd01c9..263925286 100644 --- a/include/AudioAlsa.h +++ b/include/AudioAlsa.h @@ -22,8 +22,8 @@ * */ -#ifndef AUDIO_ALSA_H -#define AUDIO_ALSA_H +#ifndef LMMS_AUDIO_ALSA_H +#define LMMS_AUDIO_ALSA_H #include "lmmsconfig.h" diff --git a/include/AudioAlsaSetupWidget.h b/include/AudioAlsaSetupWidget.h index f68d71e8a..068754b69 100644 --- a/include/AudioAlsaSetupWidget.h +++ b/include/AudioAlsaSetupWidget.h @@ -22,8 +22,8 @@ * */ -#ifndef AUDIO_ALSA_SETUP_WIDGET_H -#define AUDIO_ALSA_SETUP_WIDGET_H +#ifndef LMMS_GUI_AUDIO_ALSA_SETUP_WIDGET_H +#define LMMS_GUI_AUDIO_ALSA_SETUP_WIDGET_H #include "lmmsconfig.h" diff --git a/include/AudioDevice.h b/include/AudioDevice.h index 6b4e9939a..26cbbaccc 100644 --- a/include/AudioDevice.h +++ b/include/AudioDevice.h @@ -22,8 +22,8 @@ * */ -#ifndef AUDIO_DEVICE_H -#define AUDIO_DEVICE_H +#ifndef LMMS_AUDIO_DEVICE_H +#define LMMS_AUDIO_DEVICE_H #include #include diff --git a/include/AudioDeviceSetupWidget.h b/include/AudioDeviceSetupWidget.h index e984651e4..9c70859d2 100644 --- a/include/AudioDeviceSetupWidget.h +++ b/include/AudioDeviceSetupWidget.h @@ -22,8 +22,8 @@ * */ -#ifndef AUDIO_DEVICE_SETUP_WIDGET_H -#define AUDIO_DEVICE_SETUP_WIDGET_H +#ifndef LMMS_GUI_AUDIO_DEVICE_SETUP_WIDGET_H +#define LMMS_GUI_AUDIO_DEVICE_SETUP_WIDGET_H #include "TabWidget.h" diff --git a/include/AudioDummy.h b/include/AudioDummy.h index 30b125b3a..37363d501 100644 --- a/include/AudioDummy.h +++ b/include/AudioDummy.h @@ -22,8 +22,8 @@ * */ -#ifndef AUDIO_DUMMY_H -#define AUDIO_DUMMY_H +#ifndef LMMS_AUDIO_DUMMY_H +#define LMMS_AUDIO_DUMMY_H #include "AudioDevice.h" #include "AudioDeviceSetupWidget.h" diff --git a/include/AudioEngine.h b/include/AudioEngine.h index 71751acb8..534182d69 100644 --- a/include/AudioEngine.h +++ b/include/AudioEngine.h @@ -22,8 +22,8 @@ * */ -#ifndef AUDIO_ENGINE_H -#define AUDIO_ENGINE_H +#ifndef LMMS_AUDIO_ENGINE_H +#define LMMS_AUDIO_ENGINE_H #include diff --git a/include/AudioEngineProfiler.h b/include/AudioEngineProfiler.h index 38631c6a9..1f72939be 100644 --- a/include/AudioEngineProfiler.h +++ b/include/AudioEngineProfiler.h @@ -22,8 +22,8 @@ * */ -#ifndef AUDIO_ENGINE_PROFILER_H -#define AUDIO_ENGINE_PROFILER_H +#ifndef LMMS_AUDIO_ENGINE_PROFILER_H +#define LMMS_AUDIO_ENGINE_PROFILER_H #include diff --git a/include/AudioEngineWorkerThread.h b/include/AudioEngineWorkerThread.h index 87e2791b1..0f41982a1 100644 --- a/include/AudioEngineWorkerThread.h +++ b/include/AudioEngineWorkerThread.h @@ -22,8 +22,8 @@ * */ -#ifndef AUDIO_ENGINE_WORKER_THREAD_H -#define AUDIO_ENGINE_WORKER_THREAD_H +#ifndef LMMS_AUDIO_ENGINE_WORKER_THREAD_H +#define LMMS_AUDIO_ENGINE_WORKER_THREAD_H #include diff --git a/include/AudioFileDevice.h b/include/AudioFileDevice.h index beee087e7..fb98315db 100644 --- a/include/AudioFileDevice.h +++ b/include/AudioFileDevice.h @@ -23,8 +23,8 @@ * */ -#ifndef AUDIO_FILE_DEVICE_H -#define AUDIO_FILE_DEVICE_H +#ifndef LMMS_AUDIO_FILE_DEVICE_H +#define LMMS_AUDIO_FILE_DEVICE_H #include diff --git a/include/AudioFileFlac.h b/include/AudioFileFlac.h index 542a2e717..6750d264a 100644 --- a/include/AudioFileFlac.h +++ b/include/AudioFileFlac.h @@ -22,8 +22,8 @@ * */ -#ifndef AUDIO_FILE_FLAC_H -#define AUDIO_FILE_FLAC_H +#ifndef LMMS_AUDIO_FILE_FLAC_H +#define LMMS_AUDIO_FILE_FLAC_H #include "lmmsconfig.h" @@ -33,7 +33,7 @@ namespace lmms { -class AudioFileFlac: public AudioFileDevice +class AudioFileFlac : public AudioFileDevice { public: AudioFileFlac(OutputSettings const& outputSettings, @@ -77,4 +77,4 @@ private: } // namespace lmms -#endif //AUDIO_FILE_FLAC_H +#endif diff --git a/include/AudioFileMP3.h b/include/AudioFileMP3.h index 290c9ccbf..61406cced 100644 --- a/include/AudioFileMP3.h +++ b/include/AudioFileMP3.h @@ -23,8 +23,8 @@ * */ -#ifndef AUDIO_FILE_MP3_H -#define AUDIO_FILE_MP3_H +#ifndef LMMS_AUDIO_FILE_MP3_H +#define LMMS_AUDIO_FILE_MP3_H #include "lmmsconfig.h" diff --git a/include/AudioFileOgg.h b/include/AudioFileOgg.h index 18617fa5f..981b61733 100644 --- a/include/AudioFileOgg.h +++ b/include/AudioFileOgg.h @@ -23,8 +23,8 @@ * */ -#ifndef AUDIO_FILE_OGG_H -#define AUDIO_FILE_OGG_H +#ifndef LMMS_AUDIO_FILE_OGG_H +#define LMMS_AUDIO_FILE_OGG_H #include "lmmsconfig.h" diff --git a/include/AudioFileWave.h b/include/AudioFileWave.h index 8dd3566f4..06b797cc6 100644 --- a/include/AudioFileWave.h +++ b/include/AudioFileWave.h @@ -23,8 +23,8 @@ * */ -#ifndef AUDIO_FILE_WAVE_H -#define AUDIO_FILE_WAVE_H +#ifndef LMMS_AUDIO_FILE_WAVE_H +#define LMMS_AUDIO_FILE_WAVE_H #include "lmmsconfig.h" #include "AudioFileDevice.h" diff --git a/include/AudioJack.h b/include/AudioJack.h index 263399487..5e63074bd 100644 --- a/include/AudioJack.h +++ b/include/AudioJack.h @@ -22,8 +22,8 @@ * */ -#ifndef AUDIO_JACK_H -#define AUDIO_JACK_H +#ifndef LMMS_AUDIO_JACK_H +#define LMMS_AUDIO_JACK_H #include "lmmsconfig.h" diff --git a/include/AudioOss.h b/include/AudioOss.h index 71103586a..045cc6c56 100644 --- a/include/AudioOss.h +++ b/include/AudioOss.h @@ -22,8 +22,8 @@ * */ -#ifndef AUDIO_OSS_H -#define AUDIO_OSS_H +#ifndef LMMS_AUDIO_OSS_H +#define LMMS_AUDIO_OSS_H #include "lmmsconfig.h" diff --git a/include/AudioPort.h b/include/AudioPort.h index 5a2645784..38e495436 100644 --- a/include/AudioPort.h +++ b/include/AudioPort.h @@ -22,8 +22,8 @@ * */ -#ifndef AUDIO_PORT_H -#define AUDIO_PORT_H +#ifndef LMMS_AUDIO_PORT_H +#define LMMS_AUDIO_PORT_H #include #include diff --git a/include/AudioPortAudio.h b/include/AudioPortAudio.h index 3fd32a7ac..8ab18ce6e 100644 --- a/include/AudioPortAudio.h +++ b/include/AudioPortAudio.h @@ -22,8 +22,8 @@ * */ -#ifndef AUDIO_PORTAUDIO_H -#define AUDIO_PORTAUDIO_H +#ifndef LMMS_AUDIO_PORTAUDIO_H +#define LMMS_AUDIO_PORTAUDIO_H #include diff --git a/include/AudioPulseAudio.h b/include/AudioPulseAudio.h index 789296e27..bb5541a30 100644 --- a/include/AudioPulseAudio.h +++ b/include/AudioPulseAudio.h @@ -22,8 +22,8 @@ * */ -#ifndef AUDIO_PULSEAUDIO_H -#define AUDIO_PULSEAUDIO_H +#ifndef LMMS_AUDIO_PULSEAUDIO_H +#define LMMS_AUDIO_PULSEAUDIO_H #include "lmmsconfig.h" diff --git a/include/AudioSampleRecorder.h b/include/AudioSampleRecorder.h index 7ad551916..23c4643d8 100644 --- a/include/AudioSampleRecorder.h +++ b/include/AudioSampleRecorder.h @@ -23,8 +23,8 @@ * */ -#ifndef AUDIO_SAMPLE_RECORDER_H -#define AUDIO_SAMPLE_RECORDER_H +#ifndef LMMS_AUDIO_SAMPLE_RECORDER_H +#define LMMS_AUDIO_SAMPLE_RECORDER_H #include #include diff --git a/include/AudioSdl.h b/include/AudioSdl.h index 7e7710a2f..bd7f4b960 100644 --- a/include/AudioSdl.h +++ b/include/AudioSdl.h @@ -22,8 +22,8 @@ * */ -#ifndef AUDIO_SDL_H -#define AUDIO_SDL_H +#ifndef LMMS_AUDIO_SDL_H +#define LMMS_AUDIO_SDL_H #include "lmmsconfig.h" diff --git a/include/AudioSndio.h b/include/AudioSndio.h index 606850105..b7f42aca2 100644 --- a/include/AudioSndio.h +++ b/include/AudioSndio.h @@ -23,8 +23,8 @@ * */ -#ifndef _AUDIO_SNDIO_H -#define _AUDIO_SNDIO_H +#ifndef LMMS_AUDIO_SNDIO_H +#define LMMS_AUDIO_SNDIO_H #include "lmmsconfig.h" @@ -87,6 +87,6 @@ private: } // namespace lmms -#endif // LMMS_HAVE_SNDIO +#endif // LMMS_HAVE_SNDIO -#endif // _AUDIO_SNDIO_H +#endif diff --git a/include/AudioSoundIo.h b/include/AudioSoundIo.h index dc9afe7e4..b29ff3779 100644 --- a/include/AudioSoundIo.h +++ b/include/AudioSoundIo.h @@ -22,8 +22,8 @@ * */ -#ifndef AUDIO_SOUNDIO_H -#define AUDIO_SOUNDIO_H +#ifndef LMMS_AUDIO_SOUNDIO_H +#define LMMS_AUDIO_SOUNDIO_H #include diff --git a/include/AutomatableButton.h b/include/AutomatableButton.h index d8c58523c..4a695a677 100644 --- a/include/AutomatableButton.h +++ b/include/AutomatableButton.h @@ -22,9 +22,8 @@ * */ - -#ifndef AUTOMATABLE_BUTTON_H -#define AUTOMATABLE_BUTTON_H +#ifndef LMMS_GUI_AUTOMATABLE_BUTTON_H +#define LMMS_GUI_AUTOMATABLE_BUTTON_H #include diff --git a/include/AutomatableModel.h b/include/AutomatableModel.h index c8f2ab548..2fccf31f4 100644 --- a/include/AutomatableModel.h +++ b/include/AutomatableModel.h @@ -22,8 +22,8 @@ * */ -#ifndef AUTOMATABLE_MODEL_H -#define AUTOMATABLE_MODEL_H +#ifndef LMMS_AUTOMATABLE_MODEL_H +#define LMMS_AUTOMATABLE_MODEL_H #include #include diff --git a/include/AutomatableModelView.h b/include/AutomatableModelView.h index 1e8ef7398..e2475be48 100644 --- a/include/AutomatableModelView.h +++ b/include/AutomatableModelView.h @@ -23,8 +23,8 @@ * */ -#ifndef AUTOMATABLE_MODEL_VIEW_H -#define AUTOMATABLE_MODEL_VIEW_H +#ifndef LMMS_GUI_AUTOMATABLE_MODEL_VIEW_H +#define LMMS_GUI_AUTOMATABLE_MODEL_VIEW_H #include "ModelView.h" #include "AutomatableModel.h" diff --git a/include/AutomatableSlider.h b/include/AutomatableSlider.h index ba11741b5..9ec55c2df 100644 --- a/include/AutomatableSlider.h +++ b/include/AutomatableSlider.h @@ -22,9 +22,8 @@ * */ - -#ifndef AUTOMATABLE_SLIDER_H -#define AUTOMATABLE_SLIDER_H +#ifndef LMMS_GUI_AUTOMATABLE_SLIDER_H +#define LMMS_GUI_AUTOMATABLE_SLIDER_H #include diff --git a/include/AutomationClip.h b/include/AutomationClip.h index 3e253d85f..7281af133 100644 --- a/include/AutomationClip.h +++ b/include/AutomationClip.h @@ -24,8 +24,8 @@ * */ -#ifndef AUTOMATION_CLIP_H -#define AUTOMATION_CLIP_H +#ifndef LMMS_AUTOMATION_CLIP_H +#define LMMS_AUTOMATION_CLIP_H #include #include diff --git a/include/AutomationClipView.h b/include/AutomationClipView.h index b4de7839c..69d4943bc 100644 --- a/include/AutomationClipView.h +++ b/include/AutomationClipView.h @@ -22,8 +22,8 @@ * */ -#ifndef AUTOMATION_CLIP_VIEW_H -#define AUTOMATION_CLIP_VIEW_H +#ifndef LMMS_GUI_AUTOMATION_CLIP_VIEW_H +#define LMMS_GUI_AUTOMATION_CLIP_VIEW_H #include diff --git a/include/AutomationEditor.h b/include/AutomationEditor.h index 52609416f..8ead191a9 100644 --- a/include/AutomationEditor.h +++ b/include/AutomationEditor.h @@ -23,8 +23,8 @@ * */ -#ifndef AUTOMATION_EDITOR_H -#define AUTOMATION_EDITOR_H +#ifndef LMMS_GUI_AUTOMATION_EDITOR_H +#define LMMS_GUI_AUTOMATION_EDITOR_H #include diff --git a/include/AutomationNode.h b/include/AutomationNode.h index 11bd6d57d..9f4a4f219 100644 --- a/include/AutomationNode.h +++ b/include/AutomationNode.h @@ -23,8 +23,8 @@ * */ -#ifndef AUTOMATION_NODE_H -#define AUTOMATION_NODE_H +#ifndef LMMS_AUTOMATION_NODE_H +#define LMMS_AUTOMATION_NODE_H namespace lmms { diff --git a/include/AutomationTrack.h b/include/AutomationTrack.h index 1779bf102..653174caa 100644 --- a/include/AutomationTrack.h +++ b/include/AutomationTrack.h @@ -24,8 +24,8 @@ * */ -#ifndef AUTOMATION_TRACK_H -#define AUTOMATION_TRACK_H +#ifndef LMMS_AUTOMATION_TRACK_H +#define LMMS_AUTOMATION_TRACK_H #include "Track.h" diff --git a/include/AutomationTrackView.h b/include/AutomationTrackView.h index 18454bec2..d948d762a 100644 --- a/include/AutomationTrackView.h +++ b/include/AutomationTrackView.h @@ -23,8 +23,8 @@ * */ -#ifndef AUTOMATION_TRACK_VIEW_H -#define AUTOMATION_TRACK_VIEW_H +#ifndef LMMS_GUI_AUTOMATION_TRACK_VIEW_H +#define LMMS_GUI_AUTOMATION_TRACK_VIEW_H #include "TrackView.h" diff --git a/include/BandLimitedWave.h b/include/BandLimitedWave.h index 588fc4eea..51e55c337 100644 --- a/include/BandLimitedWave.h +++ b/include/BandLimitedWave.h @@ -23,8 +23,8 @@ * */ -#ifndef BANDLIMITEDWAVE_H -#define BANDLIMITEDWAVE_H +#ifndef LMMS_BANDLIMITEDWAVE_H +#define LMMS_BANDLIMITEDWAVE_H class QDataStream; class QString; diff --git a/include/BasicFilters.h b/include/BasicFilters.h index 836d758b6..6912f3d36 100644 --- a/include/BasicFilters.h +++ b/include/BasicFilters.h @@ -28,9 +28,8 @@ * */ - -#ifndef BASIC_FILTERS_H -#define BASIC_FILTERS_H +#ifndef LMMS_BASIC_FILTERS_H +#define LMMS_BASIC_FILTERS_H #ifndef __USE_XOPEN #define __USE_XOPEN diff --git a/include/BufferManager.h b/include/BufferManager.h index 57729918e..8e93afc92 100644 --- a/include/BufferManager.h +++ b/include/BufferManager.h @@ -23,8 +23,8 @@ * */ -#ifndef BUFFER_MANAGER_H -#define BUFFER_MANAGER_H +#ifndef LMMS_BUFFER_MANAGER_H +#define LMMS_BUFFER_MANAGER_H #include "lmms_export.h" #include "lmms_basics.h" diff --git a/include/CPULoadWidget.h b/include/CPULoadWidget.h index dd2747ef2..a249cdc5e 100644 --- a/include/CPULoadWidget.h +++ b/include/CPULoadWidget.h @@ -23,9 +23,8 @@ * */ - -#ifndef CPULOAD_WIDGET_H -#define CPULOAD_WIDGET_H +#ifndef LMMS_GUI_CPU_LOAD_WIDGET_H +#define LMMS_GUI_CPU_LOAD_WIDGET_H #include #include diff --git a/include/CaptionMenu.h b/include/CaptionMenu.h index f6a2fff25..87aedf133 100644 --- a/include/CaptionMenu.h +++ b/include/CaptionMenu.h @@ -22,9 +22,8 @@ * */ - -#ifndef CAPTION_MENU_H -#define CAPTION_MENU_H +#ifndef LMMS_GUI_CAPTION_MENU_H +#define LMMS_GUI_CAPTION_MENU_H #include diff --git a/include/Clip.h b/include/Clip.h index 204a071a7..75416ef94 100644 --- a/include/Clip.h +++ b/include/Clip.h @@ -22,8 +22,8 @@ * */ -#ifndef TRACK_CONTENT_OBJECT_H -#define TRACK_CONTENT_OBJECT_H +#ifndef LMMS_CLIP_H +#define LMMS_CLIP_H #include diff --git a/include/ClipView.h b/include/ClipView.h index 8cfb9e7a4..a342590e1 100644 --- a/include/ClipView.h +++ b/include/ClipView.h @@ -22,8 +22,8 @@ * */ -#ifndef TRACK_CONTENT_OBJECT_VIEW_H -#define TRACK_CONTENT_OBJECT_VIEW_H +#ifndef LMMS_GUI_CLIP_VIEW_H +#define LMMS_GUI_CLIP_VIEW_H #include diff --git a/include/Clipboard.h b/include/Clipboard.h index 1c2dcb647..3c38c90fe 100644 --- a/include/Clipboard.h +++ b/include/Clipboard.h @@ -22,8 +22,8 @@ * */ -#ifndef CLIPBOARD_H -#define CLIPBOARD_H +#ifndef LMMS_CLIPBOARD_H +#define LMMS_CLIPBOARD_H #include #include diff --git a/include/ColorChooser.h b/include/ColorChooser.h index 5482a9a03..da4069f5d 100644 --- a/include/ColorChooser.h +++ b/include/ColorChooser.h @@ -21,8 +21,8 @@ * */ -#ifndef COLOR_CHOOSER_H -#define COLOR_CHOOSER_H +#ifndef LMMS_GUI_COLOR_CHOOSER_H +#define LMMS_GUI_COLOR_CHOOSER_H #include #include @@ -34,7 +34,7 @@ namespace lmms::gui { -class ColorChooser: public QColorDialog +class ColorChooser : public QColorDialog { public: ColorChooser(const QColor &initial, QWidget *parent): QColorDialog(initial, parent) {}; @@ -69,4 +69,3 @@ private: } // namespace lmms::gui #endif - diff --git a/include/ComboBox.h b/include/ComboBox.h index 9a0e5a517..ba2410491 100644 --- a/include/ComboBox.h +++ b/include/ComboBox.h @@ -22,9 +22,8 @@ * */ - -#ifndef COMBOBOX_H -#define COMBOBOX_H +#ifndef LMMS_GUI_COMBOBOX_H +#define LMMS_GUI_COMBOBOX_H #include #include diff --git a/include/ComboBoxModel.h b/include/ComboBoxModel.h index 0c76620d8..a895b838f 100644 --- a/include/ComboBoxModel.h +++ b/include/ComboBoxModel.h @@ -22,8 +22,8 @@ * */ -#ifndef COMBOBOX_MODEL_H -#define COMBOBOX_MODEL_H +#ifndef LMMS_COMBOBOX_MODEL_H +#define LMMS_COMBOBOX_MODEL_H #include #include diff --git a/include/ConfigManager.h b/include/ConfigManager.h index fd2967b6a..abeb5246f 100644 --- a/include/ConfigManager.h +++ b/include/ConfigManager.h @@ -22,9 +22,8 @@ * */ - -#ifndef CONFIG_MGR_H -#define CONFIG_MGR_H +#ifndef LMMS_CONFIG_MANAGER_H +#define LMMS_CONFIG_MANAGER_H #include "lmmsconfig.h" diff --git a/include/ControlLayout.h b/include/ControlLayout.h index 8c629f8e1..e78609a37 100644 --- a/include/ControlLayout.h +++ b/include/ControlLayout.h @@ -70,8 +70,8 @@ ** ****************************************************************************/ -#ifndef CONTROLLAYOUT_H -#define CONTROLLAYOUT_H +#ifndef LMMS_GUI_CONTROL_LAYOUT_H +#define LMMS_GUI_CONTROL_LAYOUT_H #include #include @@ -141,4 +141,4 @@ private: } // namespace lmms::gui -#endif // CONTROLLAYOUT_H +#endif diff --git a/include/Controller.h b/include/Controller.h index d949cf90c..0bb229d38 100644 --- a/include/Controller.h +++ b/include/Controller.h @@ -23,9 +23,8 @@ * */ - -#ifndef CONTROLLER_H -#define CONTROLLER_H +#ifndef LMMS_CONTROLLER_H +#define LMMS_CONTROLLER_H #include "lmms_export.h" #include "Engine.h" @@ -185,4 +184,3 @@ signals: } // namespace lmms #endif - diff --git a/include/ControllerConnection.h b/include/ControllerConnection.h index 8230971cc..d75d529f6 100644 --- a/include/ControllerConnection.h +++ b/include/ControllerConnection.h @@ -26,9 +26,8 @@ * */ - -#ifndef CONTROLLER_CONNECTION_H -#define CONTROLLER_CONNECTION_H +#ifndef LMMS_CONTROLLER_CONNECTION_H +#define LMMS_CONTROLLER_CONNECTION_H #include #include @@ -129,4 +128,3 @@ signals: } // namespace lmms #endif - diff --git a/include/ControllerConnectionDialog.h b/include/ControllerConnectionDialog.h index 5565c8a67..2e3446072 100644 --- a/include/ControllerConnectionDialog.h +++ b/include/ControllerConnectionDialog.h @@ -23,9 +23,8 @@ * */ - -#ifndef CONTROLLER_CONNECTION_DIALOG_H -#define CONTROLLER_CONNECTION_DIALOG_H +#ifndef LMMS_GUI_CONTROLLER_CONNECTION_DIALOG_H +#define LMMS_GUI_CONTROLLER_CONNECTION_DIALOG_H #include #include diff --git a/include/ControllerDialog.h b/include/ControllerDialog.h index 4f496ad77..81a9a0eb6 100644 --- a/include/ControllerDialog.h +++ b/include/ControllerDialog.h @@ -23,8 +23,8 @@ * */ -#ifndef CONTROLLER_DIALOG_H -#define CONTROLLER_DIALOG_H +#ifndef LMMS_GUI_CONTROLLER_DIALOG_H +#define LMMS_GUI_CONTROLLER_DIALOG_H #include diff --git a/include/ControllerRackView.h b/include/ControllerRackView.h index 904e523dd..1133e8ec8 100644 --- a/include/ControllerRackView.h +++ b/include/ControllerRackView.h @@ -22,8 +22,8 @@ * */ -#ifndef CONTROLLER_RACK_VIEW_H -#define CONTROLLER_RACK_VIEW_H +#ifndef LMMS_GUI_CONTROLLER_RACK_VIEW_H +#define LMMS_GUI_CONTROLLER_RACK_VIEW_H #include #include diff --git a/include/ControllerView.h b/include/ControllerView.h index 8b8db0674..44f362b70 100644 --- a/include/ControllerView.h +++ b/include/ControllerView.h @@ -22,8 +22,8 @@ * */ -#ifndef CONTROLLER_VIEW_H -#define CONTROLLER_VIEW_H +#ifndef LMMS_GUI_CONTROLLER_VIEW_H +#define LMMS_GUI_CONTROLLER_VIEW_H #include diff --git a/include/Controls.h b/include/Controls.h index 9ffed465e..53c93a36f 100644 --- a/include/Controls.h +++ b/include/Controls.h @@ -22,10 +22,8 @@ * */ -#ifndef CONTROLS_H -#define CONTROLS_H - - +#ifndef LMMS_GUI_CONTROLS_H +#define LMMS_GUI_CONTROLS_H // headers only required for covariance #include "AutomatableModel.h" @@ -146,4 +144,4 @@ public: } // namespace lmms -#endif // CONTROLS_H +#endif diff --git a/include/CustomTextKnob.h b/include/CustomTextKnob.h index cde718810..23b7e8b1f 100644 --- a/include/CustomTextKnob.h +++ b/include/CustomTextKnob.h @@ -1,6 +1,6 @@ /* Text customizable knob */ -#ifndef CUSTOM_TEXT_KNOB_H -#define CUSTOM_TEXT_KNOB_H +#ifndef LMMS_GUI_CUSTOM_TEXT_KNOB_H +#define LMMS_GUI_CUSTOM_TEXT_KNOB_H #include "Knob.h" diff --git a/include/DataFile.h b/include/DataFile.h index fb8b2ae3e..18f9697b0 100644 --- a/include/DataFile.h +++ b/include/DataFile.h @@ -23,9 +23,8 @@ * */ - -#ifndef DATA_FILE_H -#define DATA_FILE_H +#ifndef LMMS_DATA_FILE_H +#define LMMS_DATA_FILE_H #include #include diff --git a/include/Delay.h b/include/Delay.h index 529577d58..ef23d7be1 100644 --- a/include/Delay.h +++ b/include/Delay.h @@ -22,10 +22,9 @@ * Boston, MA 02110-1301 USA. * */ - - -#ifndef DELAY_H -#define DELAY_H + +#ifndef LMMS_DELAY_H +#define LMMS_DELAY_H #include "lmms_basics.h" #include "lmms_math.h" diff --git a/include/DeprecationHelper.h b/include/DeprecationHelper.h index 7786665a3..f1c68902b 100644 --- a/include/DeprecationHelper.h +++ b/include/DeprecationHelper.h @@ -24,8 +24,8 @@ * */ -#ifndef DEPRECATIONHELPER_H -#define DEPRECATIONHELPER_H +#ifndef LMMS_DEPRECATIONHELPER_H +#define LMMS_DEPRECATIONHELPER_H #include #include @@ -66,4 +66,4 @@ inline QPoint position(QWheelEvent *wheelEvent) } // namespace lmms -#endif // DEPRECATIONHELPER_H +#endif diff --git a/include/DetuningHelper.h b/include/DetuningHelper.h index f90af3697..41723bee8 100644 --- a/include/DetuningHelper.h +++ b/include/DetuningHelper.h @@ -23,8 +23,8 @@ * */ -#ifndef DETUNING_HELPER_H -#define DETUNING_HELPER_H +#ifndef LMMS_DETUNING_HELPER_H +#define LMMS_DETUNING_HELPER_H #include "InlineAutomation.h" #include "MemoryManager.h" diff --git a/include/DrumSynth.h b/include/DrumSynth.h index 98574f2d2..9b759ac1a 100644 --- a/include/DrumSynth.h +++ b/include/DrumSynth.h @@ -23,9 +23,8 @@ * */ - -#ifndef DRUMSYNTH_H -#define DRUMSYNTH_H +#ifndef LMMS_DRUM_SYNTH_H +#define LMMS_DRUM_SYNTH_H #include #include "lmms_basics.h" @@ -57,4 +56,4 @@ class DrumSynth { } // namespace lmms -#endif // DRUMSYNTH_H +#endif diff --git a/include/DspEffectLibrary.h b/include/DspEffectLibrary.h index eb03e1cf0..0a19783f6 100644 --- a/include/DspEffectLibrary.h +++ b/include/DspEffectLibrary.h @@ -22,9 +22,8 @@ * */ - -#ifndef DSP_EFFECT_LIBRARY_H -#define DSP_EFFECT_LIBRARY_H +#ifndef LMMS_DSPEFFECTLIBRARY_H +#define LMMS_DSPEFFECTLIBRARY_H #include "lmms_math.h" #include "lmms_constants.h" diff --git a/include/DummyEffect.h b/include/DummyEffect.h index 9db45a3e1..945738e1b 100644 --- a/include/DummyEffect.h +++ b/include/DummyEffect.h @@ -22,8 +22,8 @@ * */ -#ifndef DUMMY_EFFECT_H -#define DUMMY_EFFECT_H +#ifndef LMMS_DUMMY_EFFECT_H +#define LMMS_DUMMY_EFFECT_H #include diff --git a/include/DummyInstrument.h b/include/DummyInstrument.h index a40d8338f..19b6b6fbd 100644 --- a/include/DummyInstrument.h +++ b/include/DummyInstrument.h @@ -23,8 +23,8 @@ * */ -#ifndef DUMMY_INSTRUMENT_H -#define DUMMY_INSTRUMENT_H +#ifndef LMMS_DUMMY_INSTRUMENT_H +#define LMMS_DUMMY_INSTRUMENT_H #include "Instrument.h" #include "InstrumentView.h" diff --git a/include/DummyPlugin.h b/include/DummyPlugin.h index 1c763ec3e..ad517c1a9 100644 --- a/include/DummyPlugin.h +++ b/include/DummyPlugin.h @@ -23,8 +23,8 @@ * */ -#ifndef DUMMY_PLUGIN_H -#define DUMMY_PLUGIN_H +#ifndef LMMS_DUMMY_PLUGIN_H +#define LMMS_DUMMY_PLUGIN_H #include "Plugin.h" #include "PluginView.h" diff --git a/include/Editor.h b/include/Editor.h index 1a39ea72f..ad330ac06 100644 --- a/include/Editor.h +++ b/include/Editor.h @@ -22,8 +22,8 @@ * */ -#ifndef EDITOR_COMMON_H -#define EDITOR_COMMON_H +#ifndef LMMS_EDITOR_H +#define LMMS_EDITOR_H #include #include diff --git a/include/Effect.h b/include/Effect.h index add1f7158..a9952d339 100644 --- a/include/Effect.h +++ b/include/Effect.h @@ -23,8 +23,8 @@ * */ -#ifndef EFFECT_H -#define EFFECT_H +#ifndef LMMS_EFFECT_H +#define LMMS_EFFECT_H #include "Plugin.h" #include "Engine.h" diff --git a/include/EffectChain.h b/include/EffectChain.h index a9da8e530..dad4de5e1 100644 --- a/include/EffectChain.h +++ b/include/EffectChain.h @@ -23,8 +23,8 @@ * */ -#ifndef EFFECT_CHAIN_H -#define EFFECT_CHAIN_H +#ifndef LMMS_EFFECT_CHAIN_H +#define LMMS_EFFECT_CHAIN_H #include "Model.h" #include "SerializingObject.h" @@ -86,4 +86,3 @@ signals: } // namespace lmms #endif - diff --git a/include/EffectControlDialog.h b/include/EffectControlDialog.h index 6389db4a3..bda845dc5 100644 --- a/include/EffectControlDialog.h +++ b/include/EffectControlDialog.h @@ -23,8 +23,8 @@ * */ -#ifndef EFFECT_CONTROL_DIALOG_H -#define EFFECT_CONTROL_DIALOG_H +#ifndef LMMS_GUI_EFFECT_CONTROL_DIALOG_H +#define LMMS_GUI_EFFECT_CONTROL_DIALOG_H #include diff --git a/include/EffectControls.h b/include/EffectControls.h index 994145a40..dfecc0792 100644 --- a/include/EffectControls.h +++ b/include/EffectControls.h @@ -22,8 +22,8 @@ * */ -#ifndef EFFECT_CONTROLS_H -#define EFFECT_CONTROLS_H +#ifndef LMMS_EFFECT_CONTROLS_H +#define LMMS_EFFECT_CONTROLS_H #include "Model.h" #include "JournallingObject.h" diff --git a/include/EffectRackView.h b/include/EffectRackView.h index fb68fda68..96f70548a 100644 --- a/include/EffectRackView.h +++ b/include/EffectRackView.h @@ -23,8 +23,8 @@ * */ -#ifndef EFFECT_RACK_VIEW_H -#define EFFECT_RACK_VIEW_H +#ifndef LMMS_GUI_EFFECT_RACK_VIEW_H +#define LMMS_GUI_EFFECT_RACK_VIEW_H #include diff --git a/include/EffectSelectDialog.h b/include/EffectSelectDialog.h index b0acfb734..c31f96e14 100644 --- a/include/EffectSelectDialog.h +++ b/include/EffectSelectDialog.h @@ -22,8 +22,8 @@ * */ -#ifndef EFFECT_SELECT_DIALOG_H -#define EFFECT_SELECT_DIALOG_H +#ifndef LMMS_GUI_EFFECT_SELECT_DIALOG_H +#define LMMS_GUI_EFFECT_SELECT_DIALOG_H #include #include diff --git a/include/EffectView.h b/include/EffectView.h index 90bb54896..fb19d52dd 100644 --- a/include/EffectView.h +++ b/include/EffectView.h @@ -23,8 +23,8 @@ * */ -#ifndef EFFECT_VIEW_H -#define EFFECT_VIEW_H +#ifndef LMMS_GUI_EFFECT_VIEW_H +#define LMMS_GUI_EFFECT_VIEW_H #include "AutomatableModel.h" #include "PluginView.h" diff --git a/include/Engine.h b/include/Engine.h index b63308cde..0cb77315f 100644 --- a/include/Engine.h +++ b/include/Engine.h @@ -22,14 +22,12 @@ * */ - -#ifndef ENGINE_H -#define ENGINE_H +#ifndef LMMS_ENGINE_H +#define LMMS_ENGINE_H #include #include - #include "lmmsconfig.h" #include "lmms_export.h" #include "lmms_basics.h" @@ -158,4 +156,3 @@ private: } // namespace lmms #endif - diff --git a/include/EnvelopeAndLfoParameters.h b/include/EnvelopeAndLfoParameters.h index 534adcbe5..0a90ec68b 100644 --- a/include/EnvelopeAndLfoParameters.h +++ b/include/EnvelopeAndLfoParameters.h @@ -22,8 +22,8 @@ * */ -#ifndef ENVELOPE_AND_LFO_PARAMETERS_H -#define ENVELOPE_AND_LFO_PARAMETERS_H +#ifndef LMMS_ENVELOPE_AND_LFO_PARAMETERS_H +#define LMMS_ENVELOPE_AND_LFO_PARAMETERS_H #include diff --git a/include/EnvelopeAndLfoView.h b/include/EnvelopeAndLfoView.h index a82ccf606..e927e9fcc 100644 --- a/include/EnvelopeAndLfoView.h +++ b/include/EnvelopeAndLfoView.h @@ -23,8 +23,8 @@ * */ -#ifndef ENVELOPE_AND_LFO_VIEW_H -#define ENVELOPE_AND_LFO_VIEW_H +#ifndef LMMS_GUI_ENVELOPE_AND_LFO_VIEW_H +#define LMMS_GUI_ENVELOPE_AND_LFO_VIEW_H #include diff --git a/include/ExportFilter.h b/include/ExportFilter.h index 29efef539..13a3c179d 100644 --- a/include/ExportFilter.h +++ b/include/ExportFilter.h @@ -23,8 +23,8 @@ * */ -#ifndef EXPORT_FILTER_H -#define EXPORT_FILTER_H +#ifndef LMMS_EXPORT_FILTER_H +#define LMMS_EXPORT_FILTER_H #include diff --git a/include/ExportProjectDialog.h b/include/ExportProjectDialog.h index 56d039afe..af33d6766 100644 --- a/include/ExportProjectDialog.h +++ b/include/ExportProjectDialog.h @@ -23,9 +23,8 @@ * */ - -#ifndef EXPORT_PROJECT_DIALOG_H -#define EXPORT_PROJECT_DIALOG_H +#ifndef LMMS_GUI_EXPORT_PROJECT_DIALOG_H +#define LMMS_GUI_EXPORT_PROJECT_DIALOG_H #include #include diff --git a/include/FadeButton.h b/include/FadeButton.h index d33900913..df0e2abf2 100644 --- a/include/FadeButton.h +++ b/include/FadeButton.h @@ -22,9 +22,8 @@ * */ - -#ifndef FADE_BUTTON_H -#define FADE_BUTTON_H +#ifndef LMMS_GUI_FADE_BUTTON_H +#define LMMS_GUI_FADE_BUTTON_H #include #include diff --git a/include/Fader.h b/include/Fader.h index 54acfc57d..cfffba843 100644 --- a/include/Fader.h +++ b/include/Fader.h @@ -44,9 +44,8 @@ * */ - -#ifndef FADER_H -#define FADER_H +#ifndef LMMS_GUI_FADER_H +#define LMMS_GUI_FADER_H #include #include diff --git a/include/FifoBuffer.h b/include/FifoBuffer.h index d49e367c0..4b5682a51 100644 --- a/include/FifoBuffer.h +++ b/include/FifoBuffer.h @@ -22,8 +22,8 @@ * */ -#ifndef FIFO_BUFFER_H -#define FIFO_BUFFER_H +#ifndef LMMS_FIFO_BUFFER_H +#define LMMS_FIFO_BUFFER_H #include diff --git a/include/FileBrowser.h b/include/FileBrowser.h index 43a0b3331..387be38d1 100644 --- a/include/FileBrowser.h +++ b/include/FileBrowser.h @@ -22,9 +22,8 @@ * */ - -#ifndef FILE_BROWSER_H -#define FILE_BROWSER_H +#ifndef LMMS_GUI_FILE_BROWSER_H +#define LMMS_GUI_FILE_BROWSER_H #include #include diff --git a/include/FileDialog.h b/include/FileDialog.h index ed5d2f231..a999fff16 100644 --- a/include/FileDialog.h +++ b/include/FileDialog.h @@ -22,9 +22,8 @@ * */ - -#ifndef FILEDIALOG_H -#define FILEDIALOG_H +#ifndef LMMS_GUI_FILE_DIALOG_H +#define LMMS_GUI_FILE_DIALOG_H #include @@ -57,4 +56,4 @@ public: } // namespace lmms::gui -#endif // FILEDIALOG_H +#endif diff --git a/include/Graph.h b/include/Graph.h index 178d1b567..d04fd926c 100644 --- a/include/Graph.h +++ b/include/Graph.h @@ -23,9 +23,8 @@ * */ - -#ifndef GRAPH_H -#define GRAPH_H +#ifndef LMMS_GUI_GRAPH_H +#define LMMS_GUI_GRAPH_H #include #include diff --git a/include/GroupBox.h b/include/GroupBox.h index e20db80a6..bf2773e23 100644 --- a/include/GroupBox.h +++ b/include/GroupBox.h @@ -22,9 +22,8 @@ * */ - -#ifndef GROUP_BOX_H -#define GROUP_BOX_H +#ifndef LMMS_GUI_GROUP_BOX_H +#define LMMS_GUI_GROUP_BOX_H #include diff --git a/include/GuiApplication.h b/include/GuiApplication.h index e39983138..dd87a5607 100644 --- a/include/GuiApplication.h +++ b/include/GuiApplication.h @@ -22,8 +22,8 @@ * */ -#ifndef GUIAPPLICATION_H -#define GUIAPPLICATION_H +#ifndef LMMS_GUI_GUI_APPLICATION_H +#define LMMS_GUI_GUI_APPLICATION_H #include @@ -93,4 +93,4 @@ LMMS_EXPORT GuiApplication* getGUI(); } // namespace lmms::gui -#endif // GUIAPPLICATION_H +#endif diff --git a/include/ImportFilter.h b/include/ImportFilter.h index b7a910e5d..587a62a78 100644 --- a/include/ImportFilter.h +++ b/include/ImportFilter.h @@ -23,8 +23,8 @@ * */ -#ifndef IMPORT_FILTER_H -#define IMPORT_FILTER_H +#ifndef LMMS_IMPORT_FILTER_H +#define LMMS_IMPORT_FILTER_H #include diff --git a/include/InlineAutomation.h b/include/InlineAutomation.h index 435604506..fbecd2769 100644 --- a/include/InlineAutomation.h +++ b/include/InlineAutomation.h @@ -22,8 +22,8 @@ * */ -#ifndef INLINE_AUTOMATION_H -#define INLINE_AUTOMATION_H +#ifndef LMMS_INLINE_AUTOMATION_H +#define LMMS_INLINE_AUTOMATION_H #include "AutomationNode.h" #include "AutomationClip.h" diff --git a/include/Instrument.h b/include/Instrument.h index 4e48e2fd6..3ea8bdf2f 100644 --- a/include/Instrument.h +++ b/include/Instrument.h @@ -23,8 +23,8 @@ * */ -#ifndef INSTRUMENT_H -#define INSTRUMENT_H +#ifndef LMMS_INSTRUMENT_H +#define LMMS_INSTRUMENT_H #include #include "lmms_export.h" diff --git a/include/InstrumentFunctionViews.h b/include/InstrumentFunctionViews.h index 99ba92031..3abd8eae7 100644 --- a/include/InstrumentFunctionViews.h +++ b/include/InstrumentFunctionViews.h @@ -22,8 +22,8 @@ * */ -#ifndef INSTRUMENT_FUNCTION_VIEWS_H -#define INSTRUMENT_FUNCTION_VIEWS_H +#ifndef LMMS_INSTRUMENT_FUNCTION_VIEWS_H +#define LMMS_INSTRUMENT_FUNCTION_VIEWS_H #include "ModelView.h" diff --git a/include/InstrumentFunctions.h b/include/InstrumentFunctions.h index 5dcb1114b..5b6c1af6d 100644 --- a/include/InstrumentFunctions.h +++ b/include/InstrumentFunctions.h @@ -22,8 +22,8 @@ * */ -#ifndef INSTRUMENT_FUNCTIONS_H -#define INSTRUMENT_FUNCTIONS_H +#ifndef LMMS_INSTRUMENT_FUNCTIONS_H +#define LMMS_INSTRUMENT_FUNCTIONS_H #include "JournallingObject.h" #include "lmms_basics.h" diff --git a/include/InstrumentMidiIOView.h b/include/InstrumentMidiIOView.h index 81feee082..dd6e43151 100644 --- a/include/InstrumentMidiIOView.h +++ b/include/InstrumentMidiIOView.h @@ -23,8 +23,8 @@ * */ -#ifndef INSTRUMENT_MIDI_IO_VIEW_H -#define INSTRUMENT_MIDI_IO_VIEW_H +#ifndef LMMS_GUI_INSTRUMENT_MIDI_IO_VIEW_H +#define LMMS_GUI_INSTRUMENT_MIDI_IO_VIEW_H #include diff --git a/include/InstrumentMiscView.h b/include/InstrumentMiscView.h index 25e16395d..9aee23676 100644 --- a/include/InstrumentMiscView.h +++ b/include/InstrumentMiscView.h @@ -24,8 +24,8 @@ * */ -#ifndef INSTRUMENT_MISC_VIEW_H -#define INSTRUMENT_MISC_VIEW_H +#ifndef LMMS_GUI_INSTRUMENT_MISC_VIEW_H +#define LMMS_GUI_INSTRUMENT_MISC_VIEW_H #include diff --git a/include/InstrumentPlayHandle.h b/include/InstrumentPlayHandle.h index e9516ab19..b65f906ae 100644 --- a/include/InstrumentPlayHandle.h +++ b/include/InstrumentPlayHandle.h @@ -22,8 +22,8 @@ * */ -#ifndef INSTRUMENT_PLAY_HANDLE_H -#define INSTRUMENT_PLAY_HANDLE_H +#ifndef LMMS_INSTRUMENT_PLAY_HANDLE_H +#define LMMS_INSTRUMENT_PLAY_HANDLE_H #include "PlayHandle.h" #include "Instrument.h" diff --git a/include/InstrumentSoundShaping.h b/include/InstrumentSoundShaping.h index 11ed4f1c4..607871c85 100644 --- a/include/InstrumentSoundShaping.h +++ b/include/InstrumentSoundShaping.h @@ -22,8 +22,8 @@ * */ -#ifndef INSTRUMENT_SOUND_SHAPING_H -#define INSTRUMENT_SOUND_SHAPING_H +#ifndef LMMS_INSTRUMENT_SOUND_SHAPING_H +#define LMMS_INSTRUMENT_SOUND_SHAPING_H #include "ComboBoxModel.h" diff --git a/include/InstrumentSoundShapingView.h b/include/InstrumentSoundShapingView.h index aa8aff19d..f37cfaa55 100644 --- a/include/InstrumentSoundShapingView.h +++ b/include/InstrumentSoundShapingView.h @@ -22,8 +22,8 @@ * */ -#ifndef INSTRUMENT_SOUND_SHAPING_VIEW_H -#define INSTRUMENT_SOUND_SHAPING_VIEW_H +#ifndef LMMS_GUI_INSTRUMENT_SOUND_SHAPING_VIEW_H +#define LMMS_GUI_INSTRUMENT_SOUND_SHAPING_VIEW_H #include diff --git a/include/InstrumentTrack.h b/include/InstrumentTrack.h index 129969292..6fa41b4a1 100644 --- a/include/InstrumentTrack.h +++ b/include/InstrumentTrack.h @@ -23,8 +23,8 @@ * */ -#ifndef INSTRUMENT_TRACK_H -#define INSTRUMENT_TRACK_H +#ifndef LMMS_INSTRUMENT_TRACK_H +#define LMMS_INSTRUMENT_TRACK_H #include "AudioPort.h" #include "InstrumentFunctions.h" diff --git a/include/InstrumentTrackView.h b/include/InstrumentTrackView.h index 3201f81d6..66fb7804b 100644 --- a/include/InstrumentTrackView.h +++ b/include/InstrumentTrackView.h @@ -22,8 +22,8 @@ * */ -#ifndef INSTRUMENT_TRACK_VIEW_H -#define INSTRUMENT_TRACK_VIEW_H +#ifndef LMMS_GUI_INSTRUMENT_TRACK_VIEW_H +#define LMMS_GUI_INSTRUMENT_TRACK_VIEW_H #include "TrackView.h" diff --git a/include/InstrumentTrackWindow.h b/include/InstrumentTrackWindow.h index 68750c0b8..f50b138df 100644 --- a/include/InstrumentTrackWindow.h +++ b/include/InstrumentTrackWindow.h @@ -22,8 +22,8 @@ * */ -#ifndef INSTRUMENT_TRACK_WINDOW_H -#define INSTRUMENT_TRACK_WINDOW_H +#ifndef LMMS_GUI_INSTRUMENT_TRACK_WINDOW_H +#define LMMS_GUI_INSTRUMENT_TRACK_WINDOW_H #include diff --git a/include/InstrumentView.h b/include/InstrumentView.h index ab18465eb..ff4b9cd66 100644 --- a/include/InstrumentView.h +++ b/include/InstrumentView.h @@ -22,9 +22,8 @@ * */ - -#ifndef INSTRUMENT_VIEW_H -#define INSTRUMENT_VIEW_H +#ifndef LMMS_GUI_INSTRUMENT_VIEW_H +#define LMMS_GUI_INSTRUMENT_VIEW_H #include "Instrument.h" #include "PluginView.h" diff --git a/include/IoHelper.h b/include/IoHelper.h index c7d65c917..423cbaab3 100644 --- a/include/IoHelper.h +++ b/include/IoHelper.h @@ -22,8 +22,8 @@ * */ -#ifndef IO_HELPER_H -#define IO_HELPER_H +#ifndef LMMS_IO_HELPER_H +#define LMMS_IO_HELPER_H #include "lmmsconfig.h" diff --git a/include/JournallingObject.h b/include/JournallingObject.h index 41ae65295..15e071577 100644 --- a/include/JournallingObject.h +++ b/include/JournallingObject.h @@ -22,8 +22,8 @@ * */ -#ifndef JOURNALLING_OBJECT_H -#define JOURNALLING_OBJECT_H +#ifndef LMMS_JOURNALLING_OBJECT_H +#define LMMS_JOURNALLING_OBJECT_H #include @@ -104,4 +104,3 @@ private: } // namespace lmms #endif - diff --git a/include/Keymap.h b/include/Keymap.h index 6286f8362..88f0df428 100644 --- a/include/Keymap.h +++ b/include/Keymap.h @@ -22,8 +22,8 @@ * */ -#ifndef KEYMAP_H -#define KEYMAP_H +#ifndef LMMS_KEYMAP_H +#define LMMS_KEYMAP_H #include #include diff --git a/include/Knob.h b/include/Knob.h index 16ac7ed01..94fb8b640 100644 --- a/include/Knob.h +++ b/include/Knob.h @@ -22,9 +22,8 @@ * */ - -#ifndef KNOB_H -#define KNOB_H +#ifndef LMMS_GUI_KNOB_H +#define LMMS_GUI_KNOB_H #include #include diff --git a/include/Ladspa2LMMS.h b/include/Ladspa2LMMS.h index 4b7eb2482..d4fd12b2d 100644 --- a/include/Ladspa2LMMS.h +++ b/include/Ladspa2LMMS.h @@ -23,13 +23,11 @@ * */ -#ifndef LADSPA_2_LMMS_H -#define LADSPA_2_LMMS_H - +#ifndef LMMS_LADSPA_2_LMMS_H +#define LMMS_LADSPA_2_LMMS_H #include "LadspaManager.h" - namespace lmms { diff --git a/include/LadspaBase.h b/include/LadspaBase.h index 3feb7d204..442d12293 100644 --- a/include/LadspaBase.h +++ b/include/LadspaBase.h @@ -23,8 +23,8 @@ * */ -#ifndef LADSPA_BASE_H -#define LADSPA_BASE_H +#ifndef LMMS_LADSPA_BASE_H +#define LMMS_LADSPA_BASE_H #include "LadspaManager.h" #include "Plugin.h" diff --git a/include/LadspaControl.h b/include/LadspaControl.h index 258a5d8fc..9bc83e352 100644 --- a/include/LadspaControl.h +++ b/include/LadspaControl.h @@ -23,8 +23,8 @@ * */ -#ifndef LADSPA_CONTROL_H -#define LADSPA_CONTROL_H +#ifndef LMMS_LADSPA_CONTROL_H +#define LMMS_LADSPA_CONTROL_H #include diff --git a/include/LadspaControlView.h b/include/LadspaControlView.h index 5dafa4e5c..4638d5b5c 100644 --- a/include/LadspaControlView.h +++ b/include/LadspaControlView.h @@ -23,8 +23,8 @@ * */ -#ifndef LADSPA_CONTROL_VIEW_H -#define LADSPA_CONTROL_VIEW_H +#ifndef LMMS_GUI_LADSPA_CONTROL_VIEW_H +#define LMMS_GUI_LADSPA_CONTROL_VIEW_H #include diff --git a/include/LadspaManager.h b/include/LadspaManager.h index 176526193..7b8639779 100644 --- a/include/LadspaManager.h +++ b/include/LadspaManager.h @@ -24,9 +24,8 @@ * */ - -#ifndef LADSPA_MANAGER_H -#define LADSPA_MANAGER_H +#ifndef LMMS_LADSPA_MANAGER_H +#define LMMS_LADSPA_MANAGER_H #include diff --git a/include/LcdFloatSpinBox.h b/include/LcdFloatSpinBox.h index ab0de304e..3dcf500b9 100644 --- a/include/LcdFloatSpinBox.h +++ b/include/LcdFloatSpinBox.h @@ -23,9 +23,8 @@ * */ - -#ifndef LCD_FLOATSPINBOX_H -#define LCD_FLOATSPINBOX_H +#ifndef LMMS_GUI_LCD_FLOATSPINBOX_H +#define LMMS_GUI_LCD_FLOATSPINBOX_H #include diff --git a/include/LcdSpinBox.h b/include/LcdSpinBox.h index 9c8923763..6dcb68c1b 100644 --- a/include/LcdSpinBox.h +++ b/include/LcdSpinBox.h @@ -22,9 +22,8 @@ * */ - -#ifndef LCD_SPINBOX_H -#define LCD_SPINBOX_H +#ifndef LMMS_GUI_LCD_SPINBOX_H +#define LMMS_GUI_LCD_SPINBOX_H #include "LcdWidget.h" #include "AutomatableModelView.h" diff --git a/include/LcdWidget.h b/include/LcdWidget.h index d55cfc017..665668b3f 100644 --- a/include/LcdWidget.h +++ b/include/LcdWidget.h @@ -22,9 +22,8 @@ * */ - -#ifndef LCD_WIDGET_H -#define LCD_WIDGET_H +#ifndef LMMS_GUI_LCD_WIDGET_H +#define LMMS_GUI_LCD_WIDGET_H #include #include diff --git a/include/LedCheckBox.h b/include/LedCheckBox.h index a215592e6..12642ef3b 100644 --- a/include/LedCheckBox.h +++ b/include/LedCheckBox.h @@ -22,9 +22,8 @@ * */ - -#ifndef LED_CHECKBOX_H -#define LED_CHECKBOX_H +#ifndef LMMS_GUI_LED_CHECKBOX_H +#define LMMS_GUI_LED_CHECKBOX_H #include "AutomatableButton.h" diff --git a/include/LeftRightNav.h b/include/LeftRightNav.h index df72193dc..e752d44c0 100644 --- a/include/LeftRightNav.h +++ b/include/LeftRightNav.h @@ -22,8 +22,8 @@ * */ -#ifndef LEFT_RIGHT_NAV_H -#define LEFT_RIGHT_NAV_H +#ifndef LMMS_GUI_LEFT_RIGHT_NAV_H +#define LMMS_GUI_LEFT_RIGHT_NAV_H #include "PixmapButton.h" @@ -51,4 +51,4 @@ private: } // namespace lmms::gui -#endif \ No newline at end of file +#endif diff --git a/include/LfoController.h b/include/LfoController.h index 48aee3d30..ccd5804c7 100644 --- a/include/LfoController.h +++ b/include/LfoController.h @@ -22,8 +22,8 @@ * */ -#ifndef LFO_CONTROLLER_H -#define LFO_CONTROLLER_H +#ifndef LMMS_LFO_CONTROLLER_H +#define LMMS_LFO_CONTROLLER_H #include @@ -51,7 +51,7 @@ class LfoControllerDialog; } -class LfoController : public Controller +class LfoController : public Controller { Q_OBJECT public: diff --git a/include/LinkedModelGroupViews.h b/include/LinkedModelGroupViews.h index 72598281b..08c25a8bb 100644 --- a/include/LinkedModelGroupViews.h +++ b/include/LinkedModelGroupViews.h @@ -22,15 +22,13 @@ * */ -#ifndef LINKEDMODELGROUPVIEWS_H -#define LINKEDMODELGROUPVIEWS_H - +#ifndef LMMS_GUI_LINKEDMODELGROUPVIEWS_H +#define LMMS_GUI_LINKEDMODELGROUPVIEWS_H #include #include #include - namespace lmms { @@ -120,4 +118,4 @@ private: } // namespace lmms -#endif // LINKEDMODELGROUPVIEWS_H +#endif diff --git a/include/LinkedModelGroups.h b/include/LinkedModelGroups.h index 84a216f30..11950d85e 100644 --- a/include/LinkedModelGroups.h +++ b/include/LinkedModelGroups.h @@ -22,15 +22,13 @@ * */ -#ifndef LINKEDMODELGROUPS_H -#define LINKEDMODELGROUPS_H - +#ifndef LMMS_LINKEDMODELGROUPS_H +#define LMMS_LINKEDMODELGROUPS_H #include #include "Model.h" - class QDomDocument; class QDomElement; @@ -178,4 +176,4 @@ public: } // namespace lmms -#endif // LINKEDMODELGROUPS_H +#endif diff --git a/include/LmmsPalette.h b/include/LmmsPalette.h index 023872254..68cd2d2ab 100644 --- a/include/LmmsPalette.h +++ b/include/LmmsPalette.h @@ -23,13 +23,12 @@ * */ -#ifndef LMMSPALETTE_H -#define LMMSPALETTE_H +#ifndef LMMS_GUI_LMMS_PALETTE_H +#define LMMS_GUI_LMMS_PALETTE_H #include #include "lmms_export.h" - namespace lmms::gui { @@ -86,7 +85,6 @@ private: }; - } // namespace lmms::gui #endif diff --git a/include/LmmsStyle.h b/include/LmmsStyle.h index ae5b65f99..c560b5be8 100644 --- a/include/LmmsStyle.h +++ b/include/LmmsStyle.h @@ -23,9 +23,8 @@ * */ - -#ifndef LMMS_STYLE_H -#define LMMS_STYLE_H +#ifndef LMMS_GUI_LMMS_STYLE_H +#define LMMS_GUI_LMMS_STYLE_H #include diff --git a/include/LocaleHelper.h b/include/LocaleHelper.h index b071a1596..61298f42b 100644 --- a/include/LocaleHelper.h +++ b/include/LocaleHelper.h @@ -25,8 +25,8 @@ * */ -#ifndef LOCALEHELPER_H -#define LOCALEHELPER_H +#ifndef LMMS_LOCALEHELPER_H +#define LMMS_LOCALEHELPER_H #include @@ -67,4 +67,4 @@ inline float toFloat(QString str, bool* ok = nullptr) } // namespace lmms::LocaleHelper -#endif // LOCALEHELPER_H +#endif diff --git a/include/LocklessAllocator.h b/include/LocklessAllocator.h index adde5fe6f..f1b3dea40 100644 --- a/include/LocklessAllocator.h +++ b/include/LocklessAllocator.h @@ -22,8 +22,8 @@ * */ -#ifndef LOCKLESS_ALLOCATOR_H -#define LOCKLESS_ALLOCATOR_H +#ifndef LMMS_LOCKLESS_ALLOCATOR_H +#define LMMS_LOCKLESS_ALLOCATOR_H #include #include diff --git a/include/LocklessList.h b/include/LocklessList.h index 44b718059..e5c5cce71 100644 --- a/include/LocklessList.h +++ b/include/LocklessList.h @@ -22,8 +22,8 @@ * */ -#ifndef LOCKLESS_LIST_H -#define LOCKLESS_LIST_H +#ifndef LMMS_LOCKLESS_LIST_H +#define LMMS_LOCKLESS_LIST_H #include "LocklessAllocator.h" diff --git a/include/LocklessRingBuffer.h b/include/LocklessRingBuffer.h index e77c62ccb..904e54f9c 100644 --- a/include/LocklessRingBuffer.h +++ b/include/LocklessRingBuffer.h @@ -22,8 +22,8 @@ * */ -#ifndef LOCKLESSRINGBUFFER_H -#define LOCKLESSRINGBUFFER_H +#ifndef LMMS_LOCKLESS_RING_BUFFER_H +#define LMMS_LOCKLESS_RING_BUFFER_H #include #include @@ -89,4 +89,4 @@ private: } // namespace lmms -#endif //LOCKLESSRINGBUFFER_H +#endif diff --git a/include/Lv2Basics.h b/include/Lv2Basics.h index b935e6a02..73f006b46 100644 --- a/include/Lv2Basics.h +++ b/include/Lv2Basics.h @@ -22,10 +22,8 @@ * */ - -#ifndef LV2BASICS_H -#define LV2BASICS_H - +#ifndef LMMS_LV2BASICS_H +#define LMMS_LV2BASICS_H #include "lmmsconfig.h" @@ -69,4 +67,5 @@ std::string stdStringFromPortName(const LilvPlugin* plug, const LilvPort* port); } // namespace lmms #endif // LMMS_HAVE_LV2 -#endif // LV2BASICS_H + +#endif diff --git a/include/Lv2ControlBase.h b/include/Lv2ControlBase.h index c6b08db8c..dcb90f27a 100644 --- a/include/Lv2ControlBase.h +++ b/include/Lv2ControlBase.h @@ -22,8 +22,8 @@ * */ -#ifndef LV2_CONTROL_BASE_H -#define LV2_CONTROL_BASE_H +#ifndef LMMS_LV2_CONTROL_BASE_H +#define LMMS_LV2_CONTROL_BASE_H #include "lmmsconfig.h" @@ -163,4 +163,5 @@ private: } // namespace lmms #endif // LMMS_HAVE_LV2 -#endif // LV2_CONTROL_BASE_H + +#endif diff --git a/include/Lv2Evbuf.h b/include/Lv2Evbuf.h index 9732fc5e1..ecf61ec99 100644 --- a/include/Lv2Evbuf.h +++ b/include/Lv2Evbuf.h @@ -1,5 +1,5 @@ /* - * lv2_evbuf.h - Lv2 event buffer definitions + * Lv2Evbuf.h - Lv2 event buffer definitions * * Copyright (c) 2019-2020 Johannes Lorenz * @@ -30,8 +30,8 @@ * match the LMMS coding conventions. */ -#ifndef LV2_EVBUF_H -#define LV2_EVBUF_H +#ifndef LMMS_LV2_EVBUF_H +#define LMMS_LV2_EVBUF_H #include "lmmsconfig.h" @@ -155,4 +155,4 @@ lv2_evbuf_write( LV2_Evbuf_Iterator* iter, #endif // LMMS_HAVE_LV2 -#endif // LV2_EVBUF_H +#endif diff --git a/include/Lv2Features.h b/include/Lv2Features.h index 033273f31..99a5762b0 100644 --- a/include/Lv2Features.h +++ b/include/Lv2Features.h @@ -22,8 +22,8 @@ * */ -#ifndef LV2FEATURES_H -#define LV2FEATURES_H +#ifndef LMMS_LV2_FEATURES_H +#define LMMS_LV2_FEATURES_H #include "lmmsconfig.h" @@ -84,4 +84,4 @@ private: #endif // LMMS_HAVE_LV2 -#endif // LV2FEATURES_H +#endif diff --git a/include/Lv2Manager.h b/include/Lv2Manager.h index 7c4a4bcb7..45ca868dd 100644 --- a/include/Lv2Manager.h +++ b/include/Lv2Manager.h @@ -22,8 +22,8 @@ * */ -#ifndef LV2MANAGER_H -#define LV2MANAGER_H +#ifndef LMMS_LV2_MANAGER_H +#define LMMS_LV2_MANAGER_H #include "lmmsconfig.h" @@ -166,4 +166,4 @@ private: #endif // LMMS_HAVE_LV2 -#endif // LV2MANAGER_H +#endif diff --git a/include/Lv2Options.h b/include/Lv2Options.h index 32225ea89..c81e4b953 100644 --- a/include/Lv2Options.h +++ b/include/Lv2Options.h @@ -22,8 +22,8 @@ * */ -#ifndef LV2OPTIONS_H -#define LV2OPTIONS_H +#ifndef LMMS_LV2_OPTIONS_H +#define LMMS_LV2_OPTIONS_H #include "lmmsconfig.h" @@ -107,4 +107,4 @@ private: #endif // LMMS_HAVE_LV2 -#endif // LV2OPTIONS_H +#endif diff --git a/include/Lv2Ports.h b/include/Lv2Ports.h index 07676fdd4..7283ebbd3 100644 --- a/include/Lv2Ports.h +++ b/include/Lv2Ports.h @@ -22,8 +22,8 @@ * */ -#ifndef LV2PORTS_H -#define LV2PORTS_H +#ifndef LMMS_LV2PORTS_H +#define LMMS_LV2PORTS_H #include "lmmsconfig.h" @@ -270,4 +270,5 @@ const Target* dcast(const PortBase* base) } // namespace lmms #endif // LMMS_HAVE_LV2 -#endif // LV2PORTS_H + +#endif diff --git a/include/Lv2Proc.h b/include/Lv2Proc.h index 31a694044..eea4e7c0e 100644 --- a/include/Lv2Proc.h +++ b/include/Lv2Proc.h @@ -22,8 +22,8 @@ * */ -#ifndef LV2PROC_H -#define LV2PROC_H +#ifndef LMMS_LV2_PROC_H +#define LMMS_LV2_PROC_H #include "lmmsconfig.h" @@ -220,4 +220,5 @@ private: } // namespace lmms #endif // LMMS_HAVE_LV2 -#endif // LV2PROC_H + +#endif diff --git a/include/Lv2SubPluginFeatures.h b/include/Lv2SubPluginFeatures.h index 9ba2c76cb..f8fbf55df 100644 --- a/include/Lv2SubPluginFeatures.h +++ b/include/Lv2SubPluginFeatures.h @@ -24,8 +24,8 @@ * */ -#ifndef LV2_SUBPLUGIN_FEATURES_H -#define LV2_SUBPLUGIN_FEATURES_H +#ifndef LMMS_LV2_SUBPLUGIN_FEATURES_H +#define LMMS_LV2_SUBPLUGIN_FEATURES_H #include "lmmsconfig.h" diff --git a/include/Lv2UridCache.h b/include/Lv2UridCache.h index bae42d318..ab80760b0 100644 --- a/include/Lv2UridCache.h +++ b/include/Lv2UridCache.h @@ -22,8 +22,8 @@ * */ -#ifndef LV2URIDCACHE_H -#define LV2URIDCACHE_H +#ifndef LMMS_LV2_URID_CACHE_H +#define LMMS_LV2_URID_CACHE_H #include "lmmsconfig.h" @@ -74,4 +74,5 @@ template<> struct Lv2UridCache::IdForType { static constexpr auto } // namespace lmms #endif // LMMS_HAVE_LV2 -#endif // LV2URIDCACHE_H + +#endif diff --git a/include/Lv2UridMap.h b/include/Lv2UridMap.h index 9db9cb0c2..ec23f4c6d 100644 --- a/include/Lv2UridMap.h +++ b/include/Lv2UridMap.h @@ -22,8 +22,8 @@ * */ -#ifndef LV2URIDMAP_H -#define LV2URIDMAP_H +#ifndef LMMS_LV2_URID_MAP_H +#define LMMS_LV2_URID_MAP_H #include "lmmsconfig.h" @@ -75,4 +75,5 @@ public: } // namespace lmms #endif // LMMS_HAVE_LV2 -#endif // LV2URIDMAP_H + +#endif diff --git a/include/Lv2ViewBase.h b/include/Lv2ViewBase.h index 605440814..e84c6c5dc 100644 --- a/include/Lv2ViewBase.h +++ b/include/Lv2ViewBase.h @@ -22,15 +22,14 @@ * */ -#ifndef LV2VIEWBASE_H -#define LV2VIEWBASE_H +#ifndef LMMS_LV2_VIEW_BASE_H +#define LMMS_LV2_VIEW_BASE_H #include "lmmsconfig.h" #ifdef LMMS_HAVE_LV2 - #include "LinkedModelGroupViews.h" #include "lmms_export.h" #include "Lv2Basics.h" @@ -109,4 +108,5 @@ private: } // namespace lmms #endif // LMMS_HAVE_LV2 -#endif // LV2VIEWBASE_H + +#endif diff --git a/include/MainApplication.h b/include/MainApplication.h index 04bc82226..0ab2877e7 100644 --- a/include/MainApplication.h +++ b/include/MainApplication.h @@ -22,8 +22,8 @@ * */ -#ifndef MAINAPPLICATION_H -#define MAINAPPLICATION_H +#ifndef LMMS_GUI_MAIN_APPLICATION_H +#define LMMS_GUI_MAIN_APPLICATION_H #include "lmmsconfig.h" @@ -64,4 +64,4 @@ private: } // namespace lmms::gui -#endif // MAINAPPLICATION_H +#endif diff --git a/include/MainWindow.h b/include/MainWindow.h index e093d1082..78d7f48d8 100644 --- a/include/MainWindow.h +++ b/include/MainWindow.h @@ -22,8 +22,8 @@ * */ -#ifndef MAIN_WINDOW_H -#define MAIN_WINDOW_H +#ifndef LMMS_GUI_MAIN_WINDOW_H +#define LMMS_GUI_MAIN_WINDOW_H #include #include diff --git a/include/MemoryHelper.h b/include/MemoryHelper.h index 1def9d9c4..22ab10a6c 100644 --- a/include/MemoryHelper.h +++ b/include/MemoryHelper.h @@ -21,9 +21,8 @@ * */ - -#ifndef MEMORY_HELPER_H -#define MEMORY_HELPER_H +#ifndef LMMS_MEMORY_HELPER_H +#define LMMS_MEMORY_HELPER_H #include @@ -48,4 +47,3 @@ private: } // namespace lmms #endif - diff --git a/include/MemoryManager.h b/include/MemoryManager.h index d50ad173d..6e172468b 100644 --- a/include/MemoryManager.h +++ b/include/MemoryManager.h @@ -24,8 +24,8 @@ * */ -#ifndef MEMORY_MANAGER_H -#define MEMORY_MANAGER_H +#ifndef LMMS_MEMORY_MANAGER_H +#define LMMS_MEMORY_MANAGER_H #include #include diff --git a/include/MeterDialog.h b/include/MeterDialog.h index 67dca2568..425590807 100644 --- a/include/MeterDialog.h +++ b/include/MeterDialog.h @@ -23,8 +23,8 @@ * */ -#ifndef METER_DIALOG_H -#define METER_DIALOG_H +#ifndef LMMS_GUI_METER_DIALOG_H +#define LMMS_GUI_METER_DIALOG_H #include diff --git a/include/MeterModel.h b/include/MeterModel.h index c2e715b79..9a6ec8015 100644 --- a/include/MeterModel.h +++ b/include/MeterModel.h @@ -22,8 +22,8 @@ * */ -#ifndef METER_MODEL_H -#define METER_MODEL_H +#ifndef LMMS_METER_MODEL_H +#define LMMS_METER_MODEL_H #include "AutomatableModel.h" diff --git a/include/MicroTimer.h b/include/MicroTimer.h index ea74e964d..e5c8e2f61 100644 --- a/include/MicroTimer.h +++ b/include/MicroTimer.h @@ -22,8 +22,8 @@ * */ -#ifndef MICRO_TIMER_H -#define MICRO_TIMER_H +#ifndef LMMS_MICRO_TIMER_H +#define LMMS_MICRO_TIMER_H #include @@ -48,4 +48,4 @@ private: } // namespace lmms -#endif // MICRO_TIMER_H +#endif diff --git a/include/Microtuner.h b/include/Microtuner.h index dff8f5773..795748b39 100644 --- a/include/Microtuner.h +++ b/include/Microtuner.h @@ -22,8 +22,8 @@ * */ -#ifndef MICROTUNER_H -#define MICROTUNER_H +#ifndef LMMS_MICROTUNER_H +#define LMMS_MICROTUNER_H #include "AutomatableModel.h" #include "ComboBoxModel.h" diff --git a/include/MicrotunerConfig.h b/include/MicrotunerConfig.h index 690587dd5..3a5130b60 100644 --- a/include/MicrotunerConfig.h +++ b/include/MicrotunerConfig.h @@ -22,9 +22,8 @@ * */ -#ifndef MICROTUNER_CONFIG_H -#define MICROTUNER_CONFIG_H - +#ifndef LMMS_GUI_MICROTUNER_CONFIG_H +#define LMMS_GUI_MICROTUNER_CONFIG_H #include diff --git a/include/Midi.h b/include/Midi.h index f75254d84..839d0b684 100644 --- a/include/Midi.h +++ b/include/Midi.h @@ -22,8 +22,8 @@ * */ -#ifndef MIDI_H -#define MIDI_H +#ifndef LMMS_MIDI_H +#define LMMS_MIDI_H #include "lmms_basics.h" diff --git a/include/MidiAlsaRaw.h b/include/MidiAlsaRaw.h index 57a477264..a2b8c4e69 100644 --- a/include/MidiAlsaRaw.h +++ b/include/MidiAlsaRaw.h @@ -22,8 +22,8 @@ * */ -#ifndef MIDI_ALSA_RAW_H -#define MIDI_ALSA_RAW_H +#ifndef LMMS_MIDI_ALSA_RAW_H +#define LMMS_MIDI_ALSA_RAW_H #include "lmmsconfig.h" diff --git a/include/MidiAlsaSeq.h b/include/MidiAlsaSeq.h index fa287a409..d6f488c82 100644 --- a/include/MidiAlsaSeq.h +++ b/include/MidiAlsaSeq.h @@ -22,8 +22,8 @@ * */ -#ifndef MIDI_ALSA_SEQ_H -#define MIDI_ALSA_SEQ_H +#ifndef LMMS_MIDI_ALSA_SEQ_H +#define LMMS_MIDI_ALSA_SEQ_H #include "lmmsconfig.h" @@ -159,4 +159,3 @@ signals: #endif // LMMS_HAVE_ALSA #endif - diff --git a/include/MidiApple.h b/include/MidiApple.h index 794641e64..1b0d59218 100644 --- a/include/MidiApple.h +++ b/include/MidiApple.h @@ -23,8 +23,8 @@ * */ -#ifndef MIDI_APPLE_H -#define MIDI_APPLE_H +#ifndef LMMS_MIDI_APPLE_H +#define LMMS_MIDI_APPLE_H #include "lmmsconfig.h" @@ -155,5 +155,4 @@ signals: #endif // LMMS_BUILD_APPLE - #endif diff --git a/include/MidiCCRackView.h b/include/MidiCCRackView.h index 59f1de020..98f5ce183 100644 --- a/include/MidiCCRackView.h +++ b/include/MidiCCRackView.h @@ -1,5 +1,5 @@ -#ifndef MIDI_CC_RACK_VIEW_H -#define MIDI_CC_RACK_VIEW_H +#ifndef LMMS_GUI_MIDI_CC_RACK_VIEW_H +#define LMMS_GUI_MIDI_CC_RACK_VIEW_H #include diff --git a/include/MidiClient.h b/include/MidiClient.h index 954cd5ef5..45ba54ee5 100644 --- a/include/MidiClient.h +++ b/include/MidiClient.h @@ -22,8 +22,8 @@ * */ -#ifndef MIDI_CLIENT_H -#define MIDI_CLIENT_H +#ifndef LMMS_MIDI_CLIENT_H +#define LMMS_MIDI_CLIENT_H #include #include @@ -174,4 +174,3 @@ private: } // namespace lmms #endif - diff --git a/include/MidiClip.h b/include/MidiClip.h index 6433ba507..2dbedc0dd 100644 --- a/include/MidiClip.h +++ b/include/MidiClip.h @@ -23,9 +23,8 @@ * */ -#ifndef MIDI_CLIP_H -#define MIDI_CLIP_H - +#ifndef LMMS_MIDI_CLIP_H +#define LMMS_MIDI_CLIP_H #include "Clip.h" #include "Note.h" diff --git a/include/MidiClipView.h b/include/MidiClipView.h index 1a9809733..dd83f98b8 100644 --- a/include/MidiClipView.h +++ b/include/MidiClipView.h @@ -21,10 +21,10 @@ * Boston, MA 02110-1301 USA. * */ - -#ifndef MIDI_CLIP_VIEW_H -#define MIDI_CLIP_VIEW_H - + +#ifndef LMMS_GUI_MIDI_CLIP_VIEW_H +#define LMMS_GUI_MIDI_CLIP_VIEW_H + #include #include "ClipView.h" @@ -43,7 +43,7 @@ class MidiClipView : public ClipView public: MidiClipView( MidiClip* clip, TrackView* parent ); - ~MidiClipView() override = default; + ~MidiClipView() override = default; Q_PROPERTY(QColor noteFillColor READ getNoteFillColor WRITE setNoteFillColor) Q_PROPERTY(QColor noteBorderColor READ getNoteBorderColor WRITE setNoteBorderColor) @@ -107,5 +107,5 @@ private: } // namespace gui } // namespace lmms - - #endif + +#endif diff --git a/include/MidiController.h b/include/MidiController.h index 500acc5f8..19577281f 100644 --- a/include/MidiController.h +++ b/include/MidiController.h @@ -22,8 +22,8 @@ * */ -#ifndef MIDI_CONTROLLER_H -#define MIDI_CONTROLLER_H +#ifndef LMMS_MIDI_CONTROLLER_H +#define LMMS_MIDI_CONTROLLER_H #include diff --git a/include/MidiDummy.h b/include/MidiDummy.h index 67a91e326..03deaf7bc 100644 --- a/include/MidiDummy.h +++ b/include/MidiDummy.h @@ -22,8 +22,8 @@ * */ -#ifndef MIDI_DUMMY_H -#define MIDI_DUMMY_H +#ifndef LMMS_MIDI_DUMMY_H +#define LMMS_MIDI_DUMMY_H #include "MidiClient.h" diff --git a/include/MidiEvent.h b/include/MidiEvent.h index 6c2bfdd55..03d3be604 100644 --- a/include/MidiEvent.h +++ b/include/MidiEvent.h @@ -22,8 +22,8 @@ * */ -#ifndef MIDI_EVENT_H -#define MIDI_EVENT_H +#ifndef LMMS_MIDI_EVENT_H +#define LMMS_MIDI_EVENT_H #include #include "Midi.h" diff --git a/include/MidiEventProcessor.h b/include/MidiEventProcessor.h index 132a5fc42..3e51d1177 100644 --- a/include/MidiEventProcessor.h +++ b/include/MidiEventProcessor.h @@ -22,8 +22,8 @@ * */ -#ifndef MIDI_EVENT_PROCESSOR_H -#define MIDI_EVENT_PROCESSOR_H +#ifndef LMMS_MIDI_EVENT_PROCESSOR_H +#define LMMS_MIDI_EVENT_PROCESSOR_H #include "MidiEvent.h" #include "MemoryManager.h" diff --git a/include/MidiEventToByteSeq.h b/include/MidiEventToByteSeq.h index f2e36f50a..03308d7b8 100644 --- a/include/MidiEventToByteSeq.h +++ b/include/MidiEventToByteSeq.h @@ -22,8 +22,8 @@ * */ -#ifndef MIDIEVENTTOBYTESEQ_H -#define MIDIEVENTTOBYTESEQ_H +#ifndef LMMS_MIDIEVENTTOBYTESEQ_H +#define LMMS_MIDIEVENTTOBYTESEQ_H #include #include @@ -51,4 +51,4 @@ std::size_t LMMS_EXPORT writeToByteSeq( const class MidiEvent& ev, } // namespace lmms -#endif // MIDIEVENTTOBYTESEQ_H +#endif diff --git a/include/MidiJack.h b/include/MidiJack.h index a4a944b81..265abedfc 100644 --- a/include/MidiJack.h +++ b/include/MidiJack.h @@ -22,8 +22,8 @@ * */ -#ifndef MIDIJACK_H -#define MIDIJACK_H +#ifndef LMMS_MIDI_JACK_H +#define LMMS_MIDI_JACK_H #include "lmmsconfig.h" @@ -102,4 +102,4 @@ private: #endif // LMMS_HAVE_JACK -#endif // MIDIJACK_H +#endif diff --git a/include/MidiOss.h b/include/MidiOss.h index 944359055..dba0a9a71 100644 --- a/include/MidiOss.h +++ b/include/MidiOss.h @@ -22,8 +22,8 @@ * */ -#ifndef MIDI_OSS_H -#define MIDI_OSS_H +#ifndef LMMS_MIDI_OSS_H +#define LMMS_MIDI_OSS_H #include "lmmsconfig.h" @@ -78,5 +78,4 @@ private: #endif // LMMS_HAVE_OSS - #endif diff --git a/include/MidiPort.h b/include/MidiPort.h index 7ef9adf90..a03b8477c 100644 --- a/include/MidiPort.h +++ b/include/MidiPort.h @@ -23,8 +23,8 @@ * */ -#ifndef MIDI_PORT_H -#define MIDI_PORT_H +#ifndef LMMS_MIDI_PORT_H +#define LMMS_MIDI_PORT_H #include #include diff --git a/include/MidiPortMenu.h b/include/MidiPortMenu.h index 215a73d06..88328e734 100644 --- a/include/MidiPortMenu.h +++ b/include/MidiPortMenu.h @@ -23,8 +23,8 @@ * */ -#ifndef MIDI_PORT_MENU_H -#define MIDI_PORT_MENU_H +#ifndef LMMS_GUI_MIDI_PORT_MENU_H +#define LMMS_GUI_MIDI_PORT_MENU_H #include diff --git a/include/MidiSetupWidget.h b/include/MidiSetupWidget.h index 4021db142..492a5bb85 100644 --- a/include/MidiSetupWidget.h +++ b/include/MidiSetupWidget.h @@ -22,9 +22,8 @@ * */ -#ifndef MIDISETUPWIDGET_H -#define MIDISETUPWIDGET_H - +#ifndef LMMS_GUI_MIDI_SETUP_WIDGET_H +#define LMMS_GUI_MIDI_SETUP_WIDGET_H #include "TabWidget.h" diff --git a/include/MidiSndio.h b/include/MidiSndio.h index 3ebd14d05..3d7226431 100644 --- a/include/MidiSndio.h +++ b/include/MidiSndio.h @@ -23,8 +23,8 @@ * */ -#ifndef _MIDI_SNDIO_H -#define _MIDI_SNDIO_H +#ifndef LMMS_MIDI_SNDIO_H +#define LMMS_MIDI_SNDIO_H #include "lmmsconfig.h" @@ -75,4 +75,4 @@ private: #endif // LMMS_HAVE_SNDIO -#endif // _MIDI_SNDIO_H +#endif diff --git a/include/MidiWinMM.h b/include/MidiWinMM.h index 0f2bd0d5f..ca1850347 100644 --- a/include/MidiWinMM.h +++ b/include/MidiWinMM.h @@ -22,8 +22,8 @@ * */ -#ifndef MIDI_WINMM_H -#define MIDI_WINMM_H +#ifndef LMMS_MIDI_WINMM_H +#define LMMS_MIDI_WINMM_H #include "lmmsconfig.h" @@ -151,4 +151,3 @@ signals: #endif // LMMS_BUILD_WIN32 #endif - diff --git a/include/MixHelpers.h b/include/MixHelpers.h index 6599b40ec..76242dd7a 100644 --- a/include/MixHelpers.h +++ b/include/MixHelpers.h @@ -22,8 +22,8 @@ * */ -#ifndef MIX_HELPERS_H -#define MIX_HELPERS_H +#ifndef LMMS_MIX_HELPERS_H +#define LMMS_MIX_HELPERS_H #include "lmms_basics.h" @@ -82,4 +82,3 @@ void multiplyAndAddMultipliedJoined( sampleFrame* dst, const sample_t* srcLeft, } // namespace lmms #endif - diff --git a/include/Mixer.h b/include/Mixer.h index ecd864ae7..d49d950ea 100644 --- a/include/Mixer.h +++ b/include/Mixer.h @@ -22,8 +22,8 @@ * */ -#ifndef MIXER_H -#define MIXER_H +#ifndef LMMS_MIXER_H +#define LMMS_MIXER_H #include "Model.h" #include "EffectChain.h" @@ -100,37 +100,37 @@ class MixerChannel : public ThreadableJob class MixerRoute : public QObject { Q_OBJECT - public: - MixerRoute( MixerChannel * from, MixerChannel * to, float amount ); - ~MixerRoute() override = default; - +public: + MixerRoute( MixerChannel * from, MixerChannel * to, float amount ); + ~MixerRoute() override = default; + mix_ch_t senderIndex() const { return m_from->m_channelIndex; } - + mix_ch_t receiverIndex() const { return m_to->m_channelIndex; } - + FloatModel * amount() { return &m_amount; } - + MixerChannel * sender() const { return m_from; } - + MixerChannel * receiver() const { return m_to; } - + void updateName(); - + private: MixerChannel * m_from; MixerChannel * m_to; diff --git a/include/MixerLine.h b/include/MixerLine.h index decd5f3aa..0121717cf 100644 --- a/include/MixerLine.h +++ b/include/MixerLine.h @@ -23,8 +23,8 @@ * */ -#ifndef MIXERLINE_H -#define MIXERLINE_H +#ifndef LMMS_GUI_MIXER_LINE_H +#define LMMS_GUI_MIXER_LINE_H #include @@ -117,4 +117,4 @@ private slots: } // namespace lmms::gui -#endif // MIXERLINE_H +#endif diff --git a/include/MixerLineLcdSpinBox.h b/include/MixerLineLcdSpinBox.h index bfd6cd5c9..0d3b182b0 100644 --- a/include/MixerLineLcdSpinBox.h +++ b/include/MixerLineLcdSpinBox.h @@ -22,8 +22,8 @@ * */ -#ifndef MIXER_LINE_LCD_SPIN_BOX_H -#define MIXER_LINE_LCD_SPIN_BOX_H +#ifndef LMMS_GUI_MIXER_LINE_LCD_SPIN_BOX_H +#define LMMS_GUI_MIXER_LINE_LCD_SPIN_BOX_H #include "LcdSpinBox.h" diff --git a/include/MixerView.h b/include/MixerView.h index a7b1b5191..e73e2e391 100644 --- a/include/MixerView.h +++ b/include/MixerView.h @@ -22,8 +22,8 @@ * */ -#ifndef MIXER_VIEW_H -#define MIXER_VIEW_H +#ifndef LMMS_GUI_MIXER_VIEW_H +#define LMMS_GUI_MIXER_VIEW_H #include #include @@ -132,7 +132,7 @@ private: QWidget * m_racksWidget; void updateMaxChannelSelector(); - + friend class MixerChannelView; } ; diff --git a/include/Model.h b/include/Model.h index 567d4ffd7..0b8142659 100644 --- a/include/Model.h +++ b/include/Model.h @@ -22,8 +22,8 @@ * */ -#ifndef MODEL_H -#define MODEL_H +#ifndef LMMS_MODEL_H +#define LMMS_MODEL_H #include #include @@ -91,4 +91,3 @@ signals: } // namespace lmms #endif - diff --git a/include/ModelView.h b/include/ModelView.h index a858dc7ec..89e60c3a6 100644 --- a/include/ModelView.h +++ b/include/ModelView.h @@ -22,8 +22,8 @@ * */ -#ifndef MODEL_VIEW_H -#define MODEL_VIEW_H +#ifndef LMMS_GUI_MODEL_VIEW_H +#define LMMS_GUI_MODEL_VIEW_H #include #include "Model.h" @@ -86,4 +86,3 @@ private: } // namespace lmms::gui #endif - diff --git a/include/ModelVisitor.h b/include/ModelVisitor.h index 8805e30e2..59928d04b 100644 --- a/include/ModelVisitor.h +++ b/include/ModelVisitor.h @@ -22,8 +22,8 @@ * */ -#ifndef MODELVISITOR_H -#define MODELVISITOR_H +#ifndef LMMS_MODEL_VISITOR_H +#define LMMS_MODEL_VISITOR_H namespace lmms { @@ -68,4 +68,4 @@ public: } // namespace lmms -#endif // MODELVISITOR_H +#endif diff --git a/include/NStateButton.h b/include/NStateButton.h index 4dac1a436..dd1c06a66 100644 --- a/include/NStateButton.h +++ b/include/NStateButton.h @@ -22,9 +22,8 @@ * */ - -#ifndef NSTATE_BUTTON_H -#define NSTATE_BUTTON_H +#ifndef LMMS_GUI_NSTATE_BUTTON_H +#define LMMS_GUI_NSTATE_BUTTON_H #include #include diff --git a/include/Note.h b/include/Note.h index 464f3906f..9eecd585f 100644 --- a/include/Note.h +++ b/include/Note.h @@ -23,8 +23,8 @@ * */ -#ifndef NOTE_H -#define NOTE_H +#ifndef LMMS_NOTE_H +#define LMMS_NOTE_H #include #include diff --git a/include/NotePlayHandle.h b/include/NotePlayHandle.h index 4969fd84a..89fc7e570 100644 --- a/include/NotePlayHandle.h +++ b/include/NotePlayHandle.h @@ -23,8 +23,8 @@ * */ -#ifndef NOTE_PLAY_HANDLE_H -#define NOTE_PLAY_HANDLE_H +#ifndef LMMS_NOTE_PLAY_HANDLE_H +#define LMMS_NOTE_PLAY_HANDLE_H #include diff --git a/include/Oscillator.h b/include/Oscillator.h index 8727ee39c..025404c41 100644 --- a/include/Oscillator.h +++ b/include/Oscillator.h @@ -23,8 +23,8 @@ * */ -#ifndef OSCILLATOR_H -#define OSCILLATOR_H +#ifndef LMMS_OSCILLATOR_H +#define LMMS_OSCILLATOR_H #include #include diff --git a/include/OscillatorConstants.h b/include/OscillatorConstants.h index 0450c2f17..ef12636d4 100644 --- a/include/OscillatorConstants.h +++ b/include/OscillatorConstants.h @@ -1,5 +1,5 @@ /* - * OscillatorConstants.h - declaration of constants used in Oscillator and SampleBuffer + * OscillatorConstants.h - declaration of constants used in Oscillator and SampleBuffer * for band limited wave tables * * Copyright (c) 2018 Dave French @@ -23,8 +23,8 @@ * */ -#ifndef OSCILLATORCONSTANTS_H -#define OSCILLATORCONSTANTS_H +#ifndef LMMS_OSCILLATORCONSTANTS_H +#define LMMS_OSCILLATORCONSTANTS_H #include @@ -55,4 +55,4 @@ namespace lmms::OscillatorConstants } // namespace lmms::OscillatorConstants -#endif // OSCILLATORCONSTANTS_H +#endif diff --git a/include/Oscilloscope.h b/include/Oscilloscope.h index db4cf2b4a..c7a52cef9 100644 --- a/include/Oscilloscope.h +++ b/include/Oscilloscope.h @@ -22,9 +22,8 @@ * */ - -#ifndef OSCILLOSCOPE_H -#define OSCILLOSCOPE_H +#ifndef LMMS_GUI_OSCILLOSCOPE_H +#define LMMS_GUI_OSCILLOSCOPE_H #include #include @@ -79,4 +78,4 @@ private: } // namespace lmms::gui -#endif // OSCILLOSCOPE_H +#endif diff --git a/include/OutputSettings.h b/include/OutputSettings.h index 03e3333ac..0b10d2b01 100644 --- a/include/OutputSettings.h +++ b/include/OutputSettings.h @@ -23,12 +23,11 @@ * */ -#ifndef OUTPUT_SETTINGS_H -#define OUTPUT_SETTINGS_H +#ifndef LMMS_OUTPUT_SETTINGS_H +#define LMMS_OUTPUT_SETTINGS_H #include "lmms_basics.h" - namespace lmms { diff --git a/include/PathUtil.h b/include/PathUtil.h index 8b1ef1097..9efd73096 100644 --- a/include/PathUtil.h +++ b/include/PathUtil.h @@ -22,8 +22,8 @@ * */ -#ifndef PATHUTIL_H -#define PATHUTIL_H +#ifndef LMMS_PATHUTIL_H +#define LMMS_PATHUTIL_H #include "lmms_export.h" diff --git a/include/PatternClip.h b/include/PatternClip.h index f1d0e2557..3f9d07cb6 100644 --- a/include/PatternClip.h +++ b/include/PatternClip.h @@ -21,10 +21,9 @@ * Boston, MA 02110-1301 USA. * */ - -#ifndef PATTERN_CLIP_H -#define PATTERN_CLIP_H +#ifndef LMMS_PATTERN_CLIP_H +#define LMMS_PATTERN_CLIP_H #include "Clip.h" diff --git a/include/PatternClipView.h b/include/PatternClipView.h index d170e4bef..f2e2208bd 100644 --- a/include/PatternClipView.h +++ b/include/PatternClipView.h @@ -21,11 +21,9 @@ * Boston, MA 02110-1301 USA. * */ - - -#ifndef PATTERN_CLIP_VIEW_H -#define PATTERN_CLIP_VIEW_H +#ifndef LMMS_GUI_PATTERN_CLIP_VIEW_H +#define LMMS_GUI_PATTERN_CLIP_VIEW_H #include diff --git a/include/PatternEditor.h b/include/PatternEditor.h index ffe08e335..fd9a1b254 100644 --- a/include/PatternEditor.h +++ b/include/PatternEditor.h @@ -22,10 +22,8 @@ * */ - -#ifndef PATTERN_EDITOR_H -#define PATTERN_EDITOR_H - +#ifndef LMMS_GUI_PATTERN_EDITOR_H +#define LMMS_GUI_PATTERN_EDITOR_H #include "Editor.h" #include "TrackContainerView.h" diff --git a/include/PatternStore.h b/include/PatternStore.h index 7bd377941..024505b83 100644 --- a/include/PatternStore.h +++ b/include/PatternStore.h @@ -22,9 +22,8 @@ * */ - -#ifndef PATTERN_STORE_H -#define PATTERN_STORE_H +#ifndef LMMS_PATTERN_STORE_H +#define LMMS_PATTERN_STORE_H #include "TrackContainer.h" #include "ComboBoxModel.h" diff --git a/include/PatternTrack.h b/include/PatternTrack.h index 73ddd4766..8e319216a 100644 --- a/include/PatternTrack.h +++ b/include/PatternTrack.h @@ -22,10 +22,8 @@ * */ - -#ifndef PATTERN_TRACK_H -#define PATTERN_TRACK_H - +#ifndef LMMS_PATTERN_TRACK_H +#define LMMS_PATTERN_TRACK_H #include diff --git a/include/PatternTrackView.h b/include/PatternTrackView.h index b6d33e444..b4d373b5d 100644 --- a/include/PatternTrackView.h +++ b/include/PatternTrackView.h @@ -22,10 +22,8 @@ * */ - -#ifndef PATTERN_TRACK_VIEW_H -#define PATTERN_TRACK_VIEW_H - +#ifndef LMMS_GUI_PATTERN_TRACK_VIEW_H +#define LMMS_GUI_PATTERN_TRACK_VIEW_H #include "TrackView.h" diff --git a/include/PeakController.h b/include/PeakController.h index 58d666dd0..ebdf49cb0 100644 --- a/include/PeakController.h +++ b/include/PeakController.h @@ -22,8 +22,8 @@ * */ -#ifndef PEAK_CONTROLLER_H -#define PEAK_CONTROLLER_H +#ifndef LMMS_PEAK_CONTROLLER_H +#define LMMS_PEAK_CONTROLLER_H #include "Controller.h" #include "ControllerDialog.h" diff --git a/include/PerfLog.h b/include/PerfLog.h index b8cc35f45..f786de1cc 100644 --- a/include/PerfLog.h +++ b/include/PerfLog.h @@ -22,8 +22,8 @@ * */ -#ifndef PERFLOG_H -#define PERFLOG_H +#ifndef LMMS_PERFLOG_H +#define LMMS_PERFLOG_H #include #include diff --git a/include/Piano.h b/include/Piano.h index 531bb65a6..e22710bba 100644 --- a/include/Piano.h +++ b/include/Piano.h @@ -22,8 +22,8 @@ * */ -#ifndef PIANO_H -#define PIANO_H +#ifndef LMMS_PIANO_H +#define LMMS_PIANO_H #include "Note.h" #include "Model.h" @@ -90,4 +90,3 @@ private: } // namespace lmms #endif - diff --git a/include/PianoRoll.h b/include/PianoRoll.h index c1973f407..5013e3e1b 100644 --- a/include/PianoRoll.h +++ b/include/PianoRoll.h @@ -24,8 +24,8 @@ * */ -#ifndef PIANO_ROLL_H -#define PIANO_ROLL_H +#ifndef LMMS_GUI_PIANO_ROLL_H +#define LMMS_GUI_PIANO_ROLL_H #include #include diff --git a/include/PianoView.h b/include/PianoView.h index 7f586809d..1d5cd4be4 100644 --- a/include/PianoView.h +++ b/include/PianoView.h @@ -22,8 +22,8 @@ * */ -#ifndef PIANO_VIEW_H -#define PIANO_VIEW_H +#ifndef LMMS_GUI_PIANO_VIEW_H +#define LMMS_GUI_PIANO_VIEW_H #include #include diff --git a/include/Pitch.h b/include/Pitch.h index 6213ef374..537941700 100644 --- a/include/Pitch.h +++ b/include/Pitch.h @@ -22,8 +22,8 @@ * */ -#ifndef PITCH_H -#define PITCH_H +#ifndef LMMS_PITCH_H +#define LMMS_PITCH_H #include diff --git a/include/PixmapButton.h b/include/PixmapButton.h index 6c37f9112..b9568e5ad 100644 --- a/include/PixmapButton.h +++ b/include/PixmapButton.h @@ -22,9 +22,8 @@ * */ - -#ifndef PIXMAP_BUTTON_H -#define PIXMAP_BUTTON_H +#ifndef LMMS_GUI_PIXMAP_BUTTON_H +#define LMMS_GUI_PIXMAP_BUTTON_H #include diff --git a/include/PlayHandle.h b/include/PlayHandle.h index 542d45871..005ef17a0 100644 --- a/include/PlayHandle.h +++ b/include/PlayHandle.h @@ -22,8 +22,8 @@ * */ -#ifndef PLAY_HANDLE_H -#define PLAY_HANDLE_H +#ifndef LMMS_PLAY_HANDLE_H +#define LMMS_PLAY_HANDLE_H #include #include diff --git a/include/Plugin.h b/include/Plugin.h index 6a4d95bb4..0a7b68a55 100644 --- a/include/Plugin.h +++ b/include/Plugin.h @@ -22,8 +22,8 @@ * */ -#ifndef PLUGIN_H -#define PLUGIN_H +#ifndef LMMS_PLUGIN_H +#define LMMS_PLUGIN_H #include #include diff --git a/include/PluginBrowser.h b/include/PluginBrowser.h index 1f2041cf4..262732398 100644 --- a/include/PluginBrowser.h +++ b/include/PluginBrowser.h @@ -22,8 +22,8 @@ * */ -#ifndef PLUGIN_BROWSER_H -#define PLUGIN_BROWSER_H +#ifndef LMMS_GUI_PLUGIN_BROWSER_H +#define LMMS_GUI_PLUGIN_BROWSER_H #include @@ -56,8 +56,6 @@ private: }; - - class PluginDescWidget : public QWidget { Q_OBJECT diff --git a/include/PluginFactory.h b/include/PluginFactory.h index 8b8b88b6e..8ea020073 100644 --- a/include/PluginFactory.h +++ b/include/PluginFactory.h @@ -22,8 +22,8 @@ * */ -#ifndef PLUGINFACTORY_H -#define PLUGINFACTORY_H +#ifndef LMMS_PLUGIN_FACTORY_H +#define LMMS_PLUGIN_FACTORY_H #include #include @@ -111,4 +111,4 @@ LMMS_EXPORT PluginFactory* getPluginFactory(); } // namespace lmms -#endif // PLUGINFACTORY_H +#endif diff --git a/include/PluginIssue.h b/include/PluginIssue.h index f0fa275f3..c3f3e5dbe 100644 --- a/include/PluginIssue.h +++ b/include/PluginIssue.h @@ -22,13 +22,12 @@ * */ -#ifndef PLUGINISSUE_H -#define PLUGINISSUE_H +#ifndef LMMS_PLUGIN_ISSUE_H +#define LMMS_PLUGIN_ISSUE_H #include #include - namespace lmms { @@ -86,4 +85,4 @@ QDebug operator<<(QDebug stream, const PluginIssue& iss); } // namespace lmms -#endif // PLUGINISSUE_H +#endif diff --git a/include/PluginView.h b/include/PluginView.h index 2c06b9ba2..75576a8c8 100644 --- a/include/PluginView.h +++ b/include/PluginView.h @@ -22,8 +22,8 @@ * */ -#ifndef PLUGIN_VIEW_H -#define PLUGIN_VIEW_H +#ifndef LMMS_GUI_PLUGIN_VIEW_H +#define LMMS_GUI_PLUGIN_VIEW_H #include diff --git a/include/PositionLine.h b/include/PositionLine.h index cc1313e57..8c1d7d60a 100644 --- a/include/PositionLine.h +++ b/include/PositionLine.h @@ -23,8 +23,8 @@ * */ -#ifndef POSITION_LINE_H -#define POSITION_LINE_H +#ifndef LMMS_GUI_POSITION_LINE_H +#define LMMS_GUI_POSITION_LINE_H #include diff --git a/include/PresetPreviewPlayHandle.h b/include/PresetPreviewPlayHandle.h index dfff0fc21..e37e976e0 100644 --- a/include/PresetPreviewPlayHandle.h +++ b/include/PresetPreviewPlayHandle.h @@ -23,8 +23,8 @@ * */ -#ifndef PRESET_PREVIEW_PLAY_HANDLE_H -#define PRESET_PREVIEW_PLAY_HANDLE_H +#ifndef LMMS_PRESET_PREVIEW_PLAY_HANDLE_H +#define LMMS_PRESET_PREVIEW_PLAY_HANDLE_H #include "NotePlayHandle.h" diff --git a/include/ProjectJournal.h b/include/ProjectJournal.h index 31a61755d..655d64a17 100644 --- a/include/ProjectJournal.h +++ b/include/ProjectJournal.h @@ -22,8 +22,8 @@ * */ -#ifndef PROJECT_JOURNAL_H -#define PROJECT_JOURNAL_H +#ifndef LMMS_PROJECT_JOURNAL_H +#define LMMS_PROJECT_JOURNAL_H #include #include @@ -127,4 +127,3 @@ private: } // namespace lmms #endif - diff --git a/include/ProjectNotes.h b/include/ProjectNotes.h index 4b9476616..51577f0b2 100644 --- a/include/ProjectNotes.h +++ b/include/ProjectNotes.h @@ -22,9 +22,8 @@ * */ - -#ifndef PROJECT_NOTES_H -#define PROJECT_NOTES_H +#ifndef LMMS_GUI_PROJECT_NOTES_H +#define LMMS_GUI_PROJECT_NOTES_H #include diff --git a/include/ProjectRenderer.h b/include/ProjectRenderer.h index 2ca20569b..d9309d3db 100644 --- a/include/ProjectRenderer.h +++ b/include/ProjectRenderer.h @@ -22,8 +22,8 @@ * */ -#ifndef PROJECT_RENDERER_H -#define PROJECT_RENDERER_H +#ifndef LMMS_PROJECT_RENDERER_H +#define LMMS_PROJECT_RENDERER_H #include "AudioFileDevice.h" #include "lmmsconfig.h" diff --git a/include/ProjectVersion.h b/include/ProjectVersion.h index 5be259c97..5401e7126 100644 --- a/include/ProjectVersion.h +++ b/include/ProjectVersion.h @@ -23,9 +23,8 @@ * */ - -#ifndef PROJECT_VERSION_H -#define PROJECT_VERSION_H +#ifndef LMMS_PROJECT_VERSION_H +#define LMMS_PROJECT_VERSION_H #include #include diff --git a/include/QuadratureLfo.h b/include/QuadratureLfo.h index 42d4d32c0..59ff81ba7 100644 --- a/include/QuadratureLfo.h +++ b/include/QuadratureLfo.h @@ -22,8 +22,8 @@ * */ -#ifndef QUADRATURELFO_H -#define QUADRATURELFO_H +#ifndef LMMS_QUADRATURE_LFO_H +#define LMMS_QUADRATURE_LFO_H #include "lmms_math.h" @@ -100,4 +100,4 @@ private: } // namespace lmms -#endif // QUADRATURELFO_H +#endif diff --git a/include/RaiiHelpers.h b/include/RaiiHelpers.h index 0cfa2c4ac..827cc955d 100644 --- a/include/RaiiHelpers.h +++ b/include/RaiiHelpers.h @@ -19,10 +19,11 @@ * License along with this program (see COPYING); if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. + * */ -#ifndef RAII_HELPERS_H -#define RAII_HELPERS_H +#ifndef LMMS_RAII_HELPERS_H +#define LMMS_RAII_HELPERS_H #include #include @@ -63,4 +64,4 @@ using UniqueNullableResource = std::unique_ptr @@ -45,4 +45,4 @@ private slots: } // namespace lmms::gui -#endif // RECENTPROJECTSMENU_H +#endif diff --git a/include/RemotePlugin.h b/include/RemotePlugin.h index 96c910d5d..af15d7d14 100644 --- a/include/RemotePlugin.h +++ b/include/RemotePlugin.h @@ -22,8 +22,8 @@ * */ -#ifndef REMOTE_PLUGIN_H -#define REMOTE_PLUGIN_H +#ifndef LMMS_REMOTE_PLUGIN_H +#define LMMS_REMOTE_PLUGIN_H #include "RemotePluginBase.h" #include "SharedMemory.h" @@ -197,4 +197,4 @@ LMMS_EXPORT inline std::string QSTR_TO_STDSTR(QString const& qstr) } // namespace lmms -#endif // REMOTE_PLUGIN_H +#endif diff --git a/include/RemotePluginBase.h b/include/RemotePluginBase.h index e309496bc..2c5e5054e 100644 --- a/include/RemotePluginBase.h +++ b/include/RemotePluginBase.h @@ -22,8 +22,8 @@ * */ -#ifndef REMOTE_PLUGIN_BASE_H -#define REMOTE_PLUGIN_BASE_H +#ifndef LMMS_REMOTE_PLUGIN_BASE_H +#define LMMS_REMOTE_PLUGIN_BASE_H #include "MidiEvent.h" @@ -673,4 +673,4 @@ private: } // namespace lmms -#endif // REMOTE_PLUGIN_BASE_H +#endif diff --git a/include/RemotePluginClient.h b/include/RemotePluginClient.h index 4c5fcc060..38c311129 100644 --- a/include/RemotePluginClient.h +++ b/include/RemotePluginClient.h @@ -22,8 +22,8 @@ * */ -#ifndef REMOTE_PLUGIN_CLIENT_H -#define REMOTE_PLUGIN_CLIENT_H +#ifndef LMMS_REMOTE_PLUGIN_CLIENT_H +#define LMMS_REMOTE_PLUGIN_CLIENT_H #include "RemotePluginBase.h" @@ -355,4 +355,4 @@ void RemotePluginClient::doProcessing() } // namespace lmms -#endif // REMOTE_PLUGIN_CLIENT_H +#endif diff --git a/include/RenameDialog.h b/include/RenameDialog.h index b543963d7..e7e5b662f 100644 --- a/include/RenameDialog.h +++ b/include/RenameDialog.h @@ -23,13 +23,11 @@ * */ - -#ifndef RENAME_DIALOG_H -#define RENAME_DIALOG_H +#ifndef LMMS_GUI_RENAME_DIALOG_H +#define LMMS_GUI_RENAME_DIALOG_H #include - class QLineEdit; namespace lmms::gui diff --git a/include/RenderManager.h b/include/RenderManager.h index 9ec4c511e..0787db6d7 100644 --- a/include/RenderManager.h +++ b/include/RenderManager.h @@ -23,8 +23,8 @@ * */ -#ifndef RENDER_MANAGER_H -#define RENDER_MANAGER_H +#ifndef LMMS_RENDER_MANAGER_H +#define LMMS_RENDER_MANAGER_H #include diff --git a/include/RingBuffer.h b/include/RingBuffer.h index c7db6b4e5..17f06fc00 100644 --- a/include/RingBuffer.h +++ b/include/RingBuffer.h @@ -23,9 +23,8 @@ * */ - -#ifndef RINGBUFFER_H -#define RINGBUFFER_H +#ifndef LMMS_RING_BUFFER_H +#define LMMS_RING_BUFFER_H #include #include diff --git a/include/RmsHelper.h b/include/RmsHelper.h index 19b7da89c..1d739ee0b 100644 --- a/include/RmsHelper.h +++ b/include/RmsHelper.h @@ -23,8 +23,8 @@ * */ -#ifndef RMS_HELPER_H -#define RMS_HELPER_H +#ifndef LMMS_RMS_HELPER_H +#define LMMS_RMS_HELPER_H #include "lmms_math.h" diff --git a/include/RowTableView.h b/include/RowTableView.h index 9934dbade..04272026e 100644 --- a/include/RowTableView.h +++ b/include/RowTableView.h @@ -22,8 +22,8 @@ * */ -#ifndef ROW_TABLE_VIEW_H -#define ROW_TABLE_VIEW_H +#ifndef LMMS_GUI_ROW_TABLE_VIEW_H +#define LMMS_GUI_ROW_TABLE_VIEW_H #include diff --git a/include/Rubberband.h b/include/Rubberband.h index d35233b4f..4805d1d31 100644 --- a/include/Rubberband.h +++ b/include/Rubberband.h @@ -23,9 +23,8 @@ * */ - -#ifndef RUBBERBAND_H -#define RUBBERBAND_H +#ifndef LMMS_GUI_RUBBERBAND_H +#define LMMS_GUI_RUBBERBAND_H #include #include @@ -95,4 +94,3 @@ private: } // namespace lmms::gui #endif - diff --git a/include/SampleBuffer.h b/include/SampleBuffer.h index f4d67859e..3fac28168 100644 --- a/include/SampleBuffer.h +++ b/include/SampleBuffer.h @@ -22,9 +22,8 @@ * */ - -#ifndef SAMPLE_BUFFER_H -#define SAMPLE_BUFFER_H +#ifndef LMMS_SAMPLE_BUFFER_H +#define LMMS_SAMPLE_BUFFER_H #include #include diff --git a/include/SampleClip.h b/include/SampleClip.h index 51225ded8..427a2bf8b 100644 --- a/include/SampleClip.h +++ b/include/SampleClip.h @@ -21,9 +21,9 @@ * Boston, MA 02110-1301 USA. * */ - -#ifndef SAMPLE_CLIP_H -#define SAMPLE_CLIP_H + +#ifndef LMMS_SAMPLE_CLIP_H +#define LMMS_SAMPLE_CLIP_H #include "Clip.h" diff --git a/include/SampleClipView.h b/include/SampleClipView.h index 74873dca7..7f09ec022 100644 --- a/include/SampleClipView.h +++ b/include/SampleClipView.h @@ -22,13 +22,11 @@ * */ -#ifndef SAMPLE_CLIP_VIEW_H -#define SAMPLE_CLIP_VIEW_H +#ifndef LMMS_GUI_SAMPLE_CLIP_VIEW_H +#define LMMS_GUI_SAMPLE_CLIP_VIEW_H #include "ClipView.h" - - namespace lmms { diff --git a/include/SamplePlayHandle.h b/include/SamplePlayHandle.h index 69ee3b38d..c0ff656db 100644 --- a/include/SamplePlayHandle.h +++ b/include/SamplePlayHandle.h @@ -23,8 +23,8 @@ * */ -#ifndef SAMPLE_PLAY_HANDLE_H -#define SAMPLE_PLAY_HANDLE_H +#ifndef LMMS_SAMPLE_PLAY_HANDLE_H +#define LMMS_SAMPLE_PLAY_HANDLE_H #include "SampleBuffer.h" #include "AutomatableModel.h" diff --git a/include/SampleRecordHandle.h b/include/SampleRecordHandle.h index 5b23f5345..deb415537 100644 --- a/include/SampleRecordHandle.h +++ b/include/SampleRecordHandle.h @@ -22,9 +22,8 @@ * */ - -#ifndef SAMPLE_RECORD_HANDLE_H -#define SAMPLE_RECORD_HANDLE_H +#ifndef LMMS_SAMPLE_RECORD_HANDLE_H +#define LMMS_SAMPLE_RECORD_HANDLE_H #include #include diff --git a/include/SampleTrack.h b/include/SampleTrack.h index 8f424178a..94d1413b7 100644 --- a/include/SampleTrack.h +++ b/include/SampleTrack.h @@ -22,9 +22,8 @@ * */ -#ifndef SAMPLE_TRACK_H -#define SAMPLE_TRACK_H - +#ifndef LMMS_SAMPLE_TRACK_H +#define LMMS_SAMPLE_TRACK_H #include "AudioPort.h" #include "Track.h" @@ -110,4 +109,4 @@ private: } // namespace lmms -#endif \ No newline at end of file +#endif diff --git a/include/SampleTrackView.h b/include/SampleTrackView.h index 9921aa735..12f95bd19 100644 --- a/include/SampleTrackView.h +++ b/include/SampleTrackView.h @@ -22,8 +22,8 @@ * */ -#ifndef SAMPLE_TRACK_VIEW_H -#define SAMPLE_TRACK_VIEW_H +#ifndef LMMS_GUI_SAMPLE_TRACK_VIEW_H +#define LMMS_GUI_SAMPLE_TRACK_VIEW_H #include "TrackView.h" @@ -109,4 +109,4 @@ private: } // namespace lmms -#endif \ No newline at end of file +#endif diff --git a/include/SampleTrackWindow.h b/include/SampleTrackWindow.h index d302b2c44..02d5cacb0 100644 --- a/include/SampleTrackWindow.h +++ b/include/SampleTrackWindow.h @@ -21,12 +21,9 @@ * Boston, MA 02110-1301 USA. * */ - - -#ifndef SAMPLE_TRACK_WINDOW_H -#define SAMPLE_TRACK_WINDOW_H - +#ifndef LMMS_GUI_SAMPLE_TRACK_WINDOW_H +#define LMMS_GUI_SAMPLE_TRACK_WINDOW_H #include @@ -43,7 +40,7 @@ class EffectRackView; class Knob; class MixerLineLcdSpinBox; class SampleTrackView; - + class SampleTrackWindow : public QWidget, public ModelView, public SerializingObjectHook { diff --git a/include/Scale.h b/include/Scale.h index 96159a53c..e36a5e08d 100644 --- a/include/Scale.h +++ b/include/Scale.h @@ -22,8 +22,8 @@ * */ -#ifndef SCALE_H -#define SCALE_H +#ifndef LMMS_SCALE_H +#define LMMS_SCALE_H #include #include diff --git a/include/SendButtonIndicator.h b/include/SendButtonIndicator.h index ec4a90db3..78fe23852 100644 --- a/include/SendButtonIndicator.h +++ b/include/SendButtonIndicator.h @@ -21,8 +21,9 @@ * Boston, MA 02110-1301 USA. * */ -#ifndef SENDBUTTONINDICATOR_H -#define SENDBUTTONINDICATOR_H + +#ifndef LMMS_GUI_SEND_BUTTON_INDICATOR_H +#define LMMS_GUI_SEND_BUTTON_INDICATOR_H #include @@ -63,4 +64,4 @@ private: } // namespace lmms -#endif // SENDBUTTONINDICATOR_H +#endif diff --git a/include/SerializingObject.h b/include/SerializingObject.h index e32d5d046..bbbbaafcc 100644 --- a/include/SerializingObject.h +++ b/include/SerializingObject.h @@ -22,8 +22,8 @@ * */ -#ifndef SERIALIZING_OBJECT_H -#define SERIALIZING_OBJECT_H +#ifndef LMMS_SERIALIZING_OBJECT_H +#define LMMS_SERIALIZING_OBJECT_H #include @@ -102,4 +102,3 @@ private: } // namespace lmms #endif - diff --git a/include/SetupDialog.h b/include/SetupDialog.h index 8973938bf..962804a9c 100644 --- a/include/SetupDialog.h +++ b/include/SetupDialog.h @@ -22,9 +22,8 @@ * */ - -#ifndef SETUP_DIALOG_H -#define SETUP_DIALOG_H +#ifndef LMMS_GUI_SETUP_DIALOG_H +#define LMMS_GUI_SETUP_DIALOG_H #include #include diff --git a/include/SharedMemory.h b/include/SharedMemory.h index 32a40ff25..0a6d3bf89 100644 --- a/include/SharedMemory.h +++ b/include/SharedMemory.h @@ -19,10 +19,11 @@ * License along with this program (see COPYING); if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. + * */ -#ifndef SHARED_MEMORY_H -#define SHARED_MEMORY_H +#ifndef LMMS_SHARED_MEMORY_H +#define LMMS_SHARED_MEMORY_H #include #include @@ -148,4 +149,4 @@ private: } // namespace lmms -#endif // SHARED_MEMORY_H +#endif diff --git a/include/SideBar.h b/include/SideBar.h index 8755c660a..0ca597b5a 100644 --- a/include/SideBar.h +++ b/include/SideBar.h @@ -22,8 +22,8 @@ * */ -#ifndef SIDE_BAR_H -#define SIDE_BAR_H +#ifndef LMMS_GUI_SIDE_BAR_H +#define LMMS_GUI_SIDE_BAR_H #include #include diff --git a/include/SideBarWidget.h b/include/SideBarWidget.h index 5df3ccb7a..2d7cce15a 100644 --- a/include/SideBarWidget.h +++ b/include/SideBarWidget.h @@ -22,8 +22,8 @@ * */ -#ifndef SIDE_BAR_WIDGET_H -#define SIDE_BAR_WIDGET_H +#ifndef LMMS_GUI_SIDE_BAR_WIDGET_H +#define LMMS_GUI_SIDE_BAR_WIDGET_H #include #include diff --git a/include/Song.h b/include/Song.h index 569b3ad14..2e4736ea5 100644 --- a/include/Song.h +++ b/include/Song.h @@ -22,8 +22,8 @@ * */ -#ifndef SONG_H -#define SONG_H +#ifndef LMMS_SONG_H +#define LMMS_SONG_H #include diff --git a/include/SongEditor.h b/include/SongEditor.h index ea57cc125..ab71b7fa7 100644 --- a/include/SongEditor.h +++ b/include/SongEditor.h @@ -23,10 +23,8 @@ * */ - -#ifndef SONG_EDITOR_H -#define SONG_EDITOR_H - +#ifndef LMMS_GUI_SONG_EDITOR_H +#define LMMS_GUI_SONG_EDITOR_H #include "Editor.h" #include "TrackContainerView.h" diff --git a/include/StepRecorder.h b/include/StepRecorder.h index b89fadb15..7cd568a79 100644 --- a/include/StepRecorder.h +++ b/include/StepRecorder.h @@ -18,8 +18,8 @@ * */ -#ifndef STEP_RECORDER_H -#define STEP_RECORDER_H +#ifndef LMMS_STEP_RECORDER_H +#define LMMS_STEP_RECORDER_H #include #include @@ -152,4 +152,4 @@ class StepRecorder : public QObject } // namespace lmms -#endif //STEP_RECORDER_H +#endif diff --git a/include/StepRecorderWidget.h b/include/StepRecorderWidget.h index 4067b0001..ec6a37330 100644 --- a/include/StepRecorderWidget.h +++ b/include/StepRecorderWidget.h @@ -19,9 +19,9 @@ * Boston, MA 02110-1301 USA. * */ -#ifndef STEP_RECOREDER_WIDGET_H -#define STEP_RECOREDER_WIDGET_H +#ifndef LMMS_GUI_STEP_RECOREDER_WIDGET_H +#define LMMS_GUI_STEP_RECOREDER_WIDGET_H #include #include @@ -95,4 +95,4 @@ signals: } // namespace lmms::gui -#endif //STEP_RECOREDER_WIDGET_H +#endif diff --git a/include/StringPairDrag.h b/include/StringPairDrag.h index e58b88f90..4763122be 100644 --- a/include/StringPairDrag.h +++ b/include/StringPairDrag.h @@ -23,8 +23,8 @@ * */ -#ifndef STRING_PAIR_DRAG_H -#define STRING_PAIR_DRAG_H +#ifndef LMMS_GUI_STRING_PAIR_DRAG_H +#define LMMS_GUI_STRING_PAIR_DRAG_H #include #include diff --git a/include/SubWindow.h b/include/SubWindow.h index 3c73a9dde..95bd6c59e 100644 --- a/include/SubWindow.h +++ b/include/SubWindow.h @@ -23,8 +23,9 @@ * Boston, MA 02110-1301 USA. * */ -#ifndef SUBWINDOW_H -#define SUBWINDOW_H + +#ifndef LMMS_GUI_SUBWINDOW_H +#define LMMS_GUI_SUBWINDOW_H #include #include diff --git a/include/SweepOscillator.h b/include/SweepOscillator.h index f113ea0fa..3463851c4 100644 --- a/include/SweepOscillator.h +++ b/include/SweepOscillator.h @@ -22,8 +22,8 @@ * */ -#ifndef SWEEP_OSCILLATOR_H -#define SWEEP_OSCILLATOR_H +#ifndef LMMS_SWEEP_OSCILLATOR_H +#define LMMS_SWEEP_OSCILLATOR_H #include "Oscillator.h" #include "DspEffectLibrary.h" diff --git a/include/TabBar.h b/include/TabBar.h index 2395e15f5..b8334c1f5 100644 --- a/include/TabBar.h +++ b/include/TabBar.h @@ -22,9 +22,8 @@ * */ - -#ifndef TAB_BAR_H -#define TAB_BAR_H +#ifndef LMMS_GUI_TAB_BAR_H +#define LMMS_GUI_TAB_BAR_H #include #include diff --git a/include/TabButton.h b/include/TabButton.h index 938230a91..c09d1ed8a 100644 --- a/include/TabButton.h +++ b/include/TabButton.h @@ -22,9 +22,8 @@ * */ - -#ifndef TAB_BUTTON_H -#define TAB_BUTTON_H +#ifndef LMMS_GUI_TAB_BUTTON_H +#define LMMS_GUI_TAB_BUTTON_H #include diff --git a/include/TabWidget.h b/include/TabWidget.h index 27a35d2a8..942b08738 100644 --- a/include/TabWidget.h +++ b/include/TabWidget.h @@ -22,9 +22,8 @@ * */ - -#ifndef TAB_WIDGET_H -#define TAB_WIDGET_H +#ifndef LMMS_GUI_TAB_WIDGET_H +#define LMMS_GUI_TAB_WIDGET_H #include #include diff --git a/include/TemplatesMenu.h b/include/TemplatesMenu.h index 7f425bd2f..660d3c760 100644 --- a/include/TemplatesMenu.h +++ b/include/TemplatesMenu.h @@ -21,8 +21,9 @@ * Boston, MA 02110-1301 USA. * */ -#ifndef TEMPLATESMENU_H -#define TEMPLATESMENU_H + +#ifndef LMMS_GUI_TEMPLATES_MENU_H +#define LMMS_GUI_TEMPLATES_MENU_H #include #include @@ -49,4 +50,4 @@ private slots: } // namespace lmms::gui -#endif // TEMPLATESMENU_H +#endif diff --git a/include/TempoSyncKnob.h b/include/TempoSyncKnob.h index 25a3b7e3b..0987e1903 100644 --- a/include/TempoSyncKnob.h +++ b/include/TempoSyncKnob.h @@ -23,8 +23,8 @@ * */ -#ifndef TEMPO_SYNC_KNOB_H -#define TEMPO_SYNC_KNOB_H +#ifndef LMMS_GUI_TEMPO_SYNC_KNOB_H +#define LMMS_GUI_TEMPO_SYNC_KNOB_H #include #include diff --git a/include/TempoSyncKnobModel.h b/include/TempoSyncKnobModel.h index 1a18486ff..7b1a10b5e 100644 --- a/include/TempoSyncKnobModel.h +++ b/include/TempoSyncKnobModel.h @@ -23,8 +23,8 @@ * */ -#ifndef TEMPO_SYNC_KNOB_MODEL_H -#define TEMPO_SYNC_KNOB_MODEL_H +#ifndef LMMS_TEMPO_SYNC_KNOB_MODEL_H +#define LMMS_TEMPO_SYNC_KNOB_MODEL_H #include "MeterModel.h" diff --git a/include/TextFloat.h b/include/TextFloat.h index 9fdabc06b..7ba38d141 100644 --- a/include/TextFloat.h +++ b/include/TextFloat.h @@ -22,9 +22,8 @@ * */ - -#ifndef TEXT_FLOAT_H -#define TEXT_FLOAT_H +#ifndef LMMS_GUI_TEXT_FLOAT_H +#define LMMS_GUI_TEXT_FLOAT_H #include #include diff --git a/include/ThreadableJob.h b/include/ThreadableJob.h index 8e714ae19..efb4b3dc7 100644 --- a/include/ThreadableJob.h +++ b/include/ThreadableJob.h @@ -22,8 +22,8 @@ * */ -#ifndef THREADABLE_JOB_H -#define THREADABLE_JOB_H +#ifndef LMMS_THREADABLE_JOB_H +#define LMMS_THREADABLE_JOB_H #include "lmms_basics.h" diff --git a/include/TimeDisplayWidget.h b/include/TimeDisplayWidget.h index 894666970..269c24978 100644 --- a/include/TimeDisplayWidget.h +++ b/include/TimeDisplayWidget.h @@ -23,8 +23,8 @@ * */ -#ifndef TIME_DISPLAY_WIDGET_H -#define TIME_DISPLAY_WIDGET_H +#ifndef LMMS_GUI_TIME_DISPLAY_WIDGET_H +#define LMMS_GUI_TIME_DISPLAY_WIDGET_H #include #include @@ -71,4 +71,4 @@ private: } // namespace lmms::gui -#endif // TIME_DISPLAY_WIDGET_H +#endif diff --git a/include/TimeLineWidget.h b/include/TimeLineWidget.h index bada25640..882e9453c 100644 --- a/include/TimeLineWidget.h +++ b/include/TimeLineWidget.h @@ -22,9 +22,8 @@ * */ - -#ifndef TIMELINE_H -#define TIMELINE_H +#ifndef LMMS_GUI_TIMELINE_WIDGET_H +#define LMMS_GUI_TIMELINE_WIDGET_H #include diff --git a/include/TimePos.h b/include/TimePos.h index 808eede25..61769de35 100644 --- a/include/TimePos.h +++ b/include/TimePos.h @@ -23,10 +23,8 @@ * */ - -#ifndef TIME_POS_H -#define TIME_POS_H - +#ifndef LMMS_TIME_POS_H +#define LMMS_TIME_POS_H #include "lmms_export.h" #include "lmms_basics.h" diff --git a/include/ToolButton.h b/include/ToolButton.h index c173a9052..aeb88a7e5 100644 --- a/include/ToolButton.h +++ b/include/ToolButton.h @@ -22,9 +22,8 @@ * */ - -#ifndef TOOL_BUTTON_H -#define TOOL_BUTTON_H +#ifndef LMMS_GUI_TOOL_BUTTON_H +#define LMMS_GUI_TOOL_BUTTON_H #include @@ -50,4 +49,3 @@ public: } // namespace lmms::gui #endif - diff --git a/include/ToolPlugin.h b/include/ToolPlugin.h index 38f4d87b1..4d7107582 100644 --- a/include/ToolPlugin.h +++ b/include/ToolPlugin.h @@ -24,8 +24,8 @@ * */ -#ifndef TOOL_PLUGIN_H -#define TOOL_PLUGIN_H +#ifndef LMMS_TOOL_PLUGIN_H +#define LMMS_TOOL_PLUGIN_H #include "Plugin.h" diff --git a/include/ToolPluginView.h b/include/ToolPluginView.h index 0b702fd1b..201a4b165 100644 --- a/include/ToolPluginView.h +++ b/include/ToolPluginView.h @@ -23,8 +23,8 @@ * */ -#ifndef TOOL_PLUGIN_VIEW_H -#define TOOL_PLUGIN_VIEW_H +#ifndef LMMS_GUI_TOOL_PLUGIN_VIEW_H +#define LMMS_GUI_TOOL_PLUGIN_VIEW_H #include "PluginView.h" diff --git a/include/Track.h b/include/Track.h index 8d756c914..555850f88 100644 --- a/include/Track.h +++ b/include/Track.h @@ -22,8 +22,8 @@ * */ -#ifndef TRACK_H -#define TRACK_H +#ifndef LMMS_TRACK_H +#define LMMS_TRACK_H #include diff --git a/include/TrackContainer.h b/include/TrackContainer.h index d947094f7..d0c116f3a 100644 --- a/include/TrackContainer.h +++ b/include/TrackContainer.h @@ -23,8 +23,8 @@ * */ -#ifndef TRACK_CONTAINER_H -#define TRACK_CONTAINER_H +#ifndef LMMS_TRACK_CONTAINER_H +#define LMMS_TRACK_CONTAINER_H #include diff --git a/include/TrackContainerView.h b/include/TrackContainerView.h index 444420d98..df61666b8 100644 --- a/include/TrackContainerView.h +++ b/include/TrackContainerView.h @@ -22,9 +22,8 @@ * */ - -#ifndef TRACK_CONTAINER_VIEW_H -#define TRACK_CONTAINER_VIEW_H +#ifndef LMMS_GUI_TRACK_CONTAINER_VIEW_H +#define LMMS_GUI_TRACK_CONTAINER_VIEW_H #include #include diff --git a/include/TrackContentWidget.h b/include/TrackContentWidget.h index f4a44d2a6..09239b392 100644 --- a/include/TrackContentWidget.h +++ b/include/TrackContentWidget.h @@ -22,8 +22,8 @@ * */ -#ifndef TRACK_CONTENT_WIDGET_H -#define TRACK_CONTENT_WIDGET_H +#ifndef LMMS_GUI_TRACK_CONTENT_WIDGET_H +#define LMMS_GUI_TRACK_CONTENT_WIDGET_H #include diff --git a/include/TrackLabelButton.h b/include/TrackLabelButton.h index 1a8d05e71..e7f159798 100644 --- a/include/TrackLabelButton.h +++ b/include/TrackLabelButton.h @@ -22,9 +22,8 @@ * */ - -#ifndef TRACK_LABEL_BUTTON_H -#define TRACK_LABEL_BUTTON_H +#ifndef LMMS_GUI_TRACK_LABEL_BUTTON_H +#define LMMS_GUI_TRACK_LABEL_BUTTON_H #include diff --git a/include/TrackOperationsWidget.h b/include/TrackOperationsWidget.h index edd9796ac..39e59ac98 100644 --- a/include/TrackOperationsWidget.h +++ b/include/TrackOperationsWidget.h @@ -22,8 +22,8 @@ * */ -#ifndef TRACK_OPERATIONS_WIDGET_H -#define TRACK_OPERATIONS_WIDGET_H +#ifndef LMMS_GUI_TRACK_OPERATIONS_WIDGET_H +#define LMMS_GUI_TRACK_OPERATIONS_WIDGET_H #include diff --git a/include/TrackRenameLineEdit.h b/include/TrackRenameLineEdit.h index 4b13ff9b7..48fb96092 100644 --- a/include/TrackRenameLineEdit.h +++ b/include/TrackRenameLineEdit.h @@ -23,9 +23,8 @@ * */ - -#ifndef TRACK_RENAME_LINE_EDIT_H -#define TRACK_RENAME_LINE_EDIT_H +#ifndef LMMS_GUI_TRACK_RENAME_LINE_EDIT_H +#define LMMS_GUI_TRACK_RENAME_LINE_EDIT_H #include diff --git a/include/TrackView.h b/include/TrackView.h index 4b02c8015..a46c15d75 100644 --- a/include/TrackView.h +++ b/include/TrackView.h @@ -22,10 +22,8 @@ * */ - - -#ifndef TRACK_VIEW_H -#define TRACK_VIEW_H +#ifndef LMMS_GUI_TRACK_VIEW_H +#define LMMS_GUI_TRACK_VIEW_H #include @@ -34,7 +32,6 @@ #include "TrackContentWidget.h" #include "TrackOperationsWidget.h" - class QMenu; namespace lmms diff --git a/include/ValueBuffer.h b/include/ValueBuffer.h index 950ad06f0..9e80b7ead 100644 --- a/include/ValueBuffer.h +++ b/include/ValueBuffer.h @@ -23,8 +23,8 @@ * */ -#ifndef VALUE_BUFFER_H -#define VALUE_BUFFER_H +#ifndef LMMS_VALUE_BUFFER_H +#define LMMS_VALUE_BUFFER_H #include diff --git a/include/VersionedSaveDialog.h b/include/VersionedSaveDialog.h index 79ab516b0..326b11fde 100644 --- a/include/VersionedSaveDialog.h +++ b/include/VersionedSaveDialog.h @@ -24,9 +24,8 @@ * */ - -#ifndef VERSIONEDSAVEDIALOG_H -#define VERSIONEDSAVEDIALOG_H +#ifndef LMMS_GUI_VERSIONED_SAVE_DIALOG_H +#define LMMS_GUI_VERSIONED_SAVE_DIALOG_H #include "FileDialog.h" #include "Song.h" @@ -69,4 +68,4 @@ public slots: } // namespace lmms::gui -#endif // VERSIONEDSAVEDIALOG_H +#endif diff --git a/include/VstSyncController.h b/include/VstSyncController.h index c70bc85c8..f63bafc41 100644 --- a/include/VstSyncController.h +++ b/include/VstSyncController.h @@ -23,8 +23,8 @@ * */ -#ifndef VST_SYNC_CONTROLLER_H -#define VST_SYNC_CONTROLLER_H +#ifndef LMMS_VST_SYNC_CONTROLLER_H +#define LMMS_VST_SYNC_CONTROLLER_H #include diff --git a/include/VstSyncData.h b/include/VstSyncData.h index baf3fa7a8..11da91d8d 100644 --- a/include/VstSyncData.h +++ b/include/VstSyncData.h @@ -23,8 +23,8 @@ * */ -#ifndef VST_SYNC_DATA_H -#define VST_SYNC_DATA_H +#ifndef LMMS_VST_SYNC_DATA_H +#define LMMS_VST_SYNC_DATA_H namespace lmms { diff --git a/include/aeffectx.h b/include/aeffectx.h index a06567ba7..188feae9f 100644 --- a/include/aeffectx.h +++ b/include/aeffectx.h @@ -22,7 +22,6 @@ * */ - #ifndef AEFFECTX_H #define AEFFECTX_H diff --git a/include/base64.h b/include/base64.h index f52d90d13..01116e4cd 100644 --- a/include/base64.h +++ b/include/base64.h @@ -23,8 +23,8 @@ * */ -#ifndef _BASE64_H -#define _BASE64_H +#ifndef LMMS_BASE64_H +#define LMMS_BASE64_H #include #include diff --git a/include/debug.h b/include/debug.h index f2ea29cc1..efabd4522 100644 --- a/include/debug.h +++ b/include/debug.h @@ -22,9 +22,8 @@ * */ - -#ifndef DEBUG_H -#define DEBUG_H +#ifndef LMMS_DEBUG_H +#define LMMS_DEBUG_H #include "lmmsconfig.h" diff --git a/include/denormals.h b/include/denormals.h index e99e767a3..cfb0d5c92 100644 --- a/include/denormals.h +++ b/include/denormals.h @@ -1,8 +1,8 @@ -// Denormals stripping. +// Denormals stripping. // These snippets should be common enough to be considered public domain. -#ifndef DENORMALS_H -#define DENORMALS_H +#ifndef LMMS_DENORMALS_H +#define LMMS_DENORMALS_H #ifdef __SSE__ #include @@ -50,5 +50,4 @@ void inline disable_denormals() } // namespace lmms -#endif // DENORMALS_H - +#endif diff --git a/include/embed.h b/include/embed.h index 03d767b43..b3d1cbc21 100644 --- a/include/embed.h +++ b/include/embed.h @@ -22,8 +22,8 @@ * */ -#ifndef EMBED_H -#define EMBED_H +#ifndef LMMS_EMBED_H +#define LMMS_EMBED_H #include #include diff --git a/include/endian_handling.h b/include/endian_handling.h index b3d122fa3..96bf11704 100644 --- a/include/endian_handling.h +++ b/include/endian_handling.h @@ -22,8 +22,8 @@ * */ -#ifndef ENDIAN_HANDLING_H -#define ENDIAN_HANDLING_H +#ifndef LMMS_ENDIAN_HANDLING_H +#define LMMS_ENDIAN_HANDLING_H #include diff --git a/include/fft_helpers.h b/include/fft_helpers.h index 8ba0fc7a0..ab4238409 100644 --- a/include/fft_helpers.h +++ b/include/fft_helpers.h @@ -23,9 +23,8 @@ * */ - -#ifndef FFT_HELPERS_H -#define FFT_HELPERS_H +#ifndef LMMS_FFT_HELPERS_H +#define LMMS_FFT_HELPERS_H #include "lmms_export.h" diff --git a/include/gui_templates.h b/include/gui_templates.h index ee0ccdbf6..7a61ccfed 100644 --- a/include/gui_templates.h +++ b/include/gui_templates.h @@ -22,9 +22,8 @@ * */ - -#ifndef GUI_TEMPLATES_H -#define GUI_TEMPLATES_H +#ifndef LMMS_GUI_TEMPLATES_H +#define LMMS_GUI_TEMPLATES_H #include "lmmsconfig.h" diff --git a/include/interpolation.h b/include/interpolation.h index 3a74334e4..9f3b3913d 100644 --- a/include/interpolation.h +++ b/include/interpolation.h @@ -22,9 +22,8 @@ * */ - -#ifndef INTERPOLATION_H -#define INTERPOLATION_H +#ifndef LMMS_INTERPOLATION_H +#define LMMS_INTERPOLATION_H #ifndef __USE_XOPEN #define __USE_XOPEN diff --git a/include/lmms_basics.h b/include/lmms_basics.h index 59a6aa359..71cc4ce53 100644 --- a/include/lmms_basics.h +++ b/include/lmms_basics.h @@ -22,9 +22,8 @@ * */ - -#ifndef TYPES_H -#define TYPES_H +#ifndef LMMS_TYPES_H +#define LMMS_TYPES_H #include #include diff --git a/include/lmms_math.h b/include/lmms_math.h index db4502f1c..a010a9d3e 100644 --- a/include/lmms_math.h +++ b/include/lmms_math.h @@ -22,7 +22,6 @@ * */ - #ifndef LMMS_MATH_H #define LMMS_MATH_H diff --git a/include/panning.h b/include/panning.h index 1521ec984..52698677c 100644 --- a/include/panning.h +++ b/include/panning.h @@ -23,8 +23,8 @@ * */ -#ifndef PANNING_H -#define PANNING_H +#ifndef LMMS_PANNING_H +#define LMMS_PANNING_H #include "lmms_basics.h" #include "panning_constants.h" diff --git a/include/panning_constants.h b/include/panning_constants.h index 00a5c3291..6e894e9d8 100644 --- a/include/panning_constants.h +++ b/include/panning_constants.h @@ -23,8 +23,8 @@ * */ -#ifndef PANNING_CONSTANTS_H -#define PANNING_CONSTANTS_H +#ifndef LMMS_PANNING_CONSTANTS_H +#define LMMS_PANNING_CONSTANTS_H namespace lmms { diff --git a/include/shared_object.h b/include/shared_object.h index ac45d6cd7..dfc94b96a 100644 --- a/include/shared_object.h +++ b/include/shared_object.h @@ -23,8 +23,8 @@ * */ -#ifndef SHARED_OBJECT_H -#define SHARED_OBJECT_H +#ifndef LMMS_SHARED_OBJECT_H +#define LMMS_SHARED_OBJECT_H #include diff --git a/include/versioninfo.h b/include/versioninfo.h index 29bf3bea9..de852b59c 100644 --- a/include/versioninfo.h +++ b/include/versioninfo.h @@ -1,5 +1,5 @@ -#ifndef VERSION_INFO_H -#define VERSION_INFO_H +#ifndef LMMS_VERSION_INFO_H +#define LMMS_VERSION_INFO_H #include "lmms_basics.h" diff --git a/include/volume.h b/include/volume.h index 5223bfa09..4d26cc815 100644 --- a/include/volume.h +++ b/include/volume.h @@ -23,8 +23,8 @@ * */ -#ifndef VOLUME_H -#define VOLUME_H +#ifndef LMMS_VOLUME_H +#define LMMS_VOLUME_H #include "lmms_basics.h" From bbf31a2e7384a7ff8eb20c6d7db5169b149a42d7 Mon Sep 17 00:00:00 2001 From: Dalton Messmer Date: Mon, 2 Jan 2023 22:02:12 -0500 Subject: [PATCH 15/70] Add missing copyright statement to MidiCCRackView.h --- include/MidiCCRackView.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/include/MidiCCRackView.h b/include/MidiCCRackView.h index 98f5ce183..ca99a7ce5 100644 --- a/include/MidiCCRackView.h +++ b/include/MidiCCRackView.h @@ -1,3 +1,27 @@ +/* + * MidiCCRackView.h - declaration of the MIDI CC rack widget + * + * Copyright (c) 2020 Ian Caio + * + * This file is part of LMMS - https://lmms.io + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + #ifndef LMMS_GUI_MIDI_CC_RACK_VIEW_H #define LMMS_GUI_MIDI_CC_RACK_VIEW_H From 679d63224a89203280d65e3d8995a931cec519ff Mon Sep 17 00:00:00 2001 From: saker Date: Tue, 3 Jan 2023 18:26:57 -0500 Subject: [PATCH 16/70] Resample SampleBuffer only once when loading from SampleClip (#6594) The SampleBuffer's sample rate in SampleClip was altered twice during SampleClip::loadSettings: first when setSampleFile was called, which set the sample rate of the SampleBuffer to the AudioEngine's sample rate (good), and a second time when calling setSampleRate, which set it to the sample rate specified within the project file (bad). This led to the sample rate of the buffer being different than that of the project, resulting in it being pitched incorrectly on playback. --- src/core/SampleClip.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/SampleClip.cpp b/src/core/SampleClip.cpp index 1d173d78e..6396d49f3 100644 --- a/src/core/SampleClip.cpp +++ b/src/core/SampleClip.cpp @@ -292,15 +292,15 @@ void SampleClip::loadSettings( const QDomElement & _this ) if( sampleFile().isEmpty() && _this.hasAttribute( "data" ) ) { m_sampleBuffer->loadFromBase64( _this.attribute( "data" ) ); + if (_this.hasAttribute("sample_rate")) + { + m_sampleBuffer->setSampleRate(_this.attribute("sample_rate").toInt()); + } } changeLength( _this.attribute( "len" ).toInt() ); setMuted( _this.attribute( "muted" ).toInt() ); setStartTimeOffset( _this.attribute( "off" ).toInt() ); - if ( _this.hasAttribute( "sample_rate" ) ) { - m_sampleBuffer->setSampleRate( _this.attribute( "sample_rate" ).toInt() ); - } - if( _this.hasAttribute( "color" ) ) { useCustomClipColor( true ); From 92522cf3ab82506e31cdbcb961abd82da2e86c9c Mon Sep 17 00:00:00 2001 From: Dalton Messmer Date: Thu, 5 Jan 2023 14:03:07 -0500 Subject: [PATCH 17/70] Add missing copyright statement to CustomTextKnob.h/cpp --- include/CustomTextKnob.h | 25 ++++++++++++++++++++++++- src/gui/widgets/CustomTextKnob.cpp | 24 ++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/include/CustomTextKnob.h b/include/CustomTextKnob.h index 23b7e8b1f..25bba1315 100644 --- a/include/CustomTextKnob.h +++ b/include/CustomTextKnob.h @@ -1,4 +1,27 @@ -/* Text customizable knob */ +/* + * CustomTextKnob.h + * + * Copyright (c) 2020 Ibuki Sugiyama
+ * + * This file is part of LMMS - https://lmms.io + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + #ifndef LMMS_GUI_CUSTOM_TEXT_KNOB_H #define LMMS_GUI_CUSTOM_TEXT_KNOB_H diff --git a/src/gui/widgets/CustomTextKnob.cpp b/src/gui/widgets/CustomTextKnob.cpp index 9f6e19b90..ce880608c 100644 --- a/src/gui/widgets/CustomTextKnob.cpp +++ b/src/gui/widgets/CustomTextKnob.cpp @@ -1,3 +1,27 @@ +/* + * CustomTextKnob.cpp + * + * Copyright (c) 2020 Ibuki Sugiyama
+ * + * This file is part of LMMS - https://lmms.io + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + #include "CustomTextKnob.h" namespace lmms::gui From 2c6d88f799203bc2a21173d597af566ac783f174 Mon Sep 17 00:00:00 2001 From: Dalton Messmer Date: Thu, 5 Jan 2023 17:58:49 -0500 Subject: [PATCH 18/70] Add GUARD_H closing comments --- include/AboutDialog.h | 2 +- include/ActionGroup.h | 2 +- include/AudioAlsa.h | 2 +- include/AudioAlsaSetupWidget.h | 2 +- include/AudioDevice.h | 2 +- include/AudioDeviceSetupWidget.h | 2 +- include/AudioDummy.h | 2 +- include/AudioEngine.h | 2 +- include/AudioEngineProfiler.h | 2 +- include/AudioEngineWorkerThread.h | 2 +- include/AudioFileDevice.h | 2 +- include/AudioFileFlac.h | 2 +- include/AudioFileMP3.h | 2 +- include/AudioFileOgg.h | 2 +- include/AudioFileWave.h | 2 +- include/AudioJack.h | 2 +- include/AudioOss.h | 2 +- include/AudioPort.h | 2 +- include/AudioPortAudio.h | 2 +- include/AudioPulseAudio.h | 2 +- include/AudioSampleRecorder.h | 2 +- include/AudioSdl.h | 2 +- include/AudioSndio.h | 2 +- include/AudioSoundIo.h | 2 +- include/AutomatableButton.h | 2 +- include/AutomatableModel.h | 3 +-- include/AutomatableModelView.h | 3 +-- include/AutomatableSlider.h | 2 +- include/AutomationClip.h | 2 +- include/AutomationClipView.h | 2 +- include/AutomationEditor.h | 2 +- include/AutomationNode.h | 2 +- include/AutomationTrack.h | 2 +- include/AutomationTrackView.h | 2 +- include/BandLimitedWave.h | 7 ++++--- include/BasicFilters.h | 2 +- include/BufferManager.h | 2 +- include/CPULoadWidget.h | 2 +- include/CaptionMenu.h | 2 +- include/Clip.h | 2 +- include/ClipView.h | 2 +- include/Clipboard.h | 2 +- include/ColorChooser.h | 2 +- include/ComboBox.h | 2 +- include/ComboBoxModel.h | 2 +- include/ConfigManager.h | 2 +- include/ControlLayout.h | 2 +- include/Controller.h | 2 +- include/ControllerConnection.h | 2 +- include/ControllerConnectionDialog.h | 2 +- include/ControllerDialog.h | 2 +- include/ControllerRackView.h | 2 +- include/ControllerView.h | 2 +- include/Controls.h | 2 +- include/CustomTextKnob.h | 2 +- include/DataFile.h | 2 +- include/Delay.h | 2 +- include/DeprecationHelper.h | 2 +- include/DetuningHelper.h | 2 +- include/DrumSynth.h | 2 +- include/DspEffectLibrary.h | 3 +-- include/DummyEffect.h | 2 +- include/DummyInstrument.h | 2 +- include/DummyPlugin.h | 2 +- include/Editor.h | 2 +- include/Effect.h | 2 +- include/EffectChain.h | 2 +- include/EffectControlDialog.h | 2 +- include/EffectControls.h | 2 +- include/EffectRackView.h | 2 +- include/EffectSelectDialog.h | 3 +-- include/EffectView.h | 2 +- include/Engine.h | 2 +- include/EnvelopeAndLfoParameters.h | 2 +- include/EnvelopeAndLfoView.h | 2 +- include/ExportFilter.h | 2 +- include/ExportProjectDialog.h | 3 +-- include/FadeButton.h | 2 +- include/Fader.h | 3 +-- include/FifoBuffer.h | 2 +- include/FileBrowser.h | 2 +- include/FileDialog.h | 2 +- include/Graph.h | 2 +- include/GroupBox.h | 3 +-- include/GuiApplication.h | 2 +- include/ImportFilter.h | 2 +- include/InlineAutomation.h | 2 +- include/Instrument.h | 2 +- include/InstrumentFunctionViews.h | 2 +- include/InstrumentFunctions.h | 2 +- include/InstrumentMidiIOView.h | 2 +- include/InstrumentMiscView.h | 2 +- include/InstrumentPlayHandle.h | 2 +- include/InstrumentSoundShaping.h | 2 +- include/InstrumentSoundShapingView.h | 2 +- include/InstrumentTrack.h | 2 +- include/InstrumentTrackView.h | 2 +- include/InstrumentTrackWindow.h | 2 +- include/InstrumentView.h | 2 +- include/IoHelper.h | 2 +- include/JournallingObject.h | 2 +- include/Keymap.h | 2 +- include/Knob.h | 2 +- include/Ladspa2LMMS.h | 2 +- include/LadspaBase.h | 2 +- include/LadspaControl.h | 2 +- include/LadspaControlView.h | 2 +- include/LadspaManager.h | 2 +- include/LcdFloatSpinBox.h | 2 +- include/LcdSpinBox.h | 2 +- include/LcdWidget.h | 2 +- include/LedCheckBox.h | 2 +- include/LeftRightNav.h | 2 +- include/LfoController.h | 2 +- include/LinkedModelGroupViews.h | 6 +++--- include/LinkedModelGroups.h | 6 +++--- include/LmmsPalette.h | 2 +- include/LmmsStyle.h | 2 +- include/LocaleHelper.h | 2 +- include/LocklessAllocator.h | 2 +- include/LocklessList.h | 2 +- include/LocklessRingBuffer.h | 2 +- include/Lv2Basics.h | 2 +- include/Lv2ControlBase.h | 2 +- include/Lv2Evbuf.h | 2 +- include/Lv2Features.h | 2 +- include/Lv2Manager.h | 2 +- include/Lv2Options.h | 2 +- include/Lv2Ports.h | 2 +- include/Lv2Proc.h | 2 +- include/Lv2SubPluginFeatures.h | 2 +- include/Lv2UridCache.h | 2 +- include/Lv2UridMap.h | 2 +- include/Lv2ViewBase.h | 2 +- include/MainApplication.h | 2 +- include/MainWindow.h | 2 +- include/MemoryHelper.h | 2 +- include/MemoryManager.h | 2 +- include/MeterDialog.h | 2 +- include/MeterModel.h | 2 +- include/MicroTimer.h | 2 +- include/Microtuner.h | 2 +- include/MicrotunerConfig.h | 2 +- include/Midi.h | 2 +- include/MidiAlsaRaw.h | 2 +- include/MidiAlsaSeq.h | 2 +- include/MidiApple.h | 2 +- include/MidiCCRackView.h | 2 +- include/MidiClient.h | 2 +- include/MidiClip.h | 2 +- include/MidiClipView.h | 2 +- include/MidiController.h | 2 +- include/MidiDummy.h | 2 +- include/MidiEvent.h | 2 +- include/MidiEventProcessor.h | 2 +- include/MidiEventToByteSeq.h | 2 +- include/MidiJack.h | 2 +- include/MidiOss.h | 2 +- include/MidiPort.h | 2 +- include/MidiPortMenu.h | 2 +- include/MidiSetupWidget.h | 2 +- include/MidiSndio.h | 2 +- include/MidiWinMM.h | 2 +- include/MixHelpers.h | 2 +- include/Mixer.h | 2 +- include/MixerLine.h | 2 +- include/MixerLineLcdSpinBox.h | 2 +- include/MixerView.h | 2 +- include/Model.h | 2 +- include/ModelView.h | 2 +- include/ModelVisitor.h | 2 +- include/NStateButton.h | 2 +- include/Note.h | 2 +- include/NotePlayHandle.h | 2 +- include/Oscillator.h | 2 +- include/OscillatorConstants.h | 2 +- include/Oscilloscope.h | 2 +- include/OutputSettings.h | 2 +- include/PathUtil.h | 2 +- include/PatternClip.h | 2 +- include/PatternClipView.h | 2 +- include/PatternEditor.h | 2 +- include/PatternStore.h | 2 +- include/PatternTrack.h | 2 +- include/PatternTrackView.h | 2 +- include/PeakController.h | 2 +- include/PerfLog.h | 2 +- include/Piano.h | 2 +- include/PianoRoll.h | 2 +- include/PianoView.h | 2 +- include/Pitch.h | 2 +- include/PixmapButton.h | 2 +- include/PlayHandle.h | 2 +- include/Plugin.h | 2 +- include/PluginBrowser.h | 2 +- include/PluginFactory.h | 2 +- include/PluginIssue.h | 3 +-- include/PluginView.h | 2 +- include/PositionLine.h | 2 +- include/PresetPreviewPlayHandle.h | 2 +- include/ProjectJournal.h | 2 +- include/ProjectNotes.h | 2 +- include/ProjectRenderer.h | 2 +- include/ProjectVersion.h | 2 +- include/QuadratureLfo.h | 2 +- include/RaiiHelpers.h | 2 +- include/RecentProjectsMenu.h | 2 +- include/RemotePlugin.h | 2 +- include/RemotePluginBase.h | 2 +- include/RemotePluginClient.h | 2 +- include/RenameDialog.h | 2 +- include/RenderManager.h | 2 +- include/RingBuffer.h | 2 +- include/RmsHelper.h | 2 +- include/RowTableView.h | 2 +- include/Rubberband.h | 2 +- include/SampleBuffer.h | 2 +- include/SampleClip.h | 2 +- include/SampleClipView.h | 2 +- include/SamplePlayHandle.h | 2 +- include/SampleRecordHandle.h | 2 +- include/SampleTrack.h | 2 +- include/SampleTrackView.h | 2 +- include/SampleTrackWindow.h | 3 +-- include/Scale.h | 2 +- include/SendButtonIndicator.h | 2 +- include/SerializingObject.h | 2 +- include/SetupDialog.h | 2 +- include/SharedMemory.h | 2 +- include/SideBar.h | 2 +- include/SideBarWidget.h | 2 +- include/Song.h | 2 +- include/SongEditor.h | 2 +- include/StepRecorder.h | 2 +- include/StepRecorderWidget.h | 2 +- include/StringPairDrag.h | 2 +- include/SubWindow.h | 2 +- include/SweepOscillator.h | 2 +- include/TabBar.h | 2 +- include/TabButton.h | 2 +- include/TabWidget.h | 2 +- include/TemplatesMenu.h | 2 +- include/TempoSyncKnob.h | 2 +- include/TempoSyncKnobModel.h | 2 +- include/TextFloat.h | 2 +- include/ThreadableJob.h | 2 +- include/TimeDisplayWidget.h | 2 +- include/TimeLineWidget.h | 2 +- include/TimePos.h | 2 +- include/ToolButton.h | 2 +- include/ToolPlugin.h | 2 +- include/ToolPluginView.h | 2 +- include/Track.h | 3 +-- include/TrackContainer.h | 2 +- include/TrackContainerView.h | 2 +- include/TrackContentWidget.h | 2 +- include/TrackLabelButton.h | 2 +- include/TrackOperationsWidget.h | 2 +- include/TrackRenameLineEdit.h | 2 +- include/TrackView.h | 2 +- include/ValueBuffer.h | 2 +- include/VersionedSaveDialog.h | 2 +- include/VstSyncController.h | 2 +- include/VstSyncData.h | 2 +- include/aeffectx.h | 6 +++--- include/base64.h | 2 +- include/debug.h | 2 +- include/denormals.h | 4 ++-- include/embed.h | 2 +- include/endian_handling.h | 2 +- include/fenv.h | 2 +- include/fft_helpers.h | 2 +- include/gui_templates.h | 2 +- include/interpolation.h | 2 +- include/lmms_basics.h | 2 +- include/lmms_constants.h | 2 +- include/lmms_math.h | 2 +- include/panning.h | 2 +- include/panning_constants.h | 2 +- include/shared_object.h | 2 +- include/versioninfo.h | 2 +- include/volume.h | 2 +- 282 files changed, 292 insertions(+), 301 deletions(-) diff --git a/include/AboutDialog.h b/include/AboutDialog.h index bb0c509a9..2fd01faf5 100644 --- a/include/AboutDialog.h +++ b/include/AboutDialog.h @@ -41,4 +41,4 @@ public: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_ABOUT_DIALOG_H diff --git a/include/ActionGroup.h b/include/ActionGroup.h index 80a6d523e..e18f6fb23 100644 --- a/include/ActionGroup.h +++ b/include/ActionGroup.h @@ -58,4 +58,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_ACTION_GROUP_H diff --git a/include/AudioAlsa.h b/include/AudioAlsa.h index 263925286..975532071 100644 --- a/include/AudioAlsa.h +++ b/include/AudioAlsa.h @@ -108,4 +108,4 @@ private: #endif // LMMS_HAVE_ALSA -#endif +#endif // LMMS_AUDIO_ALSA_H diff --git a/include/AudioAlsaSetupWidget.h b/include/AudioAlsaSetupWidget.h index 068754b69..cbe99ba01 100644 --- a/include/AudioAlsaSetupWidget.h +++ b/include/AudioAlsaSetupWidget.h @@ -66,4 +66,4 @@ private: #endif // LMMS_HAVE_ALSA -#endif +#endif // LMMS_GUI_AUDIO_ALSA_SETUP_WIDGET_H diff --git a/include/AudioDevice.h b/include/AudioDevice.h index 26cbbaccc..d1a9617cd 100644 --- a/include/AudioDevice.h +++ b/include/AudioDevice.h @@ -160,4 +160,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_AUDIO_DEVICE_H diff --git a/include/AudioDeviceSetupWidget.h b/include/AudioDeviceSetupWidget.h index 9c70859d2..f56fa07a6 100644 --- a/include/AudioDeviceSetupWidget.h +++ b/include/AudioDeviceSetupWidget.h @@ -45,4 +45,4 @@ public: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_AUDIO_DEVICE_SETUP_WIDGET_H diff --git a/include/AudioDummy.h b/include/AudioDummy.h index 37363d501..e34260171 100644 --- a/include/AudioDummy.h +++ b/include/AudioDummy.h @@ -116,4 +116,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_AUDIO_DUMMY_H diff --git a/include/AudioEngine.h b/include/AudioEngine.h index 534182d69..d0f269d87 100644 --- a/include/AudioEngine.h +++ b/include/AudioEngine.h @@ -487,4 +487,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_AUDIO_ENGINE_H diff --git a/include/AudioEngineProfiler.h b/include/AudioEngineProfiler.h index 1f72939be..7b5191e76 100644 --- a/include/AudioEngineProfiler.h +++ b/include/AudioEngineProfiler.h @@ -62,4 +62,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_AUDIO_ENGINE_PROFILER_H diff --git a/include/AudioEngineWorkerThread.h b/include/AudioEngineWorkerThread.h index 0f41982a1..112930808 100644 --- a/include/AudioEngineWorkerThread.h +++ b/include/AudioEngineWorkerThread.h @@ -121,4 +121,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_AUDIO_ENGINE_WORKER_THREAD_H diff --git a/include/AudioFileDevice.h b/include/AudioFileDevice.h index fb98315db..dc9a786a4 100644 --- a/include/AudioFileDevice.h +++ b/include/AudioFileDevice.h @@ -73,4 +73,4 @@ using AudioFileDeviceInstantiaton } // namespace lmms -#endif +#endif // LMMS_AUDIO_FILE_DEVICE_H diff --git a/include/AudioFileFlac.h b/include/AudioFileFlac.h index 6750d264a..944e30478 100644 --- a/include/AudioFileFlac.h +++ b/include/AudioFileFlac.h @@ -77,4 +77,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_AUDIO_FILE_FLAC_H diff --git a/include/AudioFileMP3.h b/include/AudioFileMP3.h index 61406cced..4289ad211 100644 --- a/include/AudioFileMP3.h +++ b/include/AudioFileMP3.h @@ -75,4 +75,4 @@ private: #endif // LMMS_HAVE_MP3LAME -#endif +#endif // LMMS_AUDIO_FILE_MP3_H diff --git a/include/AudioFileOgg.h b/include/AudioFileOgg.h index 981b61733..77be8ca1c 100644 --- a/include/AudioFileOgg.h +++ b/include/AudioFileOgg.h @@ -113,4 +113,4 @@ private: #endif // LMMS_HAVE_OGGVORBIS -#endif +#endif // LMMS_AUDIO_FILE_OGG_H diff --git a/include/AudioFileWave.h b/include/AudioFileWave.h index 06b797cc6..c186aaaa7 100644 --- a/include/AudioFileWave.h +++ b/include/AudioFileWave.h @@ -71,4 +71,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_AUDIO_FILE_WAVE_H diff --git a/include/AudioJack.h b/include/AudioJack.h index 5e63074bd..2ef0f665c 100644 --- a/include/AudioJack.h +++ b/include/AudioJack.h @@ -144,4 +144,4 @@ signals: #endif // LMMS_HAVE_JACK -#endif +#endif // LMMS_AUDIO_JACK_H diff --git a/include/AudioOss.h b/include/AudioOss.h index 045cc6c56..55f64de85 100644 --- a/include/AudioOss.h +++ b/include/AudioOss.h @@ -92,4 +92,4 @@ private: #endif // LMMS_HAVE_OSS -#endif +#endif // LMMS_AUDIO_OSS_H diff --git a/include/AudioPort.h b/include/AudioPort.h index 38e495436..d9803d205 100644 --- a/include/AudioPort.h +++ b/include/AudioPort.h @@ -138,4 +138,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_AUDIO_PORT_H diff --git a/include/AudioPortAudio.h b/include/AudioPortAudio.h index 8ab18ce6e..01b8f3fd7 100644 --- a/include/AudioPortAudio.h +++ b/include/AudioPortAudio.h @@ -163,4 +163,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_AUDIO_PORTAUDIO_H diff --git a/include/AudioPulseAudio.h b/include/AudioPulseAudio.h index bb5541a30..b6a998274 100644 --- a/include/AudioPulseAudio.h +++ b/include/AudioPulseAudio.h @@ -104,4 +104,4 @@ private: #endif // LMMS_HAVE_PULSEAUDIO -#endif +#endif // LMMS_AUDIO_PULSEAUDIO_H diff --git a/include/AudioSampleRecorder.h b/include/AudioSampleRecorder.h index 23c4643d8..8937ceb5e 100644 --- a/include/AudioSampleRecorder.h +++ b/include/AudioSampleRecorder.h @@ -59,4 +59,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_AUDIO_SAMPLE_RECORDER_H diff --git a/include/AudioSdl.h b/include/AudioSdl.h index bd7f4b960..62db8b68a 100644 --- a/include/AudioSdl.h +++ b/include/AudioSdl.h @@ -115,4 +115,4 @@ private: #endif // LMMS_HAVE_SDL -#endif +#endif // LMMS_AUDIO_SDL_H diff --git a/include/AudioSndio.h b/include/AudioSndio.h index b7f42aca2..594ca94e7 100644 --- a/include/AudioSndio.h +++ b/include/AudioSndio.h @@ -89,4 +89,4 @@ private: #endif // LMMS_HAVE_SNDIO -#endif +#endif // LMMS_AUDIO_SNDIO_H diff --git a/include/AudioSoundIo.h b/include/AudioSoundIo.h index b29ff3779..b327f7d84 100644 --- a/include/AudioSoundIo.h +++ b/include/AudioSoundIo.h @@ -145,4 +145,4 @@ private: #endif // LMMS_HAVE_SOUNDIO -#endif +#endif // LMMS_AUDIO_SOUNDIO_H diff --git a/include/AutomatableButton.h b/include/AutomatableButton.h index 4a695a677..3d78b8e9c 100644 --- a/include/AutomatableButton.h +++ b/include/AutomatableButton.h @@ -108,4 +108,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_AUTOMATABLE_BUTTON_H diff --git a/include/AutomatableModel.h b/include/AutomatableModel.h index 2fccf31f4..1e6d5eda3 100644 --- a/include/AutomatableModel.h +++ b/include/AutomatableModel.h @@ -507,5 +507,4 @@ using AutomatedValueMap = QMap; } // namespace lmms -#endif - +#endif // LMMS_AUTOMATABLE_MODEL_H diff --git a/include/AutomatableModelView.h b/include/AutomatableModelView.h index e2475be48..12b2e4d49 100644 --- a/include/AutomatableModelView.h +++ b/include/AutomatableModelView.h @@ -137,5 +137,4 @@ using BoolModelView = TypedModelView; } // namespace lmms::gui -#endif - +#endif // LMMS_GUI_AUTOMATABLE_MODEL_VIEW_H diff --git a/include/AutomatableSlider.h b/include/AutomatableSlider.h index 9ec55c2df..cb1a6965f 100644 --- a/include/AutomatableSlider.h +++ b/include/AutomatableSlider.h @@ -76,4 +76,4 @@ using sliderModel = IntModel; } // namespace lmms::gui -#endif +#endif // LMMS_GUI_AUTOMATABLE_SLIDER_H diff --git a/include/AutomationClip.h b/include/AutomationClip.h index 7281af133..077c282f8 100644 --- a/include/AutomationClip.h +++ b/include/AutomationClip.h @@ -260,4 +260,4 @@ inline int POS(AutomationClip::TimemapIterator it) } // namespace lmms -#endif +#endif // LMMS_AUTOMATION_CLIP_H diff --git a/include/AutomationClipView.h b/include/AutomationClipView.h index 69d4943bc..a20e2ce28 100644 --- a/include/AutomationClipView.h +++ b/include/AutomationClipView.h @@ -85,4 +85,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_GUI_AUTOMATION_CLIP_VIEW_H diff --git a/include/AutomationEditor.h b/include/AutomationEditor.h index 8ead191a9..c2ab98092 100644 --- a/include/AutomationEditor.h +++ b/include/AutomationEditor.h @@ -304,4 +304,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_GUI_AUTOMATION_EDITOR_H diff --git a/include/AutomationNode.h b/include/AutomationNode.h index 9f4a4f219..a922109e6 100644 --- a/include/AutomationNode.h +++ b/include/AutomationNode.h @@ -156,4 +156,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_AUTOMATION_NODE_H diff --git a/include/AutomationTrack.h b/include/AutomationTrack.h index 653174caa..64c2cc43a 100644 --- a/include/AutomationTrack.h +++ b/include/AutomationTrack.h @@ -62,4 +62,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_AUTOMATION_TRACK_H diff --git a/include/AutomationTrackView.h b/include/AutomationTrackView.h index d948d762a..449e9bef8 100644 --- a/include/AutomationTrackView.h +++ b/include/AutomationTrackView.h @@ -52,4 +52,4 @@ public: } // namespace lmms -#endif +#endif // LMMS_GUI_AUTOMATION_TRACK_VIEW_H diff --git a/include/BandLimitedWave.h b/include/BandLimitedWave.h index 51e55c337..2a12c62e3 100644 --- a/include/BandLimitedWave.h +++ b/include/BandLimitedWave.h @@ -149,7 +149,8 @@ public: return sr; -/* lookup = lookup << 1; + /* + lookup = lookup << 1; tlen = tlen << 1; t += 1; const sample_t s3 = s_waveforms[ _wave ].sampleAt( t, lookup ); @@ -159,7 +160,7 @@ public: const float ip2 = ( ( tlen - _wavelen ) / tlen - 0.5 ) * 2.0; return linearInterpolate( s12, s34, ip2 ); - */ + */ }; @@ -174,4 +175,4 @@ public: } // namespace lmms -#endif +#endif // LMMS_BANDLIMITEDWAVE_H diff --git a/include/BasicFilters.h b/include/BasicFilters.h index 6912f3d36..c10c47489 100644 --- a/include/BasicFilters.h +++ b/include/BasicFilters.h @@ -917,4 +917,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_BASIC_FILTERS_H diff --git a/include/BufferManager.h b/include/BufferManager.h index 8e93afc92..712e420ff 100644 --- a/include/BufferManager.h +++ b/include/BufferManager.h @@ -54,4 +54,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_BUFFER_MANAGER_H diff --git a/include/CPULoadWidget.h b/include/CPULoadWidget.h index a249cdc5e..904445c67 100644 --- a/include/CPULoadWidget.h +++ b/include/CPULoadWidget.h @@ -69,4 +69,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_CPU_LOAD_WIDGET_H diff --git a/include/CaptionMenu.h b/include/CaptionMenu.h index 87aedf133..4a8889a83 100644 --- a/include/CaptionMenu.h +++ b/include/CaptionMenu.h @@ -46,4 +46,4 @@ public: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_CAPTION_MENU_H diff --git a/include/Clip.h b/include/Clip.h index 75416ef94..8f4162d96 100644 --- a/include/Clip.h +++ b/include/Clip.h @@ -194,4 +194,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_CLIP_H diff --git a/include/ClipView.h b/include/ClipView.h index a342590e1..32c5130b9 100644 --- a/include/ClipView.h +++ b/include/ClipView.h @@ -252,4 +252,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_GUI_CLIP_VIEW_H diff --git a/include/Clipboard.h b/include/Clipboard.h index 3c38c90fe..c6ae66ee8 100644 --- a/include/Clipboard.h +++ b/include/Clipboard.h @@ -68,4 +68,4 @@ namespace lmms::Clipboard } // namespace lmms::Clipboard -#endif +#endif // LMMS_CLIPBOARD_H diff --git a/include/ColorChooser.h b/include/ColorChooser.h index da4069f5d..0e85ea9bb 100644 --- a/include/ColorChooser.h +++ b/include/ColorChooser.h @@ -68,4 +68,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_COLOR_CHOOSER_H diff --git a/include/ComboBox.h b/include/ComboBox.h index ba2410491..8153451e8 100644 --- a/include/ComboBox.h +++ b/include/ComboBox.h @@ -82,4 +82,4 @@ private slots: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_COMBOBOX_H diff --git a/include/ComboBoxModel.h b/include/ComboBoxModel.h index a895b838f..8fd1f49f4 100644 --- a/include/ComboBoxModel.h +++ b/include/ComboBoxModel.h @@ -95,4 +95,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_COMBOBOX_MODEL_H diff --git a/include/ConfigManager.h b/include/ConfigManager.h index abeb5246f..eee069681 100644 --- a/include/ConfigManager.h +++ b/include/ConfigManager.h @@ -313,4 +313,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_CONFIG_MANAGER_H diff --git a/include/ControlLayout.h b/include/ControlLayout.h index e78609a37..568ce1a85 100644 --- a/include/ControlLayout.h +++ b/include/ControlLayout.h @@ -141,4 +141,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_CONTROL_LAYOUT_H diff --git a/include/Controller.h b/include/Controller.h index 0bb229d38..0a5eb0f36 100644 --- a/include/Controller.h +++ b/include/Controller.h @@ -183,4 +183,4 @@ signals: } // namespace lmms -#endif +#endif // LMMS_CONTROLLER_H diff --git a/include/ControllerConnection.h b/include/ControllerConnection.h index d75d529f6..4473b68e0 100644 --- a/include/ControllerConnection.h +++ b/include/ControllerConnection.h @@ -127,4 +127,4 @@ signals: } // namespace lmms -#endif +#endif // LMMS_CONTROLLER_CONNECTION_H diff --git a/include/ControllerConnectionDialog.h b/include/ControllerConnectionDialog.h index 2e3446072..6fb9d45d0 100644 --- a/include/ControllerConnectionDialog.h +++ b/include/ControllerConnectionDialog.h @@ -110,4 +110,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_GUI_CONTROLLER_CONNECTION_DIALOG_H diff --git a/include/ControllerDialog.h b/include/ControllerDialog.h index 81a9a0eb6..0c53a8c84 100644 --- a/include/ControllerDialog.h +++ b/include/ControllerDialog.h @@ -61,4 +61,4 @@ protected: } // namespace lmms -#endif +#endif // LMMS_GUI_CONTROLLER_DIALOG_H diff --git a/include/ControllerRackView.h b/include/ControllerRackView.h index 1133e8ec8..303cc2b40 100644 --- a/include/ControllerRackView.h +++ b/include/ControllerRackView.h @@ -92,4 +92,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_GUI_CONTROLLER_RACK_VIEW_H diff --git a/include/ControllerView.h b/include/ControllerView.h index 44f362b70..d1ba533a1 100644 --- a/include/ControllerView.h +++ b/include/ControllerView.h @@ -88,4 +88,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_CONTROLLER_VIEW_H diff --git a/include/Controls.h b/include/Controls.h index 53c93a36f..5ed19027e 100644 --- a/include/Controls.h +++ b/include/Controls.h @@ -144,4 +144,4 @@ public: } // namespace lmms -#endif +#endif // LMMS_GUI_CONTROLS_H diff --git a/include/CustomTextKnob.h b/include/CustomTextKnob.h index 25bba1315..19768ec87 100644 --- a/include/CustomTextKnob.h +++ b/include/CustomTextKnob.h @@ -57,4 +57,4 @@ protected: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_CUSTOM_TEXT_KNOB_H diff --git a/include/DataFile.h b/include/DataFile.h index 18f9697b0..a91b37f9b 100644 --- a/include/DataFile.h +++ b/include/DataFile.h @@ -153,4 +153,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_DATA_FILE_H diff --git a/include/Delay.h b/include/Delay.h index ef23d7be1..daa871baf 100644 --- a/include/Delay.h +++ b/include/Delay.h @@ -364,4 +364,4 @@ using StereoAllpassDelay = AllpassDelay<2>; } // namespace lmms -#endif +#endif // LMMS_DELAY_H diff --git a/include/DeprecationHelper.h b/include/DeprecationHelper.h index f1c68902b..b9be6d42f 100644 --- a/include/DeprecationHelper.h +++ b/include/DeprecationHelper.h @@ -66,4 +66,4 @@ inline QPoint position(QWheelEvent *wheelEvent) } // namespace lmms -#endif +#endif // LMMS_DEPRECATIONHELPER_H diff --git a/include/DetuningHelper.h b/include/DetuningHelper.h index 41723bee8..e5d5f5712 100644 --- a/include/DetuningHelper.h +++ b/include/DetuningHelper.h @@ -64,4 +64,4 @@ public: } // namespace lmms -#endif +#endif // LMMS_DETUNING_HELPER_H diff --git a/include/DrumSynth.h b/include/DrumSynth.h index 9b759ac1a..750055ddb 100644 --- a/include/DrumSynth.h +++ b/include/DrumSynth.h @@ -56,4 +56,4 @@ class DrumSynth { } // namespace lmms -#endif +#endif // LMMS_DRUM_SYNTH_H diff --git a/include/DspEffectLibrary.h b/include/DspEffectLibrary.h index 0a19783f6..d8268fd8d 100644 --- a/include/DspEffectLibrary.h +++ b/include/DspEffectLibrary.h @@ -330,5 +330,4 @@ namespace lmms::DspEffectLibrary } // namespace lmms::DspEffectLibrary - -#endif +#endif // LMMS_DSPEFFECTLIBRARY_H diff --git a/include/DummyEffect.h b/include/DummyEffect.h index 945738e1b..0a80b90a9 100644 --- a/include/DummyEffect.h +++ b/include/DummyEffect.h @@ -149,4 +149,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_DUMMY_EFFECT_H diff --git a/include/DummyInstrument.h b/include/DummyInstrument.h index 19b6b6fbd..aefa035db 100644 --- a/include/DummyInstrument.h +++ b/include/DummyInstrument.h @@ -77,4 +77,4 @@ public: } // namespace lmms -#endif +#endif // LMMS_DUMMY_INSTRUMENT_H diff --git a/include/DummyPlugin.h b/include/DummyPlugin.h index ad517c1a9..3f6746b74 100644 --- a/include/DummyPlugin.h +++ b/include/DummyPlugin.h @@ -68,4 +68,4 @@ protected: } // namespace lmms -#endif +#endif // LMMS_DUMMY_PLUGIN_H diff --git a/include/Editor.h b/include/Editor.h index ad330ac06..c5e9a2d05 100644 --- a/include/Editor.h +++ b/include/Editor.h @@ -113,4 +113,4 @@ protected: } // namespace lmms::gui -#endif +#endif // LMMS_EDITOR_H diff --git a/include/Effect.h b/include/Effect.h index a9952d339..1f566e0e9 100644 --- a/include/Effect.h +++ b/include/Effect.h @@ -241,4 +241,4 @@ using EffectKeyList = Effect::Descriptor::SubPluginFeatures::KeyList; } // namespace lmms -#endif +#endif // LMMS_EFFECT_H diff --git a/include/EffectChain.h b/include/EffectChain.h index dad4de5e1..57cf8d547 100644 --- a/include/EffectChain.h +++ b/include/EffectChain.h @@ -85,4 +85,4 @@ signals: } // namespace lmms -#endif +#endif // LMMS_EFFECT_CHAIN_H diff --git a/include/EffectControlDialog.h b/include/EffectControlDialog.h index bda845dc5..4bef5ee79 100644 --- a/include/EffectControlDialog.h +++ b/include/EffectControlDialog.h @@ -64,4 +64,4 @@ protected: } // namespace lmms -#endif +#endif // LMMS_GUI_EFFECT_CONTROL_DIALOG_H diff --git a/include/EffectControls.h b/include/EffectControls.h index dfecc0792..294f61027 100644 --- a/include/EffectControls.h +++ b/include/EffectControls.h @@ -82,4 +82,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_EFFECT_CONTROLS_H diff --git a/include/EffectRackView.h b/include/EffectRackView.h index 96f70548a..a1e21be09 100644 --- a/include/EffectRackView.h +++ b/include/EffectRackView.h @@ -88,4 +88,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_EFFECT_RACK_VIEW_H diff --git a/include/EffectSelectDialog.h b/include/EffectSelectDialog.h index c31f96e14..493b07774 100644 --- a/include/EffectSelectDialog.h +++ b/include/EffectSelectDialog.h @@ -70,5 +70,4 @@ private: } // namespace lmms::gui - -#endif +#endif // LMMS_GUI_EFFECT_SELECT_DIALOG_H diff --git a/include/EffectView.h b/include/EffectView.h index fb19d52dd..5b669114d 100644 --- a/include/EffectView.h +++ b/include/EffectView.h @@ -96,4 +96,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_EFFECT_VIEW_H diff --git a/include/Engine.h b/include/Engine.h index 0cb77315f..ed4cbd93c 100644 --- a/include/Engine.h +++ b/include/Engine.h @@ -155,4 +155,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_ENGINE_H diff --git a/include/EnvelopeAndLfoParameters.h b/include/EnvelopeAndLfoParameters.h index 0a90ec68b..a713a90f3 100644 --- a/include/EnvelopeAndLfoParameters.h +++ b/include/EnvelopeAndLfoParameters.h @@ -190,4 +190,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_ENVELOPE_AND_LFO_PARAMETERS_H diff --git a/include/EnvelopeAndLfoView.h b/include/EnvelopeAndLfoView.h index e927e9fcc..b5c7a67d4 100644 --- a/include/EnvelopeAndLfoView.h +++ b/include/EnvelopeAndLfoView.h @@ -104,4 +104,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_GUI_ENVELOPE_AND_LFO_VIEW_H diff --git a/include/ExportFilter.h b/include/ExportFilter.h index 13a3c179d..acbdbb65e 100644 --- a/include/ExportFilter.h +++ b/include/ExportFilter.h @@ -69,4 +69,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_EXPORT_FILTER_H diff --git a/include/ExportProjectDialog.h b/include/ExportProjectDialog.h index af33d6766..56a9fc1f5 100644 --- a/include/ExportProjectDialog.h +++ b/include/ExportProjectDialog.h @@ -69,5 +69,4 @@ private: } // namespace lmms::gui - -#endif +#endif // LMMS_GUI_EXPORT_PROJECT_DIALOG_H diff --git a/include/FadeButton.h b/include/FadeButton.h index df0e2abf2..166ef5f21 100644 --- a/include/FadeButton.h +++ b/include/FadeButton.h @@ -76,4 +76,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_FADE_BUTTON_H diff --git a/include/Fader.h b/include/Fader.h index cfffba843..2847819a4 100644 --- a/include/Fader.h +++ b/include/Fader.h @@ -173,5 +173,4 @@ private: } // namespace lmms::gui - -#endif +#endif // LMMS_GUI_FADER_H diff --git a/include/FifoBuffer.h b/include/FifoBuffer.h index 4b5682a51..cdb1df41f 100644 --- a/include/FifoBuffer.h +++ b/include/FifoBuffer.h @@ -94,4 +94,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_FIFO_BUFFER_H diff --git a/include/FileBrowser.h b/include/FileBrowser.h index 387be38d1..51103b19f 100644 --- a/include/FileBrowser.h +++ b/include/FileBrowser.h @@ -297,4 +297,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_GUI_FILE_BROWSER_H diff --git a/include/FileDialog.h b/include/FileDialog.h index a999fff16..67ef1d8eb 100644 --- a/include/FileDialog.h +++ b/include/FileDialog.h @@ -56,4 +56,4 @@ public: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_FILE_DIALOG_H diff --git a/include/Graph.h b/include/Graph.h index d04fd926c..f62215ac2 100644 --- a/include/Graph.h +++ b/include/Graph.h @@ -227,4 +227,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_GUI_GRAPH_H diff --git a/include/GroupBox.h b/include/GroupBox.h index bf2773e23..6a8f424f9 100644 --- a/include/GroupBox.h +++ b/include/GroupBox.h @@ -73,5 +73,4 @@ private: } // namespace lmms::gui - -#endif +#endif // LMMS_GUI_GROUP_BOX_H diff --git a/include/GuiApplication.h b/include/GuiApplication.h index dd87a5607..3a0851499 100644 --- a/include/GuiApplication.h +++ b/include/GuiApplication.h @@ -93,4 +93,4 @@ LMMS_EXPORT GuiApplication* getGUI(); } // namespace lmms::gui -#endif +#endif // LMMS_GUI_GUI_APPLICATION_H diff --git a/include/ImportFilter.h b/include/ImportFilter.h index 587a62a78..9c73b3861 100644 --- a/include/ImportFilter.h +++ b/include/ImportFilter.h @@ -114,4 +114,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_IMPORT_FILTER_H diff --git a/include/InlineAutomation.h b/include/InlineAutomation.h index fbecd2769..3e27e137b 100644 --- a/include/InlineAutomation.h +++ b/include/InlineAutomation.h @@ -99,4 +99,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_INLINE_AUTOMATION_H diff --git a/include/Instrument.h b/include/Instrument.h index 3ea8bdf2f..1c42c970e 100644 --- a/include/Instrument.h +++ b/include/Instrument.h @@ -154,4 +154,4 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(Instrument::Flags) } // namespace lmms -#endif +#endif // LMMS_INSTRUMENT_H diff --git a/include/InstrumentFunctionViews.h b/include/InstrumentFunctionViews.h index 3abd8eae7..71a6e8aaa 100644 --- a/include/InstrumentFunctionViews.h +++ b/include/InstrumentFunctionViews.h @@ -99,4 +99,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_INSTRUMENT_FUNCTION_VIEWS_H diff --git a/include/InstrumentFunctions.h b/include/InstrumentFunctions.h index 5b6c1af6d..f62b74e9a 100644 --- a/include/InstrumentFunctions.h +++ b/include/InstrumentFunctions.h @@ -224,4 +224,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_INSTRUMENT_FUNCTIONS_H diff --git a/include/InstrumentMidiIOView.h b/include/InstrumentMidiIOView.h index dd6e43151..7877229a2 100644 --- a/include/InstrumentMidiIOView.h +++ b/include/InstrumentMidiIOView.h @@ -77,4 +77,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_GUI_INSTRUMENT_MIDI_IO_VIEW_H diff --git a/include/InstrumentMiscView.h b/include/InstrumentMiscView.h index 9aee23676..28f3c6a8e 100644 --- a/include/InstrumentMiscView.h +++ b/include/InstrumentMiscView.h @@ -71,4 +71,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_GUI_INSTRUMENT_MISC_VIEW_H diff --git a/include/InstrumentPlayHandle.h b/include/InstrumentPlayHandle.h index b65f906ae..bbf53d16c 100644 --- a/include/InstrumentPlayHandle.h +++ b/include/InstrumentPlayHandle.h @@ -85,4 +85,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_INSTRUMENT_PLAY_HANDLE_H diff --git a/include/InstrumentSoundShaping.h b/include/InstrumentSoundShaping.h index 607871c85..6db3078ec 100644 --- a/include/InstrumentSoundShaping.h +++ b/include/InstrumentSoundShaping.h @@ -92,4 +92,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_INSTRUMENT_SOUND_SHAPING_H diff --git a/include/InstrumentSoundShapingView.h b/include/InstrumentSoundShapingView.h index f37cfaa55..8f671514a 100644 --- a/include/InstrumentSoundShapingView.h +++ b/include/InstrumentSoundShapingView.h @@ -73,4 +73,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_INSTRUMENT_SOUND_SHAPING_VIEW_H diff --git a/include/InstrumentTrack.h b/include/InstrumentTrack.h index 6fa41b4a1..7c6d1d795 100644 --- a/include/InstrumentTrack.h +++ b/include/InstrumentTrack.h @@ -325,4 +325,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_INSTRUMENT_TRACK_H diff --git a/include/InstrumentTrackView.h b/include/InstrumentTrackView.h index 66fb7804b..363f5b3ab 100644 --- a/include/InstrumentTrackView.h +++ b/include/InstrumentTrackView.h @@ -121,4 +121,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_INSTRUMENT_TRACK_VIEW_H diff --git a/include/InstrumentTrackWindow.h b/include/InstrumentTrackWindow.h index f50b138df..d41bbdac8 100644 --- a/include/InstrumentTrackWindow.h +++ b/include/InstrumentTrackWindow.h @@ -169,4 +169,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_GUI_INSTRUMENT_TRACK_WINDOW_H diff --git a/include/InstrumentView.h b/include/InstrumentView.h index ff4b9cd66..40014a11f 100644 --- a/include/InstrumentView.h +++ b/include/InstrumentView.h @@ -75,4 +75,4 @@ public: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_INSTRUMENT_VIEW_H diff --git a/include/IoHelper.h b/include/IoHelper.h index 423cbaab3..8043df9af 100644 --- a/include/IoHelper.h +++ b/include/IoHelper.h @@ -91,4 +91,4 @@ int fileToDescriptor(FILE* f, bool closeFile = true) } // namespace lmms -#endif +#endif // LMMS_IO_HELPER_H diff --git a/include/JournallingObject.h b/include/JournallingObject.h index 15e071577..f3e134f34 100644 --- a/include/JournallingObject.h +++ b/include/JournallingObject.h @@ -103,4 +103,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_JOURNALLING_OBJECT_H diff --git a/include/Keymap.h b/include/Keymap.h index 88f0df428..967d80789 100644 --- a/include/Keymap.h +++ b/include/Keymap.h @@ -80,4 +80,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_KEYMAP_H diff --git a/include/Knob.h b/include/Knob.h index 94fb8b640..18b26f7e6 100644 --- a/include/Knob.h +++ b/include/Knob.h @@ -213,4 +213,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_KNOB_H diff --git a/include/Ladspa2LMMS.h b/include/Ladspa2LMMS.h index d4fd12b2d..abb969124 100644 --- a/include/Ladspa2LMMS.h +++ b/include/Ladspa2LMMS.h @@ -81,4 +81,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_LADSPA_2_LMMS_H diff --git a/include/LadspaBase.h b/include/LadspaBase.h index 442d12293..51c0ca202 100644 --- a/include/LadspaBase.h +++ b/include/LadspaBase.h @@ -83,4 +83,4 @@ inline Plugin::Descriptor::SubPluginFeatures::Key ladspaKeyToSubPluginKey( } // namespace lmms -#endif +#endif // LMMS_LADSPA_BASE_H diff --git a/include/LadspaControl.h b/include/LadspaControl.h index 9bc83e352..e4f0cd745 100644 --- a/include/LadspaControl.h +++ b/include/LadspaControl.h @@ -131,4 +131,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_LADSPA_CONTROL_H diff --git a/include/LadspaControlView.h b/include/LadspaControlView.h index 4638d5b5c..4f12c29e2 100644 --- a/include/LadspaControlView.h +++ b/include/LadspaControlView.h @@ -55,4 +55,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_GUI_LADSPA_CONTROL_VIEW_H diff --git a/include/LadspaManager.h b/include/LadspaManager.h index 7b8639779..8c00d2604 100644 --- a/include/LadspaManager.h +++ b/include/LadspaManager.h @@ -349,4 +349,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_LADSPA_MANAGER_H diff --git a/include/LcdFloatSpinBox.h b/include/LcdFloatSpinBox.h index 3dcf500b9..74a870114 100644 --- a/include/LcdFloatSpinBox.h +++ b/include/LcdFloatSpinBox.h @@ -84,4 +84,4 @@ using LcdFloatSpinBoxModel = FloatModel; } // namespace lmms::gui -#endif +#endif // LMMS_GUI_LCD_FLOATSPINBOX_H diff --git a/include/LcdSpinBox.h b/include/LcdSpinBox.h index 6dcb68c1b..aeccd2635 100644 --- a/include/LcdSpinBox.h +++ b/include/LcdSpinBox.h @@ -89,4 +89,4 @@ using LcdSpinBoxModel = IntModel; } // namespace lmms::gui -#endif +#endif // LMMS_GUI_LCD_SPINBOX_H diff --git a/include/LcdWidget.h b/include/LcdWidget.h index 665668b3f..f19c2c583 100644 --- a/include/LcdWidget.h +++ b/include/LcdWidget.h @@ -116,4 +116,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_LCD_WIDGET_H diff --git a/include/LedCheckBox.h b/include/LedCheckBox.h index 12642ef3b..95016b87f 100644 --- a/include/LedCheckBox.h +++ b/include/LedCheckBox.h @@ -83,4 +83,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_LED_CHECKBOX_H diff --git a/include/LeftRightNav.h b/include/LeftRightNav.h index e752d44c0..49ad25ecf 100644 --- a/include/LeftRightNav.h +++ b/include/LeftRightNav.h @@ -51,4 +51,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_LEFT_RIGHT_NAV_H diff --git a/include/LfoController.h b/include/LfoController.h index ccd5804c7..1c63ba698 100644 --- a/include/LfoController.h +++ b/include/LfoController.h @@ -136,4 +136,4 @@ private slots: } // namespace lmms -#endif +#endif // LMMS_LFO_CONTROLLER_H diff --git a/include/LinkedModelGroupViews.h b/include/LinkedModelGroupViews.h index 08c25a8bb..cf5aabd0d 100644 --- a/include/LinkedModelGroupViews.h +++ b/include/LinkedModelGroupViews.h @@ -22,8 +22,8 @@ * */ -#ifndef LMMS_GUI_LINKEDMODELGROUPVIEWS_H -#define LMMS_GUI_LINKEDMODELGROUPVIEWS_H +#ifndef LMMS_GUI_LINKED_MODEL_GROUP_VIEWS_H +#define LMMS_GUI_LINKED_MODEL_GROUP_VIEWS_H #include #include @@ -118,4 +118,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_GUI_LINKED_MODEL_GROUP_VIEWS_H diff --git a/include/LinkedModelGroups.h b/include/LinkedModelGroups.h index 11950d85e..3f274d10c 100644 --- a/include/LinkedModelGroups.h +++ b/include/LinkedModelGroups.h @@ -22,8 +22,8 @@ * */ -#ifndef LMMS_LINKEDMODELGROUPS_H -#define LMMS_LINKEDMODELGROUPS_H +#ifndef LMMS_LINKED_MODEL_GROUPS_H +#define LMMS_LINKED_MODEL_GROUPS_H #include @@ -176,4 +176,4 @@ public: } // namespace lmms -#endif +#endif // LMMS_LINKED_MODEL_GROUPS_H diff --git a/include/LmmsPalette.h b/include/LmmsPalette.h index 68cd2d2ab..91a469de0 100644 --- a/include/LmmsPalette.h +++ b/include/LmmsPalette.h @@ -87,4 +87,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_LMMS_PALETTE_H diff --git a/include/LmmsStyle.h b/include/LmmsStyle.h index c560b5be8..b3be03952 100644 --- a/include/LmmsStyle.h +++ b/include/LmmsStyle.h @@ -95,4 +95,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_LMMS_STYLE_H diff --git a/include/LocaleHelper.h b/include/LocaleHelper.h index 61298f42b..9c829fcaa 100644 --- a/include/LocaleHelper.h +++ b/include/LocaleHelper.h @@ -67,4 +67,4 @@ inline float toFloat(QString str, bool* ok = nullptr) } // namespace lmms::LocaleHelper -#endif +#endif // LMMS_LOCALEHELPER_H diff --git a/include/LocklessAllocator.h b/include/LocklessAllocator.h index f1b3dea40..d44b99543 100644 --- a/include/LocklessAllocator.h +++ b/include/LocklessAllocator.h @@ -84,4 +84,4 @@ public: } // namespace lmms -#endif +#endif // LMMS_LOCKLESS_ALLOCATOR_H diff --git a/include/LocklessList.h b/include/LocklessList.h index e5c5cce71..4a0c27de0 100644 --- a/include/LocklessList.h +++ b/include/LocklessList.h @@ -97,4 +97,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_LOCKLESS_LIST_H diff --git a/include/LocklessRingBuffer.h b/include/LocklessRingBuffer.h index 904e54f9c..99c48cc90 100644 --- a/include/LocklessRingBuffer.h +++ b/include/LocklessRingBuffer.h @@ -89,4 +89,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_LOCKLESS_RING_BUFFER_H diff --git a/include/Lv2Basics.h b/include/Lv2Basics.h index 73f006b46..3dae4c9f2 100644 --- a/include/Lv2Basics.h +++ b/include/Lv2Basics.h @@ -68,4 +68,4 @@ std::string stdStringFromPortName(const LilvPlugin* plug, const LilvPort* port); #endif // LMMS_HAVE_LV2 -#endif +#endif // LMMS_LV2BASICS_H diff --git a/include/Lv2ControlBase.h b/include/Lv2ControlBase.h index dcb90f27a..93b3b21ef 100644 --- a/include/Lv2ControlBase.h +++ b/include/Lv2ControlBase.h @@ -164,4 +164,4 @@ private: #endif // LMMS_HAVE_LV2 -#endif +#endif // LMMS_LV2_CONTROL_BASE_H diff --git a/include/Lv2Evbuf.h b/include/Lv2Evbuf.h index ecf61ec99..319bdf9ce 100644 --- a/include/Lv2Evbuf.h +++ b/include/Lv2Evbuf.h @@ -155,4 +155,4 @@ lv2_evbuf_write( LV2_Evbuf_Iterator* iter, #endif // LMMS_HAVE_LV2 -#endif +#endif // LMMS_LV2_EVBUF_H diff --git a/include/Lv2Features.h b/include/Lv2Features.h index 99a5762b0..b4fd6c06d 100644 --- a/include/Lv2Features.h +++ b/include/Lv2Features.h @@ -84,4 +84,4 @@ private: #endif // LMMS_HAVE_LV2 -#endif +#endif // LMMS_LV2_FEATURES_H diff --git a/include/Lv2Manager.h b/include/Lv2Manager.h index 45ca868dd..b62e989cf 100644 --- a/include/Lv2Manager.h +++ b/include/Lv2Manager.h @@ -166,4 +166,4 @@ private: #endif // LMMS_HAVE_LV2 -#endif +#endif // LMMS_LV2_MANAGER_H diff --git a/include/Lv2Options.h b/include/Lv2Options.h index c81e4b953..ca4fe2b7f 100644 --- a/include/Lv2Options.h +++ b/include/Lv2Options.h @@ -107,4 +107,4 @@ private: #endif // LMMS_HAVE_LV2 -#endif +#endif // LMMS_LV2_OPTIONS_H diff --git a/include/Lv2Ports.h b/include/Lv2Ports.h index 7283ebbd3..0f0b02913 100644 --- a/include/Lv2Ports.h +++ b/include/Lv2Ports.h @@ -271,4 +271,4 @@ const Target* dcast(const PortBase* base) #endif // LMMS_HAVE_LV2 -#endif +#endif // LMMS_LV2PORTS_H diff --git a/include/Lv2Proc.h b/include/Lv2Proc.h index eea4e7c0e..7e6342ec4 100644 --- a/include/Lv2Proc.h +++ b/include/Lv2Proc.h @@ -221,4 +221,4 @@ private: #endif // LMMS_HAVE_LV2 -#endif +#endif // LMMS_LV2_PROC_H diff --git a/include/Lv2SubPluginFeatures.h b/include/Lv2SubPluginFeatures.h index f8fbf55df..497c72830 100644 --- a/include/Lv2SubPluginFeatures.h +++ b/include/Lv2SubPluginFeatures.h @@ -66,4 +66,4 @@ public: #endif // LMMS_HAVE_LV2 -#endif +#endif // LMMS_LV2_SUBPLUGIN_FEATURES_H diff --git a/include/Lv2UridCache.h b/include/Lv2UridCache.h index ab80760b0..b64003a2e 100644 --- a/include/Lv2UridCache.h +++ b/include/Lv2UridCache.h @@ -75,4 +75,4 @@ template<> struct Lv2UridCache::IdForType { static constexpr auto #endif // LMMS_HAVE_LV2 -#endif +#endif // LMMS_LV2_URID_CACHE_H diff --git a/include/Lv2UridMap.h b/include/Lv2UridMap.h index ec23f4c6d..b8733023e 100644 --- a/include/Lv2UridMap.h +++ b/include/Lv2UridMap.h @@ -76,4 +76,4 @@ public: #endif // LMMS_HAVE_LV2 -#endif +#endif // LMMS_LV2_URID_MAP_H diff --git a/include/Lv2ViewBase.h b/include/Lv2ViewBase.h index e84c6c5dc..f6d97d6aa 100644 --- a/include/Lv2ViewBase.h +++ b/include/Lv2ViewBase.h @@ -109,4 +109,4 @@ private: #endif // LMMS_HAVE_LV2 -#endif +#endif // LMMS_LV2_VIEW_BASE_H diff --git a/include/MainApplication.h b/include/MainApplication.h index 0ab2877e7..98fcdef20 100644 --- a/include/MainApplication.h +++ b/include/MainApplication.h @@ -64,4 +64,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_MAIN_APPLICATION_H diff --git a/include/MainWindow.h b/include/MainWindow.h index 78d7f48d8..c4bbb6767 100644 --- a/include/MainWindow.h +++ b/include/MainWindow.h @@ -263,4 +263,4 @@ signals: } // namespace lmms -#endif +#endif // LMMS_GUI_MAIN_WINDOW_H diff --git a/include/MemoryHelper.h b/include/MemoryHelper.h index 22ab10a6c..e709ffc8a 100644 --- a/include/MemoryHelper.h +++ b/include/MemoryHelper.h @@ -46,4 +46,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_MEMORY_HELPER_H diff --git a/include/MemoryManager.h b/include/MemoryManager.h index 6e172468b..fa2fe8110 100644 --- a/include/MemoryManager.h +++ b/include/MemoryManager.h @@ -108,4 +108,4 @@ void MM_FREE(T* ptr) } // namespace lmms -#endif +#endif // LMMS_MEMORY_MANAGER_H diff --git a/include/MeterDialog.h b/include/MeterDialog.h index 425590807..dca7e5de6 100644 --- a/include/MeterDialog.h +++ b/include/MeterDialog.h @@ -54,4 +54,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_METER_DIALOG_H diff --git a/include/MeterModel.h b/include/MeterModel.h index 9a6ec8015..6c0304e37 100644 --- a/include/MeterModel.h +++ b/include/MeterModel.h @@ -68,4 +68,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_METER_MODEL_H diff --git a/include/MicroTimer.h b/include/MicroTimer.h index e5c8e2f61..cd03403dc 100644 --- a/include/MicroTimer.h +++ b/include/MicroTimer.h @@ -48,4 +48,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_MICRO_TIMER_H diff --git a/include/Microtuner.h b/include/Microtuner.h index 795748b39..c92549581 100644 --- a/include/Microtuner.h +++ b/include/Microtuner.h @@ -74,4 +74,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_MICROTUNER_H diff --git a/include/MicrotunerConfig.h b/include/MicrotunerConfig.h index 3a5130b60..0706a530f 100644 --- a/include/MicrotunerConfig.h +++ b/include/MicrotunerConfig.h @@ -95,4 +95,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_MICROTUNER_CONFIG_H diff --git a/include/Midi.h b/include/Midi.h index 839d0b684..21db021b3 100644 --- a/include/Midi.h +++ b/include/Midi.h @@ -143,4 +143,4 @@ const int MidiMaxPitchBend = 16383; } // namespace lmms -#endif +#endif // LMMS_MIDI_H diff --git a/include/MidiAlsaRaw.h b/include/MidiAlsaRaw.h index a2b8c4e69..345cdbd54 100644 --- a/include/MidiAlsaRaw.h +++ b/include/MidiAlsaRaw.h @@ -85,4 +85,4 @@ private: #endif // LMMS_HAVE_ALSA -#endif +#endif // LMMS_MIDI_ALSA_RAW_H diff --git a/include/MidiAlsaSeq.h b/include/MidiAlsaSeq.h index d6f488c82..006cdefc8 100644 --- a/include/MidiAlsaSeq.h +++ b/include/MidiAlsaSeq.h @@ -158,4 +158,4 @@ signals: #endif // LMMS_HAVE_ALSA -#endif +#endif // LMMS_MIDI_ALSA_SEQ_H diff --git a/include/MidiApple.h b/include/MidiApple.h index 1b0d59218..37d408d4d 100644 --- a/include/MidiApple.h +++ b/include/MidiApple.h @@ -155,4 +155,4 @@ signals: #endif // LMMS_BUILD_APPLE -#endif +#endif // LMMS_MIDI_APPLE_H diff --git a/include/MidiCCRackView.h b/include/MidiCCRackView.h index ca99a7ce5..4cb82b3d8 100644 --- a/include/MidiCCRackView.h +++ b/include/MidiCCRackView.h @@ -73,4 +73,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_GUI_MIDI_CC_RACK_VIEW_H diff --git a/include/MidiClient.h b/include/MidiClient.h index 45ba54ee5..3a64f709c 100644 --- a/include/MidiClient.h +++ b/include/MidiClient.h @@ -173,4 +173,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_MIDI_CLIENT_H diff --git a/include/MidiClip.h b/include/MidiClip.h index 2dbedc0dd..bbb7d325d 100644 --- a/include/MidiClip.h +++ b/include/MidiClip.h @@ -154,4 +154,4 @@ signals: } // namespace lmms -#endif +#endif // LMMS_MIDI_CLIP_H diff --git a/include/MidiClipView.h b/include/MidiClipView.h index dd83f98b8..6558688b4 100644 --- a/include/MidiClipView.h +++ b/include/MidiClipView.h @@ -108,4 +108,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_GUI_MIDI_CLIP_VIEW_H diff --git a/include/MidiController.h b/include/MidiController.h index 19577281f..c4ef49590 100644 --- a/include/MidiController.h +++ b/include/MidiController.h @@ -92,4 +92,4 @@ protected: } // namespace lmms -#endif +#endif // LMMS_MIDI_CONTROLLER_H diff --git a/include/MidiDummy.h b/include/MidiDummy.h index 03deaf7bc..b117bd136 100644 --- a/include/MidiDummy.h +++ b/include/MidiDummy.h @@ -65,4 +65,4 @@ protected: } // namespace lmms -#endif +#endif // LMMS_MIDI_DUMMY_H diff --git a/include/MidiEvent.h b/include/MidiEvent.h index 03d3be604..956c33fb3 100644 --- a/include/MidiEvent.h +++ b/include/MidiEvent.h @@ -221,4 +221,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_MIDI_EVENT_H diff --git a/include/MidiEventProcessor.h b/include/MidiEventProcessor.h index 3e51d1177..1c45b3e3f 100644 --- a/include/MidiEventProcessor.h +++ b/include/MidiEventProcessor.h @@ -49,4 +49,4 @@ public: } // namespace lmms -#endif +#endif // LMMS_MIDI_EVENT_PROCESSOR_H diff --git a/include/MidiEventToByteSeq.h b/include/MidiEventToByteSeq.h index 03308d7b8..6490ae385 100644 --- a/include/MidiEventToByteSeq.h +++ b/include/MidiEventToByteSeq.h @@ -51,4 +51,4 @@ std::size_t LMMS_EXPORT writeToByteSeq( const class MidiEvent& ev, } // namespace lmms -#endif +#endif // LMMS_MIDIEVENTTOBYTESEQ_H diff --git a/include/MidiJack.h b/include/MidiJack.h index 265abedfc..e2b38e290 100644 --- a/include/MidiJack.h +++ b/include/MidiJack.h @@ -102,4 +102,4 @@ private: #endif // LMMS_HAVE_JACK -#endif +#endif // LMMS_MIDI_JACK_H diff --git a/include/MidiOss.h b/include/MidiOss.h index dba0a9a71..9acc0e8e6 100644 --- a/include/MidiOss.h +++ b/include/MidiOss.h @@ -78,4 +78,4 @@ private: #endif // LMMS_HAVE_OSS -#endif +#endif // LMMS_MIDI_OSS_H diff --git a/include/MidiPort.h b/include/MidiPort.h index a03b8477c..6f759708e 100644 --- a/include/MidiPort.h +++ b/include/MidiPort.h @@ -190,4 +190,4 @@ using MidiPortList = QList; } // namespace lmms -#endif +#endif // LMMS_MIDI_PORT_H diff --git a/include/MidiPortMenu.h b/include/MidiPortMenu.h index 88328e734..0b3fc1b2f 100644 --- a/include/MidiPortMenu.h +++ b/include/MidiPortMenu.h @@ -61,4 +61,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_MIDI_PORT_MENU_H diff --git a/include/MidiSetupWidget.h b/include/MidiSetupWidget.h index 492a5bb85..a61b606ac 100644 --- a/include/MidiSetupWidget.h +++ b/include/MidiSetupWidget.h @@ -59,4 +59,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_MIDI_SETUP_WIDGET_H diff --git a/include/MidiSndio.h b/include/MidiSndio.h index 3d7226431..5734745b9 100644 --- a/include/MidiSndio.h +++ b/include/MidiSndio.h @@ -75,4 +75,4 @@ private: #endif // LMMS_HAVE_SNDIO -#endif +#endif // LMMS_MIDI_SNDIO_H diff --git a/include/MidiWinMM.h b/include/MidiWinMM.h index ca1850347..3a8edfbcd 100644 --- a/include/MidiWinMM.h +++ b/include/MidiWinMM.h @@ -150,4 +150,4 @@ signals: #endif // LMMS_BUILD_WIN32 -#endif +#endif // LMMS_MIDI_WINMM_H diff --git a/include/MixHelpers.h b/include/MixHelpers.h index 76242dd7a..6458c65fc 100644 --- a/include/MixHelpers.h +++ b/include/MixHelpers.h @@ -81,4 +81,4 @@ void multiplyAndAddMultipliedJoined( sampleFrame* dst, const sample_t* srcLeft, } // namespace lmms -#endif +#endif // LMMS_MIX_HELPERS_H diff --git a/include/Mixer.h b/include/Mixer.h index d49d950ea..d84a11063 100644 --- a/include/Mixer.h +++ b/include/Mixer.h @@ -226,4 +226,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_MIXER_H diff --git a/include/MixerLine.h b/include/MixerLine.h index 0121717cf..68a61728c 100644 --- a/include/MixerLine.h +++ b/include/MixerLine.h @@ -117,4 +117,4 @@ private slots: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_MIXER_LINE_H diff --git a/include/MixerLineLcdSpinBox.h b/include/MixerLineLcdSpinBox.h index 0d3b182b0..1ae2813f2 100644 --- a/include/MixerLineLcdSpinBox.h +++ b/include/MixerLineLcdSpinBox.h @@ -56,4 +56,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_MIXER_LINE_LCD_SPIN_BOX_H diff --git a/include/MixerView.h b/include/MixerView.h index e73e2e391..9dc5abeee 100644 --- a/include/MixerView.h +++ b/include/MixerView.h @@ -139,4 +139,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_MIXER_VIEW_H diff --git a/include/Model.h b/include/Model.h index 0b8142659..3e304297f 100644 --- a/include/Model.h +++ b/include/Model.h @@ -90,4 +90,4 @@ signals: } // namespace lmms -#endif +#endif // LMMS_MODEL_H diff --git a/include/ModelView.h b/include/ModelView.h index 89e60c3a6..786a6812c 100644 --- a/include/ModelView.h +++ b/include/ModelView.h @@ -85,4 +85,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_MODEL_VIEW_H diff --git a/include/ModelVisitor.h b/include/ModelVisitor.h index 59928d04b..a4654e529 100644 --- a/include/ModelVisitor.h +++ b/include/ModelVisitor.h @@ -68,4 +68,4 @@ public: } // namespace lmms -#endif +#endif // LMMS_MODEL_VISITOR_H diff --git a/include/NStateButton.h b/include/NStateButton.h index dd1c06a66..a6b4c4d9a 100644 --- a/include/NStateButton.h +++ b/include/NStateButton.h @@ -77,4 +77,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_NSTATE_BUTTON_H diff --git a/include/Note.h b/include/Note.h index 9eecd585f..15aeaa2ce 100644 --- a/include/Note.h +++ b/include/Note.h @@ -265,4 +265,4 @@ std::optional boundsForNotes(const NoteVector& notes); } // namespace lmms -#endif +#endif // LMMS_NOTE_H diff --git a/include/NotePlayHandle.h b/include/NotePlayHandle.h index 89fc7e570..29477705b 100644 --- a/include/NotePlayHandle.h +++ b/include/NotePlayHandle.h @@ -364,4 +364,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_NOTE_PLAY_HANDLE_H diff --git a/include/Oscillator.h b/include/Oscillator.h index 025404c41..46d858032 100644 --- a/include/Oscillator.h +++ b/include/Oscillator.h @@ -313,4 +313,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_OSCILLATOR_H diff --git a/include/OscillatorConstants.h b/include/OscillatorConstants.h index ef12636d4..85ae38fe8 100644 --- a/include/OscillatorConstants.h +++ b/include/OscillatorConstants.h @@ -55,4 +55,4 @@ namespace lmms::OscillatorConstants } // namespace lmms::OscillatorConstants -#endif +#endif // LMMS_OSCILLATORCONSTANTS_H diff --git a/include/Oscilloscope.h b/include/Oscilloscope.h index c7a52cef9..209370ce0 100644 --- a/include/Oscilloscope.h +++ b/include/Oscilloscope.h @@ -78,4 +78,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_OSCILLOSCOPE_H diff --git a/include/OutputSettings.h b/include/OutputSettings.h index 0b10d2b01..12242e1bb 100644 --- a/include/OutputSettings.h +++ b/include/OutputSettings.h @@ -119,4 +119,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_OUTPUT_SETTINGS_H diff --git a/include/PathUtil.h b/include/PathUtil.h index 9efd73096..9b410d014 100644 --- a/include/PathUtil.h +++ b/include/PathUtil.h @@ -70,4 +70,4 @@ namespace lmms::PathUtil } // namespace lmms::PathUtil -#endif +#endif // LMMS_PATHUTIL_H diff --git a/include/PatternClip.h b/include/PatternClip.h index 3f9d07cb6..968a0b198 100644 --- a/include/PatternClip.h +++ b/include/PatternClip.h @@ -58,4 +58,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_PATTERN_CLIP_H diff --git a/include/PatternClipView.h b/include/PatternClipView.h index f2e2208bd..ee313f32a 100644 --- a/include/PatternClipView.h +++ b/include/PatternClipView.h @@ -72,4 +72,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_GUI_PATTERN_CLIP_VIEW_H diff --git a/include/PatternEditor.h b/include/PatternEditor.h index fd9a1b254..5787f27ec 100644 --- a/include/PatternEditor.h +++ b/include/PatternEditor.h @@ -97,4 +97,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_GUI_PATTERN_EDITOR_H diff --git a/include/PatternStore.h b/include/PatternStore.h index 024505b83..fcb55e411 100644 --- a/include/PatternStore.h +++ b/include/PatternStore.h @@ -113,4 +113,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_PATTERN_STORE_H diff --git a/include/PatternTrack.h b/include/PatternTrack.h index 8e319216a..1c0c610d2 100644 --- a/include/PatternTrack.h +++ b/include/PatternTrack.h @@ -102,4 +102,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_PATTERN_TRACK_H diff --git a/include/PatternTrackView.h b/include/PatternTrackView.h index b4d373b5d..09a1ba37b 100644 --- a/include/PatternTrackView.h +++ b/include/PatternTrackView.h @@ -68,4 +68,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_GUI_PATTERN_TRACK_VIEW_H diff --git a/include/PeakController.h b/include/PeakController.h index ebdf49cb0..357e2a95d 100644 --- a/include/PeakController.h +++ b/include/PeakController.h @@ -107,4 +107,4 @@ protected: } // namespace lmms -#endif +#endif // LMMS_PEAK_CONTROLLER_H diff --git a/include/PerfLog.h b/include/PerfLog.h index f786de1cc..7b0b587f6 100644 --- a/include/PerfLog.h +++ b/include/PerfLog.h @@ -77,4 +77,4 @@ class PerfLogTimer } // namespace lmms -#endif +#endif // LMMS_PERFLOG_H diff --git a/include/Piano.h b/include/Piano.h index e22710bba..96f374840 100644 --- a/include/Piano.h +++ b/include/Piano.h @@ -89,4 +89,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_PIANO_H diff --git a/include/PianoRoll.h b/include/PianoRoll.h index 5013e3e1b..23fe7ddc6 100644 --- a/include/PianoRoll.h +++ b/include/PianoRoll.h @@ -573,4 +573,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_GUI_PIANO_ROLL_H diff --git a/include/PianoView.h b/include/PianoView.h index 1d5cd4be4..6421ff438 100644 --- a/include/PianoView.h +++ b/include/PianoView.h @@ -103,4 +103,4 @@ signals: } // namespace lmms -#endif +#endif // LMMS_GUI_PIANO_VIEW_H diff --git a/include/Pitch.h b/include/Pitch.h index 537941700..1f721b5f1 100644 --- a/include/Pitch.h +++ b/include/Pitch.h @@ -40,4 +40,4 @@ constexpr pitch_t DefaultPitch = 0; } // namespace lmms -#endif +#endif // LMMS_PITCH_H diff --git a/include/PixmapButton.h b/include/PixmapButton.h index b9568e5ad..e8f546dc0 100644 --- a/include/PixmapButton.h +++ b/include/PixmapButton.h @@ -67,4 +67,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_PIXMAP_BUTTON_H diff --git a/include/PlayHandle.h b/include/PlayHandle.h index 005ef17a0..c64931ac0 100644 --- a/include/PlayHandle.h +++ b/include/PlayHandle.h @@ -166,4 +166,4 @@ using ConstPlayHandleList = QList; } // namespace lmms -#endif +#endif // LMMS_PLAY_HANDLE_H diff --git a/include/Plugin.h b/include/Plugin.h index 0a7b68a55..b1982f98c 100644 --- a/include/Plugin.h +++ b/include/Plugin.h @@ -312,4 +312,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_PLUGIN_H diff --git a/include/PluginBrowser.h b/include/PluginBrowser.h index 262732398..dd2e0a5cb 100644 --- a/include/PluginBrowser.h +++ b/include/PluginBrowser.h @@ -83,4 +83,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_PLUGIN_BROWSER_H diff --git a/include/PluginFactory.h b/include/PluginFactory.h index 8ea020073..ad09b74ed 100644 --- a/include/PluginFactory.h +++ b/include/PluginFactory.h @@ -111,4 +111,4 @@ LMMS_EXPORT PluginFactory* getPluginFactory(); } // namespace lmms -#endif +#endif // LMMS_PLUGIN_FACTORY_H diff --git a/include/PluginIssue.h b/include/PluginIssue.h index c3f3e5dbe..87e895113 100644 --- a/include/PluginIssue.h +++ b/include/PluginIssue.h @@ -84,5 +84,4 @@ QDebug operator<<(QDebug stream, const PluginIssue& iss); } // namespace lmms - -#endif +#endif // LMMS_PLUGIN_ISSUE_H diff --git a/include/PluginView.h b/include/PluginView.h index 75576a8c8..3c78cb00a 100644 --- a/include/PluginView.h +++ b/include/PluginView.h @@ -47,4 +47,4 @@ public: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_PLUGIN_VIEW_H diff --git a/include/PositionLine.h b/include/PositionLine.h index 8c1d7d60a..3e798948f 100644 --- a/include/PositionLine.h +++ b/include/PositionLine.h @@ -51,4 +51,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_POSITION_LINE_H diff --git a/include/PresetPreviewPlayHandle.h b/include/PresetPreviewPlayHandle.h index e37e976e0..b8199a71b 100644 --- a/include/PresetPreviewPlayHandle.h +++ b/include/PresetPreviewPlayHandle.h @@ -69,4 +69,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_PRESET_PREVIEW_PLAY_HANDLE_H diff --git a/include/ProjectJournal.h b/include/ProjectJournal.h index 655d64a17..a4a263078 100644 --- a/include/ProjectJournal.h +++ b/include/ProjectJournal.h @@ -126,4 +126,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_PROJECT_JOURNAL_H diff --git a/include/ProjectNotes.h b/include/ProjectNotes.h index 51577f0b2..861dcb4a8 100644 --- a/include/ProjectNotes.h +++ b/include/ProjectNotes.h @@ -93,4 +93,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_PROJECT_NOTES_H diff --git a/include/ProjectRenderer.h b/include/ProjectRenderer.h index d9309d3db..95a1f53ed 100644 --- a/include/ProjectRenderer.h +++ b/include/ProjectRenderer.h @@ -103,4 +103,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_PROJECT_RENDERER_H diff --git a/include/ProjectVersion.h b/include/ProjectVersion.h index 5401e7126..d9a459a43 100644 --- a/include/ProjectVersion.h +++ b/include/ProjectVersion.h @@ -81,4 +81,4 @@ inline bool operator!=(const ProjectVersion & v1, const ProjectVersion & v2) { r } // namespace lmms -#endif +#endif // LMMS_PROJECT_VERSION_H diff --git a/include/QuadratureLfo.h b/include/QuadratureLfo.h index 59ff81ba7..6f007e072 100644 --- a/include/QuadratureLfo.h +++ b/include/QuadratureLfo.h @@ -100,4 +100,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_QUADRATURE_LFO_H diff --git a/include/RaiiHelpers.h b/include/RaiiHelpers.h index 827cc955d..3108dc080 100644 --- a/include/RaiiHelpers.h +++ b/include/RaiiHelpers.h @@ -64,4 +64,4 @@ using UniqueNullableResource = std::unique_ptr #include @@ -257,4 +256,4 @@ signals: } // namespace lmms -#endif +#endif // LMMS_TRACK_H diff --git a/include/TrackContainer.h b/include/TrackContainer.h index d0c116f3a..5ca831dbe 100644 --- a/include/TrackContainer.h +++ b/include/TrackContainer.h @@ -124,4 +124,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_TRACK_CONTAINER_H diff --git a/include/TrackContainerView.h b/include/TrackContainerView.h index df61666b8..d53291c33 100644 --- a/include/TrackContainerView.h +++ b/include/TrackContainerView.h @@ -218,4 +218,4 @@ signals: } // namespace lmms -#endif +#endif // LMMS_GUI_TRACK_CONTAINER_VIEW_H diff --git a/include/TrackContentWidget.h b/include/TrackContentWidget.h index 09239b392..1a3e14a0e 100644 --- a/include/TrackContentWidget.h +++ b/include/TrackContentWidget.h @@ -149,4 +149,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_GUI_TRACK_CONTENT_WIDGET_H diff --git a/include/TrackLabelButton.h b/include/TrackLabelButton.h index e7f159798..0d1c6e163 100644 --- a/include/TrackLabelButton.h +++ b/include/TrackLabelButton.h @@ -71,4 +71,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_TRACK_LABEL_BUTTON_H diff --git a/include/TrackOperationsWidget.h b/include/TrackOperationsWidget.h index 39e59ac98..4dbb5353c 100644 --- a/include/TrackOperationsWidget.h +++ b/include/TrackOperationsWidget.h @@ -80,4 +80,4 @@ signals: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_TRACK_OPERATIONS_WIDGET_H diff --git a/include/TrackRenameLineEdit.h b/include/TrackRenameLineEdit.h index 48fb96092..2f6a1f4fb 100644 --- a/include/TrackRenameLineEdit.h +++ b/include/TrackRenameLineEdit.h @@ -47,4 +47,4 @@ private: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_TRACK_RENAME_LINE_EDIT_H diff --git a/include/TrackView.h b/include/TrackView.h index a46c15d75..efa4f4a0a 100644 --- a/include/TrackView.h +++ b/include/TrackView.h @@ -176,4 +176,4 @@ private slots: } // namespace lmms -#endif +#endif // LMMS_GUI_TRACK_VIEW_H diff --git a/include/ValueBuffer.h b/include/ValueBuffer.h index 9e80b7ead..683d17fb1 100644 --- a/include/ValueBuffer.h +++ b/include/ValueBuffer.h @@ -57,4 +57,4 @@ public: } // namespace lmms -#endif +#endif // LMMS_VALUE_BUFFER_H diff --git a/include/VersionedSaveDialog.h b/include/VersionedSaveDialog.h index 326b11fde..6d707cd51 100644 --- a/include/VersionedSaveDialog.h +++ b/include/VersionedSaveDialog.h @@ -68,4 +68,4 @@ public slots: } // namespace lmms::gui -#endif +#endif // LMMS_GUI_VERSIONED_SAVE_DIALOG_H diff --git a/include/VstSyncController.h b/include/VstSyncController.h index f63bafc41..d3c6af051 100644 --- a/include/VstSyncController.h +++ b/include/VstSyncController.h @@ -62,4 +62,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_VST_SYNC_CONTROLLER_H diff --git a/include/VstSyncData.h b/include/VstSyncData.h index 11da91d8d..480bc7fb4 100644 --- a/include/VstSyncData.h +++ b/include/VstSyncData.h @@ -61,4 +61,4 @@ struct VstSyncData } // namespace lmms -#endif +#endif // LMMS_VST_SYNC_DATA_H diff --git a/include/aeffectx.h b/include/aeffectx.h index 188feae9f..a7f6002b8 100644 --- a/include/aeffectx.h +++ b/include/aeffectx.h @@ -22,8 +22,8 @@ * */ -#ifndef AEFFECTX_H -#define AEFFECTX_H +#ifndef LMMS_AEFFECTX_H +#define LMMS_AEFFECTX_H #include #include @@ -297,4 +297,4 @@ public: using audioMasterCallback = intptr_t (VST_CALL_CONV*)(AEffect*, int32_t, int32_t, intptr_t, void*, float); -#endif +#endif // LMMS_AEFFECTX_H diff --git a/include/base64.h b/include/base64.h index 01116e4cd..42066d564 100644 --- a/include/base64.h +++ b/include/base64.h @@ -53,4 +53,4 @@ namespace lmms::base64 } // namespace lmms::base64 -#endif +#endif // LMMS_BASE64_H diff --git a/include/debug.h b/include/debug.h index efabd4522..7cf51acaa 100644 --- a/include/debug.h +++ b/include/debug.h @@ -38,4 +38,4 @@ #include -#endif +#endif // LMMS_DEBUG_H diff --git a/include/denormals.h b/include/denormals.h index cfb0d5c92..92b84c7dd 100644 --- a/include/denormals.h +++ b/include/denormals.h @@ -35,7 +35,7 @@ int inline can_we_daz() #endif // __SSE__ -// Set denormal protection for this thread. +// Set denormal protection for this thread. void inline disable_denormals() { #ifdef __SSE__ @@ -50,4 +50,4 @@ void inline disable_denormals() } // namespace lmms -#endif +#endif // LMMS_DENORMALS_H diff --git a/include/embed.h b/include/embed.h index b3d1cbc21..7d69f7c7d 100644 --- a/include/embed.h +++ b/include/embed.h @@ -139,4 +139,4 @@ public: } // namespace lmms -#endif +#endif // LMMS_EMBED_H diff --git a/include/endian_handling.h b/include/endian_handling.h index 96bf11704..7ddb22f22 100644 --- a/include/endian_handling.h +++ b/include/endian_handling.h @@ -57,4 +57,4 @@ inline int32_t swap32IfBE( int32_t i ) } // namespace lmms -#endif +#endif // LMMS_ENDIAN_HANDLING_H diff --git a/include/fenv.h b/include/fenv.h index c9cc508f5..665d88155 100644 --- a/include/fenv.h +++ b/include/fenv.h @@ -45,4 +45,4 @@ inline int fedisableexcept(unsigned int excepts) return fesetenv(&fenv) ? -1 : old_excepts; } -#endif +#endif // defined(__APPLE__) && defined(__MACH__) diff --git a/include/fft_helpers.h b/include/fft_helpers.h index ab4238409..2d2a8d19e 100644 --- a/include/fft_helpers.h +++ b/include/fft_helpers.h @@ -108,4 +108,4 @@ int LMMS_EXPORT compressbands(const float * _absspec_buffer, float * _compressed } // namespace lmms -#endif +#endif // LMMS_FFT_HELPERS_H diff --git a/include/gui_templates.h b/include/gui_templates.h index 7a61ccfed..c0afbdfc0 100644 --- a/include/gui_templates.h +++ b/include/gui_templates.h @@ -68,4 +68,4 @@ inline QFont pointSizeF( QFont _f, float SIZE ) } // namespace lmms -#endif +#endif // LMMS_GUI_TEMPLATES_H diff --git a/include/interpolation.h b/include/interpolation.h index 9f3b3913d..fd2c29a04 100644 --- a/include/interpolation.h +++ b/include/interpolation.h @@ -139,4 +139,4 @@ inline float lagrangeInterpolate( float v0, float v1, float v2, float v3, float } // namespace lmms -#endif +#endif // LMMS_INTERPOLATION_H diff --git a/include/lmms_basics.h b/include/lmms_basics.h index 71cc4ce53..b566fa781 100644 --- a/include/lmms_basics.h +++ b/include/lmms_basics.h @@ -145,4 +145,4 @@ constexpr const char* UI_CTRL_KEY = } // namespace lmms -#endif +#endif // LMMS_TYPES_H diff --git a/include/lmms_constants.h b/include/lmms_constants.h index 7796f6bdf..e6fce9f4d 100644 --- a/include/lmms_constants.h +++ b/include/lmms_constants.h @@ -103,4 +103,4 @@ constexpr int ARANGE_SILENT_END = -10; } // namespace lmms -#endif +#endif // LMMS_CONSTANTS_H diff --git a/include/lmms_math.h b/include/lmms_math.h index a010a9d3e..1f896a683 100644 --- a/include/lmms_math.h +++ b/include/lmms_math.h @@ -328,4 +328,4 @@ static inline T absMin( T a, T b ) } // namespace lmms -#endif +#endif // LMMS_MATH_H diff --git a/include/panning.h b/include/panning.h index 52698677c..56ca04eee 100644 --- a/include/panning.h +++ b/include/panning.h @@ -56,4 +56,4 @@ inline int panningToMidi( panning_t _p ) } // namespace lmms -#endif +#endif // LMMS_PANNING_H diff --git a/include/panning_constants.h b/include/panning_constants.h index 6e894e9d8..8f40219f8 100644 --- a/include/panning_constants.h +++ b/include/panning_constants.h @@ -38,4 +38,4 @@ constexpr panning_t DefaultPanning = PanningCenter; } // namespace lmms -#endif +#endif // LMMS_PANNING_CONSTANTS_H diff --git a/include/shared_object.h b/include/shared_object.h index dfc94b96a..e9fdb57a3 100644 --- a/include/shared_object.h +++ b/include/shared_object.h @@ -86,4 +86,4 @@ private: } // namespace lmms -#endif +#endif // LMMS_SHARED_OBJECT_H diff --git a/include/versioninfo.h b/include/versioninfo.h index de852b59c..f224b62c5 100644 --- a/include/versioninfo.h +++ b/include/versioninfo.h @@ -51,4 +51,4 @@ constexpr const char* LMMS_BUILDCONF_PLATFORM = "win32"; constexpr const char* LMMS_BUILDCONF_PLATFORM = "Haiku"; #endif -#endif +#endif // LMMS_VERSION_INFO_H diff --git a/include/volume.h b/include/volume.h index 4d26cc815..382f76780 100644 --- a/include/volume.h +++ b/include/volume.h @@ -43,4 +43,4 @@ struct StereoVolumeVector } // namespace lmms -#endif +#endif // LMMS_VOLUME_H From 6dfdafe1f712caa50a796a2f2ae98352fc5e8fae Mon Sep 17 00:00:00 2001 From: Michael Gregorius Date: Sat, 7 Jan 2023 20:43:53 +0100 Subject: [PATCH 19/70] Improve readability of text floats Improve the readability of text floats by removing the hard coded pixel font size. The widget is now composed of three QLabels which are used to display the title, text and pixmap. Remove the methods paintEvent and updateSize because the widget is now updated automatically whenever the QLabels change state. Merge both versions of TextFloat::displayMessage because one of them was only called by the other. The default constructor of TextFloat now delegates to the "full" constructor. The latter is private because it is only used from within displayMessage. The methods setTitle, setText and setPixmap show/hide their corresponding labels depending on whether there is text or a pixmap to show. Adjust the class Fader so that the text float is shown to the right of the fader. Otherwise the new implementation would have covered the fader while it is being moved. --- include/TextFloat.h | 17 ++-- src/gui/widgets/Fader.cpp | 5 +- src/gui/widgets/TextFloat.cpp | 178 +++++++++++----------------------- 3 files changed, 63 insertions(+), 137 deletions(-) diff --git a/include/TextFloat.h b/include/TextFloat.h index 9fdabc06b..fccd10ae8 100644 --- a/include/TextFloat.h +++ b/include/TextFloat.h @@ -27,10 +27,11 @@ #define TEXT_FLOAT_H #include -#include #include "lmms_export.h" +class QLabel; + namespace lmms::gui { @@ -47,11 +48,6 @@ public: void setVisibilityTimeOut( int _msecs ); - - static TextFloat * displayMessage( const QString & _msg, - int _timeout = 2000, - QWidget * _parent = nullptr, - int _add_y_margin = 0 ); static TextFloat * displayMessage( const QString & _title, const QString & _msg, const QPixmap & _pixmap = @@ -66,16 +62,15 @@ public: protected: - void paintEvent( QPaintEvent * _me ) override; void mousePressEvent( QMouseEvent * _me ) override; private: - void updateSize(); + TextFloat(const QString & _title, const QString & _text, const QPixmap & _pixmap); - QString m_title; - QString m_text; - QPixmap m_pixmap; + QLabel * m_pixmapLabel; + QLabel * m_titleLabel; + QLabel * m_textLabel; }; diff --git a/src/gui/widgets/Fader.cpp b/src/gui/widgets/Fader.cpp index f853ff707..e2d6d8218 100644 --- a/src/gui/widgets/Fader.cpp +++ b/src/gui/widgets/Fader.cpp @@ -328,7 +328,8 @@ void Fader::updateTextFloat() { s_textFloat->setText( m_description + " " + QString("%1 ").arg( model()->value() * m_conversionFactor ) + " " + m_unit ); } - s_textFloat->moveGlobal( this, QPoint( width() - ( *m_knob ).width() - 5, knobPosY() - 46 ) ); + + s_textFloat->moveGlobal( this, QPoint( width() + 2, knobPosY() - s_textFloat->height() / 2 ) ); } @@ -483,4 +484,4 @@ void Fader::setPeakYellow( const QColor & c ) } -} // namespace lmms::gui \ No newline at end of file +} // namespace lmms::gui diff --git a/src/gui/widgets/TextFloat.cpp b/src/gui/widgets/TextFloat.cpp index 99eb5531f..6588902f9 100644 --- a/src/gui/widgets/TextFloat.cpp +++ b/src/gui/widgets/TextFloat.cpp @@ -22,12 +22,15 @@ * */ +#include "TextFloat.h" + #include #include #include +#include +#include +#include -#include "TextFloat.h" -#include "gui_templates.h" #include "GuiApplication.h" #include "MainWindow.h" @@ -36,170 +39,97 @@ namespace lmms::gui TextFloat::TextFloat() : - QWidget( getGUI()->mainWindow(), Qt::ToolTip ), - m_title(), - m_text(), - m_pixmap() + TextFloat("", "", QPixmap()) { - resize( 20, 20 ); - hide(); - - setAttribute( Qt::WA_TranslucentBackground, true ); - setStyle( QApplication::style() ); - setFont( pointSize<8>( font() ) ); } +TextFloat::TextFloat(const QString & _title, const QString & _text, const QPixmap & _pixmap) : + QWidget( getGUI()->mainWindow(), Qt::ToolTip ) +{ + QHBoxLayout * mainLayout = new QHBoxLayout(); + setLayout(mainLayout); + // Create the label that displays the pixmap + m_pixmapLabel = new QLabel(this); + mainLayout->addWidget(m_pixmapLabel); + // Create the widget that displays the title and the text + QWidget * titleAndTextWidget = new QWidget(this); + QVBoxLayout * titleAndTextLayout = new QVBoxLayout(); + titleAndTextWidget->setLayout(titleAndTextLayout); + + m_titleLabel = new QLabel(titleAndTextWidget); + m_titleLabel->setStyleSheet("font-weight: bold;"); + titleAndTextLayout->addWidget(m_titleLabel); + + m_textLabel = new QLabel(titleAndTextWidget); + titleAndTextLayout->addWidget(m_textLabel); + + mainLayout->addWidget(titleAndTextWidget); + + // Call the setters so that the hidden state is updated + setTitle(_title); + setText(_text); + setPixmap(_pixmap); +} void TextFloat::setTitle( const QString & _title ) { - m_title = _title; - updateSize(); + m_titleLabel->setText(_title); + m_titleLabel->setHidden(_title.isEmpty()); } - - - void TextFloat::setText( const QString & _text ) { - m_text = _text; - updateSize(); + m_textLabel->setText(_text); + m_textLabel->setHidden(_text.isEmpty()); } - - - void TextFloat::setPixmap( const QPixmap & _pixmap ) { - m_pixmap = _pixmap; - updateSize(); + m_pixmapLabel->setPixmap(_pixmap); + m_pixmapLabel->setHidden(_pixmap.isNull()); } - - - void TextFloat::setVisibilityTimeOut( int _msecs ) { QTimer::singleShot( _msecs, this, SLOT(hide())); show(); } - - - -TextFloat * TextFloat::displayMessage( const QString & _msg, int _timeout, - QWidget * _parent, int _add_y_margin ) +TextFloat * TextFloat::displayMessage( const QString & _title, + const QString & _msg, + const QPixmap & _pixmap, + int _timeout, QWidget * _parent ) { - QWidget * mw = getGUI()->mainWindow(); - auto tf = new TextFloat; + auto tf = new TextFloat(_title, _msg, _pixmap); + + // Show the widget so that the correct height is calculated in the code that follows + tf->show(); + if( _parent != nullptr ) { tf->moveGlobal( _parent, QPoint( _parent->width() + 2, 0 ) ); } else { - tf->moveGlobal( mw, QPoint( 32, mw->height() - tf->height() - 8 - _add_y_margin ) ); + // If no parent is given move the window to the lower left area of the main window + QWidget * mw = getGUI()->mainWindow(); + tf->moveGlobal( mw, QPoint( 32, mw->height() - tf->height() - 8 ) ); } - tf->setText( _msg ); - tf->show(); + if( _timeout > 0 ) { tf->setAttribute( Qt::WA_DeleteOnClose, true ); QTimer::singleShot( _timeout, tf, SLOT(close())); } - return( tf ); + + return tf; } - - - -TextFloat * TextFloat::displayMessage( const QString & _title, - const QString & _msg, - const QPixmap & _pixmap, - int _timeout, QWidget * _parent ) -{ - TextFloat * tf = displayMessage( _msg, _timeout, _parent, 16 ); - tf->setTitle( _title ); - tf->setPixmap( _pixmap ); - return( tf ); -} - - - - -void TextFloat::paintEvent( QPaintEvent * _pe ) -{ - QStyleOption opt; - opt.init( this ); - QPainter p( this ); - p.fillRect( 0, 0, width(), height(), QColor( 0, 0, 0, 0 ) ); - -/* p.setPen( p.pen().brush().color() ); - p.setBrush( p.background() );*/ - - p.setFont( pointSize<8>( p.font() ) ); - - style()->drawPrimitive( QStyle::PE_Widget, &opt, &p, this ); - -/* p.drawRect( 0, 0, rect().right(), rect().bottom() );*/ - - if( m_title.isEmpty() ) - { - p.drawText( opt.rect, Qt::AlignCenter, m_text ); - } - else - { - int text_x = opt.rect.left() + 2; - int text_y = opt.rect.top() + 12; - if( m_pixmap.isNull() == false ) - { - p.drawPixmap( opt.rect.topLeft() + QPoint( 5, 5 ), m_pixmap ); - text_x += m_pixmap.width() + 8; - } - p.drawText( text_x, text_y + 16, m_text ); - QFont f = p.font(); - f.setBold( true ); - p.setFont( f ); - p.drawText( text_x, text_y, m_title ); - } -} - - - - void TextFloat::mousePressEvent( QMouseEvent * ) { close(); } - - - -void TextFloat::updateSize() -{ - QFontMetrics metrics( pointSize<8>( font() ) ); - QRect textBound = metrics.boundingRect( m_text ); - if( !m_title.isEmpty() ) - { - QFont f = pointSize<8>( font() ); - f.setBold( true ); - int title_w = QFontMetrics( f ).boundingRect( m_title ).width(); - if( title_w > textBound.width() ) - { - textBound.setWidth( title_w ); - } - textBound.setHeight( textBound.height() * 2 + 8 ); - } - if( m_pixmap.isNull() == false ) - { - textBound.setWidth( textBound.width() + m_pixmap.width() + 10 ); - } - resize( textBound.width() + 5, textBound.height()+2 ); - //move( QPoint( parentWidget()->width() + 5, 5 ) ); - update(); -} - - - } // namespace lmms::gui From d89f53b4b0d71be4b128cc790adfa2fbffa7acde Mon Sep 17 00:00:00 2001 From: Dalton Messmer Date: Sat, 7 Jan 2023 21:12:23 -0500 Subject: [PATCH 20/70] Fix mistakes --- include/Editor.h | 6 +++--- include/Lv2ViewBase.h | 6 +++--- include/aeffectx.h | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/Editor.h b/include/Editor.h index c5e9a2d05..681bce46c 100644 --- a/include/Editor.h +++ b/include/Editor.h @@ -22,8 +22,8 @@ * */ -#ifndef LMMS_EDITOR_H -#define LMMS_EDITOR_H +#ifndef LMMS_GUI_EDITOR_H +#define LMMS_GUI_EDITOR_H #include #include @@ -113,4 +113,4 @@ protected: } // namespace lmms::gui -#endif // LMMS_EDITOR_H +#endif // LMMS_GUI_EDITOR_H diff --git a/include/Lv2ViewBase.h b/include/Lv2ViewBase.h index f6d97d6aa..d27f35cec 100644 --- a/include/Lv2ViewBase.h +++ b/include/Lv2ViewBase.h @@ -22,8 +22,8 @@ * */ -#ifndef LMMS_LV2_VIEW_BASE_H -#define LMMS_LV2_VIEW_BASE_H +#ifndef LMMS_GUI_LV2_VIEW_BASE_H +#define LMMS_GUI_LV2_VIEW_BASE_H #include "lmmsconfig.h" @@ -109,4 +109,4 @@ private: #endif // LMMS_HAVE_LV2 -#endif // LMMS_LV2_VIEW_BASE_H +#endif // LMMS_GUI_LV2_VIEW_BASE_H diff --git a/include/aeffectx.h b/include/aeffectx.h index a7f6002b8..2c69464cc 100644 --- a/include/aeffectx.h +++ b/include/aeffectx.h @@ -22,8 +22,8 @@ * */ -#ifndef LMMS_AEFFECTX_H -#define LMMS_AEFFECTX_H +#ifndef AEFFECTX_H +#define AEFFECTX_H #include #include @@ -297,4 +297,4 @@ public: using audioMasterCallback = intptr_t (VST_CALL_CONV*)(AEffect*, int32_t, int32_t, intptr_t, void*, float); -#endif // LMMS_AEFFECTX_H +#endif // AEFFECTX_H From 17295a4f864dd474eea107e5b0ccc335e29f1da5 Mon Sep 17 00:00:00 2001 From: Michael Gregorius Date: Tue, 10 Jan 2023 19:20:26 +0100 Subject: [PATCH 21/70] Introduce SimpleTextFloat Introduce the new class SimpleTextFloat which simply shows a text and that works like a pseudo tool tip with a narrow margin. It was extracted from TextFloat to adhere to the single responsibility principle. The new class is used by: * Fader: display the current volume when moving the fader * Knob: display the current value when the knob is moved * PianoRoll: display the current value when setting the note volume and panning Add stylings for the new widget in style.css. --- data/themes/classic/style.css | 2 +- data/themes/default/style.css | 2 +- include/Fader.h | 5 ++- include/Knob.h | 4 +- include/PianoRoll.h | 4 +- include/SimpleTextFloat.h | 61 ++++++++++++++++++++++++++++ src/gui/CMakeLists.txt | 1 + src/gui/editors/PianoRoll.cpp | 5 ++- src/gui/widgets/Fader.cpp | 8 ++-- src/gui/widgets/Knob.cpp | 6 +-- src/gui/widgets/SimpleTextFloat.cpp | 62 +++++++++++++++++++++++++++++ 11 files changed, 143 insertions(+), 17 deletions(-) create mode 100644 include/SimpleTextFloat.h create mode 100644 src/gui/widgets/SimpleTextFloat.cpp diff --git a/data/themes/classic/style.css b/data/themes/classic/style.css index 58ec5dc09..2880fe661 100644 --- a/data/themes/classic/style.css +++ b/data/themes/classic/style.css @@ -70,7 +70,7 @@ QToolTip { color: #4afd85; } -lmms--gui--TextFloat { +lmms--gui--TextFloat, lmms--gui--SimpleTextFloat { border-radius: 4px; background: qlineargradient(spread:reflect, x1:0.5, y1:0.5, x2:0.5, y2:0, stop:0 rgba(0, 0, 0, 255), stop:1 rgba(50, 50, 50, 220)); opacity: 175; diff --git a/data/themes/default/style.css b/data/themes/default/style.css index f4c651c9e..a9646cfe4 100644 --- a/data/themes/default/style.css +++ b/data/themes/default/style.css @@ -100,7 +100,7 @@ QToolTip { color: #d1d8e4; } -lmms--gui--TextFloat { +lmms--gui--TextFloat, lmms--gui--SimpleTextFloat { background: #040506; color: #d1d8e4; } diff --git a/include/Fader.h b/include/Fader.h index 54acfc57d..d0ee302cb 100644 --- a/include/Fader.h +++ b/include/Fader.h @@ -55,10 +55,11 @@ #include "AutomatableModelView.h" + namespace lmms::gui { -class TextFloat; +class SimpleTextFloat; class LMMS_EXPORT Fader : public QWidget, public FloatModelView @@ -164,7 +165,7 @@ private: int m_moveStartPoint; float m_startValue; - static TextFloat * s_textFloat; + static SimpleTextFloat * s_textFloat; QColor m_peakGreen; QColor m_peakRed; diff --git a/include/Knob.h b/include/Knob.h index 16ac7ed01..8976dc9ca 100644 --- a/include/Knob.h +++ b/include/Knob.h @@ -41,7 +41,7 @@ namespace lmms::gui { -class TextFloat; +class SimpleTextFloat; enum knobTypes { @@ -175,7 +175,7 @@ private: } - static TextFloat * s_textFloat; + static SimpleTextFloat * s_textFloat; QString m_label; bool m_isHtmlLabel; diff --git a/include/PianoRoll.h b/include/PianoRoll.h index c1973f407..5469e70f9 100644 --- a/include/PianoRoll.h +++ b/include/PianoRoll.h @@ -60,7 +60,7 @@ namespace gui class ComboBox; class PositionLine; -class TextFloat; +class SimpleTextFloat; class TimeLineWidget; @@ -345,7 +345,7 @@ private: static std::array prKeyOrder; - static TextFloat * s_textFloat; + static SimpleTextFloat * s_textFloat; ComboBoxModel m_zoomingModel; ComboBoxModel m_zoomingYModel; diff --git a/include/SimpleTextFloat.h b/include/SimpleTextFloat.h new file mode 100644 index 000000000..1d029c189 --- /dev/null +++ b/include/SimpleTextFloat.h @@ -0,0 +1,61 @@ +/* + * TextFloat.h - class textFloat, a floating text-label + * + * Copyright (c) 2023 LMMS team + * + * This file is part of LMMS - https://lmms.io + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + + +#ifndef SIMPLE_TEXT_FLOAT_H +#define SIMPLE_TEXT_FLOAT_H + +#include + +#include "lmms_export.h" + +class QLabel; + +namespace lmms::gui +{ + +class LMMS_EXPORT SimpleTextFloat : public QWidget +{ + Q_OBJECT +public: + SimpleTextFloat(); + ~SimpleTextFloat() override = default; + + void setText( const QString & _text ); + + void setVisibilityTimeOut( int _msecs ); + + void moveGlobal( QWidget * _w, const QPoint & _offset ) + { + move( _w->mapToGlobal( QPoint( 0, 0 ) ) + _offset ); + } + +private: + QLabel * m_textLabel; +}; + + +} // namespace lmms::gui + +#endif diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 1000ba51d..9f940c035 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -112,6 +112,7 @@ SET(LMMS_SRCS gui/widgets/NStateButton.cpp gui/widgets/Oscilloscope.cpp gui/widgets/PixmapButton.cpp + gui/widgets/SimpleTextFloat.cpp gui/widgets/TabBar.cpp gui/widgets/TabWidget.cpp gui/widgets/TempoSyncKnob.cpp diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 5f294d6e8..0cf72e5cb 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -66,6 +66,7 @@ #include "PatternStore.h" #include "PianoView.h" #include "PositionLine.h" +#include "SimpleTextFloat.h" #include "SongEditor.h" #include "StepRecorderWidget.h" #include "TextFloat.h" @@ -127,7 +128,7 @@ QPixmap * PianoRoll::s_toolMove = nullptr; QPixmap * PianoRoll::s_toolOpen = nullptr; QPixmap* PianoRoll::s_toolKnife = nullptr; -TextFloat * PianoRoll::s_textFloat = nullptr; +SimpleTextFloat * PianoRoll::s_textFloat = nullptr; static std::array s_noteStrings {"C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"}; @@ -290,7 +291,7 @@ PianoRoll::PianoRoll() : // init text-float if( s_textFloat == nullptr ) { - s_textFloat = new TextFloat; + s_textFloat = new SimpleTextFloat; } setAttribute( Qt::WA_OpaquePaintEvent, true ); diff --git a/src/gui/widgets/Fader.cpp b/src/gui/widgets/Fader.cpp index e2d6d8218..4cc5802a4 100644 --- a/src/gui/widgets/Fader.cpp +++ b/src/gui/widgets/Fader.cpp @@ -54,13 +54,13 @@ #include "embed.h" #include "CaptionMenu.h" #include "ConfigManager.h" -#include "TextFloat.h" +#include "SimpleTextFloat.h" namespace lmms::gui { -TextFloat * Fader::s_textFloat = nullptr; +SimpleTextFloat * Fader::s_textFloat = nullptr; QPixmap * Fader::s_back = nullptr; QPixmap * Fader::s_leds = nullptr; QPixmap * Fader::s_knob = nullptr; @@ -83,7 +83,7 @@ Fader::Fader( FloatModel * _model, const QString & _name, QWidget * _parent ) : { if( s_textFloat == nullptr ) { - s_textFloat = new TextFloat; + s_textFloat = new SimpleTextFloat; } if( ! s_back ) { @@ -125,7 +125,7 @@ Fader::Fader( FloatModel * model, const QString & name, QWidget * parent, QPixma { if( s_textFloat == nullptr ) { - s_textFloat = new TextFloat; + s_textFloat = new SimpleTextFloat; } m_back = back; diff --git a/src/gui/widgets/Knob.cpp b/src/gui/widgets/Knob.cpp index 049a86be1..8640bb81d 100644 --- a/src/gui/widgets/Knob.cpp +++ b/src/gui/widgets/Knob.cpp @@ -45,14 +45,14 @@ #include "LocaleHelper.h" #include "MainWindow.h" #include "ProjectJournal.h" +#include "SimpleTextFloat.h" #include "StringPairDrag.h" -#include "TextFloat.h" namespace lmms::gui { -TextFloat * Knob::s_textFloat = nullptr; +SimpleTextFloat * Knob::s_textFloat = nullptr; @@ -86,7 +86,7 @@ void Knob::initUi( const QString & _name ) { if( s_textFloat == nullptr ) { - s_textFloat = new TextFloat; + s_textFloat = new SimpleTextFloat; } setWindowTitle( _name ); diff --git a/src/gui/widgets/SimpleTextFloat.cpp b/src/gui/widgets/SimpleTextFloat.cpp new file mode 100644 index 000000000..e6625063b --- /dev/null +++ b/src/gui/widgets/SimpleTextFloat.cpp @@ -0,0 +1,62 @@ +/* + * TextFloat.cpp - class textFloat, a floating text-label + * + * Copyright (c) LMMS team + * + * This file is part of LMMS - https://lmms.io + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + +#include "SimpleTextFloat.h" + +#include +#include +#include +#include + +#include "GuiApplication.h" +#include "MainWindow.h" + +namespace lmms::gui +{ + + +SimpleTextFloat::SimpleTextFloat() : + QWidget(getGUI()->mainWindow(), Qt::ToolTip) +{ + QHBoxLayout * layout = new QHBoxLayout(this); + layout->setMargin(3); + setLayout(layout); + + m_textLabel = new QLabel(this); + layout->addWidget(m_textLabel); +} + +void SimpleTextFloat::setText( const QString & _text ) +{ + m_textLabel->setText(_text); +} + + +void SimpleTextFloat::setVisibilityTimeOut( int _msecs ) +{ + QTimer::singleShot( _msecs, this, SLOT(hide())); + show(); +} + +} // namespace lmms::gui From e8e54a7ba8d97357366593df19fa09b98347dc33 Mon Sep 17 00:00:00 2001 From: Hyunjin Song Date: Tue, 17 Jan 2023 21:17:38 +0900 Subject: [PATCH 22/70] Remove more global automation from MidiImport (#6605) --- include/Song.h | 6 +++++- include/TrackContainer.h | 6 ------ plugins/MidiImport/MidiImport.cpp | 6 +++++- src/core/Song.cpp | 8 -------- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/include/Song.h b/include/Song.h index 569b3ad14..eacd2114f 100644 --- a/include/Song.h +++ b/include/Song.h @@ -283,7 +283,6 @@ public: bpm_t getTempo(); - AutomationClip * tempoAutomationClip() override; AutomationTrack * globalAutomationTrack() { @@ -352,6 +351,11 @@ public: return m_timeSigModel; } + IntModel& tempoModel() + { + return m_tempoModel; + } + void exportProjectMidi(QString const & exportFileName) const; inline void setLoadOnLaunch(bool value) { m_loadOnLaunch = value; } diff --git a/include/TrackContainer.h b/include/TrackContainer.h index d947094f7..ca9964e30 100644 --- a/include/TrackContainer.h +++ b/include/TrackContainer.h @@ -63,12 +63,6 @@ public: void loadSettings( const QDomElement & _this ) override; - - virtual AutomationClip * tempoAutomationClip() - { - return nullptr; - } - int countTracks( Track::TrackTypes _tt = Track::NumTrackTypes ) const; diff --git a/plugins/MidiImport/MidiImport.cpp b/plugins/MidiImport/MidiImport.cpp index 6a0314966..6836060f3 100644 --- a/plugins/MidiImport/MidiImport.cpp +++ b/plugins/MidiImport/MidiImport.cpp @@ -358,7 +358,11 @@ bool MidiImport::readSMF( TrackContainer* tc ) pd.setValue( 2 ); // Tempo stuff - AutomationClip * tap = tc->tempoAutomationClip(); + auto tt = dynamic_cast(Track::create(Track::AutomationTrack, Engine::getSong())); + tt->setName(tr("Tempo")); + auto tap = new AutomationClip(tt); + tap->setDisplayName(tr("Tempo")); + tap->addObject(&Engine::getSong()->tempoModel()); if( tap ) { tap->clear(); diff --git a/src/core/Song.cpp b/src/core/Song.cpp index ab4ac940b..82388268f 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -837,14 +837,6 @@ bpm_t Song::getTempo() } - - -AutomationClip * Song::tempoAutomationClip() -{ - return AutomationClip::globalAutomationClip( &m_tempoModel ); -} - - AutomatedValueMap Song::automatedValuesAt(TimePos time, int clipNum) const { return TrackContainer::automatedValuesFromTracks(TrackList{m_globalAutomationTrack} << tracks(), time, clipNum); From 158bb5081678931921154e20d2f9e3a0ecedfb32 Mon Sep 17 00:00:00 2001 From: Hyunjin Song Date: Tue, 17 Jan 2023 21:56:31 +0900 Subject: [PATCH 23/70] Fix recent files menu on old KDE in a different way (#6612) --- src/gui/MainApplication.cpp | 13 +++++++++++++ src/gui/MainWindow.cpp | 20 -------------------- 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/src/gui/MainApplication.cpp b/src/gui/MainApplication.cpp index ab45ce304..d33ede4d2 100644 --- a/src/gui/MainApplication.cpp +++ b/src/gui/MainApplication.cpp @@ -39,6 +39,19 @@ MainApplication::MainApplication(int& argc, char** argv) : QApplication(argc, argv), m_queuedFile() { +#if !defined(LMMS_BUILD_WIN32) && !defined(LMMS_BUILD_APPLE) && !defined(LMMS_BUILD_HAIKU) + // Work around a bug of KXmlGui < 5.55 + // which breaks the recent files menu + // https://bugs.kde.org/show_bug.cgi?id=337491 + for (auto child : children()) + { + if (child->inherits("KCheckAcceleratorsInitializer")) + { + delete child; + } + } +#endif + #if defined(LMMS_BUILD_WIN32) installNativeEventFilter(this); #endif diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 706d63e27..b53ce629e 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -33,7 +33,6 @@ #include #include #include -#include #include #include "AboutDialog.h" @@ -78,22 +77,6 @@ namespace lmms::gui { -#if !defined(LMMS_BUILD_WIN32) && !defined(LMMS_BUILD_APPLE) && !defined(LMMS_BUILD_HAIKU) -//Work around an issue on KDE5 as per https://bugs.kde.org/show_bug.cgi?id=337491#c21 -void disableAutoKeyAccelerators(QWidget* mainWindow) -{ - using DisablerFunc = void(*)(QWidget*); - QLibrary kf5WidgetsAddon("KF5WidgetsAddons", 5); - auto setNoAccelerators - = reinterpret_cast(kf5WidgetsAddon.resolve("_ZN19KAcceleratorManager10setNoAccelEP7QWidget")); - if(setNoAccelerators) - { - setNoAccelerators(mainWindow); - } - kf5WidgetsAddon.unload(); -} -#endif - MainWindow::MainWindow() : m_workspace( nullptr ), @@ -103,9 +86,6 @@ MainWindow::MainWindow() : m_metronomeToggle( 0 ), m_session( Normal ) { -#if !defined(LMMS_BUILD_WIN32) && !defined(LMMS_BUILD_APPLE) && !defined(LMMS_BUILD_HAIKU) - disableAutoKeyAccelerators(this); -#endif setAttribute( Qt::WA_DeleteOnClose ); auto main_widget = new QWidget(this); From f89d52fa21c1da6691735f5455ca78873843b963 Mon Sep 17 00:00:00 2001 From: Hyunjin Song Date: Wed, 18 Jan 2023 10:16:28 +0900 Subject: [PATCH 24/70] Fix more Qt deprecation warnings (#6615) * Add to PluginFactory.h * Handle one more deprecated QTextStream::endl * Replace QLayout::setMargin with setContentsMargins * Replace Qt::MidButton with Qt::MiddleButton * Replace QPalette::Background with QPalette::Window * Fix deprecation warnings in LcdFloatSpinBox --- include/PluginFactory.h | 1 + plugins/LadspaBrowser/LadspaBrowser.cpp | 4 ++-- plugins/LadspaBrowser/LadspaDescription.cpp | 6 +++--- plugins/LadspaBrowser/LadspaPortDialog.cpp | 2 +- .../LadspaEffect/LadspaSubPluginFeatures.cpp | 4 ++-- plugins/VstBase/VstPlugin.cpp | 2 +- src/core/Song.cpp | 7 ++++++- src/core/lv2/Lv2SubPluginFeatures.cpp | 4 ++-- src/gui/AutomatableModelView.cpp | 2 +- src/gui/EffectRackView.cpp | 2 +- src/gui/FileBrowser.cpp | 4 ++-- src/gui/LadspaControlView.cpp | 2 +- src/gui/LmmsPalette.cpp | 2 +- src/gui/LmmsStyle.cpp | 2 +- src/gui/MainWindow.cpp | 6 +++--- src/gui/MixerView.cpp | 4 ++-- src/gui/PluginBrowser.cpp | 2 +- src/gui/SampleTrackWindow.cpp | 2 +- src/gui/SideBarWidget.cpp | 2 +- src/gui/editors/SongEditor.cpp | 2 +- src/gui/editors/TrackContainerView.cpp | 4 ++-- .../instrument/InstrumentFunctionViews.cpp | 4 ++-- src/gui/instrument/InstrumentMidiIOView.cpp | 2 +- src/gui/instrument/InstrumentMiscView.cpp | 2 +- src/gui/instrument/InstrumentTrackWindow.cpp | 4 ++-- src/gui/instrument/PianoView.cpp | 2 +- src/gui/modals/ControllerConnectionDialog.cpp | 2 +- src/gui/modals/EffectSelectDialog.cpp | 4 ++-- src/gui/modals/SetupDialog.cpp | 20 +++++++++---------- src/gui/tracks/SampleTrackView.cpp | 2 +- src/gui/tracks/TrackView.cpp | 2 +- src/gui/widgets/LcdFloatSpinBox.cpp | 7 ++++--- src/gui/widgets/MeterDialog.cpp | 6 +++--- src/gui/widgets/TabBar.cpp | 2 +- src/gui/widgets/TabWidget.cpp | 4 ++-- src/gui/widgets/TimeDisplayWidget.cpp | 2 +- 36 files changed, 69 insertions(+), 62 deletions(-) diff --git a/include/PluginFactory.h b/include/PluginFactory.h index 8b8b88b6e..15c8882ac 100644 --- a/include/PluginFactory.h +++ b/include/PluginFactory.h @@ -29,6 +29,7 @@ #include #include +#include #include #include #include diff --git a/plugins/LadspaBrowser/LadspaBrowser.cpp b/plugins/LadspaBrowser/LadspaBrowser.cpp index 714b3887c..09f83ab4e 100644 --- a/plugins/LadspaBrowser/LadspaBrowser.cpp +++ b/plugins/LadspaBrowser/LadspaBrowser.cpp @@ -98,7 +98,7 @@ LadspaBrowserView::LadspaBrowserView( ToolPlugin * _tool ) : { auto hlayout = new QHBoxLayout(this); hlayout->setSpacing( 0 ); - hlayout->setMargin( 0 ); + hlayout->setContentsMargins(0, 0, 0, 0); m_tabBar = new TabBar( this, QBoxLayout::TopToBottom ); m_tabBar->setExclusive( true ); @@ -166,7 +166,7 @@ QWidget * LadspaBrowserView::createTab( QWidget * _parent, const QString & _txt, tab->setFixedSize( 500, 400 ); auto layout = new QVBoxLayout(tab); layout->setSpacing( 0 ); - layout->setMargin( 0 ); + layout->setContentsMargins(0, 0, 0, 0); const QString type = "" + tr( "Type:" ) + " "; auto title = new QLabel(type + _txt, tab); diff --git a/plugins/LadspaBrowser/LadspaDescription.cpp b/plugins/LadspaBrowser/LadspaDescription.cpp index ff4d74867..004505d66 100644 --- a/plugins/LadspaBrowser/LadspaDescription.cpp +++ b/plugins/LadspaBrowser/LadspaDescription.cpp @@ -94,7 +94,7 @@ LadspaDescription::LadspaDescription( QWidget * _parent, auto descriptionBox = new QGroupBox(tr("Description"), this); auto descriptionLayout = new QVBoxLayout(descriptionBox); descriptionLayout->setSpacing( 0 ); - descriptionLayout->setMargin( 0 ); + descriptionLayout->setContentsMargins(0, 0, 0, 0); m_scrollArea = new QScrollArea( descriptionBox ); descriptionLayout->addWidget( m_scrollArea ); @@ -130,7 +130,7 @@ void LadspaDescription::update( const ladspa_key_t & _key ) auto maker = new QWidget(description); auto makerLayout = new QHBoxLayout(maker); - makerLayout->setMargin( 0 ); + makerLayout->setContentsMargins(0, 0, 0, 0); makerLayout->setSpacing( 0 ); layout->addWidget( maker ); @@ -145,7 +145,7 @@ void LadspaDescription::update( const ladspa_key_t & _key ) auto copyright = new QWidget(description); auto copyrightLayout = new QHBoxLayout(copyright); - copyrightLayout->setMargin( 0 ); + copyrightLayout->setContentsMargins(0, 0, 0, 0); copyrightLayout->setSpacing( 0 ); layout->addWidget( copyright ); diff --git a/plugins/LadspaBrowser/LadspaPortDialog.cpp b/plugins/LadspaBrowser/LadspaPortDialog.cpp index 3c0dbabd5..e25679511 100644 --- a/plugins/LadspaBrowser/LadspaPortDialog.cpp +++ b/plugins/LadspaBrowser/LadspaPortDialog.cpp @@ -47,7 +47,7 @@ LadspaPortDialog::LadspaPortDialog( const ladspa_key_t & _key ) auto vlayout = new QVBoxLayout(this); vlayout->setSpacing( 0 ); - vlayout->setMargin( 0 ); + vlayout->setContentsMargins(0, 0, 0, 0); int pc = manager->getPortCount( _key ); diff --git a/plugins/LadspaEffect/LadspaSubPluginFeatures.cpp b/plugins/LadspaEffect/LadspaSubPluginFeatures.cpp index 8ab50858a..1522d7187 100644 --- a/plugins/LadspaEffect/LadspaSubPluginFeatures.cpp +++ b/plugins/LadspaEffect/LadspaSubPluginFeatures.cpp @@ -71,7 +71,7 @@ void LadspaSubPluginFeatures::fillDescriptionWidget( QWidget * _parent, auto maker = new QWidget(_parent); auto l = new QHBoxLayout(maker); - l->setMargin( 0 ); + l->setContentsMargins(0, 0, 0, 0); l->setSpacing( 0 ); auto maker_label = new QLabel(maker); @@ -85,7 +85,7 @@ void LadspaSubPluginFeatures::fillDescriptionWidget( QWidget * _parent, auto copyright = new QWidget(_parent); l = new QHBoxLayout( copyright ); - l->setMargin( 0 ); + l->setContentsMargins(0, 0, 0, 0); l->setSpacing( 0 ); copyright->setMinimumWidth( _parent->minimumWidth() ); diff --git a/plugins/VstBase/VstPlugin.cpp b/plugins/VstBase/VstPlugin.cpp index 700a14ac7..c3fe17d72 100644 --- a/plugins/VstBase/VstPlugin.cpp +++ b/plugins/VstBase/VstPlugin.cpp @@ -751,7 +751,7 @@ void VstPlugin::createUI( QWidget * parent ) QHBoxLayout * l = new QHBoxLayout( helper ); QWidget * target = new QWidget( helper ); l->setSpacing( 0 ); - l->setMargin( 0 ); + l->setContentsMargins(0, 0, 0, 0); l->addWidget( target ); // we've to call that for making sure, Qt created the windows diff --git a/src/core/Song.cpp b/src/core/Song.cpp index 82388268f..06ac15633 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -1043,7 +1043,12 @@ void Song::loadProject( const QString & fileName ) else { QTextStream(stderr) << tr("Can't load project: " - "Project file contains local paths to plugins.") << endl; + "Project file contains local paths to plugins.") +#if (QT_VERSION >= QT_VERSION_CHECK(5,15,0)) + << Qt::endl; +#else + << endl; +#endif } } } diff --git a/src/core/lv2/Lv2SubPluginFeatures.cpp b/src/core/lv2/Lv2SubPluginFeatures.cpp index 4fb377b1c..8c3c98711 100644 --- a/src/core/lv2/Lv2SubPluginFeatures.cpp +++ b/src/core/lv2/Lv2SubPluginFeatures.cpp @@ -81,7 +81,7 @@ void Lv2SubPluginFeatures::fillDescriptionWidget(QWidget *parent, auto maker = new QWidget(parent); auto l = new QHBoxLayout(maker); - l->setMargin(0); + l->setContentsMargins(0, 0, 0, 0); l->setSpacing(0); auto maker_label = new QLabel(maker); @@ -98,7 +98,7 @@ void Lv2SubPluginFeatures::fillDescriptionWidget(QWidget *parent, auto copyright = new QWidget(parent); l = new QHBoxLayout(copyright); - l->setMargin(0); + l->setContentsMargins(0, 0, 0, 0); l->setSpacing(0); copyright->setMinimumWidth(parent->minimumWidth()); diff --git a/src/gui/AutomatableModelView.cpp b/src/gui/AutomatableModelView.cpp index 52ee1ed7e..0e364993f 100644 --- a/src/gui/AutomatableModelView.cpp +++ b/src/gui/AutomatableModelView.cpp @@ -176,7 +176,7 @@ void AutomatableModelView::mousePressEvent( QMouseEvent* event ) new gui::StringPairDrag( "automatable_model", QString::number( modelUntyped()->id() ), QPixmap(), widget() ); event->accept(); } - else if( event->button() == Qt::MidButton ) + else if( event->button() == Qt::MiddleButton ) { modelUntyped()->reset(); } diff --git a/src/gui/EffectRackView.cpp b/src/gui/EffectRackView.cpp index 75cac67dc..aa790d74d 100644 --- a/src/gui/EffectRackView.cpp +++ b/src/gui/EffectRackView.cpp @@ -42,7 +42,7 @@ EffectRackView::EffectRackView( EffectChain* model, QWidget* parent ) : ModelView( nullptr, this ) { auto mainLayout = new QVBoxLayout(this); - mainLayout->setMargin( 5 ); + mainLayout->setContentsMargins(5, 5, 5, 5); m_effectsGroupBox = new GroupBox( tr( "EFFECTS CHAIN" ) ); mainLayout->addWidget( m_effectsGroupBox ); diff --git a/src/gui/FileBrowser.cpp b/src/gui/FileBrowser.cpp index 4ef41217d..a104d3265 100644 --- a/src/gui/FileBrowser.cpp +++ b/src/gui/FileBrowser.cpp @@ -76,7 +76,7 @@ void FileBrowser::addContentCheckBox() auto filterWidget = new QWidget(contentParent()); filterWidget->setFixedHeight(15); auto filterWidgetLayout = new QHBoxLayout(filterWidget); - filterWidgetLayout->setMargin(0); + filterWidgetLayout->setContentsMargins(0, 0, 0, 0); filterWidgetLayout->setSpacing(0); auto configCheckBox = [this, &filterWidgetLayout](QCheckBox* box) @@ -119,7 +119,7 @@ FileBrowser::FileBrowser(const QString & directories, const QString & filter, searchWidget->setFixedHeight( 24 ); auto searchWidgetLayout = new QHBoxLayout(searchWidget); - searchWidgetLayout->setMargin( 0 ); + searchWidgetLayout->setContentsMargins(0, 0, 0, 0); searchWidgetLayout->setSpacing( 0 ); m_filterEdit = new QLineEdit( searchWidget ); diff --git a/src/gui/LadspaControlView.cpp b/src/gui/LadspaControlView.cpp index 38ad4a146..46e208d2e 100644 --- a/src/gui/LadspaControlView.cpp +++ b/src/gui/LadspaControlView.cpp @@ -43,7 +43,7 @@ LadspaControlView::LadspaControlView( QWidget * _parent, m_ctl( _ctl ) { auto layout = new QHBoxLayout(this); - layout->setMargin( 0 ); + layout->setContentsMargins(0, 0, 0, 0); layout->setSpacing( 0 ); LedCheckBox * link = nullptr; diff --git a/src/gui/LmmsPalette.cpp b/src/gui/LmmsPalette.cpp index 48d6de0df..0d135f52c 100644 --- a/src/gui/LmmsPalette.cpp +++ b/src/gui/LmmsPalette.cpp @@ -75,7 +75,7 @@ QPalette LmmsPalette::palette() const { QPalette pal = QApplication::style()->standardPalette(); - pal.setColor( QPalette::Background, background() ); + pal.setColor( QPalette::Window, background() ); pal.setColor( QPalette::WindowText, windowText() ); pal.setColor( QPalette::Base, base() ); pal.setColor( QPalette::ButtonText, buttonText() ); diff --git a/src/gui/LmmsStyle.cpp b/src/gui/LmmsStyle.cpp index 060a97811..50a2a9de4 100644 --- a/src/gui/LmmsStyle.cpp +++ b/src/gui/LmmsStyle.cpp @@ -189,7 +189,7 @@ void LmmsStyle::drawComplexControl( ComplexControl control, /* else if( control == CC_ScrollBar ) { painter->fillRect( option->rect, QApplication::palette().color( QPalette::Active, - QPalette::Background ) ); + QPalette::Window ) ); }*/ QProxyStyle::drawComplexControl( control, option, painter, widget ); diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index b53ce629e..40c8334ba 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -91,12 +91,12 @@ MainWindow::MainWindow() : auto main_widget = new QWidget(this); auto vbox = new QVBoxLayout(main_widget); vbox->setSpacing( 0 ); - vbox->setMargin( 0 ); + vbox->setContentsMargins(0, 0, 0, 0); auto w = new QWidget(main_widget); auto hbox = new QHBoxLayout(w); hbox->setSpacing( 0 ); - hbox->setMargin( 0 ); + hbox->setContentsMargins(0, 0, 0, 0); auto sideBar = new SideBar(Qt::Vertical, w); @@ -206,7 +206,7 @@ MainWindow::MainWindow() : // add layout for organizing quite complex toolbar-layouting m_toolBarLayout = new QGridLayout( m_toolBar/*, 2, 1*/ ); - m_toolBarLayout->setMargin( 0 ); + m_toolBarLayout->setContentsMargins(0, 0, 0, 0); m_toolBarLayout->setSpacing( 0 ); vbox->addWidget( m_toolBar ); diff --git a/src/gui/MixerView.cpp b/src/gui/MixerView.cpp index 62d4cb7ce..a9b7bf992 100644 --- a/src/gui/MixerView.cpp +++ b/src/gui/MixerView.cpp @@ -59,7 +59,7 @@ MixerView::MixerView() : m->setHook( this ); //QPalette pal = palette(); - //pal.setColor( QPalette::Background, QColor( 72, 76, 88 ) ); + //pal.setColor( QPalette::Window, QColor( 72, 76, 88 ) ); //setPalette( pal ); setAutoFillBackground( true ); @@ -79,7 +79,7 @@ MixerView::MixerView() : chLayout = new QHBoxLayout( m_channelAreaWidget ); chLayout->setSizeConstraint( QLayout::SetMinimumSize ); chLayout->setSpacing( 0 ); - chLayout->setMargin( 0 ); + chLayout->setContentsMargins(0, 0, 0, 0); m_channelAreaWidget->setLayout(chLayout); // create rack layout before creating the first channel diff --git a/src/gui/PluginBrowser.cpp b/src/gui/PluginBrowser.cpp index a19c80df0..afb74dcd3 100644 --- a/src/gui/PluginBrowser.cpp +++ b/src/gui/PluginBrowser.cpp @@ -52,7 +52,7 @@ PluginBrowser::PluginBrowser( QWidget * _parent ) : addContentWidget( m_view ); auto view_layout = new QVBoxLayout(m_view); - view_layout->setMargin( 5 ); + view_layout->setContentsMargins(5, 5, 5, 5); view_layout->setSpacing( 5 ); diff --git a/src/gui/SampleTrackWindow.cpp b/src/gui/SampleTrackWindow.cpp index 78b899a09..6fe70bf41 100644 --- a/src/gui/SampleTrackWindow.cpp +++ b/src/gui/SampleTrackWindow.cpp @@ -57,7 +57,7 @@ SampleTrackWindow::SampleTrackWindow(SampleTrackView * tv) : // init own layout + widgets setFocusPolicy(Qt::StrongFocus); auto vlayout = new QVBoxLayout(this); - vlayout->setMargin(0); + vlayout->setContentsMargins(0, 0, 0, 0); vlayout->setSpacing(0); auto generalSettingsWidget = new TabWidget(tr("GENERAL SETTINGS"), this); diff --git a/src/gui/SideBarWidget.cpp b/src/gui/SideBarWidget.cpp index cf0233af1..60760ba59 100644 --- a/src/gui/SideBarWidget.cpp +++ b/src/gui/SideBarWidget.cpp @@ -44,7 +44,7 @@ SideBarWidget::SideBarWidget( const QString & _title, const QPixmap & _icon, m_contents = new QWidget( this ); m_layout = new QVBoxLayout( m_contents ); m_layout->setSpacing( 5 ); - m_layout->setMargin( 0 ); + m_layout->setContentsMargins(0, 0, 0, 0); m_closeBtn = new QPushButton(embed::getIconPixmap("close"), QString(), this); m_closeBtn->resize(m_buttonSize); m_closeBtn->setToolTip(tr("Close")); diff --git a/src/gui/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index 40be52319..3e62cc238 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -213,7 +213,7 @@ SongEditor::SongEditor( Song * song ) : // create widget for oscilloscope- and cpu-load-widget auto vc_w = new QWidget(tb); auto vcw_layout = new QVBoxLayout(vc_w); - vcw_layout->setMargin( 0 ); + vcw_layout->setContentsMargins(0, 0, 0, 0); vcw_layout->setSpacing( 0 ); vcw_layout->addStretch(); diff --git a/src/gui/editors/TrackContainerView.cpp b/src/gui/editors/TrackContainerView.cpp index 351fe8295..38a6a36d5 100644 --- a/src/gui/editors/TrackContainerView.cpp +++ b/src/gui/editors/TrackContainerView.cpp @@ -90,13 +90,13 @@ TrackContainerView::TrackContainerView( TrackContainer * _tc ) : //keeps the direction of the widget, undepended on the locale setLayoutDirection( Qt::LeftToRight ); auto layout = new QVBoxLayout(this); - layout->setMargin( 0 ); + layout->setContentsMargins(0, 0, 0, 0); layout->setSpacing( 0 ); layout->addWidget( m_scrollArea ); auto scrollContent = new QWidget; m_scrollLayout = new QVBoxLayout( scrollContent ); - m_scrollLayout->setMargin( 0 ); + m_scrollLayout->setContentsMargins(0, 0, 0, 0); m_scrollLayout->setSpacing( 0 ); m_scrollLayout->setSizeConstraint( QLayout::SetMinAndMaxSize ); diff --git a/src/gui/instrument/InstrumentFunctionViews.cpp b/src/gui/instrument/InstrumentFunctionViews.cpp index 99c68a5ed..a4f0e670a 100644 --- a/src/gui/instrument/InstrumentFunctionViews.cpp +++ b/src/gui/instrument/InstrumentFunctionViews.cpp @@ -47,7 +47,7 @@ InstrumentFunctionNoteStackingView::InstrumentFunctionNoteStackingView( Instrume m_chordRangeKnob( new Knob( knobBright_26 ) ) { auto topLayout = new QHBoxLayout(this); - topLayout->setMargin( 0 ); + topLayout->setContentsMargins(0, 0, 0, 0); topLayout->addWidget( m_chordsGroupBox ); auto mainLayout = new QGridLayout(m_chordsGroupBox); @@ -109,7 +109,7 @@ InstrumentFunctionArpeggioView::InstrumentFunctionArpeggioView( InstrumentFuncti m_arpModeComboBox( new ComboBox() ) { auto topLayout = new QHBoxLayout(this); - topLayout->setMargin( 0 ); + topLayout->setContentsMargins(0, 0, 0, 0); topLayout->addWidget( m_arpGroupBox ); auto mainLayout = new QGridLayout(m_arpGroupBox); diff --git a/src/gui/instrument/InstrumentMidiIOView.cpp b/src/gui/instrument/InstrumentMidiIOView.cpp index 8d7cf9dda..fd9d6fc54 100644 --- a/src/gui/instrument/InstrumentMidiIOView.cpp +++ b/src/gui/instrument/InstrumentMidiIOView.cpp @@ -48,7 +48,7 @@ InstrumentMidiIOView::InstrumentMidiIOView( QWidget* parent ) : m_wpBtn( nullptr ) { auto layout = new QVBoxLayout(this); - layout->setMargin( 5 ); + layout->setContentsMargins(5, 5, 5, 5); m_midiInputGroupBox = new GroupBox( tr( "ENABLE MIDI INPUT" ) ); layout->addWidget( m_midiInputGroupBox ); diff --git a/src/gui/instrument/InstrumentMiscView.cpp b/src/gui/instrument/InstrumentMiscView.cpp index 1b4f82333..514db579c 100644 --- a/src/gui/instrument/InstrumentMiscView.cpp +++ b/src/gui/instrument/InstrumentMiscView.cpp @@ -44,7 +44,7 @@ InstrumentMiscView::InstrumentMiscView(InstrumentTrack *it, QWidget *parent) : QWidget(parent) { auto layout = new QVBoxLayout(this); - layout->setMargin(5); + layout->setContentsMargins(5, 5, 5, 5); // Master pitch toggle m_pitchGroupBox = new GroupBox(tr("GLOBAL TRANSPOSITION")); diff --git a/src/gui/instrument/InstrumentTrackWindow.cpp b/src/gui/instrument/InstrumentTrackWindow.cpp index 70c11976a..1d26dd9dc 100644 --- a/src/gui/instrument/InstrumentTrackWindow.cpp +++ b/src/gui/instrument/InstrumentTrackWindow.cpp @@ -90,7 +90,7 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) : // init own layout + widgets setFocusPolicy( Qt::StrongFocus ); auto vlayout = new QVBoxLayout(this); - vlayout->setMargin( 0 ); + vlayout->setContentsMargins(0, 0, 0, 0); vlayout->setSpacing( 0 ); auto generalSettingsWidget = new TabWidget(tr("GENERAL SETTINGS"), this); @@ -246,7 +246,7 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) : // FUNC tab auto instrumentFunctions = new QWidget(m_tabWidget); auto instrumentFunctionsLayout = new QVBoxLayout(instrumentFunctions); - instrumentFunctionsLayout->setMargin( 5 ); + instrumentFunctionsLayout->setContentsMargins(5, 5, 5, 5); m_noteStackingView = new InstrumentFunctionNoteStackingView( &m_track->m_noteStacking ); m_arpeggioView = new InstrumentFunctionArpeggioView( &m_track->m_arpeggio ); diff --git a/src/gui/instrument/PianoView.cpp b/src/gui/instrument/PianoView.cpp index 7478c8204..a2df50e47 100644 --- a/src/gui/instrument/PianoView.cpp +++ b/src/gui/instrument/PianoView.cpp @@ -147,7 +147,7 @@ PianoView::PianoView(QWidget *parent) : // create a layout for ourselves auto layout = new QVBoxLayout(this); layout->setSpacing( 0 ); - layout->setMargin( 0 ); + layout->setContentsMargins(0, 0, 0, 0); layout->addSpacing( PIANO_BASE+PW_WHITE_KEY_HEIGHT ); layout->addWidget( m_pianoScroll ); diff --git a/src/gui/modals/ControllerConnectionDialog.cpp b/src/gui/modals/ControllerConnectionDialog.cpp index 149303da8..06f6a5708 100644 --- a/src/gui/modals/ControllerConnectionDialog.cpp +++ b/src/gui/modals/ControllerConnectionDialog.cpp @@ -215,7 +215,7 @@ ControllerConnectionDialog::ControllerConnectionDialog( QWidget * _parent, auto btn_layout = new QHBoxLayout(buttons); btn_layout->setSpacing( 0 ); - btn_layout->setMargin( 0 ); + btn_layout->setContentsMargins(0, 0, 0, 0); auto select_btn = new QPushButton(embed::getIconPixmap("add"), tr("OK"), buttons); connect( select_btn, SIGNAL(clicked()), diff --git a/src/gui/modals/EffectSelectDialog.cpp b/src/gui/modals/EffectSelectDialog.cpp index 9ce3f90b6..eac5a3783 100644 --- a/src/gui/modals/EffectSelectDialog.cpp +++ b/src/gui/modals/EffectSelectDialog.cpp @@ -213,14 +213,14 @@ void EffectSelectDialog::rowChanged( const QModelIndex & _idx, hbox->addWidget(textualInfoWidget); auto textWidgetLayout = new QVBoxLayout(textualInfoWidget); - textWidgetLayout->setMargin( 4 ); + textWidgetLayout->setContentsMargins(4, 4, 4, 4); textWidgetLayout->setSpacing( 0 ); if ( m_currentSelection.desc->subPluginFeatures ) { auto subWidget = new QWidget(textualInfoWidget); auto subLayout = new QVBoxLayout(subWidget); - subLayout->setMargin( 4 ); + subLayout->setContentsMargins(4, 4, 4, 4); subLayout->setSpacing( 0 ); m_currentSelection.desc->subPluginFeatures-> fillDescriptionWidget( subWidget, &m_currentSelection ); diff --git a/src/gui/modals/SetupDialog.cpp b/src/gui/modals/SetupDialog.cpp index 5140a63b5..44eaf87b0 100644 --- a/src/gui/modals/SetupDialog.cpp +++ b/src/gui/modals/SetupDialog.cpp @@ -175,12 +175,12 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : // Vertical layout. auto vlayout = new QVBoxLayout(this); vlayout->setSpacing(0); - vlayout->setMargin(0); + vlayout->setContentsMargins(0, 0, 0, 0); // Horizontal layout. auto hlayout = new QHBoxLayout(main_w); hlayout->setSpacing(0); - hlayout->setMargin(0); + hlayout->setContentsMargins(0, 0, 0, 0); // Tab bar for the main tabs. m_tabBar = new TabBar(main_w, QBoxLayout::TopToBottom); @@ -195,7 +195,7 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : auto general_w = new QWidget(settings_w); auto general_layout = new QVBoxLayout(general_w); general_layout->setSpacing(10); - general_layout->setMargin(0); + general_layout->setContentsMargins(0, 0, 0, 0); labelWidget(general_w, tr("General")); auto addLedCheckBox = [&XDelta, &YDelta, this](const QString& ledText, TabWidget* tw, int& counter, @@ -324,7 +324,7 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : auto performance_w = new QWidget(settings_w); auto performance_layout = new QVBoxLayout(performance_w); performance_layout->setSpacing(10); - performance_layout->setMargin(0); + performance_layout->setContentsMargins(0, 0, 0, 0); labelWidget(performance_w, tr("Performance")); @@ -442,7 +442,7 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : auto audio_w = new QWidget(settings_w); auto audio_layout = new QVBoxLayout(audio_w); audio_layout->setSpacing(10); - audio_layout->setMargin(0); + audio_layout->setContentsMargins(0, 0, 0, 0); labelWidget(audio_w, tr("Audio")); @@ -460,7 +460,7 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : auto as_w_layout = new QHBoxLayout(as_w); as_w_layout->setSpacing(0); - as_w_layout->setMargin(0); + as_w_layout->setContentsMargins(0, 0, 0, 0); #ifdef LMMS_HAVE_JACK m_audioIfaceSetupWidgets[AudioJack::name()] = @@ -592,7 +592,7 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : auto midi_w = new QWidget(settings_w); auto midi_layout = new QVBoxLayout(midi_w); midi_layout->setSpacing(10); - midi_layout->setMargin(0); + midi_layout->setContentsMargins(0, 0, 0, 0); labelWidget(midi_w, tr("MIDI")); @@ -609,7 +609,7 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : auto ms_w_layout = new QHBoxLayout(ms_w); ms_w_layout->setSpacing(0); - ms_w_layout->setMargin(0); + ms_w_layout->setContentsMargins(0, 0, 0, 0); #ifdef LMMS_HAVE_ALSA m_midiIfaceSetupWidgets[MidiAlsaSeq::name()] = @@ -709,7 +709,7 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : auto paths_layout = new QVBoxLayout(paths_w); paths_layout->setSpacing(10); - paths_layout->setMargin(0); + paths_layout->setContentsMargins(0, 0, 0, 0); labelWidget(paths_w, tr("Paths")); @@ -823,7 +823,7 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : auto extras_w = new QWidget(this); auto extras_layout = new QHBoxLayout(extras_w); extras_layout->setSpacing(0); - extras_layout->setMargin(0); + extras_layout->setContentsMargins(0, 0, 0, 0); // Restart warning label. restartWarningLbl = new QLabel( diff --git a/src/gui/tracks/SampleTrackView.cpp b/src/gui/tracks/SampleTrackView.cpp index 08ddee863..fbdd41ded 100644 --- a/src/gui/tracks/SampleTrackView.cpp +++ b/src/gui/tracks/SampleTrackView.cpp @@ -82,7 +82,7 @@ SampleTrackView::SampleTrackView( SampleTrack * _t, TrackContainerView* tcv ) : m_panningKnob->show(); m_activityIndicator = new FadeButton( - QApplication::palette().color(QPalette::Active, QPalette::Background), + QApplication::palette().color(QPalette::Active, QPalette::Window), QApplication::palette().color(QPalette::Active, QPalette::BrightText), QApplication::palette().color(QPalette::Active, QPalette::BrightText).darker(), getTrackSettingsWidget() diff --git a/src/gui/tracks/TrackView.cpp b/src/gui/tracks/TrackView.cpp index 0aabc705d..3e9257a0d 100644 --- a/src/gui/tracks/TrackView.cpp +++ b/src/gui/tracks/TrackView.cpp @@ -75,7 +75,7 @@ TrackView::TrackView( Track * track, TrackContainerView * tcv ) : m_trackSettingsWidget.setAutoFillBackground( true ); auto layout = new QHBoxLayout(this); - layout->setMargin( 0 ); + layout->setContentsMargins(0, 0, 0, 0); layout->setSpacing( 0 ); layout->addWidget( &m_trackOperationsWidget ); layout->addWidget( &m_trackSettingsWidget ); diff --git a/src/gui/widgets/LcdFloatSpinBox.cpp b/src/gui/widgets/LcdFloatSpinBox.cpp index e57012e10..6391f314a 100644 --- a/src/gui/widgets/LcdFloatSpinBox.cpp +++ b/src/gui/widgets/LcdFloatSpinBox.cpp @@ -38,6 +38,7 @@ #include #include "CaptionMenu.h" +#include "DeprecationHelper.h" #include "embed.h" #include "GuiApplication.h" #include "gui_templates.h" @@ -179,7 +180,7 @@ void LcdFloatSpinBox::mouseReleaseEvent(QMouseEvent*) void LcdFloatSpinBox::wheelEvent(QWheelEvent *event) { // switch between integer and fractional step based on cursor position - if (event->x() < m_wholeDisplay.width()) { m_intStep = true; } + if (position(event).x() < m_wholeDisplay.width()) { m_intStep = true; } else { m_intStep = false; } event->accept(); @@ -239,9 +240,9 @@ void LcdFloatSpinBox::paintEvent(QPaintEvent*) { p.setFont(pointSizeF(p.font(), 6.5)); p.setPen(m_wholeDisplay.textShadowColor()); - p.drawText(width() / 2 - p.fontMetrics().width(m_label) / 2 + 1, height(), m_label); + p.drawText(width() / 2 - horizontalAdvance(p.fontMetrics(), m_label) / 2 + 1, height(), m_label); p.setPen(m_wholeDisplay.textColor()); - p.drawText(width() / 2 - p.fontMetrics().width(m_label) / 2, height() - 1, m_label); + p.drawText(width() / 2 - horizontalAdvance(p.fontMetrics(), m_label) / 2, height() - 1, m_label); } } diff --git a/src/gui/widgets/MeterDialog.cpp b/src/gui/widgets/MeterDialog.cpp index 938177dce..ced08382e 100644 --- a/src/gui/widgets/MeterDialog.cpp +++ b/src/gui/widgets/MeterDialog.cpp @@ -43,12 +43,12 @@ MeterDialog::MeterDialog( QWidget * _parent, bool _simple ) : { auto vlayout = new QVBoxLayout(this); vlayout->setSpacing( 0 ); - vlayout->setMargin( 0 ); + vlayout->setContentsMargins(0, 0, 0, 0); auto num = new QWidget(this); auto num_layout = new QHBoxLayout(num); num_layout->setSpacing( 0 ); - num_layout->setMargin( 0 ); + num_layout->setContentsMargins(0, 0, 0, 0); m_numerator = new LcdSpinBox( 2, num, tr( "Meter Numerator" ) ); @@ -69,7 +69,7 @@ MeterDialog::MeterDialog( QWidget * _parent, bool _simple ) : auto den = new QWidget(this); auto den_layout = new QHBoxLayout(den); den_layout->setSpacing( 0 ); - den_layout->setMargin( 0 ); + den_layout->setContentsMargins(0, 0, 0, 0); m_denominator = new LcdSpinBox( 2, den, tr( "Meter Denominator" ) ); m_denominator->setToolTip(tr("Meter denominator")); diff --git a/src/gui/widgets/TabBar.cpp b/src/gui/widgets/TabBar.cpp index d3c1fa0c5..806a93252 100644 --- a/src/gui/widgets/TabBar.cpp +++ b/src/gui/widgets/TabBar.cpp @@ -37,7 +37,7 @@ TabBar::TabBar( QWidget * _parent, QBoxLayout::Direction _dir ) : m_layout( new QBoxLayout( _dir, this ) ), m_exclusive( false ) { - m_layout->setMargin( 8 ); + m_layout->setContentsMargins(8, 8, 8, 8); m_layout->setSpacing( 0 ); setLayout( m_layout ); diff --git a/src/gui/widgets/TabWidget.cpp b/src/gui/widgets/TabWidget.cpp index 106387e42..5ab56fee7 100644 --- a/src/gui/widgets/TabWidget.cpp +++ b/src/gui/widgets/TabWidget.cpp @@ -60,9 +60,9 @@ TabWidget::TabWidget(const QString & caption, QWidget * parent, bool usePixmap, setFont( pointSize<8>( font() ) ); setAutoFillBackground( true ); - QColor bg_color = QApplication::palette().color( QPalette::Active, QPalette::Background ). darker( 132 ); + QColor bg_color = QApplication::palette().color( QPalette::Active, QPalette::Window ). darker( 132 ); QPalette pal = palette(); - pal.setColor( QPalette::Background, bg_color ); + pal.setColor( QPalette::Window, bg_color ); setPalette( pal ); } diff --git a/src/gui/widgets/TimeDisplayWidget.cpp b/src/gui/widgets/TimeDisplayWidget.cpp index cefa0fa8f..cf139d4a8 100644 --- a/src/gui/widgets/TimeDisplayWidget.cpp +++ b/src/gui/widgets/TimeDisplayWidget.cpp @@ -43,7 +43,7 @@ TimeDisplayWidget::TimeDisplayWidget() : m_milliSecondsLCD( 3, this ) { m_spinBoxesLayout.setSpacing( 0 ); - m_spinBoxesLayout.setMargin( 0 ); + m_spinBoxesLayout.setContentsMargins(0, 0, 0, 0); m_spinBoxesLayout.addWidget( &m_majorLCD ); m_spinBoxesLayout.addWidget( &m_minorLCD ); m_spinBoxesLayout.addWidget( &m_milliSecondsLCD ); From 22eb7a1364309af13423abaed134df35498ec551 Mon Sep 17 00:00:00 2001 From: Johannes Lorenz Date: Sun, 1 Jan 2023 02:08:29 +0100 Subject: [PATCH 25/70] clang-tidy: Apply readability-const-return-type --- .clang-tidy | 1 + include/AutomationClip.h | 2 +- include/PluginFactory.h | 10 +++++----- src/core/AutomationClip.cpp | 4 ++-- src/core/PluginFactory.cpp | 10 +++++----- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index aff46bba6..804bc28f1 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -9,6 +9,7 @@ Checks: > modernize-use-equals-delete, modernize-use-override, performance-trivially-destructible, + readability-const-return-type, readability-identifier-naming, readability-misleading-indentation, readability-simplify-boolean-expr, diff --git a/include/AutomationClip.h b/include/AutomationClip.h index 3e253d85f..6f7c6291d 100644 --- a/include/AutomationClip.h +++ b/include/AutomationClip.h @@ -154,7 +154,7 @@ public: float valueAt( const TimePos & _time ) const; float *valuesAfter( const TimePos & _time ) const; - const QString name() const; + QString name() const; // settings-management void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override; diff --git a/include/PluginFactory.h b/include/PluginFactory.h index 15c8882ac..8a8a22c68 100644 --- a/include/PluginFactory.h +++ b/include/PluginFactory.h @@ -47,7 +47,7 @@ class LMMS_EXPORT PluginFactory public: struct PluginInfo { - const QString name() const; + QString name() const; QFileInfo file; std::shared_ptr library = nullptr; Plugin::Descriptor* descriptor = nullptr; @@ -67,8 +67,8 @@ public: static PluginFactory* instance(); /// Returns a list of all found plugins' descriptors. - const Plugin::DescriptorList descriptors() const; - const Plugin::DescriptorList descriptors(Plugin::PluginTypes type) const; + Plugin::DescriptorList descriptors() const; + Plugin::DescriptorList descriptors(Plugin::PluginTypes type) const; struct PluginInfoAndKey { @@ -80,12 +80,12 @@ public: /// Returns a list of all found plugins' PluginFactory::PluginInfo objects. const PluginInfoList& pluginInfos() const; /// Returns a plugin that support the given file extension - const PluginInfoAndKey pluginSupportingExtension(const QString& ext); + PluginInfoAndKey pluginSupportingExtension(const QString& ext); /// Returns the PluginInfo object of the plugin with the given name. /// If the plugin is not found, an empty PluginInfo is returned (use /// PluginInfo::isNull() to check this). - const PluginInfo pluginInfo(const char* name) const; + PluginInfo pluginInfo(const char* name) const; /// When loading a library fails during discovery, the error string is saved. /// It can be retrieved by calling this function. diff --git a/src/core/AutomationClip.cpp b/src/core/AutomationClip.cpp index fb2d7dbb0..c031c5a41 100644 --- a/src/core/AutomationClip.cpp +++ b/src/core/AutomationClip.cpp @@ -857,7 +857,7 @@ void AutomationClip::loadSettings( const QDomElement & _this ) -const QString AutomationClip::name() const +QString AutomationClip::name() const { QMutexLocker m(&m_clipMutex); @@ -1173,4 +1173,4 @@ void AutomationClip::generateTangents(timeMap::iterator it, int numToGenerate) } } -} // namespace lmms \ No newline at end of file +} // namespace lmms diff --git a/src/core/PluginFactory.cpp b/src/core/PluginFactory.cpp index 81a6122d1..ece589274 100644 --- a/src/core/PluginFactory.cpp +++ b/src/core/PluginFactory.cpp @@ -105,12 +105,12 @@ PluginFactory* getPluginFactory() return PluginFactory::instance(); } -const Plugin::DescriptorList PluginFactory::descriptors() const +Plugin::DescriptorList PluginFactory::descriptors() const { return m_descriptors.values(); } -const Plugin::DescriptorList PluginFactory::descriptors(Plugin::PluginTypes type) const +Plugin::DescriptorList PluginFactory::descriptors(Plugin::PluginTypes type) const { return m_descriptors.values(type); } @@ -120,12 +120,12 @@ const PluginFactory::PluginInfoList& PluginFactory::pluginInfos() const return m_pluginInfos; } -const PluginFactory::PluginInfoAndKey PluginFactory::pluginSupportingExtension(const QString& ext) +PluginFactory::PluginInfoAndKey PluginFactory::pluginSupportingExtension(const QString& ext) { return m_pluginByExt.value(ext, PluginInfoAndKey()); } -const PluginFactory::PluginInfo PluginFactory::pluginInfo(const char* name) const +PluginFactory::PluginInfo PluginFactory::pluginInfo(const char* name) const { for (const PluginInfo& info : m_pluginInfos) { @@ -248,7 +248,7 @@ void PluginFactory::discoverPlugins() -const QString PluginFactory::PluginInfo::name() const +QString PluginFactory::PluginInfo::name() const { return descriptor ? descriptor->name : QString(); } From 50a4297c9718dc8f919781af8f792f5542f124f1 Mon Sep 17 00:00:00 2001 From: Johannes Lorenz Date: Sat, 21 Jan 2023 16:39:17 +0100 Subject: [PATCH 26/70] [ci skip] Update .clang-format This adds previously applied checks to the `.clang-format` file and also reorders the checks alphabetically. --- .clang-tidy | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 804bc28f1..5de9376e5 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -2,18 +2,22 @@ Checks: > bugprone-macro-parentheses, bugprone-macro-repeated-side-effects, + modernize-avoid-c-arrays, + modernize-loop-convert, modernize-redundant-void-arg, + modernize-use-auto, modernize-use-bool-literals, modernize-use-emplace, modernize-use-equals-default, modernize-use-equals-delete, modernize-use-override, + modernize-use-using, performance-trivially-destructible, + readability-braces-around-statements, readability-const-return-type, readability-identifier-naming, readability-misleading-indentation, - readability-simplify-boolean-expr, - readability-braces-around-statements + readability-simplify-boolean-expr WarningsAsErrors: '' HeaderFilterRegex: '' # don't show errors from headers AnalyzeTemporaryDtors: false From c8a9d45ef05e06e813c813debbfd9ed1c0c96883 Mon Sep 17 00:00:00 2001 From: Hyunjin Song Date: Tue, 24 Jan 2023 10:46:11 +0900 Subject: [PATCH 27/70] [ci skip] Remove the reorganization disclaimer --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 7090a6a15..c64ca0a97 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,6 @@ [![Join the chat at Discord](https://img.shields.io/badge/chat-on%20discord-7289DA.svg)](https://discord.gg/3sc5su7) [![Localise on transifex](https://img.shields.io/badge/localise-on_transifex-green.svg)](https://www.transifex.com/lmms/lmms/) -**New PRs may be affected by ongoing reorganization ([#5592](https://github.com/LMMS/lmms/issues/5592)). Please be prepared to rebase your PR as necessary.** - What is LMMS? -------------- From 4d1d8871cd0bca162787d55473b94a0454085cc5 Mon Sep 17 00:00:00 2001 From: Lost Robot <34612565+LostRobotMusic@users.noreply.github.com> Date: Thu, 26 Jan 2023 11:29:41 -0800 Subject: [PATCH 28/70] Add HIIR library to LMMS (#6553) --- .gitmodules | 3 +++ src/3rdparty/CMakeLists.txt | 1 + src/3rdparty/hiir/CMakeLists.txt | 3 +++ src/3rdparty/hiir/hiir | 1 + 4 files changed, 8 insertions(+) create mode 100644 src/3rdparty/hiir/CMakeLists.txt create mode 160000 src/3rdparty/hiir/hiir diff --git a/.gitmodules b/.gitmodules index 2ccfcbcdf..ee6e7eac9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -49,3 +49,6 @@ [submodule "plugins/LadspaEffect/cmt/cmt"] path = plugins/LadspaEffect/cmt/cmt url = https://github.com/lmms/cmt +[submodule "src/3rdparty/hiir/hiir"] + path = src/3rdparty/hiir/hiir + url = https://github.com/LostRobotMusic/hiir diff --git a/src/3rdparty/CMakeLists.txt b/src/3rdparty/CMakeLists.txt index 24d156095..7a6b88775 100644 --- a/src/3rdparty/CMakeLists.txt +++ b/src/3rdparty/CMakeLists.txt @@ -3,6 +3,7 @@ IF(LMMS_BUILD_LINUX AND WANT_VST) add_subdirectory(qt5-x11embed) ENDIF() +ADD_SUBDIRECTORY(hiir) ADD_SUBDIRECTORY(rpmalloc) ADD_SUBDIRECTORY(weakjack) diff --git a/src/3rdparty/hiir/CMakeLists.txt b/src/3rdparty/hiir/CMakeLists.txt new file mode 100644 index 000000000..e954ff187 --- /dev/null +++ b/src/3rdparty/hiir/CMakeLists.txt @@ -0,0 +1,3 @@ +add_library(hiir INTERFACE) +target_include_directories(hiir INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +target_compile_features(hiir INTERFACE cxx_std_17) diff --git a/src/3rdparty/hiir/hiir b/src/3rdparty/hiir/hiir new file mode 160000 index 000000000..54a41371d --- /dev/null +++ b/src/3rdparty/hiir/hiir @@ -0,0 +1 @@ +Subproject commit 54a41371d9da47e62d669ac86bd0b2e726a2a057 From cf13cfa57aaa8a314f34670913395d9da6425d4d Mon Sep 17 00:00:00 2001 From: Lost Robot <34612565+LostRobotMusic@users.noreply.github.com> Date: Thu, 26 Jan 2023 12:28:37 -0800 Subject: [PATCH 29/70] Update HIIR submodule to latest (#6622) --- src/3rdparty/hiir/hiir | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty/hiir/hiir b/src/3rdparty/hiir/hiir index 54a41371d..4a9a1e67f 160000 --- a/src/3rdparty/hiir/hiir +++ b/src/3rdparty/hiir/hiir @@ -1 +1 @@ -Subproject commit 54a41371d9da47e62d669ac86bd0b2e726a2a057 +Subproject commit 4a9a1e67fa6f8ce7688e1c0c8a2b017cecd206a3 From 9d5d86d863ad9d55ee1d70fe6065f1f215d5b436 Mon Sep 17 00:00:00 2001 From: Hyunjin Song Date: Fri, 27 Jan 2023 21:55:43 +0900 Subject: [PATCH 30/70] Update Docker image version for ShellCheck --- .github/workflows/checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 1d893989e..3f7700674 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -21,7 +21,7 @@ jobs: run: tests/scripted/check-namespace shellcheck: runs-on: ubuntu-latest - container: koalaman/shellcheck-alpine:v0.4.6 + container: koalaman/shellcheck-alpine:v0.9.0 steps: - name: Check out uses: actions/checkout@v3 From 507fa239ddffd2ed1f186d0a51016c85d9c2b5a9 Mon Sep 17 00:00:00 2001 From: Bimal Poudel Date: Wed, 8 Feb 2023 00:16:10 -0700 Subject: [PATCH 31/70] Update BashCompletion.cmake (#6634) --- cmake/modules/BashCompletion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/modules/BashCompletion.cmake b/cmake/modules/BashCompletion.cmake index c3916f201..7301e82aa 100644 --- a/cmake/modules/BashCompletion.cmake +++ b/cmake/modules/BashCompletion.cmake @@ -24,7 +24,7 @@ # - Windows does not support bash completion # - macOS support should eventually be added for Homebrew (TODO) IF(WIN32) - MESSAGE(STATUS "Bash competion is not supported on this platform.") + MESSAGE(STATUS "Bash completion is not supported on this platform.") ELSEIF(APPLE) MESSAGE(STATUS "Bash completion is not yet implemented for this platform.") ELSE() From 8ba6a5f89e044bfcb893455f6ac146e2eb7e2aac Mon Sep 17 00:00:00 2001 From: Lost Robot <34612565+LostRobotMusic@users.noreply.github.com> Date: Sat, 18 Feb 2023 07:22:16 -0800 Subject: [PATCH 32/70] Draggable effects (#6648) Reorder effects in Mixer with the mouse via click and drag --- include/EffectView.h | 9 ++++++++ src/gui/EffectView.cpp | 51 ++++++++++++++++++++++++++++++++++++++---- 2 files changed, 56 insertions(+), 4 deletions(-) diff --git a/include/EffectView.h b/include/EffectView.h index 90bb54896..b2b5985ad 100644 --- a/include/EffectView.h +++ b/include/EffectView.h @@ -30,6 +30,7 @@ #include "PluginView.h" #include "Effect.h" +class QGraphicsOpacityEffect; class QGroupBox; class QLabel; class QPushButton; @@ -61,6 +62,11 @@ public: } static constexpr int DEFAULT_WIDTH = 215; + static constexpr int DEFAULT_HEIGHT = 60; + + void mouseMoveEvent(QMouseEvent* event) override; + void mousePressEvent(QMouseEvent* event) override; + void mouseReleaseEvent(QMouseEvent* event) override; public slots: void editControls(); @@ -90,6 +96,9 @@ private: Knob * m_gate; QMdiSubWindow * m_subWindow; EffectControlDialog * m_controlView; + + bool m_dragging; + QGraphicsOpacityEffect* m_opacityEffect; } ; diff --git a/src/gui/EffectView.cpp b/src/gui/EffectView.cpp index fed1ce4e9..f2caaadd5 100644 --- a/src/gui/EffectView.cpp +++ b/src/gui/EffectView.cpp @@ -23,9 +23,11 @@ * */ +#include +#include +#include #include #include -#include #include "EffectView.h" #include "DummyEffect.h" @@ -47,9 +49,10 @@ EffectView::EffectView( Effect * _model, QWidget * _parent ) : PluginView( _model, _parent ), m_bg( embed::getIconPixmap( "effect_plugin" ) ), m_subWindow( nullptr ), - m_controlView( nullptr ) + m_controlView(nullptr), + m_dragging(false) { - setFixedSize( EffectView::DEFAULT_WIDTH, 60 ); + setFixedSize(EffectView::DEFAULT_WIDTH, EffectView::DEFAULT_HEIGHT); // Disable effects that are of type "DummyEffect" bool isEnabled = !dynamic_cast( effect() ); @@ -116,7 +119,10 @@ EffectView::EffectView( Effect * _model, QWidget * _parent ) : m_subWindow->hide(); } } - + + m_opacityEffect = new QGraphicsOpacityEffect(this); + m_opacityEffect->setOpacity(1); + setGraphicsEffect(m_opacityEffect); //move above vst effect view creation //setModel( _model ); @@ -208,6 +214,43 @@ void EffectView::contextMenuEvent( QContextMenuEvent * ) +void EffectView::mousePressEvent(QMouseEvent* event) +{ + if (event->button() == Qt::LeftButton) + { + m_dragging = true; + m_opacityEffect->setOpacity(0.3); + QCursor c(Qt::SizeVerCursor); + QApplication::setOverrideCursor(c); + update(); + } +} + +void EffectView::mouseReleaseEvent(QMouseEvent* event) +{ + if (event->button() == Qt::LeftButton) + { + m_dragging = false; + m_opacityEffect->setOpacity(1); + QApplication::restoreOverrideCursor(); + update(); + } +} + +void EffectView::mouseMoveEvent(QMouseEvent* event) +{ + if (!m_dragging) { return; } + if (event->pos().y() < 0) + { + moveUp(); + } + else if (event->pos().y() > EffectView::DEFAULT_HEIGHT) + { + moveDown(); + } +} + + void EffectView::paintEvent( QPaintEvent * ) { From 1a68aee149565e86af23ce2d4654d8ea689b7f86 Mon Sep 17 00:00:00 2001 From: Proud Electrics Studios Date: Mon, 16 Jan 2023 10:13:35 +0100 Subject: [PATCH 33/70] PatternClips now use startTimeOffset, too, and can be resized on their start [FIX 7] --- src/core/PatternClip.cpp | 2 ++ src/gui/clips/ClipView.cpp | 37 +++++++++++++++++++++++-------- src/gui/clips/PatternClipView.cpp | 14 +++++++----- src/tracks/PatternTrack.cpp | 18 ++++++++++----- 4 files changed, 52 insertions(+), 19 deletions(-) diff --git a/src/core/PatternClip.cpp b/src/core/PatternClip.cpp index 9af9bda6a..a0752b0aa 100644 --- a/src/core/PatternClip.cpp +++ b/src/core/PatternClip.cpp @@ -60,6 +60,7 @@ void PatternClip::saveSettings(QDomDocument& doc, QDomElement& element) element.setAttribute( "pos", startPosition() ); } element.setAttribute( "len", length() ); + element.setAttribute("off", startTimeOffset()); element.setAttribute( "muted", isMuted() ); if( usesCustomClipColor() ) { @@ -78,6 +79,7 @@ void PatternClip::loadSettings(const QDomElement& element) movePosition( element.attribute( "pos" ).toInt() ); } changeLength( element.attribute( "len" ).toInt() ); + setStartTimeOffset(element.attribute("off").toInt()); if( element.attribute( "muted" ).toInt() != isMuted() ) { toggleMute(); diff --git a/src/gui/clips/ClipView.cpp b/src/gui/clips/ClipView.cpp index e2da11439..8c4f704bc 100644 --- a/src/gui/clips/ClipView.cpp +++ b/src/gui/clips/ClipView.cpp @@ -43,6 +43,8 @@ #include "MidiClip.h" #include "MidiClipView.h" #include "Note.h" +#include "PatternClip.h" +#include "PatternStore.h" #include "SampleClip.h" #include "Song.h" #include "SongEditor.h" @@ -502,10 +504,11 @@ void ClipView::dropEvent( QDropEvent * de ) void ClipView::updateCursor(QMouseEvent * me) { auto sClip = dynamic_cast(m_clip); + auto pClip = dynamic_cast(m_clip); // If we are at the edges, use the resize cursor if (!me->buttons() && !m_clip->getAutoResize() && !isSelected() - && ((me->x() > width() - RESIZE_GRIP_WIDTH) || (me->x() < RESIZE_GRIP_WIDTH && sClip))) + && ((me->x() > width() - RESIZE_GRIP_WIDTH) || (me->x() < RESIZE_GRIP_WIDTH && (sClip || pClip)))) { setCursor(Qt::SizeHorCursor); } @@ -633,6 +636,7 @@ void ClipView::mousePressEvent( QMouseEvent * me ) if( !fixedClips() && me->button() == Qt::LeftButton ) { auto sClip = dynamic_cast(m_clip); + auto pClip = dynamic_cast(m_clip); const bool knifeMode = m_trackView->trackContainerView()->knifeMode(); if ( me->modifiers() & Qt::ControlModifier && !(sClip && knifeMode) ) @@ -677,7 +681,7 @@ void ClipView::mousePressEvent( QMouseEvent * me ) m_action = Resize; setCursor( Qt::SizeHorCursor ); } - else if( me->x() < RESIZE_GRIP_WIDTH && sClip ) + else if( me->x() < RESIZE_GRIP_WIDTH && (sClip || pClip) ) { m_action = ResizeLeft; setCursor( Qt::SizeHorCursor ); @@ -836,7 +840,6 @@ void ClipView::mouseMoveEvent( QMouseEvent * me ) if( m_action == Move ) { TimePos newPos = draggedClipPos( me ); - m_clip->movePosition(newPos); newPos = m_clip->startPosition(); // Get the real position the Clip was dragged to for the label m_trackView->getTrackContentWidget()->changePosition(); @@ -916,7 +919,8 @@ void ClipView::mouseMoveEvent( QMouseEvent * me ) else { auto sClip = dynamic_cast(m_clip); - if( sClip ) + auto pClip = dynamic_cast(m_clip); + if( sClip || pClip ) { const int x = mapToParent( me->pos() ).x() - m_initialMousePos.x(); @@ -948,12 +952,27 @@ void ClipView::mouseMoveEvent( QMouseEvent * me ) t = qMin( m_initialClipEnd - minLength, m_initialClipPos + offset ); } - TimePos oldPos = m_clip->startPosition(); - if( m_clip->length() + ( oldPos - t ) >= 1 ) + TimePos positionOffset = m_clip->startPosition() - t; + if (m_clip->length() + positionOffset >= 1) { - m_clip->movePosition( t ); - m_clip->changeLength( m_clip->length() + ( oldPos - t ) ); - sClip->setStartTimeOffset( sClip->startTimeOffset() + ( oldPos - t ) ); + m_clip->movePosition(t); + m_clip->changeLength(m_clip->length() + positionOffset); + if (sClip) + { + sClip->setStartTimeOffset(sClip->startTimeOffset() + positionOffset); + } + else if (pClip) + { + // Modulus the start time offset as we need it only for offsets + // inside the pattern length. This is done to prevent a value overflow. + // The start time offset may still become larger than the pattern length + // whenever the pattern length decreases without a clip resize following. + // To deal safely with it, always modulus before use. + tick_t patternLength = Engine::patternStore()->lengthOfPattern(pClip->patternIndex()) + * TimePos::ticksPerBar(); + TimePos position = (pClip->startTimeOffset() + positionOffset) % patternLength; + pClip->setStartTimeOffset(position); + } } } } diff --git a/src/gui/clips/PatternClipView.cpp b/src/gui/clips/PatternClipView.cpp index 477a90052..bf12440c7 100644 --- a/src/gui/clips/PatternClipView.cpp +++ b/src/gui/clips/PatternClipView.cpp @@ -115,14 +115,18 @@ void PatternClipView::paintEvent(QPaintEvent*) // bar lines const int lineSize = 3; + int pixelsPerPattern = Engine::patternStore()->lengthOfPattern(m_patternClip->patternIndex()) * pixelsPerBar(); + int offset = static_cast(m_patternClip->startTimeOffset() * (pixelsPerBar() / TimePos::ticksPerBar())) + % pixelsPerPattern; + if (offset < 2) { + offset += pixelsPerPattern; + } + p.setPen( c.darker( 200 ) ); - bar_t t = Engine::patternStore()->lengthOfPattern(m_patternClip->patternIndex()); - if (m_patternClip->length() > TimePos::ticksPerBar() && t > 0) + if (pixelsPerPattern > 0) { - for( int x = static_cast( t * pixelsPerBar() ); - x < width() - 2; - x += static_cast( t * pixelsPerBar() ) ) + for (int x = offset; x < width() - 2; x += pixelsPerPattern) { p.drawLine( x, BORDER_WIDTH, x, BORDER_WIDTH + lineSize ); p.drawLine( x, rect().bottom() - ( BORDER_WIDTH + lineSize ), diff --git a/src/tracks/PatternTrack.cpp b/src/tracks/PatternTrack.cpp index 9fcc2c831..cdcd108ff 100644 --- a/src/tracks/PatternTrack.cpp +++ b/src/tracks/PatternTrack.cpp @@ -108,19 +108,27 @@ bool PatternTrack::play( const TimePos & _start, const fpp_t _frames, } TimePos lastPosition; - TimePos lastLen; + TimePos lastLength; + tick_t lastOffset = 0; for (const auto& clip : clips) { if (!clip->isMuted() && clip->startPosition() >= lastPosition) { lastPosition = clip->startPosition(); - lastLen = clip->length(); + lastLength = clip->length(); + tick_t patternLength = Engine::patternStore()->lengthOfPattern(static_cast(clip)->patternIndex()) + * TimePos::ticksPerBar(); + lastOffset = patternLength - (clip->startTimeOffset() % patternLength); + if (lastOffset == patternLength) + { + lastOffset = 0; + } } } - if( _start - lastPosition < lastLen ) + if( _start - lastPosition < lastLength ) { - return Engine::patternStore()->play(_start - lastPosition, _frames, _offset, s_infoMap[this]); + return Engine::patternStore()->play(_start - lastPosition + lastOffset, _frames, _offset, s_infoMap[this]); } return false; } @@ -240,4 +248,4 @@ void PatternTrack::swapPatternTracks(Track* track1, Track* track2) } -} // namespace lmms \ No newline at end of file +} // namespace lmms From 1ddd204250b944af73ad231014947cdf849977fe Mon Sep 17 00:00:00 2001 From: dj-pixus Date: Mon, 13 Dec 2021 17:27:25 +0100 Subject: [PATCH 34/70] workize output note setting --- src/core/midi/MidiPort.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/midi/MidiPort.cpp b/src/core/midi/MidiPort.cpp index 63ca817e0..b656d9541 100644 --- a/src/core/midi/MidiPort.cpp +++ b/src/core/midi/MidiPort.cpp @@ -169,6 +169,12 @@ void MidiPort::processOutEvent( const MidiEvent& event, const TimePos& time ) outEvent.setVelocity( fixedOutputVelocity() ); } + if( fixedOutputNote() >= 0 && + ( event.type() == MidiNoteOn || event.type() == MidiNoteOff || event.type() == MidiKeyPressure ) ) + { + outEvent.setKey( fixedOutputNote() ); + } + m_midiClient->processOutEvent( outEvent, time, this ); } } @@ -238,6 +244,7 @@ void MidiPort::loadSettings( const QDomElement& thisElement ) m_outputControllerModel.loadSettings( thisElement, "outputcontroller" ); m_fixedInputVelocityModel.loadSettings( thisElement, "fixedinputvelocity" ); m_fixedOutputVelocityModel.loadSettings( thisElement, "fixedoutputvelocity" ); + m_fixedOutputNoteModel.loadSettings( thisElement, "fixedoutputnote" ); m_outputProgramModel.loadSettings( thisElement, "outputprogram" ); m_baseVelocityModel.loadSettings( thisElement, "basevelocity" ); m_readableModel.loadSettings( thisElement, "readable" ); From 192119621f1d321ac3eb853ec5ba54a1b3ba67e6 Mon Sep 17 00:00:00 2001 From: dev Date: Wed, 10 Mar 2021 13:33:31 +0530 Subject: [PATCH 35/70] Save Piano Roll behaviour at stop state --- include/TimeLineWidget.h | 5 +++++ src/gui/editors/PianoRoll.cpp | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/include/TimeLineWidget.h b/include/TimeLineWidget.h index 0f9b1e23a..061a31081 100644 --- a/include/TimeLineWidget.h +++ b/include/TimeLineWidget.h @@ -121,6 +121,11 @@ public: return m_behaviourAtStop; } + void setBehaviourAtStop (int state) + { + emit loadBehaviourAtStop (state); + } + bool loopPointsEnabled() const { return m_loopPoints == LoopPointsEnabled; diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 5f294d6e8..1dbbe1cf4 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -5180,6 +5180,8 @@ void PianoRollWindow::saveSettings( QDomDocument & doc, QDomElement & de ) de.appendChild(markedSemiTonesRoot); } + de.setAttribute("stopbehaviour", m_editor->m_timeLine->behaviourAtStop()); + MainWindow::saveWidgetState( this, de ); } @@ -5193,6 +5195,8 @@ void PianoRollWindow::loadSettings( const QDomElement & de ) MainWindow::restoreWidgetState( this, de ); + m_editor->m_timeLine->setBehaviourAtStop(de.attribute("stopbehaviour").toInt()); + // update margins here because we're later in the startup process // We can't earlier because everything is still starting with the // WHITE_KEY_WIDTH default From 9bcf63c5da3132c669af1f237d98770e766aaa6f Mon Sep 17 00:00:00 2001 From: madisonsilver Date: Sat, 18 Feb 2023 18:01:11 -0800 Subject: [PATCH 36/70] Fix issues #6383 and #4410 (pause issues). (#6590) Fixes #6383 and fixes #4410. Co-authored-by: Hyunjin Song --- src/core/Song.cpp | 1 + src/gui/editors/PianoRoll.cpp | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/Song.cpp b/src/core/Song.cpp index 06ac15633..fef66f193 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -620,6 +620,7 @@ void Song::togglePause() { m_playing = false; m_paused = true; + Engine::audioEngine()->clear(); } m_vstSyncController.setPlaybackState( m_playing ); diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 1dbbe1cf4..d4781eccd 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -858,8 +858,7 @@ void PianoRoll::setCurrentMidiClip( MidiClip* newMidiClip ) } // force the song-editor to stop playing if it played a MIDI clip before - if( Engine::getSong()->isPlaying() && - Engine::getSong()->playMode() == Song::Mode_PlayMidiClip ) + if (Engine::getSong()->playMode() == Song::Mode_PlayMidiClip) { Engine::getSong()->playMidiClip( nullptr ); } From 7649f5ed240dc97d9a9a66fb8effdcf15360c4d5 Mon Sep 17 00:00:00 2001 From: Johannes Lorenz Date: Sat, 4 Jun 2022 23:50:57 +0200 Subject: [PATCH 37/70] Lv2ControlBase: Remove unused virtuals They were never used. Possibly they were just in the code because the code originated from #4662 (where the virtuals would also be omittable...). --- include/Lv2ControlBase.h | 5 ----- plugins/Lv2Effect/Lv2FxControls.cpp | 16 ---------------- plugins/Lv2Effect/Lv2FxControls.h | 3 --- plugins/Lv2Instrument/Lv2Instrument.cpp | 16 ---------------- plugins/Lv2Instrument/Lv2Instrument.h | 2 -- 5 files changed, 42 deletions(-) diff --git a/include/Lv2ControlBase.h b/include/Lv2ControlBase.h index 93b3b21ef..353941f3d 100644 --- a/include/Lv2ControlBase.h +++ b/include/Lv2ControlBase.h @@ -142,11 +142,6 @@ protected: const class TimePos &time, f_cnt_t offset); private: - //! Return the DataFile settings type - virtual DataFile::Types settingsType() = 0; - //! Inform the plugin about a file name change - virtual void setNameFromFile(const QString &fname) = 0; - //! Independent processors //! If this is a mono effect, the vector will have size 2 in order to //! fulfill LMMS' requirement of having stereo input and output diff --git a/plugins/Lv2Effect/Lv2FxControls.cpp b/plugins/Lv2Effect/Lv2FxControls.cpp index a865151dd..a7fbfc782 100644 --- a/plugins/Lv2Effect/Lv2FxControls.cpp +++ b/plugins/Lv2Effect/Lv2FxControls.cpp @@ -86,20 +86,4 @@ void Lv2FxControls::changeControl() // TODO: what is that? } - - -DataFile::Types Lv2FxControls::settingsType() -{ - return DataFile::EffectSettings; -} - - - - -void Lv2FxControls::setNameFromFile(const QString &name) -{ - effect()->setDisplayName(name); -} - - } // namespace lmms diff --git a/plugins/Lv2Effect/Lv2FxControls.h b/plugins/Lv2Effect/Lv2FxControls.h index 952e4db6c..1d7553a34 100644 --- a/plugins/Lv2Effect/Lv2FxControls.h +++ b/plugins/Lv2Effect/Lv2FxControls.h @@ -60,9 +60,6 @@ private slots: void changeControl(); private: - DataFile::Types settingsType() override; - void setNameFromFile(const QString &name) override; - friend class gui::Lv2FxControlDialog; friend class Lv2Effect; }; diff --git a/plugins/Lv2Instrument/Lv2Instrument.cpp b/plugins/Lv2Instrument/Lv2Instrument.cpp index ae7e37119..77130bcc2 100644 --- a/plugins/Lv2Instrument/Lv2Instrument.cpp +++ b/plugins/Lv2Instrument/Lv2Instrument.cpp @@ -196,25 +196,9 @@ QString Lv2Instrument::nodeName() const -DataFile::Types Lv2Instrument::settingsType() -{ - return DataFile::InstrumentTrackSettings; -} - - - - -void Lv2Instrument::setNameFromFile(const QString &name) -{ - instrumentTrack()->setName(name); -} - - - namespace gui { - /* Lv2InsView */ diff --git a/plugins/Lv2Instrument/Lv2Instrument.h b/plugins/Lv2Instrument/Lv2Instrument.h index e9a6cc2fd..38ffdd680 100644 --- a/plugins/Lv2Instrument/Lv2Instrument.h +++ b/plugins/Lv2Instrument/Lv2Instrument.h @@ -97,8 +97,6 @@ private slots: private: QString nodeName() const override; - DataFile::Types settingsType() override; - void setNameFromFile(const QString &name) override; #ifdef LV2_INSTRUMENT_USE_MIDI std::array m_runningNotes = {}; From f48dd0fb1f424e06cd7bff1cb3d4c37f5d9a11a7 Mon Sep 17 00:00:00 2001 From: Johannes Lorenz Date: Sat, 4 Jun 2022 23:11:04 +0200 Subject: [PATCH 38/70] Fixes #6401: Reload Lv2 plugin on SR change This also includes banning blop's wavedata plugins, because they crash on reloading. Reference: https://gitlab.com/drobilla/blop-lv2/-/issues/3 --- include/Lv2ControlBase.h | 6 +- include/Lv2Features.h | 2 + include/Lv2Proc.h | 4 +- plugins/Lv2Effect/Lv2FxControlDialog.cpp | 6 +- plugins/Lv2Effect/Lv2FxControlDialog.h | 2 +- plugins/Lv2Effect/Lv2FxControls.cpp | 22 ++++++- plugins/Lv2Effect/Lv2FxControls.h | 5 ++ plugins/Lv2Instrument/Lv2Instrument.cpp | 39 +++++++++++- plugins/Lv2Instrument/Lv2Instrument.h | 5 ++ src/core/lv2/Lv2ControlBase.cpp | 80 ++++++++++++++---------- src/core/lv2/Lv2Features.cpp | 8 +++ src/core/lv2/Lv2Manager.cpp | 6 ++ src/core/lv2/Lv2Proc.cpp | 24 +++++++ 13 files changed, 168 insertions(+), 41 deletions(-) diff --git a/include/Lv2ControlBase.h b/include/Lv2ControlBase.h index 353941f3d..b1482afcb 100644 --- a/include/Lv2ControlBase.h +++ b/include/Lv2ControlBase.h @@ -77,6 +77,9 @@ public: static Plugin::PluginTypes check(const LilvPlugin* m_plugin, std::vector &issues); + void shutdown(); + void init(Model* meAsModel); + const LilvPlugin* getPlugin() const { return m_plugin; } Lv2Proc *control(std::size_t idx) { return m_procs[idx].get(); } @@ -95,6 +98,7 @@ protected: Lv2ControlBase(class Model *that, const QString& uri); Lv2ControlBase(const Lv2ControlBase&) = delete; ~Lv2ControlBase() override; + void reload(); Lv2ControlBase& operator=(const Lv2ControlBase&) = delete; @@ -129,8 +133,6 @@ protected: void saveSettings(QDomDocument &doc, QDomElement &that); void loadSettings(const QDomElement &that); void loadFile(const QString &file); - //! TODO: not implemented - void reloadPlugin(); /* more functions that must be called from virtuals diff --git a/include/Lv2Features.h b/include/Lv2Features.h index b4fd6c06d..b5bc284c8 100644 --- a/include/Lv2Features.h +++ b/include/Lv2Features.h @@ -69,6 +69,8 @@ public: { return m_featurePointers.data(); } + //! Clear everything + void clear(); private: //! feature storage diff --git a/include/Lv2Proc.h b/include/Lv2Proc.h index 7e6342ec4..8e6d2ad44 100644 --- a/include/Lv2Proc.h +++ b/include/Lv2Proc.h @@ -68,10 +68,12 @@ public: std::vector &issues); /* - ctor/dtor + ctor/dtor/reload */ Lv2Proc(const LilvPlugin* plugin, Model *parent); ~Lv2Proc() override; + void reload(); + void onSampleRateChanged(); //! Must be checked after ctor or reload bool isValid() const { return m_valid; } diff --git a/plugins/Lv2Effect/Lv2FxControlDialog.cpp b/plugins/Lv2Effect/Lv2FxControlDialog.cpp index d10c01cd4..1b0c05bb8 100644 --- a/plugins/Lv2Effect/Lv2FxControlDialog.cpp +++ b/plugins/Lv2Effect/Lv2FxControlDialog.cpp @@ -38,7 +38,7 @@ Lv2FxControlDialog::Lv2FxControlDialog(Lv2FxControls *controls) : { if (m_reloadPluginButton) { connect(m_reloadPluginButton, &QPushButton::clicked, - this, [this](){ lv2Controls()->reloadPlugin(); }); + this, [this](){ lv2Controls()->reload(); }); } if (m_toggleUIButton) { connect(m_toggleUIButton, &QPushButton::toggled, @@ -67,7 +67,9 @@ Lv2FxControls *Lv2FxControlDialog::lv2Controls() void Lv2FxControlDialog::modelChanged() { Lv2ViewBase::modelChanged(lv2Controls()); + connect(lv2Controls(), &Lv2FxControls::modelChanged, + this, [this](){ this->modelChanged();} ); } -} // namespace lmms::gui \ No newline at end of file +} // namespace lmms::gui diff --git a/plugins/Lv2Effect/Lv2FxControlDialog.h b/plugins/Lv2Effect/Lv2FxControlDialog.h index c749dc124..208a4c86a 100644 --- a/plugins/Lv2Effect/Lv2FxControlDialog.h +++ b/plugins/Lv2Effect/Lv2FxControlDialog.h @@ -45,7 +45,7 @@ public: private: Lv2FxControls *lv2Controls(); - void modelChanged() override; + void modelChanged() final; }; diff --git a/plugins/Lv2Effect/Lv2FxControls.cpp b/plugins/Lv2Effect/Lv2FxControls.cpp index a7fbfc782..2fde949d4 100644 --- a/plugins/Lv2Effect/Lv2FxControls.cpp +++ b/plugins/Lv2Effect/Lv2FxControls.cpp @@ -41,13 +41,33 @@ Lv2FxControls::Lv2FxControls(class Lv2Effect *effect, const QString& uri) : if (isValid()) { connect(Engine::audioEngine(), &AudioEngine::sampleRateChanged, - this, [this](){Lv2ControlBase::reloadPlugin();}); + this, [this](){onSampleRateChanged();}); } } +void Lv2FxControls::reload() +{ + Lv2ControlBase::reload(); + emit modelChanged(); +} + + + + +void Lv2FxControls::onSampleRateChanged() +{ + // TODO: once lv2 options are implemented, + // plugins that support it might allow changing their samplerate + // through it instead of reloading + reload(); +} + + + + void Lv2FxControls::saveSettings(QDomDocument &doc, QDomElement &that) { Lv2ControlBase::saveSettings(doc, that); diff --git a/plugins/Lv2Effect/Lv2FxControls.h b/plugins/Lv2Effect/Lv2FxControls.h index 1d7553a34..0ae57de94 100644 --- a/plugins/Lv2Effect/Lv2FxControls.h +++ b/plugins/Lv2Effect/Lv2FxControls.h @@ -43,8 +43,11 @@ class Lv2FxControlDialog; class Lv2FxControls : public EffectControls, public Lv2ControlBase { Q_OBJECT +signals: + void modelChanged(); public: Lv2FxControls(Lv2Effect *effect, const QString &uri); + void reload(); void saveSettings(QDomDocument &_doc, QDomElement &_parent) override; void loadSettings(const QDomElement &that) override; @@ -60,6 +63,8 @@ private slots: void changeControl(); private: + void onSampleRateChanged(); + friend class gui::Lv2FxControlDialog; friend class Lv2Effect; }; diff --git a/plugins/Lv2Instrument/Lv2Instrument.cpp b/plugins/Lv2Instrument/Lv2Instrument.cpp index 77130bcc2..e766924ec 100644 --- a/plugins/Lv2Instrument/Lv2Instrument.cpp +++ b/plugins/Lv2Instrument/Lv2Instrument.cpp @@ -78,10 +78,12 @@ Lv2Instrument::Lv2Instrument(InstrumentTrack *instrumentTrackArg, { if (Lv2ControlBase::isValid()) { + clearRunningNotes(); + connect(instrumentTrack()->pitchRangeModel(), SIGNAL(dataChanged()), this, SLOT(updatePitchRange()), Qt::DirectConnection); connect(Engine::audioEngine(), &AudioEngine::sampleRateChanged, - this, [this](){Lv2ControlBase::reloadPlugin();}); + this, [this](){onSampleRateChanged();}); // now we need a play-handle which cares for calling play() auto iph = new InstrumentPlayHandle(this, instrumentTrackArg); @@ -101,6 +103,37 @@ Lv2Instrument::~Lv2Instrument() +void Lv2Instrument::reload() +{ + Lv2ControlBase::reload(); + clearRunningNotes(); + emit modelChanged(); +} + + + + +void Lv2Instrument::clearRunningNotes() +{ +#ifdef LV2_INSTRUMENT_USE_MIDI + for (int i = 0; i < NumKeys; ++i) { m_runningNotes[i] = 0; } +#endif +} + + + + +void Lv2Instrument::onSampleRateChanged() +{ + // TODO: once lv2 options are implemented, + // plugins that support it might allow changing their samplerate + // through it instead of reloading + reload(); +} + + + + bool Lv2Instrument::isValid() const { return Lv2ControlBase::isValid(); } @@ -211,7 +244,7 @@ Lv2InsView::Lv2InsView(Lv2Instrument *_instrument, QWidget *_parent) : setAutoFillBackground(true); if (m_reloadPluginButton) { connect(m_reloadPluginButton, &QPushButton::clicked, - this, [this](){ this->castModel()->reloadPlugin();} ); + this, [this](){ this->castModel()->reload();} ); } if (m_toggleUIButton) { connect(m_toggleUIButton, &QPushButton::toggled, @@ -267,6 +300,8 @@ void Lv2InsView::dropEvent(QDropEvent *_de) void Lv2InsView::modelChanged() { Lv2ViewBase::modelChanged(castModel()); + connect(castModel(), &Lv2Instrument::modelChanged, + this, [this](){ this->modelChanged();} ); } diff --git a/plugins/Lv2Instrument/Lv2Instrument.h b/plugins/Lv2Instrument/Lv2Instrument.h index 38ffdd680..8eaf9b1d4 100644 --- a/plugins/Lv2Instrument/Lv2Instrument.h +++ b/plugins/Lv2Instrument/Lv2Instrument.h @@ -50,6 +50,8 @@ class Lv2InsView; class Lv2Instrument : public Instrument, public Lv2ControlBase { Q_OBJECT +signals: + void modelChanged(); public: /* initialization @@ -57,6 +59,8 @@ public: Lv2Instrument(InstrumentTrack *instrumentTrackArg, Descriptor::SubPluginFeatures::Key* key); ~Lv2Instrument() override; + void reload(); + void onSampleRateChanged(); //! Must be checked after ctor or reload bool isValid() const; @@ -101,6 +105,7 @@ private: #ifdef LV2_INSTRUMENT_USE_MIDI std::array m_runningNotes = {}; #endif + void clearRunningNotes(); friend class gui::Lv2InsView; }; diff --git a/src/core/lv2/Lv2ControlBase.cpp b/src/core/lv2/Lv2ControlBase.cpp index 3ab8b278c..7764313fc 100644 --- a/src/core/lv2/Lv2ControlBase.cpp +++ b/src/core/lv2/Lv2ControlBase.cpp @@ -54,30 +54,7 @@ Lv2ControlBase::Lv2ControlBase(Model* that, const QString &uri) : { if (m_plugin) { - int channelsLeft = DEFAULT_CHANNELS; // LMMS plugins are stereo - while (channelsLeft > 0) - { - std::unique_ptr newOne = std::make_unique(m_plugin, that); - if (newOne->isValid()) - { - channelsLeft -= std::max( - 1 + static_cast(newOne->inPorts().m_right), - 1 + static_cast(newOne->outPorts().m_right)); - Q_ASSERT(channelsLeft >= 0); - m_procs.push_back(std::move(newOne)); - } - else - { - qCritical() << "Failed instantiating LV2 processor"; - m_valid = false; - channelsLeft = 0; - } - } - if (m_valid) - { - m_channelsPerProc = DEFAULT_CHANNELS / m_procs.size(); - linkAllModels(); - } + init(that); } else { @@ -94,6 +71,53 @@ Lv2ControlBase::~Lv2ControlBase() = default; +void Lv2ControlBase::init(Model* meAsModel) +{ + int channelsLeft = DEFAULT_CHANNELS; // LMMS plugins are stereo + while (channelsLeft > 0) + { + std::unique_ptr newOne = std::make_unique(m_plugin, meAsModel); + if (newOne->isValid()) + { + channelsLeft -= std::max( + 1 + static_cast(newOne->inPorts().m_right), + 1 + static_cast(newOne->outPorts().m_right)); + Q_ASSERT(channelsLeft >= 0); + m_procs.push_back(std::move(newOne)); + } + else + { + qCritical() << "Failed instantiating LV2 processor"; + m_valid = false; + channelsLeft = 0; + } + } + if (m_valid) + { + m_channelsPerProc = DEFAULT_CHANNELS / m_procs.size(); + linkAllModels(); + } +} + + + + +void Lv2ControlBase::shutdown() +{ + // currently nothing to do here +} + + + + +void Lv2ControlBase::reload() +{ + for (const auto& c : m_procs) { c->reload(); } +} + + + + LinkedModelGroup *Lv2ControlBase::getGroup(std::size_t idx) { return (m_procs.size() > idx) ? m_procs[idx].get() : nullptr; @@ -183,14 +207,6 @@ void Lv2ControlBase::loadFile(const QString &file) -void Lv2ControlBase::reloadPlugin() -{ - // TODO -} - - - - std::size_t Lv2ControlBase::controlCount() const { std::size_t res = 0; for (const auto& c : m_procs) { res += c->controlCount(); } diff --git a/src/core/lv2/Lv2Features.cpp b/src/core/lv2/Lv2Features.cpp index be7fb6e28..6e74a8936 100644 --- a/src/core/lv2/Lv2Features.cpp +++ b/src/core/lv2/Lv2Features.cpp @@ -105,6 +105,14 @@ void *&Lv2Features::operator[](const char *featName) } + + +void Lv2Features::clear() +{ + m_featureByUri.clear(); +} + + } // namespace lmms #endif // LMMS_HAVE_LV2 diff --git a/src/core/lv2/Lv2Manager.cpp b/src/core/lv2/Lv2Manager.cpp index b1391b065..d60bf6c49 100644 --- a/src/core/lv2/Lv2Manager.cpp +++ b/src/core/lv2/Lv2Manager.cpp @@ -60,6 +60,12 @@ const std::set Lv2Manager::pluginBlacklist = "http://calf.sourceforge.net/plugins/TransientDesigner", "http://calf.sourceforge.net/plugins/Vinyl", + // https://gitlab.com/drobilla/blop-lv2/-/issues/3 + "http://drobilla.net/plugins/blop/pulse", + "http://drobilla.net/plugins/blop/sawtooth", + "http://drobilla.net/plugins/blop/square", + "http://drobilla.net/plugins/blop/triangle", + // Visualization, meters, and scopes etc., won't work until we have gui support "http://distrho.sf.net/plugins/ProM", "http://distrho.sf.net/plugins/glBars", diff --git a/src/core/lv2/Lv2Proc.cpp b/src/core/lv2/Lv2Proc.cpp index cbb4be2d2..31af47a63 100644 --- a/src/core/lv2/Lv2Proc.cpp +++ b/src/core/lv2/Lv2Proc.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include "AudioEngine.h" @@ -175,6 +176,26 @@ Lv2Proc::~Lv2Proc() { shutdownPlugin(); } +void Lv2Proc::reload() +{ + // save controls, which we want to keep + QDomDocument doc; + QDomElement controls = doc.createElement("controls"); + saveValues(doc, controls); + // backup construction variables + const LilvPlugin* plugin = m_plugin; + Model* parent = Model::parentModel(); + // destroy everything using RAII ... + this->~Lv2Proc(); + // ... and reuse it ("placement new") + new (this) Lv2Proc(plugin, parent); + // reload the controls + loadValues(controls); +} + + + + void Lv2Proc::dumpPorts() { std::size_t num = 0; @@ -424,7 +445,10 @@ void Lv2Proc::shutdownPlugin() lilv_instance_deactivate(m_instance); lilv_instance_free(m_instance); m_instance = nullptr; + + m_features.clear(); } + m_valid = true; } From 49a6abb343e26e82ab89287dca0ee3cadc8c440b Mon Sep 17 00:00:00 2001 From: Johannes Lorenz Date: Thu, 1 Dec 2022 15:17:27 +0100 Subject: [PATCH 39/70] Lv2: Add/improve some comments --- include/LinkedModelGroups.h | 2 ++ include/Lv2Proc.h | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/LinkedModelGroups.h b/include/LinkedModelGroups.h index 3f274d10c..c537d7fca 100644 --- a/include/LinkedModelGroups.h +++ b/include/LinkedModelGroups.h @@ -131,6 +131,8 @@ public: private: //! models for the controls + //! @note The AutomatableModels behind the ModelInfo are not owned, + //! but referenced after `addModel` is being called. std::map m_models; }; diff --git a/include/Lv2Proc.h b/include/Lv2Proc.h index 8e6d2ad44..1be284ced 100644 --- a/include/Lv2Proc.h +++ b/include/Lv2Proc.h @@ -59,8 +59,8 @@ namespace Lv2Ports } -//! Class representing one Lv2 processor, i.e. one Lv2 handle -//! For Mono effects, 1 Lv2ControlBase references 2 Lv2Proc +//! Class representing one Lv2 processor, i.e. one Lv2 handle. +//! For Mono effects, 1 Lv2ControlBase references 2 Lv2Proc. class Lv2Proc : public LinkedModelGroup { public: @@ -197,6 +197,8 @@ private: static int32_t defaultEvbufSize() { return 1 << 15; /* ardour uses this*/ } //! models for the controls, sorted by port symbols + //! @note These are not owned, but rather link to the models in + //! ControlPorts in `m_ports` std::map m_connectedModels; void initMOptions(); //!< initialize m_options From 5b84b65236d2933f70aba6878ad77a6599ed8125 Mon Sep 17 00:00:00 2001 From: Johannes Lorenz Date: Sun, 5 Jun 2022 01:22:32 +0200 Subject: [PATCH 40/70] Lv2: Update copyright --- include/Lv2Basics.h | 2 +- include/Lv2ControlBase.h | 2 +- include/Lv2Manager.h | 2 +- include/Lv2SubPluginFeatures.h | 2 +- include/Lv2ViewBase.h | 2 +- plugins/Lv2Effect/Lv2Effect.cpp | 2 +- plugins/Lv2Effect/Lv2Effect.h | 2 +- plugins/Lv2Effect/Lv2FxControlDialog.cpp | 2 +- plugins/Lv2Effect/Lv2FxControlDialog.h | 2 +- plugins/Lv2Effect/Lv2FxControls.cpp | 2 +- plugins/Lv2Effect/Lv2FxControls.h | 2 +- plugins/Lv2Instrument/Lv2Instrument.cpp | 2 +- plugins/Lv2Instrument/Lv2Instrument.h | 2 +- src/core/lv2/Lv2ControlBase.cpp | 2 +- src/core/lv2/Lv2Manager.cpp | 2 +- src/core/lv2/Lv2SubPluginFeatures.cpp | 2 +- src/gui/Lv2ViewBase.cpp | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/include/Lv2Basics.h b/include/Lv2Basics.h index 3dae4c9f2..9a958d973 100644 --- a/include/Lv2Basics.h +++ b/include/Lv2Basics.h @@ -1,7 +1,7 @@ /* * Lv2Basics.h - basic Lv2 utils * - * Copyright (c) 2018-2020 Johannes Lorenz + * Copyright (c) 2018-2023 Johannes Lorenz * * This file is part of LMMS - https://lmms.io * diff --git a/include/Lv2ControlBase.h b/include/Lv2ControlBase.h index b1482afcb..f5cb0cdb4 100644 --- a/include/Lv2ControlBase.h +++ b/include/Lv2ControlBase.h @@ -1,7 +1,7 @@ /* * Lv2ControlBase.h - Lv2 control base class * - * Copyright (c) 2018-2020 Johannes Lorenz + * Copyright (c) 2018-2023 Johannes Lorenz * * This file is part of LMMS - https://lmms.io * diff --git a/include/Lv2Manager.h b/include/Lv2Manager.h index b62e989cf..89f6a0efd 100644 --- a/include/Lv2Manager.h +++ b/include/Lv2Manager.h @@ -1,7 +1,7 @@ /* * Lv2Manager.h - Implementation of Lv2Manager class * - * Copyright (c) 2018-2020 Johannes Lorenz + * Copyright (c) 2018-2023 Johannes Lorenz * * This file is part of LMMS - https://lmms.io * diff --git a/include/Lv2SubPluginFeatures.h b/include/Lv2SubPluginFeatures.h index 497c72830..57eab8715 100644 --- a/include/Lv2SubPluginFeatures.h +++ b/include/Lv2SubPluginFeatures.h @@ -3,7 +3,7 @@ * Plugin::Descriptor::SubPluginFeatures for * hosting LV2 plugins * - * Copyright (c) 2018-2020 Johannes Lorenz + * Copyright (c) 2018-2023 Johannes Lorenz * * This file is part of LMMS - https://lmms.io * diff --git a/include/Lv2ViewBase.h b/include/Lv2ViewBase.h index d27f35cec..f7d0e9bcb 100644 --- a/include/Lv2ViewBase.h +++ b/include/Lv2ViewBase.h @@ -1,7 +1,7 @@ /* * Lv2ViewBase.h - base class for Lv2 plugin views * - * Copyright (c) 2018-2020 Johannes Lorenz + * Copyright (c) 2018-2023 Johannes Lorenz * * This file is part of LMMS - https://lmms.io * diff --git a/plugins/Lv2Effect/Lv2Effect.cpp b/plugins/Lv2Effect/Lv2Effect.cpp index 1a25c718a..ec2dc1f48 100644 --- a/plugins/Lv2Effect/Lv2Effect.cpp +++ b/plugins/Lv2Effect/Lv2Effect.cpp @@ -1,7 +1,7 @@ /* * Lv2Effect.cpp - implementation of LV2 effect * - * Copyright (c) 2018-2020 Johannes Lorenz + * Copyright (c) 2018-2023 Johannes Lorenz * * This file is part of LMMS - https://lmms.io * diff --git a/plugins/Lv2Effect/Lv2Effect.h b/plugins/Lv2Effect/Lv2Effect.h index 521a7df74..3bcded355 100644 --- a/plugins/Lv2Effect/Lv2Effect.h +++ b/plugins/Lv2Effect/Lv2Effect.h @@ -1,7 +1,7 @@ /* * Lv2Effect.h - implementation of LV2 effect * - * Copyright (c) 2018-2020 Johannes Lorenz + * Copyright (c) 2018-2023 Johannes Lorenz * * This file is part of LMMS - https://lmms.io * diff --git a/plugins/Lv2Effect/Lv2FxControlDialog.cpp b/plugins/Lv2Effect/Lv2FxControlDialog.cpp index 1b0c05bb8..5265cb181 100644 --- a/plugins/Lv2Effect/Lv2FxControlDialog.cpp +++ b/plugins/Lv2Effect/Lv2FxControlDialog.cpp @@ -1,7 +1,7 @@ /* * Lv2FxControlDialog.cpp - Lv2FxControlDialog implementation * - * Copyright (c) 2018-2020 Johannes Lorenz + * Copyright (c) 2018-2023 Johannes Lorenz * * This file is part of LMMS - https://lmms.io * diff --git a/plugins/Lv2Effect/Lv2FxControlDialog.h b/plugins/Lv2Effect/Lv2FxControlDialog.h index 208a4c86a..45c14c2c0 100644 --- a/plugins/Lv2Effect/Lv2FxControlDialog.h +++ b/plugins/Lv2Effect/Lv2FxControlDialog.h @@ -1,7 +1,7 @@ /* * Lv2FxControlDialog.h - Lv2FxControlDialog implementation * - * Copyright (c) 2018-2020 Johannes Lorenz + * Copyright (c) 2018-2023 Johannes Lorenz * * This file is part of LMMS - https://lmms.io * diff --git a/plugins/Lv2Effect/Lv2FxControls.cpp b/plugins/Lv2Effect/Lv2FxControls.cpp index 2fde949d4..3ec7dbe23 100644 --- a/plugins/Lv2Effect/Lv2FxControls.cpp +++ b/plugins/Lv2Effect/Lv2FxControls.cpp @@ -1,7 +1,7 @@ /* * Lv2FxControls.cpp - Lv2FxControls implementation * - * Copyright (c) 2018-2020 Johannes Lorenz + * Copyright (c) 2018-2023 Johannes Lorenz * * This file is part of LMMS - https://lmms.io * diff --git a/plugins/Lv2Effect/Lv2FxControls.h b/plugins/Lv2Effect/Lv2FxControls.h index 0ae57de94..9f3736292 100644 --- a/plugins/Lv2Effect/Lv2FxControls.h +++ b/plugins/Lv2Effect/Lv2FxControls.h @@ -1,7 +1,7 @@ /* * Lv2FxControls.h - Lv2FxControls implementation * - * Copyright (c) 2018-2020 Johannes Lorenz + * Copyright (c) 2018-2023 Johannes Lorenz * * This file is part of LMMS - https://lmms.io * diff --git a/plugins/Lv2Instrument/Lv2Instrument.cpp b/plugins/Lv2Instrument/Lv2Instrument.cpp index e766924ec..052445844 100644 --- a/plugins/Lv2Instrument/Lv2Instrument.cpp +++ b/plugins/Lv2Instrument/Lv2Instrument.cpp @@ -1,7 +1,7 @@ /* * Lv2Instrument.cpp - implementation of LV2 instrument * - * Copyright (c) 2018-2020 Johannes Lorenz + * Copyright (c) 2018-2023 Johannes Lorenz * * This file is part of LMMS - https://lmms.io * diff --git a/plugins/Lv2Instrument/Lv2Instrument.h b/plugins/Lv2Instrument/Lv2Instrument.h index 8eaf9b1d4..7b521e1b0 100644 --- a/plugins/Lv2Instrument/Lv2Instrument.h +++ b/plugins/Lv2Instrument/Lv2Instrument.h @@ -1,7 +1,7 @@ /* * Lv2Instrument.h - implementation of LV2 instrument * - * Copyright (c) 2018-2020 Johannes Lorenz + * Copyright (c) 2018-2023 Johannes Lorenz * * This file is part of LMMS - https://lmms.io * diff --git a/src/core/lv2/Lv2ControlBase.cpp b/src/core/lv2/Lv2ControlBase.cpp index 7764313fc..3d21474b0 100644 --- a/src/core/lv2/Lv2ControlBase.cpp +++ b/src/core/lv2/Lv2ControlBase.cpp @@ -1,7 +1,7 @@ /* * Lv2ControlBase.cpp - Lv2 control base class * - * Copyright (c) 2018-2020 Johannes Lorenz + * Copyright (c) 2018-2023 Johannes Lorenz * * This file is part of LMMS - https://lmms.io * diff --git a/src/core/lv2/Lv2Manager.cpp b/src/core/lv2/Lv2Manager.cpp index d60bf6c49..cc90f5e05 100644 --- a/src/core/lv2/Lv2Manager.cpp +++ b/src/core/lv2/Lv2Manager.cpp @@ -1,7 +1,7 @@ /* * Lv2Manager.cpp - Implementation of Lv2Manager class * - * Copyright (c) 2018-2020 Johannes Lorenz + * Copyright (c) 2018-2023 Johannes Lorenz * * This file is part of LMMS - https://lmms.io * diff --git a/src/core/lv2/Lv2SubPluginFeatures.cpp b/src/core/lv2/Lv2SubPluginFeatures.cpp index 8c3c98711..4e02bc698 100644 --- a/src/core/lv2/Lv2SubPluginFeatures.cpp +++ b/src/core/lv2/Lv2SubPluginFeatures.cpp @@ -3,7 +3,7 @@ * Plugin::Descriptor::SubPluginFeatures for * hosting LV2 plugins * - * Copyright (c) 2018-2020 Johannes Lorenz + * Copyright (c) 2018-2023 Johannes Lorenz * * This file is part of LMMS - https://lmms.io * diff --git a/src/gui/Lv2ViewBase.cpp b/src/gui/Lv2ViewBase.cpp index 4347c37cd..3fd1d44b1 100644 --- a/src/gui/Lv2ViewBase.cpp +++ b/src/gui/Lv2ViewBase.cpp @@ -1,7 +1,7 @@ /* * Lv2ViewBase.cpp - base class for Lv2 plugin views * - * Copyright (c) 2018-2020 Johannes Lorenz + * Copyright (c) 2018-2023 Johannes Lorenz * * This file is part of LMMS - https://lmms.io * From ac080513fdf552a8f43b1ed09eece880c02617fa Mon Sep 17 00:00:00 2001 From: JGHFunRun <52897905+JGHFunRun@users.noreply.github.com> Date: Thu, 23 Feb 2023 16:31:07 -0600 Subject: [PATCH 41/70] Fixed typo (#6652) --- plugins/VstBase/RemoteVstPlugin32.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/VstBase/RemoteVstPlugin32.cmake b/plugins/VstBase/RemoteVstPlugin32.cmake index 466752aa5..f39bd93d0 100644 --- a/plugins/VstBase/RemoteVstPlugin32.cmake +++ b/plugins/VstBase/RemoteVstPlugin32.cmake @@ -51,7 +51,7 @@ ELSEIF(LMMS_BUILD_LINUX) INCLUDE(CheckWineGcc) CheckWineGcc(32 "${WINEGCC}" WINEGCC_WORKING) IF(NOT WINEGCC_WORKING) - MESSAGE(WARNING "winegcc fails to complie 32-bit binaries, please make sure you have 32-bit GCC libraries") + MESSAGE(WARNING "winegcc fails to compile 32-bit binaries, please make sure you have 32-bit GCC libraries") RETURN() ENDIF() ExternalProject_Add(RemoteVstPlugin32 From 2baa23ee1a45373cbe91a8ccf55e010954af922b Mon Sep 17 00:00:00 2001 From: Arash Partow Date: Thu, 16 Feb 2023 22:52:16 +1100 Subject: [PATCH 42/70] Update ExprTk package --- plugins/Xpressive/exprtk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Xpressive/exprtk b/plugins/Xpressive/exprtk index 93a9f44f9..f46bffcd6 160000 --- a/plugins/Xpressive/exprtk +++ b/plugins/Xpressive/exprtk @@ -1 +1 @@ -Subproject commit 93a9f44f99b910bfe07cd1e933371e83cea3841c +Subproject commit f46bffcd6966d38a09023fb37ba9335214c9b959 From fb529a19c5c6ab615c266eafa27c7b6bb29efa42 Mon Sep 17 00:00:00 2001 From: Lost Robot <34612565+LostRobotMusic@users.noreply.github.com> Date: Sun, 26 Mar 2023 12:30:12 -0700 Subject: [PATCH 43/70] Make note octave highlight in piano roll obey microtonality (#6663) --- include/PianoRoll.h | 2 ++ src/gui/editors/PianoRoll.cpp | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/include/PianoRoll.h b/include/PianoRoll.h index 23fe7ddc6..25b4166c4 100644 --- a/include/PianoRoll.h +++ b/include/PianoRoll.h @@ -149,6 +149,8 @@ public: { return m_midiClip != nullptr; } + + int trackOctaveSize() const; Song::PlayModes desiredPlayModeForAccompany() const; diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index d4781eccd..b5a7e74b0 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -600,7 +600,7 @@ void PianoRoll::markSemiTone(int i, bool fromMenu) const int first = chord->isScale() ? 0 : key; const int last = chord->isScale() ? NumKeys : key + chord->last(); - const int cap = ( chord->isScale() || chord->last() == 0 ) ? KeysPerOctave : chord->last(); + const int cap = (chord->isScale() || chord->last() == 0) ? trackOctaveSize() : chord->last(); for( int i = first; i <= last; i++ ) { @@ -937,6 +937,14 @@ void PianoRoll::hideMidiClip( MidiClip* clip ) } } + +int PianoRoll::trackOctaveSize() const +{ + auto ut = m_midiClip->instrumentTrack()->microtuner(); + return ut->enabled() ? ut->octaveSize() : KeysPerOctave; +} + + void PianoRoll::selectRegionFromPixels( int xStart, int xEnd ) { @@ -3950,7 +3958,8 @@ QList PianoRoll::getAllOctavesForKey( int keyToMirror ) const { QList keys; - for (int i=keyToMirror % KeysPerOctave; i < NumKeys; i += KeysPerOctave) + int trackKeysPerOctave = trackOctaveSize(); + for (int i = keyToMirror % trackKeysPerOctave; i < NumKeys; i += trackKeysPerOctave) { keys.append(i); } From 2e572caa58a0fecf521865a0330687b8b7462285 Mon Sep 17 00:00:00 2001 From: Lost Robot <34612565+LostRobotMusic@users.noreply.github.com> Date: Wed, 5 Apr 2023 21:08:24 -0700 Subject: [PATCH 44/70] Add Dispersion effect (#6683) --- cmake/modules/PluginList.cmake | 1 + plugins/Dispersion/CMakeLists.txt | 3 + plugins/Dispersion/Dispersion.cpp | 162 ++++++++++++++++++ plugins/Dispersion/Dispersion.h | 78 +++++++++ .../Dispersion/DispersionControlDialog.cpp | 82 +++++++++ plugins/Dispersion/DispersionControlDialog.h | 52 ++++++ plugins/Dispersion/DispersionControls.cpp | 73 ++++++++ plugins/Dispersion/DispersionControls.h | 81 +++++++++ plugins/Dispersion/artwork.png | Bin 0 -> 8757 bytes plugins/Dispersion/dc_active.png | Bin 0 -> 9043 bytes plugins/Dispersion/dc_inactive.png | Bin 0 -> 8948 bytes plugins/Dispersion/logo.png | Bin 0 -> 774 bytes 12 files changed, 532 insertions(+) create mode 100644 plugins/Dispersion/CMakeLists.txt create mode 100644 plugins/Dispersion/Dispersion.cpp create mode 100644 plugins/Dispersion/Dispersion.h create mode 100644 plugins/Dispersion/DispersionControlDialog.cpp create mode 100644 plugins/Dispersion/DispersionControlDialog.h create mode 100644 plugins/Dispersion/DispersionControls.cpp create mode 100644 plugins/Dispersion/DispersionControls.h create mode 100644 plugins/Dispersion/artwork.png create mode 100644 plugins/Dispersion/dc_active.png create mode 100644 plugins/Dispersion/dc_inactive.png create mode 100644 plugins/Dispersion/logo.png diff --git a/cmake/modules/PluginList.cmake b/cmake/modules/PluginList.cmake index fe98a64b4..6b2c7519a 100644 --- a/cmake/modules/PluginList.cmake +++ b/cmake/modules/PluginList.cmake @@ -33,6 +33,7 @@ SET(LMMS_PLUGIN_LIST Compressor CrossoverEQ Delay + Dispersion DualFilter DynamicsProcessor Eq diff --git a/plugins/Dispersion/CMakeLists.txt b/plugins/Dispersion/CMakeLists.txt new file mode 100644 index 000000000..a40e04b80 --- /dev/null +++ b/plugins/Dispersion/CMakeLists.txt @@ -0,0 +1,3 @@ +INCLUDE(BuildPlugin) + +BUILD_PLUGIN(dispersion Dispersion.cpp DispersionControls.cpp DispersionControlDialog.cpp MOCFILES DispersionControls.h DispersionControlDialog.h EMBEDDED_RESOURCES *.png) diff --git a/plugins/Dispersion/Dispersion.cpp b/plugins/Dispersion/Dispersion.cpp new file mode 100644 index 000000000..9b98877e5 --- /dev/null +++ b/plugins/Dispersion/Dispersion.cpp @@ -0,0 +1,162 @@ +/* + * Dispersion.cpp + * + * Copyright (c) 2023 Lost Robot + * + * This file is part of LMMS - https://lmms.io + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + +#include "Dispersion.h" + +#include "embed.h" +#include "plugin_export.h" + +namespace lmms +{ + +extern "C" +{ + +Plugin::Descriptor PLUGIN_EXPORT dispersion_plugin_descriptor = +{ + LMMS_STRINGIFY(PLUGIN_NAME), + "Dispersion", + QT_TRANSLATE_NOOP("PluginBrowser", "An all-pass filter allowing for extremely high orders."), + "Lost Robot ", + 0x0100, + Plugin::Effect, + new PluginPixmapLoader("logo"), + nullptr, + nullptr +}; + +} + + +DispersionEffect::DispersionEffect(Model* parent, const Descriptor::SubPluginFeatures::Key* key) : + Effect(&dispersion_plugin_descriptor, parent, key), + m_dispersionControls(this), + m_sampleRate(Engine::audioEngine()->processingSampleRate()), + m_amountVal(0) +{ +} + + +bool DispersionEffect::processAudioBuffer(sampleFrame* buf, const fpp_t frames) +{ + if (!isEnabled() || !isRunning()) + { + return false; + } + + double outSum = 0.0; + const float d = dryLevel(); + const float w = wetLevel(); + + const int amount = m_dispersionControls.m_amountModel.value(); + const float freq = m_dispersionControls.m_freqModel.value(); + const float reso = m_dispersionControls.m_resoModel.value(); + float feedback = m_dispersionControls.m_feedbackModel.value(); + const bool dc = m_dispersionControls.m_dcModel.value(); + + // All-pass coefficient calculation + const float w0 = (F_2PI / m_sampleRate) * freq; + const float a0 = 1 + (std::sin(w0) / (reso * 2.f)); + float apCoeff1 = (1 - (a0 - 1)) / a0; + float apCoeff2 = (-2 * std::cos(w0)) / a0; + + float dcCoeff = 0.001 * (44100.f / m_sampleRate); + + if (amount != m_amountVal) + { + if (amount < m_amountVal) + { + // Flush filter buffers when they're no longer in use + for (int i = amount * 2; i < m_amountVal * 2; ++i) + { + m_state.x0[i] = m_state.x1[i] = m_state.y0[i] = m_state.y1[i] = 0; + } + } + m_amountVal = amount; + } + + if (amount == 0) + { + feedback = 0; + m_feedbackVal[0] = m_feedbackVal[1] = 0; + } + + for (fpp_t f = 0; f < frames; ++f) + { + std::array s = { buf[f][0] + m_feedbackVal[0], buf[f][1] + m_feedbackVal[1] }; + + runDispersionAP(m_amountVal, apCoeff1, apCoeff2, s); + m_feedbackVal[0] = s[0] * feedback; + m_feedbackVal[1] = s[1] * feedback; + + if (dc) + { + // DC offset removal + for (int i = 0; i < 2; ++i) + { + m_integrator[i] = m_integrator[i] * (1.f - dcCoeff) + s[i] * dcCoeff; + s[i] -= m_integrator[i]; + } + } + + buf[f][0] = d * buf[f][0] + w * s[0]; + buf[f][1] = d * buf[f][1] + w * s[1]; + outSum += buf[f][0] * buf[f][0] + buf[f][1] * buf[f][1]; + } + + checkGate(outSum / frames); + return isRunning(); +} + + +void DispersionEffect::runDispersionAP(const int filtNum, const float apCoeff1, const float apCoeff2, std::array &put) +{ + for (int i = 0; i < filtNum * 2; ++i) + { + const int channel = i % 2; + const sample_t currentInput = put[channel]; + const sample_t filterOutput = apCoeff1 * (currentInput - m_state.y1[i]) + + apCoeff2 * (m_state.x0[i] - m_state.y0[i]) + m_state.x1[i]; + m_state.x1[i] = m_state.x0[i]; + m_state.x0[i] = currentInput; + m_state.y1[i] = m_state.y0[i]; + m_state.y0[i] = filterOutput; + + put[channel] = filterOutput; + } +} + + +extern "C" +{ + +// necessary for getting instance out of shared lib +PLUGIN_EXPORT Plugin * lmms_plugin_main(Model* parent, void* data) +{ + return new DispersionEffect(parent, static_cast(data)); +} + +} + +} // namespace lmms diff --git a/plugins/Dispersion/Dispersion.h b/plugins/Dispersion/Dispersion.h new file mode 100644 index 000000000..9e2014baf --- /dev/null +++ b/plugins/Dispersion/Dispersion.h @@ -0,0 +1,78 @@ +/* + * Dispersion.h + * + * Copyright (c) 2023 Lost Robot + * + * This file is part of LMMS - https://lmms.io + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + + +#ifndef LMMS_DISPERSION_H +#define LMMS_DISPERSION_H + +#include "DispersionControls.h" +#include "Effect.h" + +#include "lmms_math.h" + +namespace lmms +{ + +constexpr inline int MAX_DISPERSION_FILTERS = 999; + +class DispersionEffect : public Effect +{ +public: + DispersionEffect(Model* parent, const Descriptor::SubPluginFeatures::Key* key); + ~DispersionEffect() override = default; + bool processAudioBuffer(sampleFrame* buf, const fpp_t frames) override; + + EffectControls* controls() override + { + return &m_dispersionControls; + } + + void runDispersionAP(const int filtNum, const float apCoeff1, const float apCoeff2, std::array &put); + +private: + DispersionControls m_dispersionControls; + + float m_sampleRate; + + int m_amountVal; + + using Filter = std::array; + struct FilterState { + Filter x0{}; + Filter x1{}; + Filter y0{}; + Filter y1{}; + }; + FilterState m_state = {}; + + std::array m_feedbackVal{}; + std::array m_integrator{}; + + friend class DispersionControls; +}; + + +} // namespace lmms + +#endif // LMMS_DISPERSION_H diff --git a/plugins/Dispersion/DispersionControlDialog.cpp b/plugins/Dispersion/DispersionControlDialog.cpp new file mode 100644 index 000000000..b9f04baa2 --- /dev/null +++ b/plugins/Dispersion/DispersionControlDialog.cpp @@ -0,0 +1,82 @@ +/* + * DispersionControlDialog.cpp + * + * Copyright (c) 2023 Lost Robot + * + * This file is part of LMMS - https://lmms.io + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + + +#include "DispersionControlDialog.h" +#include "DispersionControls.h" + +#include "embed.h" +#include "Knob.h" +#include "LcdSpinBox.h" +#include "PixmapButton.h" + + +namespace lmms::gui +{ + + +DispersionControlDialog::DispersionControlDialog(DispersionControls* controls) : + EffectControlDialog(controls) +{ + setAutoFillBackground(true); + QPalette pal; + pal.setBrush(backgroundRole(), PLUGIN_NAME::getIconPixmap("artwork")); + setPalette(pal); + setFixedSize(207, 50); + + LcdSpinBox * m_amountBox = new LcdSpinBox(3, this, "Amount"); + m_amountBox->setModel(&controls->m_amountModel); + m_amountBox->move(5, 10); + m_amountBox->setLabel(tr("AMOUNT")); + m_amountBox->setToolTip(tr("Number of all-pass filters")); + + Knob * freqKnob = new Knob(knobBright_26, this); + freqKnob->move(59, 8); + freqKnob->setModel(&controls->m_freqModel); + freqKnob->setLabel(tr("FREQ")); + freqKnob->setHintText(tr("Frequency:") , " Hz"); + + Knob * resoKnob = new Knob(knobBright_26, this); + resoKnob->move(99, 8); + resoKnob->setModel(&controls->m_resoModel); + resoKnob->setLabel(tr("RESO")); + resoKnob->setHintText(tr("Resonance:") , " octaves"); + + Knob * feedbackKnob = new Knob(knobBright_26, this); + feedbackKnob->move(139, 8); + feedbackKnob->setModel(&controls->m_feedbackModel); + feedbackKnob->setLabel(tr("FEED")); + feedbackKnob->setHintText(tr("Feedback:") , ""); + + PixmapButton * dcButton = new PixmapButton(this, tr("DC Offset Removal")); + dcButton->move(176, 16); + dcButton->setActiveGraphic(PLUGIN_NAME::getIconPixmap("dc_active")); + dcButton->setInactiveGraphic(PLUGIN_NAME::getIconPixmap("dc_inactive")); + dcButton->setCheckable(true); + dcButton->setModel(&controls->m_dcModel); + dcButton->setToolTip(tr("Remove DC Offset")); +} + + +} // namespace lmms::gui diff --git a/plugins/Dispersion/DispersionControlDialog.h b/plugins/Dispersion/DispersionControlDialog.h new file mode 100644 index 000000000..0d55678bd --- /dev/null +++ b/plugins/Dispersion/DispersionControlDialog.h @@ -0,0 +1,52 @@ +/* + * DispersionControlDialog.h + * + * Copyright (c) 2023 Lost Robot + * + * This file is part of LMMS - https://lmms.io + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + +#ifndef LMMS_GUI_DISPERSION_CONTROL_DIALOG_H +#define LMMS_GUI_DISPERSION_CONTROL_DIALOG_H + +#include "EffectControlDialog.h" + +namespace lmms +{ + +class DispersionControls; + + +namespace gui +{ + +class DispersionControlDialog : public EffectControlDialog +{ + Q_OBJECT +public: + DispersionControlDialog(DispersionControls* controls); + ~DispersionControlDialog() override = default; +}; + + +} // namespace gui + +} // namespace lmms + +#endif // LMMS_GUI_DISPERSION_CONTROL_DIALOG_H diff --git a/plugins/Dispersion/DispersionControls.cpp b/plugins/Dispersion/DispersionControls.cpp new file mode 100644 index 000000000..771ffb89d --- /dev/null +++ b/plugins/Dispersion/DispersionControls.cpp @@ -0,0 +1,73 @@ +/* + * DispersionControls.cpp + * + * Copyright (c) 2023 Lost Robot + * + * This file is part of LMMS - https://lmms.io + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + + +#include "DispersionControls.h" +#include "Dispersion.h" + +#include + +namespace lmms +{ + +DispersionControls::DispersionControls(DispersionEffect* effect) : + EffectControls(effect), + m_effect(effect), + m_amountModel(0, 0, MAX_DISPERSION_FILTERS, this, tr("Amount")), + m_freqModel(200, 20, 20000, 0.001, this, tr("Frequency")), + m_resoModel(0.707, 0.01, 8, 0.0001, this, tr("Resonance")), + m_feedbackModel(0.f, -1.f, 1.f, 0.0001, this, tr("Feedback")), + m_dcModel(false, this, tr("DC Offset Removal")) +{ + m_freqModel.setScaleLogarithmic(true); + m_resoModel.setScaleLogarithmic(true); +} + + + +void DispersionControls::loadSettings(const QDomElement& parent) +{ + m_amountModel.loadSettings(parent, "amount"); + m_freqModel.loadSettings(parent, "freq"); + m_resoModel.loadSettings(parent, "reso"); + m_feedbackModel.loadSettings(parent, "feedback"); + m_dcModel.loadSettings(parent, "dc"); +} + + + + +void DispersionControls::saveSettings(QDomDocument& doc, QDomElement& parent) +{ + m_amountModel.saveSettings(doc, parent, "amount"); + m_freqModel.saveSettings(doc, parent, "freq"); + m_resoModel.saveSettings(doc, parent, "reso"); + m_feedbackModel.saveSettings(doc, parent, "feedback"); + m_dcModel.saveSettings(doc, parent, "dc"); +} + + +} // namespace lmms + + diff --git a/plugins/Dispersion/DispersionControls.h b/plugins/Dispersion/DispersionControls.h new file mode 100644 index 000000000..e815e1115 --- /dev/null +++ b/plugins/Dispersion/DispersionControls.h @@ -0,0 +1,81 @@ +/* + * DispersionControls.h + * + * Copyright (c) 2023 Lost Robot + * + * This file is part of LMMS - https://lmms.io + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + +#ifndef LMMS_DISPERSION_CONTROLS_H +#define LMMS_DISPERSION_CONTROLS_H + +#include "DispersionControlDialog.h" +#include "EffectControls.h" + +namespace lmms +{ + +class DispersionEffect; + +namespace gui +{ +class DispersionControlDialog; +} + + +class DispersionControls : public EffectControls +{ + Q_OBJECT +public: + DispersionControls(DispersionEffect* effect); + ~DispersionControls() override = default; + + void saveSettings(QDomDocument & doc, QDomElement & parent) override; + void loadSettings(const QDomElement & parent) override; + inline QString nodeName() const override + { + return "DispersionControls"; + } + + int controlCount() override + { + return 5; + } + + gui::EffectControlDialog* createView() override + { + return new gui::DispersionControlDialog(this); + } + +private: + DispersionEffect* m_effect; + IntModel m_amountModel; + FloatModel m_freqModel; + FloatModel m_resoModel; + FloatModel m_feedbackModel; + BoolModel m_dcModel; + + friend class gui::DispersionControlDialog; + friend class DispersionEffect; +}; + + +} // namespace lmms + +#endif // LMMS_DISPERSION_CONTROLS_H diff --git a/plugins/Dispersion/artwork.png b/plugins/Dispersion/artwork.png new file mode 100644 index 0000000000000000000000000000000000000000..17e3b9a118973f04f70c8a813f0c4667a7eb6f5d GIT binary patch literal 8757 zcmeHKcT`hLw-3E{q=_+vE`)?og9*J$=tvVZ4T#cGfPfU~T&gscB1I4cK`8+4=14Q71mjp#Koyu;EYOi2Yg z4@ps?&wdYmsFBTg%F}uOH*wU5i_4MSwj4(h0c)4_N)oNU>3#xHr;ewqM03hSoVLCD z=&@PEb6y1M@KbU2iQEWot z6E-8%H!DZq_>GUrRK;uGhI2B74jRs=4!hc6^7Jxeg2uovdd_~~shv9d8f6P+(H^Uu zwfpWdve6WJbsT!lx%sUCUh=`_fu_?D9}3*VKJ0&=;YV>eLMj-NK6>!ex&!L{+jn80 zknqTZh$hHNnQr2@G>@{7n}hF&HE5iutnnoHBih6LnBd}vnwc;q?1cy&e5Fz_H)KRL1T@S;lfggfO9BLwDHGe0H0FwI~YcRv}wjNyJG{hPh9>42}X0-muX zX3~|>nIGiz(L5{GoLRDvw{PIE>2OZ2jYem+VBr;G)w(+4OYzA59r@${@f zLb~=yn)<4OR#Vz~?AC~zpwt<;Gv`~0>+c7jZQzg-|id$Z9cD3J8% zVUH6(bCmuuk3wOO^1g3bhACnPkG&WS{UrIZosa#|uvMeZ007-G>IhcxYPgEs+$Y6t zP?DdSM;NiN7wlYE05WvG?5CaE>Ckh|$Zr(m=l{(+5A(Edf1g7^b5Cfo%Lx-#SzURc zMwP*g*)=6#7fI!&w9N^#&W4-qIT$eptg`UOrrW@}B?zi(CJJzC3 z;Jf*ZVXK&XD#t_7c;Co;^oH72h4TFnF6#AA%BiB+&kW`dYO=Jtd!%6YC5u7DAt6oo zmR=qn{rUqii6xIUMjw4Z&v`T=J-4}_t#oh!ekvGz0G6Oa^9!WsJ^%ozM+?N@P7$ae zEWw-Tj{<*c?*fB}cof)K0}Vq58WDVm=3!)lLzuNAF6QYpz{HxVFID5Dln*@AM{rZ3e_Z- z4)VJ}|5bzHNZ%r$_5?~m5E(}>2`2bcrGJIM`cYGau0FH>)*?ZN5!L_ups+tfl96=kRj)5T{+Bi)DM9oVLuc59+(8A#G zzd%{|Q>Yk!9AOuV4z5C^6U6Vk&ntyhq>EVROP%*|BDuE6PgRAMl)O6Hfj;i#hs*ai#1g50} z`$awgPxK1?-=ueg2Za2&=YJr@2%rv!LWLoj55fj6B;I#+b}+~W$Qu(wc(f0qvNA?&UKoiGSY4f3CaL4Thx zbT?=GF=Hh3KR7||3H*{|=z2ff=*f$o3!#4|!{0fh+x!3d`+Y6`KZgK;{vG5W@%t}b z|I+o382CrR|9aQIbp0a+{*my%-t~V*7w2EcDS|(}3JRegmbz}fYNQ{uSg}XUi~&2l zS4l@@Hob)-(A<>*0B{NI-VA{JLNR(H8`T1B!ZyzY6h0_h8^gIPCr&kSp&AAF?N;T0 zy<(Ao2Za!+KA_!V(K(t|6ae5uSr{8Q(w;7P45z=*=EaKz6?-gVw|8uCe9c$bv&KI3 zcut%-bsy#7WbKX}5XO-XP(tHr|1H(ADC* zF;OxVq8XnCW?l5;r1?od)~6{`+ZUPUM)z&u+b^u479#GNO>J+3z(s3@k?qA?pBG3! zo*L-yU)kb)l@>Q{)~6wszIJ+r#tUSVjxh#Ah+ba5!1LuihKZE*hJFYZbU&-w@8*X{_*cqknc`MZ5b5tXl*+ zRse5$Bzxx6IdxPBI)^cE1K)ednx%tRS-PN!I!1+4aGel_2zZ!ni!zo;kT;J^28dwa4!opiD3p6spr>jy_Nv6nk_TyNQ*zyf3MP|F&}K}x;UW`Y&c3De{>?vY^l~&9h)x$w(^;j zZ}B&m@qs!fTs5qTFFSF(lXC>)8rh#R=&-D-_o#$%kfua&UKttR4drebN}+y zFJQ{`bFJ(KDbaLj%Ch#AOdE{^MfWF~vIVs%B43up!jo99g!ykKafG3qd(Ie>$Z@Pi z^0&TFeRK~Y-?cXR@nyMDy^jw|ojQa1Nb)zCX4Di}=k`Q)9?Xy)oy|rtU4NHg+8$k6ezcGirr%Str)*Lvm%B} zf2r5+_oSKsEqRsp?TjhK#r>1->Ca0!IqY{}9?v4qL2L#D+Ugc*?j=r3bp(}TxA`3o z2H~?gdiUE8rwq2tlAd)9KKY~z3s`eGEm4?M{((zUEIm+@Wwz*y2Fm^YKFKT*G=WR? zH(yT;`6d@0Pf`t6W|jD8P-}+d8zaQV^D3al#IE8;BnP98syXBE zO*zwr4i*(oKX^w<4+%-Q=765 zCv;vh9N`$R3(N^YUhJz|E8d7+X;t7lp$I5nB&7w+GroB`sveU1NSKT*7|wNF?@u#q z@g5<&MzX>KF1{arV|fSsi20di{)JnfNMP(BpAwH@2qFp1d6#Pl#{76=c{8e^bhYS` zhsYTnd*7Hab^@Lu@uX$WlGx~tuDH(3Am@x&9la?z z>fN`8znEH-5Y^4@#ES6DL>Q(Sp1N258Xho$STY`Ew*1c6Ej|bZ-s_n?ag%9KFz25A z<)eCWST&{RM!jA|FQG>n@!0@EG)3I$)GXKEo=`B19?-`>dDPPdT4qg4Czo70pVrj6y1B`VtSh8cSy1ztN}4 zwQ%)OCzHtp`>?+AcJASf8ztF?KaG&R=Zou=v4;|0_0KZUBsIRXo<#Q=Kg#~1J3M8? z6CDQTyFA8xe`KjS&`z#wT(DN>nWh@{Lu-&}9&2(rt-iveF;1-ImU2^p=tW)8vPkO% z8<{BZN`8%9)l#~GVc5!MB$C&nx}x`j_#Ag-oi|yLLp{Q94Cvfe+NX2V@M2wuro2sy zE(d<@you49WzOd@SNat^vko`d%8hlJ*1{m37dKQ$*Bk||zMlUm`QUbyAU0wbGcu5) zudVz^%?UvDjkA>m`a$J|B3LOOM+T4lR#?A>FpP5jdo^Mn33skw%(W{sk6y@L}G7dXU4DzIWROwYhw+6G@|@%ZsIq2i(5>1k19_ zZ7Dz>r<9fQuw%zA+|mFP-)+%)E2}I*=e2=EqDov zFcfIhJ!@W>?HSwSYur-M^Dx>;jq%I!OhxVm1v^1bNjUFG1BEk6--l9;O%xauH6J>) zJpX-Uj%c!)M{Q4d(uStIeS{v4_g>SLntVLrQ|o|fx*o6keP)Fl8R>S^Vmj5dp1Wdm zdr`3YNyO#QMbpy-!tGo&rq}ve(N{j>M8ckY#Z9!$Aay9(aWq$=r218cO8p>ck z$$swL8{YE+dpoDL%yjiA5Ny}-p;#qQ_ z-Bhrj5}S^OXZDx(_{Pb88vd~yPsaAO`p*v-o&i@m> zP%_RDy8gKL9)Q!*GWAhXoQ0y@2PQ~Z_K(zuJK4a&;1On|?aZ5fJKUGmnAg|bs+H7* z8`Gu=FfJN(g8FsC86k15DPy+>7-fSyY2hfKS@8M99h+YlLq?~*ksG(5&w?coNA{PFZ(2)q*i$@&Of0Cbl~GsYUrIP3?1Ym| zirzCKZZxw(l`@8>a=o0EHQ)5j7$mN9yJr?!0d|WUK4RDqxl!MOzHe$^m0 zrEzY%w_H4)@>6p)c`Femc0{G}X_DTj+bo_Nn__ViCPw?k>S`loj09zaIfK+2zL>@` z(s!`#S+RDwW2s0apZskPwDM$D@6jPg^RURm3Ej~e+dg+-G>XYOr^g4yp4fRuwR~Y# z?g9G}P)$5!Pl0l5y0M|`2k+7TER_sHsR~e#+YW!>73=W zuXBRrBJasOt|5{5uRf48im7ih@J|Vg6iM1Y?!-GquXyNnlVWvdEHxzg$wlUw&fX)U zp#5pM$g%J<+yR}vkkK;r1|Rfla;~FC`tfroFRDd#Y^@Ef%&bJv>zh@Q8Qc5yH|q%( z10VYEny~l?X7sPjnrqEKqCcb$Q`<+x`d2#UaT@+YO6c;1C7Tp#jx>TiN-r@*Gh!#1 zaPwM1b{VP|PG=k}Xt1$tM7Bh%iJkvydaOvyQpc@V74U#yw_p_KuwUZ&A0IBY&S_?H zWdk#Ug&kZceN*{!g6)ECcB=sCXEIhG8!YE;BK~BVvC}o)P5mlq@pNhxzQgyp+n9rt z6jG_})_YyaBd_qIwtU%5OhpruiFmU`ZLxcHLs4?d=OVMNmbYxlzI*;%`9gtu0r?FZ zL5dzxj2UGu-^bkqn)Op#eZ++-HwF*2awPYyIlk@=T#PRkOjtbIwI$Yg0cN%2^Oend z8yM2{_BIPH=+d|%=n4Z^>DfduK-7V|bN`J5)s!t#Q}W&93!)i=uT~mcsCYi87c%^y zf1F_a9S+-qxWvaLM@+xwge)=7)$k8h5$-#TC{%ihO@}M zJuZ)Zxk$_|eMKQLQ=nkWj;BaSp18zZH5R@?V+QUp6_aWi<^%P9&`;X{3lnSOYlbIc F{s*w2i^Ko` literal 0 HcmV?d00001 diff --git a/plugins/Dispersion/dc_active.png b/plugins/Dispersion/dc_active.png new file mode 100644 index 0000000000000000000000000000000000000000..d9c8c93784521b5310d745be52a6a876d1782627 GIT binary patch literal 9043 zcmeHrcTm$?(01q$sUjdvx}XSz9zyR4y-QOGAwYmY2%!ifA_|cry-Kf2mm-P+Qbds6 zJA!~x1f&RFK==aJ+va;`zPU5s``=9_$?xpheRlWRJ!f*xBO?QC8Xy}G007Xypc*EG zUsl5BJS92dyIj;e8vtNf^f$A_nZSLyF<1{rlpB&8cN>G`M*5)~0RX?rvNWqW{*pM2 z6RUSN#MRB%i<zMcuTXJVVt zwX|`oaQtwnx1@UO%`DybSD%%#WP6oa6pD!7W0aGQrcWT7v*a(s+F$R&vn4Xm{oHxT zmbKND9Gv;+zIDD{*ra^Gh_e{9-kjU$Xb z<>F6?n|=#Fxo!QcNVi7lct7Jgn%o1Zq`Qsq%V2nPbJN79-kK3wFGt~S1J>DHva zyEq%movuRRuE*g)14-=zyu?3aY=5ajicdS&iFA4w;7O~^Ogs#l30szDz+Cz5QLIvE z%p?6Rh;%ewzV2XA4h^PDVR&=_OK)$g&Sxopd0X3_C(Ignr7!^-XJ(==62{^6K~C4g z$n88o8!S#UADU>P_DCSnHb22cx1^C=MRLTpAj#U*wR_^?t1a9@=xF_B&ihQgz8n54 zwRNfok>J4&buCu!niZ#%x%b_sj;Y=+mYAQ_e9{pXvqFxH$UJ)yGT~X2QTMfK&E3N| zpygnFpG%`h(RfGD#6RziW>htA1y6blY%qlZd~#Su%An1isn`^q zeekkTXGd}Ad3&1h_ls5?d+MI;!2vJkQF6FqoMPsWX7!a#Us{v=}%#OS?vq(otX~h>VZ45+kI|Q zAES;W*?Ts@+rDm6O$!~#QSt7zRU}nmiz6sQ?x60R96{;}O?$Qe2Ic*7P~Z9)XTe+I zgYrZ>ij@_xNt4w4D^dEog#q(>&tLZEp-hLZS6hwQJ#%@V0_!zJDxap9Egtm_9Bo7? zb8v=sW^UQP*qyO;747uT2+Rooo_ww|Yiz!DR7mf-xA?@=n9Ut|o)Ng*E_Yv>^^Qx) zlEJO;N`xlqin_xm3|{(6pF2XXViSMEB6T(F=XA&2dhEm7SZu^RF&l zy`5qklHQidGdcq|&Mbzgz5zE`CfH>0qf&;PWCQvf9BtL2y5${^Pl-8RUnURHc^J6g z&c>YoNVD+5yrE)?dKEQILS&==`v68A{%Uio=P_RbyWPeNlvw-Fd5g@<&2&+a?MLpW zQ&%~)$mV&B@>*j24F#U^caOQx$;D`jidC0$IE9r+A3ONc$>GgA>Vva zNU>HPnqDysRsDRgjMc`K4jI$Q-ag@LtqyI{b1n?+o$N!U4%@%X0M8yLBI(mF)#Sd zuYeghaaT1O)OV)h$r?8tO5SsHVglJvBJ)F(N9&H~~eD-XEnzpZvQx`$~u-Y@6poE2^444)lcdOlzruWkxe zp5JWapnN47>gcv&dq17TLZnOa2C>6pcotjc4V7m7(e$v8Q3IZ!z`Dk+Rn3tc>8Qa( zWb$a&v{KE8$A(*w!W=CLI`d|uanze{j-P2A27%Wz7TJH?=t-L{vT~E#d!C+3d5Pp*VP_#Qsn?v$A$W?VIf$Xi81#~KjuYldD;}}` znVaH$Li?>{Hs#NfH#3&{nC_VU5I67Dx(l9{Q zTE?@tAwFw3qsBL~H>$znoIL89gU$mU*ly7Rq()UNNSM6j<3Y^Dw3E&!^jHFi2DfLZ z0-m^BL(^P~#mrPxw$$fb-qqPKOLO!gYq=8lE}tzfJjt0N@Qot?2lodwJ>|m`TrQ=% zM^C2Gvd znr*k}VDzPCN+&cWb;j&EQAmhSdfdLfd z63nAJSXOr}&WqOkM8PP3iVh=Ftavcz7&zSK%)LlOS$%Y8R}aWJ){Z|?D>gLOjY_SL zD`rc_8g38TS_()TIu5?Y!ou0;D+6mN#?=_*VQkY+GOciQ^3vH<%=aX_NBOfxRkNKN zfIKgl-*GnRVba>0QPN5W^TiY+w4^0C_ktbydP>&$T{T0a*~X`@Kw85T$%fw&vVUW! z5zA6HDYUF6!_9Zg-{9gtYIz{O8$28=lWyy6r(#7xH)}Fd5MMk$0n@QxnJ${jmaX0> zx){JP?lQ5!*FjS+O*Z*qS0G>)?-qT>1YJ1A7BI6x^yD(a6QEeBYULbL>=(McAvo^g z)M%1&^v;-)bg))V`$Q$3dq)TevF2TA8UCE|VIKkCF7>SS95O(p zXk&li8|Nk2KQt?W4|SY&y6)`B?VZSGeH@x_R^lQ)IAo1t3+*3qxgIjnpFelf(|;7h zcJOds#Y$ujw$vB@$s4LuN_vO9IKf@*#xuaKuCiMjGg8Kv3rigBS67gHG;Fc_T1hvO zUMsgT=+V$*F&!YjL`pV#ZV0XN{?6y!Pi#vo7THg2k`I4W*8%Su-Riz|Ut>}mW3WOU z971INP_6y4vi^z$$p*d#y&ThjozFgNk1W?hfHu+o93${^tWF{+fkhoh{A3W{0ezLFPw#DG>;(OWX(j*CuH$USIw#Z6O zY9(IT0=y=aHStyWdJSTv??E{=o1OZS2}^2W;Zdg(@@{NQSXW!@VmH*}e&Wq#UT%{r z9+qTb6*ZFFt??Dk`D)fwTll9;g|P}xnBkzJL@IKt%1;mql&B?K65lPMBot}1t5nM&8=_3ad*vVrRy$wKr( zW{8Ife@R;)Det*0>28_w-5zjcTzY}4w@?tOxZR-1OC-y=k%%G{~re)=Nlk8bbDb`_xO`Gi{K zF~NyMvow95T{OOOWJDH$%7mAPBsg$Hzv)b~Wl#tOi%ADOLC7WIe$fKx{{adbBaZuc6TH}|dMNFbt79?jRVY<~0leV?~rCDv#% zuY8_DFxsoGpC^rIj?Oo`m}E{Z+JF5*8p~enYE53wl&aENJ4blh2J;+oMMEPeF2GuQ zAFoh6Gf?$?jeRaJl`5Ag+ePCM=O-xBM7no~-id3$j|Fy8c@-{aw&a<;)x@5FN+5OEY8SZI*p}5_{}wz?mc< zICFli!q4R)o}~0cAr*(#@UsazQQ~U7!Y^+%!*BJs55-PEd$T__uQn}xEq`4!95x(> zJ9NBeSgp;khKGudlHbtG;_x^WI9P;Hh!^|FW@<1!rc75ePKXVRu=m#-_$Wkd1Kwyi z)*bkf^O_}%czviDQ_cCa!~GdbO@B=ZjZ<5}&86PhRDj{BrJ*T8Zb?j~9OM z27lLyCd1mETh-lvg9#L+7gpB>__VyI_?jGWca3?+H&k`_CGJxX8 z8nQ60SzKl08eby*TOa>jZsUUz0%-;ce%*te~;|7F<%dzs`8 z@z%8=nh3uTKbN6FxlKlGOJfs!-y?0BdhRX0F=X;bFbl`tPB%W*podW#|4@y+3*8+a zs-pnoFgJ_Z{>hrm)N7MIf=!g(?7Vfc7bVADY!{)*LTlQ02tt!qe&ckkphvP5U1y$x) zUk+Ly>u{zV^EZqR=4z|-$zVKZ1{W3QuoTMyg97TM3*E^ThOZLWWm>^Z&*C^f@2>O|;P5H9BYP=pIOOMN{E!UHV| zckr-Biu$23gbO+VKtb6L14pX#Ij9j1+mDaX1V_Ow8BUSJYQh)C21zCN3u@ zCkB!blaLT0Xoz^-cE`c}MBKgjP9c8B&_H@2uqX@;<>AhKiV3&(@Wv_f@)G8`|A-Hb z(bxYI-regL3j{vI{NNZdaZ!*M8ZGvB3oo3e4*}#?K>wqKml@$6Q_KYE<>8G*AT@oE z?l```LpUJ*w8wa3-Okc+K!_pTkZ6Lc7s0FeKU`|V^o{i%3a{gGAs6FhT?&0hhIhJ4%8I5NH|;s zECrV&KuLi`a(qKoKGbjfHM9Tw67)A~3nbQy z(21v*;vi8;i8J%lvOoyQ5Qv4J_9+42OisuJqK-wvaUNJR4-Yp*-qVn{Pc8qP)+a0{ z2RII{0mmT;pdblJ2uKnlA!jBb4w00CfC$x)h5QQO6i(m60p)o6|D}Dpc(@e^`h=20 zQCbgx%v; zyZ#|Z{SU3+ATH-9Cr((`U<4c?B88BYB|OQAi^xjbgQX;8~zogBVz@z|BDla zGljoxG6cKdWrWR(uosH`xf%ZAj1cet=Id82{x@B4bN}b$U-A1NUH{SbuNe4O%KvrO ze{}sT2L6@uf8F)}jV|C{$0?*c;a`w1;jrZHBAr1vXp!6NYHI*aPT$!LMezg)6$WbM z1ptWhoqmY?3Y2{aLJAyAUz6es$t6-=3fgPguL#HKDVT<;8MvzLU?Git_Sddi*iIar$55F;da%f3(G^0-TNQoq=tQcLcYab5YcMhEB(ZJ2p$JNr)zcHEh!AknS+uy4LF~Z3W2zB`det zC%Lx+IX0p9Ki4A0`zq#U!AxwrfWeD1ucKx|Z+CIQuNZSAr&u{IH_Inn*E}JbAgz`E z@{DUHBpJ`gF~+s?ii6h!o!nZ_l$oFWwA2PIPOGvN*eibVGWDmS0~(ngdY~pgyq!>a O08G7I{{I0n?sE$O literal 0 HcmV?d00001 diff --git a/plugins/Dispersion/dc_inactive.png b/plugins/Dispersion/dc_inactive.png new file mode 100644 index 0000000000000000000000000000000000000000..9a0ee069399c47b10bdfc291a79e573eccf98591 GIT binary patch literal 8948 zcmeHLXH-*7w+5sm(gdW(ponOIByERMb=7DPD08{m$2bHuu!0mK{bXaL#=>qtiCGg+99N#T{R z4Esr7uc7p<;T_2Q;zQ++sD{_|%G?y$pvUMf9RyBCCc zZQ%0g#)8_DU5&o{n$HTe((C&@0nc1Bf)qDx=oM~%ul=xeIOe&VHLpllHFP_2)kkqT zTgmBjT1#NsvZe3?wd?KvLf89M+vb?2p&`?_iRtV6_2JJxeSsc64f&}qu(OF-Dw*ql z_AHKSqqkkI?K`{8Lxo%ORpeKG(y)bbhG+<+&vxNhpA$M@Df98!2VV~nmNlazd++qJ z^R@!F&s+V7e7MhDv7BxFob$rc?w7c+SREye_w|P_x*sW49W1R`+SGFdd_MFz%<{~J z)i6YInJ;0Ct3X-i(;6~)`X-D;XzRV~)Vz$jmu~0FXiCJ_A7;)iq<<-Iwj~ZnPPt|- zEl>-ox5S7wZ3Z#}n=Mp6_c8%ju8v%*3!nq_7)HL8LBzGS;5;xBj<;pYOwF?HST`df zo$*SCl0kCzZXl|qk$XR=$r_u?G00o$`T`BH5%oW0B>8As0$UE9Y{;2EJ%4QlWbE9L zS2Os;$r{GC+!`CXWF1=BgQ2i#AEHCr04P*@!xyV-I=;WQAMzM4rYAw--^JwEzok6}M}j(xSgul!O;4DM~qao0rfn zd#^l4_~oxc1=^_r{o ztdZaIZ|l2Ec^|SK?6X~Le$*!6|yXbnDt={Lfd?=2ed$(geQdFDk0rV;} z%)EYLv~#H}3e#KfXdga=W7pj#lxtmcCbYw!PkMZ_BWHW+lP)zTT398CnZ+$WT>I#U zdgaF`tuj&O9zsRS;+U#6SP;@+YJu^#emfG!giQ`!$|HEq{OdNzdhe*qHIZCmFQyL4M?*`Tj=rQTulKTm?f4 z?sF2#_Kg9pfZEVlnxtt<6pi^-j{TLSG(RcRTE4?Lr+6x}J z4-}SE$f6m_r1QW_!KiO6b)x03yG8>rn?jF@bnVP_oZ$IjA zHsyQYK{Keu|LeV48{;0O+Co$D7Oji2^%H5ra`OVzuYj7tcT-MP#OnvVQO%=7B~N$g zS)E?d;gq+4;U-YM;}>7L&Syy_kDq71D~GDnm>^aq7e?2HHUmL*n6x$xCmT2kpNNO6wYAHvruk@}H<_P1DFU{L+N2_!em`RQs+E(~|5k)9*UvTzA+! z<>}QJG+BWKH{5zS#8~6s=b5t-RS&m4lQQ9D>Nx)3OQw#1XW_VY<)~R{N>K(p6-wbE z&&-ZRPq2x}9aOVjLqfy#f>U;t6Dr7c?rwbb%a-Jt> zHPf3T8ggv2N2Z;}9_(m$y5wI9CXO@4NO{#Seez}n5Y^95Ch>c@pxKfAY+BJDhQXB@iQRKPK{U%wBmfFSi7NApt8_|l>zp@GHGV1sovmuao*>9c}Gj&Hmr4JPL5 zBdrU5q8yXWXJZtde=6_@X3^vD)|hpd#O7*GFF8NP*Wod~nE~@3P#@q9-Q84l=23m> zJ)Z7nKJARfon?ah0d)$wAHzj??`P&qy6tAnaP1wq^LNJO!L6*SoZ|)6qMchkr)0u4 z$Sy2zYF|~x+cefGul|styhxq`78bC-4J=VkT^ljuGEYYgZ9=7tmAmoGYDplP!^VtX6$X zV)3dsp|)l&9CQ0XqIG5MO5aV3=b;k3kV4%(2Pb%2xk;|adfy)foXX*Q3h?zN>Xa~sJv^q2Rl5{wBJQ;cZ3i8pcCO} z_Jt3!dSDKVC?8fYK9BV0Hnw=>6(9Q}^BkGfI8LTHA)RLm^z_6mZ-hpN%Ng}XA^jD$ zj&8-vhx9zRN;jdczMd-Xn9r5EBO&|R@QcAUy$In_su&9Ho%oXq8ctWMCY$r_o?%E# z)jHr)PIm&nub#%eduabs&$wXCgv-0!e<)aUdMDLvc>e9TbevjgqWa_&1^?@_s+MCj zr)H`GU54H}vT9qiQ76zBN%P=yg*6=wS(%<*6;sX^uoC$3p7OSWDLCB5b`tTxU>ji5 zDu$kxf0UcZ&9YL3{@HGPU!%k-ab>fiP{0rxxre{jvj9?QxX{+TZi`XA_uFsV~xP z-f6n2IQQfPqCQ!vhg}=|5XDD+s^g_&A$EbuS6_*4_)d3`pJHz(Q+#}YX^9BAfkZp? z+mgiL(uHC4^(kcm&{_;@qpJq&%&RN4DmR zxgK3oz*d=EC{F$gP=8H<_keGDs9AGr#9dH*8Qk1Uy`ameKOQrXemW3~FXc;~S5IAi zy)hc78#iae52#+51Eh)E@|&4t$TphJekkyG$L;YmuImrtPgyOwIoWERt&od4|Ncdr z!D#E*-HNB2=5Kmgmc8q zs;y3SPOt8kD00i5yF5szGy9FQt+%cc>tskV<#6tavo(^+SmPFmjI~&zb^LLcu%>I< zp*a7mJo`+uSplPOP|f?%Lnx4UZ(thB0d;(EN2_|SxWBTI%*RF?urtTRcHX)@B*vKY z3{3EAv8I`Zz;%Pi-E%Ywd}R6C8X@&}&-qSrw@tItH)vl#BuM7IKFx8yx?F4%CgTav zS)$cWNVZ>@+-akzWzb{@rz%bi$fXQZ^to_7{!Bgkad^zZ`+J9NVkJ+6iS7F9-;0)Z z*p_bR@pa524IW`z3fn8ialROo>7are|JXZh#md59$MM$D3 zM#g3my}COr!UbrjCv;~_zG#=d7)o+|&U`UOMT%+62?Mgj`40a)jJpiYke3SWE zJ{zvgHQC({YvI;Hq*AM`?pJ+dhd80{uJisdb>PQ@Jc?khC5w<2S;~2CiC2|)yEbVd zuA0<&Yc8jT#{WcfDDyd8+c>kUHXq*h;mAIbu^NR$sjpiZxA^ENyK8~#KGJBegRojO z!nt>@-ki$!%)jx?FRk=uLgV``TM(PsaH#atZfsaM%L4DYsOw1{DQ1N|u&+`tesqyF zIvx04X1Y+!mhoy`#)OW-ukF(Gmpqkw)y#uoTU6UAhip)So#vZJ z-Z<418tepHE1NcZu{kag)kez_c4%55Q$7b8gq5~a;{IV-Fu&6B02&ik9Eur5q$ zxC{ZeR4oXqkKJ@A$)%XnC%QYA7aoR%m$sELoXpu*RWPN|*kG<^VSS5X(ZeeBN4*URtdaNzE7XqrbZZTs%pfe2NhK7xth8KkJ99UqB+i~vTn!Huxa>^z znwXz2iucLH_J*3q*9W`j*hU3nB_BIbTFxajw9@i!={~qNv!9FE-&C{U+UB{>kHO0K ze#@MsY{V?xDGlNf*ROUr1=LOEZ7cYJl<#(rYrOQ;Oug2^tJ|0^MX$a(*GuMPqRV>0 zB}Vi_^vJOE53kIplhMXcIMkV4_$?CeZQ-tp8aLdDhIf&UyljHkRjgxjdir zTr1-CCA!kGgPwf7{#S8_ZM1DC<1*DI(JmLj_3Z`ksyhoxZoCL!^3OKzVB_X~&X)cl z`>OU!smR&e3x-acg3dz;Pp_h`SBLC{3?z&c>RpfOUA>-l;#C0+pTNMOnD>q#Zb+R!B%46*AGfUfiGBYPCO}LW%lr;i2M*KH~=y7K$JYLso&_L>GsZ2 zF+ZPwrG>)dOUBxuhV_sl@fr5g=c23dl$n;8le_m5$CST#6iAIdz&KZ0C{>L|Y6y!o zKAYRV!f(Qt+mN@+tJW`YQ+#mK{i4OrU=BPmYY+Vr^L-f5($7hKF|`W1)-EPkX*Dwz z@#5RZI=*K`Qa@iwE3I#?EmpzO4T=t2<64RiCq_RGHc9Vi@9a$sDy@sB_Fp+z0!z&G z?qR?Z*`a&=NT^=*9zlLylg!)_`9+KT))37jtNAyQ(Fg^u* z792z0o0H+>-TBfJk)YqprV$Z-mFG3CC+e2Af)=l-N$l1Su6yi#))}MtWXX+J*Ut1| zFTJ)YmJO!lctpuUfif|=%EjUE_HKzU+~f8&$O#`+wz z_b`yG+ywtjJ6flTbTsCJB^`lT=;_KK-Eg7^l$!%u)CcEIIwB(@Q&948MR8pi@@R1_{;Lt<_zz65z zN|5t`0grLzNbg5tF(BYrh3E_eTId-9RNU}rfP|=os5nT?2kQj^D$)ZK@F+()xT^YZ z5Tq6i=tLyC%ZZ73dwYv|Lq*;27%{M{tgM(gL<|A}ku*Sr8?Hoz56G1ucm(kaLlsRx z;<4^TteY#~2ovGp=1GJBfuw%G@BZQ3_4NLLcP0GB0*MbXAB4LYSX5jLhZFm&1%asM zMFRQFq5o<@Fd>~JiowwYH%~kgt>%SxB?|r(0)_m;-rW=LavTl{DTa1I<4CFm(x~9S z4XL4}XZVN35d|15&i&YmME2h_iCD)!$@-gbM?J^k{M8YX`5(A{)BZj7V`Y+-o}Qel z8`AU0JuOuj@MwHFlp7L@k~@9{JIFdBWMmK^2QUH+k^n=&AOr*=1wtNO5Cj4xEra+A zl$I-jh;T)skDy54qF53RSOz5nb#RaZA@dON(8ff> z5u0Es8F8?rIO!oFD@{evk(sDu}hzL~#5lsRWhd|}Tp>hye69`xiN_qi<#HHoL z|Dx}P!aCmg-?Wbw4?yA9lxt!Mr15VYi+-&rW346Z#@%n8p{vSsmLH|3*KjQaa zy8fl>A2INcl>g1Hf9d*14E!VIf3xfVj4t{=w^L|W(!U^Y(q>7fT-B1a(V}+H(NHD( zdGyI?E>0v#=-f3e31noVf=4&GPoa_*Nk~J~(o>^ZI>AqQmicw3Gc5z#VE&G*P1!W+)|x;*Oh0j8y6HY6KU0T8g1;SR9ucPd z$vIqeG%s=M#8;aJ?ag*A*V(7B`%?w-!~~%y{9*I>2MkXhg&ZD!CuXb`Z1lk>DJmYd zrM!L<8NQNcN&SwF^mVmaTiAP)-{iATuV+l>d0VSUgM3esYiaxbUex<^Z#a0Cs5 z^+-;1Y+Y4~+pxOT?na@sf8_d;C#rdIH@+X9m~gpM$*?3lKC9kq7QRz^!e)b!u()~F zT9l4?wGyWD5f;R)mVyprK6C4e-B_e5(w|$O+^`16uq0<-e68+8)mSuG`gY~o*BL%Q zB9HZRNyvf66%-~K87*^{x4P)HWqD-R0YvV=>k&ux8-Y{pe6daXp`xV3Ak$LQSFOBi HfAfC;^8!HH literal 0 HcmV?d00001 diff --git a/plugins/Dispersion/logo.png b/plugins/Dispersion/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..9340da708dd79ed97111eb535f51b81a91d6a15b GIT binary patch literal 774 zcmV+h1Nr=kP)7WEc)VQ)zLm`B#lSD% z0Wg;#IH?7|3b0p&fj_`2;A{cm@zx+(Ge?s$@EN$6LtMjg>;+(boCbaXw;ja=b6mQ?gRp67Yf18(18niCN0v&eY^{Cr&#;#IcF{ks?!* z&o!_q>9xbSw`QytRI!M?zP_o#K-8ExJaV?vi znPt?~0KhTu23U+Gy8^Tw;^SzWSet9n Date: Sun, 9 Apr 2023 16:42:18 +0200 Subject: [PATCH 45/70] Coding conventions Adjust the code style of the adjusted and created classes according to the coding conventions. --- include/SimpleTextFloat.h | 14 ++++---- include/TextFloat.h | 27 +++++++------- src/gui/widgets/Fader.cpp | 2 +- src/gui/widgets/SimpleTextFloat.cpp | 8 ++--- src/gui/widgets/TextFloat.cpp | 56 ++++++++++++++--------------- 5 files changed, 53 insertions(+), 54 deletions(-) diff --git a/include/SimpleTextFloat.h b/include/SimpleTextFloat.h index 1d029c189..f720d0b3e 100644 --- a/include/SimpleTextFloat.h +++ b/include/SimpleTextFloat.h @@ -2,8 +2,8 @@ * TextFloat.h - class textFloat, a floating text-label * * Copyright (c) 2023 LMMS team - * - * This file is part of LMMS - https://lmms.io +* +* This file is part of LMMS - https://lmms.io * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public @@ -20,7 +20,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - */ +*/ #ifndef SIMPLE_TEXT_FLOAT_H @@ -42,13 +42,13 @@ public: SimpleTextFloat(); ~SimpleTextFloat() override = default; - void setText( const QString & _text ); + void setText(const QString & text); - void setVisibilityTimeOut( int _msecs ); + void setVisibilityTimeOut(int msecs); - void moveGlobal( QWidget * _w, const QPoint & _offset ) + void moveGlobal(QWidget * w, const QPoint & offset) { - move( _w->mapToGlobal( QPoint( 0, 0 ) ) + _offset ); + move(w->mapToGlobal(QPoint(0, 0)) + offset); } private: diff --git a/include/TextFloat.h b/include/TextFloat.h index fccd10ae8..4b97fa3fc 100644 --- a/include/TextFloat.h +++ b/include/TextFloat.h @@ -42,31 +42,30 @@ public: TextFloat(); ~TextFloat() override = default; - void setTitle( const QString & _title ); - void setText( const QString & _text ); - void setPixmap( const QPixmap & _pixmap ); + void setTitle(const QString & title); + void setText(const QString & text); + void setPixmap(const QPixmap & pixmap); - void setVisibilityTimeOut( int _msecs ); + void setVisibilityTimeOut(int msecs); - static TextFloat * displayMessage( const QString & _title, - const QString & _msg, - const QPixmap & _pixmap = - QPixmap(), - int _timeout = 2000, - QWidget * _parent = nullptr ); + static TextFloat * displayMessage(const QString & title, + const QString & msg, + const QPixmap & pixmap = QPixmap(), + int timeout = 2000, + QWidget * parent = nullptr); - void moveGlobal( QWidget * _w, const QPoint & _offset ) + void moveGlobal(QWidget * w, const QPoint & offset) { - move( _w->mapToGlobal( QPoint( 0, 0 ) )+_offset ); + move(w->mapToGlobal(QPoint(0, 0)) + offset); } protected: - void mousePressEvent( QMouseEvent * _me ) override; + void mousePressEvent(QMouseEvent * me) override; private: - TextFloat(const QString & _title, const QString & _text, const QPixmap & _pixmap); + TextFloat(const QString & title, const QString & text, const QPixmap & pixmap); QLabel * m_pixmapLabel; QLabel * m_titleLabel; diff --git a/src/gui/widgets/Fader.cpp b/src/gui/widgets/Fader.cpp index 4cc5802a4..dcf648c37 100644 --- a/src/gui/widgets/Fader.cpp +++ b/src/gui/widgets/Fader.cpp @@ -329,7 +329,7 @@ void Fader::updateTextFloat() s_textFloat->setText( m_description + " " + QString("%1 ").arg( model()->value() * m_conversionFactor ) + " " + m_unit ); } - s_textFloat->moveGlobal( this, QPoint( width() + 2, knobPosY() - s_textFloat->height() / 2 ) ); + s_textFloat->moveGlobal(this, QPoint(width() + 2, knobPosY() - s_textFloat->height() / 2)); } diff --git a/src/gui/widgets/SimpleTextFloat.cpp b/src/gui/widgets/SimpleTextFloat.cpp index e6625063b..d1f490b5e 100644 --- a/src/gui/widgets/SimpleTextFloat.cpp +++ b/src/gui/widgets/SimpleTextFloat.cpp @@ -47,15 +47,15 @@ SimpleTextFloat::SimpleTextFloat() : layout->addWidget(m_textLabel); } -void SimpleTextFloat::setText( const QString & _text ) +void SimpleTextFloat::setText(const QString & text) { - m_textLabel->setText(_text); + m_textLabel->setText(text); } -void SimpleTextFloat::setVisibilityTimeOut( int _msecs ) +void SimpleTextFloat::setVisibilityTimeOut(int msecs) { - QTimer::singleShot( _msecs, this, SLOT(hide())); + QTimer::singleShot(msecs, this, SLOT(hide())); show(); } diff --git a/src/gui/widgets/TextFloat.cpp b/src/gui/widgets/TextFloat.cpp index 6588902f9..4eb14bd50 100644 --- a/src/gui/widgets/TextFloat.cpp +++ b/src/gui/widgets/TextFloat.cpp @@ -43,8 +43,8 @@ TextFloat::TextFloat() : { } -TextFloat::TextFloat(const QString & _title, const QString & _text, const QPixmap & _pixmap) : - QWidget( getGUI()->mainWindow(), Qt::ToolTip ) +TextFloat::TextFloat(const QString & title, const QString & text, const QPixmap & pixmap) : + QWidget(getGUI()->mainWindow(), Qt::ToolTip) { QHBoxLayout * mainLayout = new QHBoxLayout(); setLayout(mainLayout); @@ -68,66 +68,66 @@ TextFloat::TextFloat(const QString & _title, const QString & _text, const QPixma mainLayout->addWidget(titleAndTextWidget); // Call the setters so that the hidden state is updated - setTitle(_title); - setText(_text); - setPixmap(_pixmap); + setTitle(title); + setText(text); + setPixmap(pixmap); } -void TextFloat::setTitle( const QString & _title ) +void TextFloat::setTitle(const QString & title) { - m_titleLabel->setText(_title); - m_titleLabel->setHidden(_title.isEmpty()); + m_titleLabel->setText(title); + m_titleLabel->setHidden(title.isEmpty()); } -void TextFloat::setText( const QString & _text ) +void TextFloat::setText(const QString & text) { - m_textLabel->setText(_text); - m_textLabel->setHidden(_text.isEmpty()); + m_textLabel->setText(text); + m_textLabel->setHidden(text.isEmpty()); } -void TextFloat::setPixmap( const QPixmap & _pixmap ) +void TextFloat::setPixmap(const QPixmap & pixmap) { - m_pixmapLabel->setPixmap(_pixmap); - m_pixmapLabel->setHidden(_pixmap.isNull()); + m_pixmapLabel->setPixmap(pixmap); + m_pixmapLabel->setHidden(pixmap.isNull()); } -void TextFloat::setVisibilityTimeOut( int _msecs ) +void TextFloat::setVisibilityTimeOut(int msecs) { - QTimer::singleShot( _msecs, this, SLOT(hide())); + QTimer::singleShot(msecs, this, SLOT(hide())); show(); } -TextFloat * TextFloat::displayMessage( const QString & _title, - const QString & _msg, - const QPixmap & _pixmap, - int _timeout, QWidget * _parent ) +TextFloat * TextFloat::displayMessage(const QString & title, + const QString & msg, + const QPixmap & pixmap, + int timeout, QWidget * parent) { - auto tf = new TextFloat(_title, _msg, _pixmap); + auto tf = new TextFloat(title, msg, pixmap); // Show the widget so that the correct height is calculated in the code that follows tf->show(); - if( _parent != nullptr ) + if(parent != nullptr) { - tf->moveGlobal( _parent, QPoint( _parent->width() + 2, 0 ) ); + tf->moveGlobal(parent, QPoint(parent->width() + 2, 0)); } else { // If no parent is given move the window to the lower left area of the main window QWidget * mw = getGUI()->mainWindow(); - tf->moveGlobal( mw, QPoint( 32, mw->height() - tf->height() - 8 ) ); + tf->moveGlobal(mw, QPoint(32, mw->height() - tf->height() - 8)); } - if( _timeout > 0 ) + if (timeout > 0) { - tf->setAttribute( Qt::WA_DeleteOnClose, true ); - QTimer::singleShot( _timeout, tf, SLOT(close())); + tf->setAttribute(Qt::WA_DeleteOnClose, true); + QTimer::singleShot(timeout, tf, SLOT(close())); } return tf; } -void TextFloat::mousePressEvent( QMouseEvent * ) +void TextFloat::mousePressEvent(QMouseEvent *) { close(); } From 95cd028e5d1bb265ca6250df51066ba69e472f39 Mon Sep 17 00:00:00 2001 From: Gregaras <69623172+Gregaras@users.noreply.github.com> Date: Tue, 18 Apr 2023 05:39:15 +0300 Subject: [PATCH 46/70] Update InstrumentTrackView.cpp (#6687) --- src/gui/tracks/InstrumentTrackView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/tracks/InstrumentTrackView.cpp b/src/gui/tracks/InstrumentTrackView.cpp index 5daa51381..17adc99a6 100644 --- a/src/gui/tracks/InstrumentTrackView.cpp +++ b/src/gui/tracks/InstrumentTrackView.cpp @@ -211,7 +211,7 @@ InstrumentTrackWindow * InstrumentTrackView::topLevelInstrumentTrackWindow() getGUI()->mainWindow()->workspace()->subWindowList( QMdiArea::ActivationHistoryOrder ) ) { - if( sw->isVisible() && sw->widget()->inherits( "InstrumentTrackWindow" ) ) + if( sw->isVisible() && sw->widget()->inherits( "lmms::gui::InstrumentTrackWindow" ) ) { w = qobject_cast( sw->widget() ); } From 64003fb004419a318eae8e532278f1885d7c8fbf Mon Sep 17 00:00:00 2001 From: Dalton Messmer Date: Mon, 20 Mar 2023 18:11:24 -0400 Subject: [PATCH 47/70] Fix FreeBoy CPU time bug (#6680) --- plugins/FreeBoy/CMakeLists.txt | 4 +- plugins/FreeBoy/FreeBoy.cpp | 216 +++++++++--------- plugins/FreeBoy/FreeBoy.h | 26 +-- .../{Gb_Apu_Buffer.cpp => GbApuWrapper.cpp} | 44 ++-- .../{Gb_Apu_Buffer.h => GbApuWrapper.h} | 36 +-- 5 files changed, 168 insertions(+), 158 deletions(-) rename plugins/FreeBoy/{Gb_Apu_Buffer.cpp => GbApuWrapper.cpp} (57%) rename plugins/FreeBoy/{Gb_Apu_Buffer.h => GbApuWrapper.h} (59%) diff --git a/plugins/FreeBoy/CMakeLists.txt b/plugins/FreeBoy/CMakeLists.txt index fb5093ee0..485ed3cc2 100644 --- a/plugins/FreeBoy/CMakeLists.txt +++ b/plugins/FreeBoy/CMakeLists.txt @@ -4,8 +4,8 @@ INCLUDE_DIRECTORIES(game-music-emu/gme) BUILD_PLUGIN(freeboy FreeBoy.cpp FreeBoy.h - Gb_Apu_Buffer.cpp - Gb_Apu_Buffer.h + GbApuWrapper.cpp + GbApuWrapper.h game-music-emu/gme/Gb_Apu.cpp game-music-emu/gme/Gb_Apu.h game-music-emu/gme/Gb_Oscs.cpp diff --git a/plugins/FreeBoy/FreeBoy.cpp b/plugins/FreeBoy/FreeBoy.cpp index 0d639d3a6..f9ef2c5aa 100644 --- a/plugins/FreeBoy/FreeBoy.cpp +++ b/plugins/FreeBoy/FreeBoy.cpp @@ -2,7 +2,7 @@ * FreeBoy.cpp - GameBoy papu based instrument * * Copyright (c) 2008 Attila Herman - * Csaba Hruska + * Csaba Hruska * * This file is part of LMMS - https://lmms.io * @@ -23,11 +23,12 @@ * */ -#include - -#include #include "FreeBoy.h" -#include "Gb_Apu_Buffer.h" + +#include +#include + +#include "GbApuWrapper.h" #include "base64.h" #include "InstrumentTrack.h" #include "Knob.h" @@ -45,8 +46,11 @@ namespace lmms { -const blip_time_t FRAME_LENGTH = 70224; -const long CLOCK_RATE = 4194304; +namespace +{ +constexpr blip_time_t FRAME_LENGTH = 70224; +constexpr long CLOCK_RATE = 4194304; +} extern "C" { @@ -118,9 +122,7 @@ FreeBoyInstrument::FreeBoyInstrument( InstrumentTrack * _instrument_track ) : m_trebleModel( -20.0f, -100.0f, 200.0f, 1.0f, this, tr( "Treble" ) ), m_bassModel( 461.0f, -1.0f, 600.0f, 1.0f, this, tr( "Bass" ) ), - m_graphModel( 0, 15, 32, this, false, 1 ), - - m_time(0) + m_graphModel( 0, 15, 32, this, false, 1 ) { } @@ -238,189 +240,189 @@ f_cnt_t FreeBoyInstrument::desiredReleaseFrames() const -void FreeBoyInstrument::playNote( NotePlayHandle * _n, - sampleFrame * _working_buffer ) +void FreeBoyInstrument::playNote(NotePlayHandle* nph, sampleFrame* workingBuffer) { - const f_cnt_t tfp = _n->totalFramesPlayed(); + const f_cnt_t tfp = nph->totalFramesPlayed(); const int samplerate = Engine::audioEngine()->processingSampleRate(); - const fpp_t frames = _n->framesLeftForCurrentPeriod(); - const f_cnt_t offset = _n->noteOffset(); + const fpp_t frames = nph->framesLeftForCurrentPeriod(); + const f_cnt_t offset = nph->noteOffset(); int data = 0; - int freq = _n->frequency(); + int freq = nph->frequency(); if ( tfp == 0 ) { - auto papu = new Gb_Apu_Buffer(); - papu->set_sample_rate( samplerate, CLOCK_RATE ); + auto papu = new GbApuWrapper{}; + papu->setSampleRate(samplerate, CLOCK_RATE); // Master sound circuitry power control - papu->write_register( fakeClock(), 0xff26, 0x80 ); + papu->writeRegister(0xff26, 0x80); data = m_ch1VolumeModel.value(); - data = data<<1; + data = data << 1; data += m_ch1VolSweepDirModel.value(); - data = data<<3; + data = data << 3; data += m_ch1SweepStepLengthModel.value(); - papu->write_register( fakeClock(), 0xff12, data ); + papu->writeRegister(0xff12, data); data = m_ch2VolumeModel.value(); - data = data<<1; + data = data << 1; data += m_ch2VolSweepDirModel.value(); - data = data<<3; + data = data << 3; data += m_ch2SweepStepLengthModel.value(); - papu->write_register( fakeClock(), 0xff17, data ); + papu->writeRegister(0xff17, data); //channel 4 - noise data = m_ch4VolumeModel.value(); - data = data<<1; + data = data << 1; data += m_ch4VolSweepDirModel.value(); - data = data<<3; + data = data << 3; data += m_ch4SweepStepLengthModel.value(); - papu->write_register( fakeClock(), 0xff21, data ); + papu->writeRegister(0xff21, data); - _n->m_pluginData = papu; + nph->m_pluginData = papu; } - auto papu = static_cast(_n->m_pluginData); + auto papu = static_cast(nph->m_pluginData); - papu->treble_eq( m_trebleModel.value() ); - papu->bass_freq( m_bassModel.value() ); + papu->trebleEq(m_trebleModel.value()); + papu->bassFreq(m_bassModel.value()); //channel 1 - square data = m_ch1SweepTimeModel.value(); - data = data<<1; + data = data << 1; data += m_ch1SweepDirModel.value(); data = data << 3; data += m_ch1SweepRtShiftModel.value(); - papu->write_register( fakeClock(), 0xff10, data ); + papu->writeRegister(0xff10, data); data = m_ch1WavePatternDutyModel.value(); - data = data<<6; - papu->write_register( fakeClock(), 0xff11, data ); - + data = data << 6; + papu->writeRegister(0xff11, data); //channel 2 - square data = m_ch2WavePatternDutyModel.value(); - data = data<<6; - papu->write_register( fakeClock(), 0xff16, data ); - + data = data << 6; + papu->writeRegister(0xff16, data); //channel 3 - wave - //data = m_ch3OnModel.value()?128:0; + //data = m_ch3OnModel.value() ? 128 : 0; data = 128; - papu->write_register( fakeClock(), 0xff1a, data ); + papu->writeRegister(0xff1a, data); auto ch3voldata = std::array{0, 3, 2, 1}; data = ch3voldata[(int)m_ch3VolumeModel.value()]; - data = data<<5; - papu->write_register( fakeClock(), 0xff1c, data ); - + data = data << 5; + papu->writeRegister(0xff1c, data); //controls data = m_so1VolumeModel.value(); - data = data<<4; + data = data << 4; data += m_so2VolumeModel.value(); - papu->write_register( fakeClock(), 0xff24, data ); + papu->writeRegister(0xff24, data); - data = m_ch4So2Model.value()?128:0; - data += m_ch3So2Model.value()?64:0; - data += m_ch2So2Model.value()?32:0; - data += m_ch1So2Model.value()?16:0; - data += m_ch4So1Model.value()?8:0; - data += m_ch3So1Model.value()?4:0; - data += m_ch2So1Model.value()?2:0; - data += m_ch1So1Model.value()?1:0; - papu->write_register( fakeClock(), 0xff25, data ); + data = m_ch4So2Model.value() ? 128 : 0; + data += m_ch3So2Model.value() ? 64 : 0; + data += m_ch2So2Model.value() ? 32 : 0; + data += m_ch1So2Model.value() ? 16 : 0; + data += m_ch4So1Model.value() ? 8 : 0; + data += m_ch3So1Model.value() ? 4 : 0; + data += m_ch2So1Model.value() ? 2 : 0; + data += m_ch1So1Model.value() ? 1 : 0; + papu->writeRegister(0xff25, data); - const float * wpm = m_graphModel.samples(); + const float* wpm = m_graphModel.samples(); - for( char i=0; i<16; i++ ) + for (char i = 0; i < 16; ++i) { - data = (int)floor(wpm[i*2]) << 4; - data += (int)floor(wpm[i*2+1]); - papu->write_register( fakeClock(), 0xff30 + i, data ); + data = static_cast(std::floor(wpm[i * 2])) << 4; + data += static_cast(std::floor(wpm[(i * 2) + 1])); + papu->writeRegister(0xff30 + i, data); } - if( ( freq >= 65 ) && ( freq <=4000 ) ) + if ((freq >= 65) && (freq <= 4000)) { - int initflag = (tfp==0)?128:0; - // Hz = 4194304 / ( ( 2048 - ( 11-bit-freq ) ) << 5 ) - data = 2048 - ( ( 4194304 / freq )>>5 ); - if( tfp==0 ) + int initFlag = (tfp == 0) ? 128 : 0; + // Hz = 4194304 / ((2048 - (11-bit-freq)) << 5) + data = 2048 - ((4194304 / freq) >> 5); + if (tfp == 0) { - papu->write_register( fakeClock(), 0xff13, data & 0xff ); - papu->write_register( fakeClock(), 0xff14, (data>>8) | initflag ); + papu->writeRegister(0xff13, data & 0xff); + papu->writeRegister(0xff14, (data >> 8) | initFlag); } - papu->write_register( fakeClock(), 0xff18, data & 0xff ); - papu->write_register( fakeClock(), 0xff19, (data>>8) | initflag ); - papu->write_register( fakeClock(), 0xff1d, data & 0xff ); - papu->write_register( fakeClock(), 0xff1e, (data>>8) | initflag ); + papu->writeRegister(0xff18, data & 0xff); + papu->writeRegister(0xff19, (data >> 8) | initFlag); + papu->writeRegister(0xff1d, data & 0xff); + papu->writeRegister(0xff1e, (data >> 8) | initFlag); } - if( tfp == 0 ) + if (tfp == 0) { //PRNG Frequency = (1048576 Hz / (ratio + 1)) / 2 ^ (shiftclockfreq + 1) - char sopt=0; - char ropt=1; - float fopt = 524288.0 / ( ropt * pow( 2.0, sopt + 1.0 ) ); + char sopt = 0; + char ropt = 1; + float fopt = 524288.0 / (ropt * std::pow(2.0, sopt + 1.0)); float f; - for ( char s=0; s<16; s++ ) - for ( char r=0; r<8; r++ ) { - f = 524288.0 / ( r * pow( 2.0, s + 1.0 ) ); - if( fabs( freq-fopt ) > fabs( freq-f ) ) { - fopt = f; - ropt = r; - sopt = s; + for (char s = 0; s < 16; ++s) + { + for (char r = 0; r < 8; ++r) + { + f = 524288.0 / (r * std::pow(2.0, s + 1.0)); + if (std::fabs(freq - fopt) > std::fabs(freq - f)) + { + fopt = f; + ropt = r; + sopt = s; + } } } + data = sopt; data = data << 1; data += m_ch4ShiftRegWidthModel.value(); data = data << 3; data += ropt; - papu->write_register( fakeClock(), 0xff22, data ); + papu->writeRegister(0xff22, data); //channel 4 init - papu->write_register( fakeClock(), 0xff23, 128 ); + papu->writeRegister(0xff23, 128); } - int const buf_size = 2048; - int framesleft = frames; - int datalen = 0; - auto buf = std::array{}; - while( framesleft > 0 ) + constexpr int bufSize = 2048; + int framesLeft = frames; + int dataLen = 0; + auto buf = std::array{}; + while (framesLeft > 0) { - int avail = papu->samples_avail(); - if( avail <= 0 ) + int avail = papu->samplesAvail(); + if (avail <= 0) { - m_time = 0; - papu->end_frame(FRAME_LENGTH); - avail = papu->samples_avail(); + papu->endFrame(FRAME_LENGTH); + avail = papu->samplesAvail(); } - datalen = framesleft>avail?avail:framesleft; - datalen = datalen>buf_size?buf_size:datalen; + dataLen = framesLeft > avail ? avail : framesLeft; + dataLen = dataLen > bufSize ? bufSize : dataLen; - long count = papu->read_samples(buf.data(), datalen * 2) / 2; + long count = papu->readSamples(buf.data(), dataLen * 2) / 2; - for( fpp_t frame = 0; frame < count; ++frame ) + for (fpp_t frame = 0; frame < count; ++frame) { - for( ch_cnt_t ch = 0; ch < DEFAULT_CHANNELS; ++ch ) + for (ch_cnt_t ch = 0; ch < DEFAULT_CHANNELS; ++ch) { - sample_t s = float(buf[frame*2+ch])/32768.0; - _working_buffer[frames-framesleft+frame+offset][ch] = s; + sample_t s = static_cast(buf[(frame * 2) + ch]) / 32768.0f; + workingBuffer[frames - framesLeft + frame + offset][ch] = s; } } - framesleft -= count; + framesLeft -= count; } - instrumentTrack()->processAudioBuffer( _working_buffer, frames + offset, _n ); + instrumentTrack()->processAudioBuffer(workingBuffer, frames + offset, nph); } -void FreeBoyInstrument::deleteNotePluginData( NotePlayHandle * _n ) +void FreeBoyInstrument::deleteNotePluginData(NotePlayHandle* nph) { - delete static_cast( _n->m_pluginData ); + delete static_cast(nph->m_pluginData); } @@ -736,4 +738,4 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model *m, void * ) } -} // namespace lmms \ No newline at end of file +} // namespace lmms diff --git a/plugins/FreeBoy/FreeBoy.h b/plugins/FreeBoy/FreeBoy.h index aecd2b188..747305414 100644 --- a/plugins/FreeBoy/FreeBoy.h +++ b/plugins/FreeBoy/FreeBoy.h @@ -1,8 +1,8 @@ /* - * FreeBoyInstrument.h - GameBoy papu based instrument + * FreeBoy.h - GameBoy papu based instrument * - * Copyright (c) 2008 - * Csaba Hruska + * Copyright (c) 2008 Attila Herman + * Csaba Hruska * * This file is part of LMMS - https://lmms.io * @@ -23,8 +23,8 @@ * */ -#ifndef FREEBOY_H -#define FREEBOY_H +#ifndef LMMS_FREEBOY_H +#define LMMS_FREEBOY_H #include "AutomatableModel.h" #include "Blip_Buffer.h" @@ -54,10 +54,8 @@ public: FreeBoyInstrument( InstrumentTrack * _instrument_track ); ~FreeBoyInstrument() override = default; - void playNote( NotePlayHandle * _n, - sampleFrame * _working_buffer ) override; - void deleteNotePluginData( NotePlayHandle * _n ) override; - + void playNote(NotePlayHandle* nph, sampleFrame* workingBuffer) override; + void deleteNotePluginData(NotePlayHandle* nph) override; void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override; void loadSettings( const QDomElement & _this ) override; @@ -112,12 +110,8 @@ private: graphModel m_graphModel; - // Fake CPU timing - blip_time_t m_time; - blip_time_t fakeClock() { return m_time += 4; } - friend class gui::FreeBoyInstrumentView; -} ; +}; namespace gui @@ -172,11 +166,11 @@ private: /*protected slots: void updateKnobHint(); void updateKnobToolTip();*/ -} ; +}; } // namespace gui } // namespace lmms -#endif +#endif // LMMS_FREEBOY_H diff --git a/plugins/FreeBoy/Gb_Apu_Buffer.cpp b/plugins/FreeBoy/GbApuWrapper.cpp similarity index 57% rename from plugins/FreeBoy/Gb_Apu_Buffer.cpp rename to plugins/FreeBoy/GbApuWrapper.cpp index ec1a36479..790cf96e2 100644 --- a/plugins/FreeBoy/Gb_Apu_Buffer.cpp +++ b/plugins/FreeBoy/GbApuWrapper.cpp @@ -1,7 +1,7 @@ /* - * Gb_Apu_Buffer.cpp - Gb_Apu subclass which allows direct buffer access + * GbApuWrapper.cpp - Gb_Apu subclass which allows direct buffer access * Copyright (c) 2017 Tres Finocchiaro - * + * * This file is part of LMMS - https://lmms.io * * This program is free software; you can redistribute it and/or @@ -20,37 +20,45 @@ * Boston, MA 02110-1301 USA. * */ -#include "Gb_Apu_Buffer.h" + +#include "GbApuWrapper.h" namespace lmms { -void Gb_Apu_Buffer::end_frame(blip_time_t end_time) { - Gb_Apu::end_frame(end_time); - m_buf.end_frame(end_time); +// Sets specified sample rate and clock rate in Stereo_Buffer +blargg_err_t GbApuWrapper::setSampleRate(long sampleRate, long clockRate) +{ + Gb_Apu::output(m_buf.center(), m_buf.left(), m_buf.right()); + m_buf.clock_rate(clockRate); + return m_buf.set_sample_rate(sampleRate); } -// Sets specified sample rate and clock rate in Multi_Buffer -blargg_err_t Gb_Apu_Buffer::set_sample_rate(long sample_rate, long clock_rate) { - Gb_Apu_Buffer::output(m_buf.center(), m_buf.left(), m_buf.right()); - m_buf.clock_rate(clock_rate); - return m_buf.set_sample_rate(sample_rate); -} - -// Wrap Multi_Buffer::samples_avail() -long Gb_Apu_Buffer::samples_avail() const { +// Wrap Stereo_Buffer::samples_avail() +long GbApuWrapper::samplesAvail() const +{ return m_buf.samples_avail(); } -// Wrap Multi_Buffer::read_samples(...) -long Gb_Apu_Buffer::read_samples(sample_t* out, long count) { +// Wrap Stereo_Buffer::read_samples(...) +long GbApuWrapper::readSamples(blip_sample_t* out, long count) +{ return m_buf.read_samples(out, count); } -void Gb_Apu_Buffer::bass_freq(int freq) { +// Wrap Stereo_Buffer::bass_freq(...) +void GbApuWrapper::bassFreq(int freq) +{ m_buf.bass_freq(freq); } +void GbApuWrapper::endFrame(blip_time_t endTime) +{ + m_time = 0; + Gb_Apu::end_frame(endTime); + m_buf.end_frame(endTime); +} + } // namespace lmms diff --git a/plugins/FreeBoy/Gb_Apu_Buffer.h b/plugins/FreeBoy/GbApuWrapper.h similarity index 59% rename from plugins/FreeBoy/Gb_Apu_Buffer.h rename to plugins/FreeBoy/GbApuWrapper.h index 760e0920d..493a28731 100644 --- a/plugins/FreeBoy/Gb_Apu_Buffer.h +++ b/plugins/FreeBoy/GbApuWrapper.h @@ -1,7 +1,7 @@ /* - * Gb_Apu_Buffer.cpp - Gb_Apu subclass which allows direct buffer access + * GbApuWrapper.h - Gb_Apu subclass which allows direct buffer access * Copyright (c) 2017 Tres Finocchiaro - * + * * This file is part of LMMS - https://lmms.io * * This program is free software; you can redistribute it and/or @@ -20,8 +20,9 @@ * Boston, MA 02110-1301 USA. * */ -#ifndef GB_APU_BUFFER_H -#define GB_APU_BUFFER_H + +#ifndef LMMS_GB_APU_WRAPPER_H +#define LMMS_GB_APU_WRAPPER_H #include "Gb_Apu.h" #include "Multi_Buffer.h" @@ -31,25 +32,30 @@ namespace lmms { -class Gb_Apu_Buffer : public Gb_Apu { +class GbApuWrapper : private Gb_Apu +{ MM_OPERATORS public: - Gb_Apu_Buffer() = default; - ~Gb_Apu_Buffer() = default; + GbApuWrapper() = default; + ~GbApuWrapper() = default; - void end_frame(blip_time_t); + blargg_err_t setSampleRate(long sampleRate, long clockRate); + void writeRegister(unsigned addr, int data) { Gb_Apu::write_register(fakeClock(), addr, data); } + long samplesAvail() const; + long readSamples(blip_sample_t* out, long count); + void trebleEq(const blip_eq_t& eq) { Gb_Apu::treble_eq(eq); } + void bassFreq(int freq); + void endFrame(blip_time_t endTime); - blargg_err_t set_sample_rate(long sample_rate, long clock_rate); - long samples_avail() const; - using sample_t = blip_sample_t; - long read_samples(sample_t* out, long count); - void bass_freq(int freq); private: Stereo_Buffer m_buf; + + // Fake CPU timing + blip_time_t fakeClock() { return m_time += 4; } + blip_time_t m_time = 0; }; } // namespace lmms -#endif - +#endif // LMMS_GB_APU_WRAPPER_H From 1f93dbc1248cb8d6679c3941e5df62aa68ce5b4f Mon Sep 17 00:00:00 2001 From: Lost Robot <34612565+LostRobotMusic@users.noreply.github.com> Date: Fri, 21 Apr 2023 11:17:53 -0700 Subject: [PATCH 48/70] EQ default shelf reso (#6694) --- plugins/Eq/EqControls.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/Eq/EqControls.cpp b/plugins/Eq/EqControls.cpp index ad1ffa2ac..04fb9bd3a 100644 --- a/plugins/Eq/EqControls.cpp +++ b/plugins/Eq/EqControls.cpp @@ -46,12 +46,12 @@ EqControls::EqControls( EqEffect *effect ) : m_para4GainModel( 0.0 , -18, 18, 0.001, this, tr( "Peak 4 gain" ) ), m_highShelfGainModel( 0.0 , -18, 18, 0.001, this, tr( "High-shelf gain" ) ), m_hpResModel( 0.707,0.003, 10.0 , 0.001, this, tr( "HP res" ) ), - m_lowShelfResModel( 1.4,0.55, 10.0 , 0.001, this , tr( "Low-shelf res" ) ), + m_lowShelfResModel( 0.707, 0.55, 10.0 , 0.001, this , tr( "Low-shelf res" ) ), m_para1BwModel( 0.3, 0.1, 4 , 0.001, this , tr( "Peak 1 BW" ) ), m_para2BwModel( 0.3, 0.1, 4 , 0.001, this , tr( "Peak 2 BW" ) ), m_para3BwModel( 0.3, 0.1, 4 , 0.001, this , tr( "Peak 3 BW" ) ), m_para4BwModel( 0.3, 0.1, 4 , 0.001, this , tr( "Peak 4 BW" ) ), - m_highShelfResModel( 1.4, 0.55, 10.0 , 0.001, this , tr( "High-shelf res" ) ), + m_highShelfResModel( 0.707, 0.55, 10.0 , 0.001, this , tr( "High-shelf res" ) ), m_lpResModel( 0.707,0.003, 10.0 , 0.001, this , tr( "LP res" ) ), m_hpFeqModel( 31.0, 20.0, 20000, 0.001, this , tr( "HP freq" ) ), m_lowShelfFreqModel( 80.0, 20.0, 20000, 0.001, this , tr( "Low-shelf freq" ) ), From f13e95932df72748fd2d2afa2030490a169a79bc Mon Sep 17 00:00:00 2001 From: Lost Robot <34612565+LostRobotMusic@users.noreply.github.com> Date: Tue, 25 Apr 2023 11:06:15 -0700 Subject: [PATCH 49/70] Include cstdint (#6697) --- plugins/MidiImport/portsmf/allegro.h | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/MidiImport/portsmf/allegro.h b/plugins/MidiImport/portsmf/allegro.h index ca5859aef..6210652e2 100644 --- a/plugins/MidiImport/portsmf/allegro.h +++ b/plugins/MidiImport/portsmf/allegro.h @@ -49,6 +49,7 @@ #ifndef ALLEGRO_H #define ALLEGRO_H #include +#include #include #include #include From 3440d49aa8e915ba1bf00ae060a30ba9fff76d0c Mon Sep 17 00:00:00 2001 From: Bimal Poudel Date: Sat, 29 Apr 2023 22:07:13 -0600 Subject: [PATCH 50/70] Fix comparing int with bool (#6637) Co-authored-by: Hyunjin Song --- src/core/PatternClip.cpp | 2 +- src/tracks/MidiClip.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/PatternClip.cpp b/src/core/PatternClip.cpp index a0752b0aa..1058da6ba 100644 --- a/src/core/PatternClip.cpp +++ b/src/core/PatternClip.cpp @@ -80,7 +80,7 @@ void PatternClip::loadSettings(const QDomElement& element) } changeLength( element.attribute( "len" ).toInt() ); setStartTimeOffset(element.attribute("off").toInt()); - if( element.attribute( "muted" ).toInt() != isMuted() ) + if (static_cast(element.attribute("muted").toInt()) != isMuted()) { toggleMute(); } diff --git a/src/tracks/MidiClip.cpp b/src/tracks/MidiClip.cpp index e5bff8b6f..08e76ae59 100644 --- a/src/tracks/MidiClip.cpp +++ b/src/tracks/MidiClip.cpp @@ -424,7 +424,7 @@ void MidiClip::loadSettings( const QDomElement & _this ) { movePosition( _this.attribute( "pos" ).toInt() ); } - if( _this.attribute( "muted" ).toInt() != isMuted() ) + if (static_cast(_this.attribute("muted").toInt()) != isMuted()) { toggleMute(); } From 87a57db593d23d0549012278aea87ffcbfb40265 Mon Sep 17 00:00:00 2001 From: Lost Robot <34612565+LostRobotMusic@users.noreply.github.com> Date: Fri, 5 May 2023 21:16:07 -0700 Subject: [PATCH 51/70] Add instrument plugins to Song Editor via right click (#6698) --- include/PluginBrowser.h | 3 ++- src/gui/PluginBrowser.cpp | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/include/PluginBrowser.h b/include/PluginBrowser.h index dd2e0a5cb..2bb1b6d5c 100644 --- a/include/PluginBrowser.h +++ b/include/PluginBrowser.h @@ -63,13 +63,14 @@ public: using PluginKey = Plugin::Descriptor::SubPluginFeatures::Key; PluginDescWidget( const PluginKey & _pk, QWidget * _parent ); QString name() const; - + void openInNewInstrumentTrack(QString value); protected: void enterEvent( QEvent * _e ) override; void leaveEvent( QEvent * _e ) override; void mousePressEvent( QMouseEvent * _me ) override; void paintEvent( QPaintEvent * _pe ) override; + void contextMenuEvent(QContextMenuEvent* e) override; private: constexpr static int DEFAULT_HEIGHT{24}; diff --git a/src/gui/PluginBrowser.cpp b/src/gui/PluginBrowser.cpp index afb74dcd3..b59064f05 100644 --- a/src/gui/PluginBrowser.cpp +++ b/src/gui/PluginBrowser.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -34,7 +35,10 @@ #include "embed.h" #include "Engine.h" +#include "InstrumentTrack.h" +#include "Song.h" #include "StringPairDrag.h" +#include "TrackContainerView.h" #include "PluginFactory.h" namespace lmms::gui @@ -287,4 +291,24 @@ void PluginDescWidget::mousePressEvent( QMouseEvent * _me ) } +void PluginDescWidget::contextMenuEvent(QContextMenuEvent* e) +{ + QMenu contextMenu(this); + contextMenu.addAction( + tr("Send to new instrument track"), + [=]{ openInNewInstrumentTrack(m_pluginKey.desc->name); } + ); + contextMenu.exec(e->globalPos()); +} + + +void PluginDescWidget::openInNewInstrumentTrack(QString value) +{ + TrackContainer* tc = Engine::getSong(); + auto it = dynamic_cast(Track::create(Track::InstrumentTrack, tc)); + auto ilt = new InstrumentLoaderThread(this, it, value); + ilt->start(); +} + + } // namespace lmms::gui From d551938cbd3a7bad3e7859ab7abd1499d7326b3b Mon Sep 17 00:00:00 2001 From: superpaik <68785450+superpaik@users.noreply.github.com> Date: Wed, 10 May 2023 13:14:24 +0200 Subject: [PATCH 52/70] Add confirm removal on mixer channels (#6691) * Add confirm removal on mixer channels Add confirm removal popup when the user calls the action "remove channel" on a mixer channel that is in use (receives audio from other channel or track). Set a config variable to keep track if the user don't want to be asked again. Adding a scroll on settings-general tab because there weren't enough space on the area. * Core Mixer function channel in use New core Mixer function to check if a given channel is in use (receives audio) --------- Co-authored-by: Hyunjin Song Co-authored-by: saker --- include/Mixer.h | 4 ++ include/MixerView.h | 1 + include/SetupDialog.h | 2 + src/core/Mixer.cpp | 36 ++++++++++++++ src/gui/MixerView.cpp | 88 ++++++++++++++++++++++------------ src/gui/modals/SetupDialog.cpp | 46 +++++++++++++++--- 6 files changed, 140 insertions(+), 37 deletions(-) diff --git a/include/Mixer.h b/include/Mixer.h index d84a11063..6589836c4 100644 --- a/include/Mixer.h +++ b/include/Mixer.h @@ -202,6 +202,10 @@ public: // rename channels when moving etc. if they still have their original name void validateChannelName( int index, int oldIndex ); + // check if the index channel receives audio from any other channel + // or from any instrument or sample track + bool isChannelInUse(int index); + void toggledSolo(); void activateSolo(); void deactivateSolo(); diff --git a/include/MixerView.h b/include/MixerView.h index 9dc5abeee..2bb5ed417 100644 --- a/include/MixerView.h +++ b/include/MixerView.h @@ -95,6 +95,7 @@ public: // notify the view that a mixer channel was deleted void deleteChannel(int index); + bool confirmRemoval(int index); // delete all unused channels void deleteUnusedChannels(); diff --git a/include/SetupDialog.h b/include/SetupDialog.h index 6a9986d64..27a4ce4f9 100644 --- a/include/SetupDialog.h +++ b/include/SetupDialog.h @@ -82,6 +82,7 @@ private slots: void toggleLetPreviewsFinish(bool enabled); void toggleSoloLegacyBehavior(bool enabled); void toggleTrackDeletionWarning(bool enabled); + void toggleMixerChannelDeletionWarning(bool enabled); void toggleMMPZ(bool enabled); void toggleDisableBackup(bool enabled); void toggleOpenLastProject(bool enabled); @@ -141,6 +142,7 @@ private: bool m_letPreviewsFinish; bool m_soloLegacyBehavior; bool m_trackDeletionWarning; + bool m_mixerChannelDeletionWarning; bool m_MMPZ; bool m_disableBackup; bool m_openLastProject; diff --git a/src/core/Mixer.cpp b/src/core/Mixer.cpp index 52ce2732c..9354687a8 100644 --- a/src/core/Mixer.cpp +++ b/src/core/Mixer.cpp @@ -825,5 +825,41 @@ void Mixer::validateChannelName( int index, int oldIndex ) } } +bool Mixer::isChannelInUse(int index) +{ + // check if the index mixer channel receives audio from any other channel + if (!m_mixerChannels[index]->m_receives.isEmpty()) + { + return true; + } + + // check if the destination mixer channel on any instrument or sample track is the index mixer channel + TrackContainer::TrackList tracks; + tracks += Engine::getSong()->tracks(); + tracks += Engine::patternStore()->tracks(); + + for (const auto t : tracks) + { + if (t->type() == Track::InstrumentTrack) + { + auto inst = dynamic_cast(t); + if (inst->mixerChannelModel()->value() == index) + { + return true; + } + } + else if (t->type() == Track::SampleTrack) + { + auto strack = dynamic_cast(t); + if (strack->mixerChannelModel()->value() == index) + { + return true; + } + } + } + + return false; +} + } // namespace lmms diff --git a/src/gui/MixerView.cpp b/src/gui/MixerView.cpp index a9b7bf992..a9582b4e2 100644 --- a/src/gui/MixerView.cpp +++ b/src/gui/MixerView.cpp @@ -23,7 +23,9 @@ */ +#include #include +#include #include #include #include @@ -385,6 +387,12 @@ void MixerView::deleteChannel(int index) // can't delete master if( index == 0 ) return; + // if there is no user confirmation, do nothing + if (!confirmRemoval(index)) + { + return; + } + // remember selected line int selLine = m_currentMixerLine->channelIndex(); @@ -397,7 +405,7 @@ void MixerView::deleteChannel(int index) // delete the view chLayout->removeWidget(m_mixerChannelViews[index]->m_mixerLine); - m_racksLayout->removeWidget( m_mixerChannelViews[index]->m_rackView ); + m_racksLayout->removeWidget(m_mixerChannelViews[index]->m_rackView); delete m_mixerChannelViews[index]->m_fader; delete m_mixerChannelViews[index]->m_muteBtn; delete m_mixerChannelViews[index]->m_soloBtn; @@ -409,56 +417,74 @@ void MixerView::deleteChannel(int index) m_channelAreaWidget->adjustSize(); // make sure every channel knows what index it is - for(int i=index + 1; im_mixerLine->setChannelIndex(i-1); + m_mixerChannelViews[i]->m_mixerLine->setChannelIndex(i - 1); } m_mixerChannelViews.remove(index); // select the next channel - if( selLine >= m_mixerChannelViews.size() ) + if (selLine >= m_mixerChannelViews.size()) { - selLine = m_mixerChannelViews.size()-1; + selLine = m_mixerChannelViews.size() - 1; } setCurrentMixerLine(selLine); updateMaxChannelSelector(); } +bool MixerView::confirmRemoval(int index) +{ + // if config variable is set to false, there is no need for user confirmation + bool needConfirm = ConfigManager::inst()->value("ui", "mixerchanneldeletionwarning", "1").toInt(); + if (!needConfirm) { return true; } + + Mixer* mix = Engine::mixer(); + + if (!mix->isChannelInUse(index)) + { + // is the channel is not in use, there is no need for user confirmation + return true; + } + + QString messageRemoveTrack = tr("This Mixer Channel is being used.\n" + "Are you sure you want to remove this channel?\n\n" + "Warning: This operation can not be undone."); + + QString messageTitleRemoveTrack = tr("Confirm removal"); + QString askAgainText = tr("Don't ask again"); + auto askAgainCheckBox = new QCheckBox(askAgainText, nullptr); + connect(askAgainCheckBox, &QCheckBox::stateChanged, [this](int state) { + // Invert button state, if it's checked we *shouldn't* ask again + ConfigManager::inst()->setValue("ui", "mixerchanneldeletionwarning", state ? "0" : "1"); + }); + + QMessageBox mb(this); + mb.setText(messageRemoveTrack); + mb.setWindowTitle(messageTitleRemoveTrack); + mb.setIcon(QMessageBox::Warning); + mb.addButton(QMessageBox::Cancel); + mb.addButton(QMessageBox::Ok); + mb.setCheckBox(askAgainCheckBox); + mb.setDefaultButton(QMessageBox::Cancel); + + int answer = mb.exec(); + + return answer == QMessageBox::Ok; +} void MixerView::deleteUnusedChannels() { - TrackContainer::TrackList tracks; - tracks += Engine::getSong()->tracks(); - tracks += Engine::patternStore()->tracks(); + Mixer* mix = Engine::mixer(); - std::vector inUse(m_mixerChannelViews.size(), false); - - //Populate inUse by checking the destination channel for every track - for (Track* t: tracks) + // Check all channels except master, delete those with no incoming sends + for (int i = m_mixerChannelViews.size() - 1; i > 0; --i) { - //The channel that this track sends to. Since master channel is always in use, - //setting this to 0 is a safe default (for tracks that don't sent to the mixer). - int channel = 0; - if (t->type() == Track::InstrumentTrack) + if (!mix->isChannelInUse(i)) { - auto inst = dynamic_cast(t); - channel = inst->mixerChannelModel()->value(); + deleteChannel(i); } - else if (t->type() == Track::SampleTrack) - { - auto strack = dynamic_cast(t); - channel = strack->mixerChannelModel()->value(); - } - inUse[channel] = true; - } - - //Check all channels except master, delete those with no incoming sends - for(int i = m_mixerChannelViews.size()-1; i > 0; --i) - { - if (!inUse[i] && Engine::mixer()->mixerChannel(i)->m_receives.isEmpty()) - { deleteChannel(i); } } } diff --git a/src/gui/modals/SetupDialog.cpp b/src/gui/modals/SetupDialog.cpp index 44eaf87b0..33505c399 100644 --- a/src/gui/modals/SetupDialog.cpp +++ b/src/gui/modals/SetupDialog.cpp @@ -112,6 +112,8 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : "app", "sololegacybehavior", "0").toInt()), m_trackDeletionWarning(ConfigManager::inst()->value( "ui", "trackdeletionwarning", "1").toInt()), + m_mixerChannelDeletionWarning(ConfigManager::inst()->value( + "ui", "mixerchanneldeletionwarning", "1").toInt()), m_MMPZ(!ConfigManager::inst()->value( "app", "nommpz").toInt()), m_disableBackup(!ConfigManager::inst()->value( @@ -198,6 +200,18 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : general_layout->setContentsMargins(0, 0, 0, 0); labelWidget(general_w, tr("General")); + // General scroll area. + auto generalScroll = new QScrollArea(general_w); + generalScroll->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); + generalScroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + + // General controls widget. + auto generalControls = new QWidget(general_w); + + // Path selectors layout. + auto generalControlsLayout = new QVBoxLayout; + generalControlsLayout->setSpacing(10); + auto addLedCheckBox = [&XDelta, &YDelta, this](const QString& ledText, TabWidget* tw, int& counter, bool initialState, const char* toggledSlot, bool showRestartWarning) { auto checkBox = new LedCheckBox(ledText, tw); @@ -214,7 +228,7 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : int counter = 0; // GUI tab. - auto gui_tw = new TabWidget(tr("Graphical user interface (GUI)"), general_w); + auto gui_tw = new TabWidget(tr("Graphical user interface (GUI)"), generalControls); addLedCheckBox(tr("Display volume as dBFS "), gui_tw, counter, m_displaydBFS, SLOT(toggleDisplaydBFS(bool)), true); @@ -236,14 +250,19 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : m_soloLegacyBehavior, SLOT(toggleSoloLegacyBehavior(bool)), false); addLedCheckBox(tr("Show warning when deleting tracks"), gui_tw, counter, m_trackDeletionWarning, SLOT(toggleTrackDeletionWarning(bool)), false); + addLedCheckBox(tr("Show warning when deleting a mixer channel that is in use"), gui_tw, counter, + m_mixerChannelDeletionWarning, SLOT(toggleMixerChannelDeletionWarning(bool)), false); gui_tw->setFixedHeight(YDelta + YDelta * counter); + generalControlsLayout->addWidget(gui_tw); + generalControlsLayout->addSpacing(10); + counter = 0; // Projects tab. - auto projects_tw = new TabWidget(tr("Projects"), general_w); + auto projects_tw = new TabWidget(tr("Projects"), generalControls); addLedCheckBox(tr("Compress project files by default"), projects_tw, counter, m_MMPZ, SLOT(toggleMMPZ(bool)), true); @@ -254,8 +273,12 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : projects_tw->setFixedHeight(YDelta + YDelta * counter); + generalControlsLayout->addWidget(projects_tw); + generalControlsLayout->addSpacing(10); + + // Language tab. - auto lang_tw = new TabWidget(tr("Language"), general_w); + auto lang_tw = new TabWidget(tr("Language"), generalControls); lang_tw->setFixedHeight(48); auto changeLang = new QComboBox(lang_tw); changeLang->move(XDelta, 20); @@ -310,11 +333,15 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : connect(changeLang, SIGNAL(currentIndexChanged(int)), this, SLOT(showRestartWarning())); + generalControlsLayout->addWidget(lang_tw); + generalControlsLayout->addSpacing(10); // General layout ordering. - general_layout->addWidget(gui_tw); - general_layout->addWidget(projects_tw); - general_layout->addWidget(lang_tw); + generalControlsLayout->addStretch(); + generalControls->setLayout(generalControlsLayout); + generalScroll->setWidget(generalControls); + generalScroll->setWidgetResizable(true); + general_layout->addWidget(generalScroll); general_layout->addStretch(); @@ -896,6 +923,8 @@ void SetupDialog::accept() QString::number(m_soloLegacyBehavior)); ConfigManager::inst()->setValue("ui", "trackdeletionwarning", QString::number(m_trackDeletionWarning)); + ConfigManager::inst()->setValue("ui", "mixerchanneldeletionwarning", + QString::number(m_mixerChannelDeletionWarning)); ConfigManager::inst()->setValue("app", "nommpz", QString::number(!m_MMPZ)); ConfigManager::inst()->setValue("app", "disablebackup", @@ -1017,6 +1046,11 @@ void SetupDialog::toggleTrackDeletionWarning(bool enabled) m_trackDeletionWarning = enabled; } +void SetupDialog::toggleMixerChannelDeletionWarning(bool enabled) +{ + m_mixerChannelDeletionWarning = enabled; +} + void SetupDialog::toggleMMPZ(bool enabled) { From b322f8022e9873ea0d09a7e3bb5cf785605fa793 Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Tue, 23 May 2023 03:14:28 -0400 Subject: [PATCH 53/70] Add .DirIcon to AppImage (#6715) * Add .DirIcon to AppImage * Add X-AppImage-Version to .desktop file * Closes #6695 --- cmake/linux/package_linux.sh.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/linux/package_linux.sh.in b/cmake/linux/package_linux.sh.in index 89e500060..16cd5719b 100644 --- a/cmake/linux/package_linux.sh.in +++ b/cmake/linux/package_linux.sh.in @@ -149,6 +149,7 @@ fi # Patch the desktop file sed -i 's/.*Exec=.*/Exec=lmms.real/' "$DESKTOPFILE" +echo "X-AppImage-Version=@VERSION@" >> "$DESKTOPFILE" # Fix linking for soft-linked plugins for file in "${APPDIR}usr/lib/lmms/"*.so; do @@ -201,6 +202,9 @@ fi rm -f "${APPDIR}/AppRun" ln -sr "${APPDIR}/usr/bin/lmms" "${APPDIR}/AppRun" +# Add icon +ln -srf "${APPDIR}/lmms.png" "${APPDIR}/.DirIcon" + # Create AppImage echo -e "\nFinishing the AppImage..." run_and_log "$APPIMAGETOOL" "${APPDIR}" "@APPIMAGE_FILE@" From 75627a15f9fc23fe0a652175406c79dafd879e46 Mon Sep 17 00:00:00 2001 From: Michael Gregorius Date: Fri, 26 May 2023 10:52:35 +0200 Subject: [PATCH 54/70] Fix automation crash (#6711) Fix a crash that occurs if the zooming or snapping model of the Song Editor is used for automation. The crash is caused by a failed static_cast to a Model* in Model::parentModel(). The cast fails because in the constructor of SongEditor the SongEditor is set as the parent of the zooming and snapping model: m_zoomingModel->setParent(this); m_snappingModel->setParent(this); This commit is rather a "band aid" fix because it only fixes the crash by changing the static_cast to a dynamic_cast. However this means that the name of the automation clip is initially empty. A better solution would be to not use the Qt parent/child relationships to implement the model hierarchies. --- include/Model.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/Model.h b/include/Model.h index 3e304297f..cc3079796 100644 --- a/include/Model.h +++ b/include/Model.h @@ -54,7 +54,7 @@ public: Model* parentModel() const { - return static_cast( parent() ); + return dynamic_cast( parent() ); } virtual QString displayName() const From 43319a8d793aca70b7a06090d24ac5dfb834910f Mon Sep 17 00:00:00 2001 From: Michael Gregorius Date: Fri, 26 May 2023 11:11:45 +0200 Subject: [PATCH 55/70] Move implementations of Model into cpp file (#6711) Move the implementation of the Model methods into Model.cpp so that recompiles after changes are much quicker. Make Model:: isDefaultConstructed const. --- include/Model.h | 29 ++++++----------------------- src/core/Model.cpp | 27 +++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 23 deletions(-) diff --git a/include/Model.h b/include/Model.h index cc3079796..6db8f9f30 100644 --- a/include/Model.h +++ b/include/Model.h @@ -37,35 +37,18 @@ class LMMS_EXPORT Model : public QObject { Q_OBJECT public: - Model( Model * _parent, QString _display_name = QString(), - bool _default_constructed = false ) : - QObject( _parent ), - m_displayName( _display_name ), - m_defaultConstructed( _default_constructed ) - { - } + Model(Model * _parent, QString _display_name = QString(), + bool _default_constructed = false ); ~Model() override = default; - bool isDefaultConstructed() - { - return m_defaultConstructed; - } + bool isDefaultConstructed() const; - Model* parentModel() const - { - return dynamic_cast( parent() ); - } + Model* parentModel() const; - virtual QString displayName() const - { - return m_displayName; - } + virtual QString displayName() const; - virtual void setDisplayName( const QString& displayName ) - { - m_displayName = displayName; - } + virtual void setDisplayName(const QString& displayName); virtual QString fullDisplayName() const; diff --git a/src/core/Model.cpp b/src/core/Model.cpp index dd277bc4e..83602bd08 100644 --- a/src/core/Model.cpp +++ b/src/core/Model.cpp @@ -27,6 +27,33 @@ namespace lmms { +Model::Model(Model * _parent, QString _display_name, bool _default_constructed) : + QObject( _parent ), + m_displayName( _display_name ), + m_defaultConstructed( _default_constructed ) +{ +} + +bool Model::isDefaultConstructed() const +{ + return m_defaultConstructed; +} + +Model* Model::parentModel() const +{ + return dynamic_cast( parent() ); +} + +QString Model::displayName() const +{ + return m_displayName; +} + +void Model::setDisplayName( const QString& displayName ) +{ + m_displayName = displayName; +} + QString Model::fullDisplayName() const { const QString & n = displayName(); From 8a07328a93e973357851169b81248d3c7b5f56a7 Mon Sep 17 00:00:00 2001 From: Lost Robot <34612565+LostRobotMusic@users.noreply.github.com> Date: Thu, 1 Jun 2023 12:31:00 -0500 Subject: [PATCH 56/70] Remove non-directory expansion --- src/gui/FileBrowser.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/gui/FileBrowser.cpp b/src/gui/FileBrowser.cpp index a104d3265..88932af19 100644 --- a/src/gui/FileBrowser.cpp +++ b/src/gui/FileBrowser.cpp @@ -235,10 +235,6 @@ void FileBrowser::expandItems( QTreeWidgetItem * item, QList expandedDi for (int i = 0; i < numChildren; ++i) { QTreeWidgetItem * it = item ? item->child( i ) : m_fileBrowserTreeWidget->topLevelItem(i); - if ( m_recurse ) - { - it->setExpanded( true ); - } auto d = dynamic_cast(it); if (d) { @@ -1282,4 +1278,4 @@ QString FileItem::extension(const QString & file ) } -} // namespace lmms::gui \ No newline at end of file +} // namespace lmms::gui From fda938fccaf543a480561c7c4e759731690ee299 Mon Sep 17 00:00:00 2001 From: Michael Gregorius Date: Fri, 2 Jun 2023 20:31:38 +0200 Subject: [PATCH 57/70] Code review changes (#6711) Remove underscores and whitespace in the Model files. --- include/Model.h | 4 ++-- src/core/Model.cpp | 20 ++++++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/include/Model.h b/include/Model.h index 6db8f9f30..e481fbdf1 100644 --- a/include/Model.h +++ b/include/Model.h @@ -37,8 +37,8 @@ class LMMS_EXPORT Model : public QObject { Q_OBJECT public: - Model(Model * _parent, QString _display_name = QString(), - bool _default_constructed = false ); + Model(Model * parent, QString displayName = QString(), + bool defaultConstructed = false ); ~Model() override = default; diff --git a/src/core/Model.cpp b/src/core/Model.cpp index 83602bd08..c59887702 100644 --- a/src/core/Model.cpp +++ b/src/core/Model.cpp @@ -27,10 +27,10 @@ namespace lmms { -Model::Model(Model * _parent, QString _display_name, bool _default_constructed) : - QObject( _parent ), - m_displayName( _display_name ), - m_defaultConstructed( _default_constructed ) +Model::Model(Model * parent, QString displayName, bool defaultConstructed) : + QObject(parent), + m_displayName(displayName), + m_defaultConstructed(defaultConstructed) { } @@ -41,7 +41,7 @@ bool Model::isDefaultConstructed() const Model* Model::parentModel() const { - return dynamic_cast( parent() ); + return dynamic_cast(parent()); } QString Model::displayName() const @@ -57,19 +57,23 @@ void Model::setDisplayName( const QString& displayName ) QString Model::fullDisplayName() const { const QString & n = displayName(); - if( parentModel() ) + + if(parentModel()) { const QString p = parentModel()->fullDisplayName(); - if( n.isEmpty() && p.isEmpty() ) + + if(n.isEmpty() && p.isEmpty()) { return QString(); } - else if( p.isEmpty() ) + else if(p.isEmpty()) { return n; } + return p + ">" + n; } + return n; } From 9fe7fbd69eabc98f6fe63ef4c4b018fae09442f0 Mon Sep 17 00:00:00 2001 From: Michael Gregorius Date: Fri, 2 Jun 2023 20:45:58 +0200 Subject: [PATCH 58/70] Simplify logic of Model::fullDisplayName (#6711) Simplify the logic of the method Model::fullDisplayName. Please note that this shows that with the current logic if the parent model has a non-empty name like "parentmodel" and the name of the child model is empty the result is the name "parentmodel >" which might not be what's wanted. --- src/core/Model.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/core/Model.cpp b/src/core/Model.cpp index c59887702..7a7919bb8 100644 --- a/src/core/Model.cpp +++ b/src/core/Model.cpp @@ -56,22 +56,16 @@ void Model::setDisplayName( const QString& displayName ) QString Model::fullDisplayName() const { - const QString & n = displayName(); + const QString n = displayName(); if(parentModel()) { const QString p = parentModel()->fullDisplayName(); - if(n.isEmpty() && p.isEmpty()) + if (!p.isEmpty()) { - return QString(); + return p + ">" + n; } - else if(p.isEmpty()) - { - return n; - } - - return p + ">" + n; } return n; From 0ebc18941b934893f82e322b8bd09efea139b05d Mon Sep 17 00:00:00 2001 From: Michael Gregorius Date: Fri, 2 Jun 2023 22:17:03 +0200 Subject: [PATCH 59/70] More whitespace adjustments (#6711) More whitespace adjustments as proposed in the code review. --- include/Model.h | 4 ++-- src/core/Model.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/Model.h b/include/Model.h index e481fbdf1..ce7b751e7 100644 --- a/include/Model.h +++ b/include/Model.h @@ -37,8 +37,8 @@ class LMMS_EXPORT Model : public QObject { Q_OBJECT public: - Model(Model * parent, QString displayName = QString(), - bool defaultConstructed = false ); + Model(Model* parent, QString displayName = QString(), + bool defaultConstructed = false); ~Model() override = default; diff --git a/src/core/Model.cpp b/src/core/Model.cpp index 7a7919bb8..634e2fbed 100644 --- a/src/core/Model.cpp +++ b/src/core/Model.cpp @@ -27,7 +27,7 @@ namespace lmms { -Model::Model(Model * parent, QString displayName, bool defaultConstructed) : +Model::Model(Model* parent, QString displayName, bool defaultConstructed) : QObject(parent), m_displayName(displayName), m_defaultConstructed(defaultConstructed) @@ -41,7 +41,7 @@ bool Model::isDefaultConstructed() const Model* Model::parentModel() const { - return dynamic_cast(parent()); + return dynamic_cast(parent()); } QString Model::displayName() const @@ -49,7 +49,7 @@ QString Model::displayName() const return m_displayName; } -void Model::setDisplayName( const QString& displayName ) +void Model::setDisplayName(const QString& displayName) { m_displayName = displayName; } @@ -58,7 +58,7 @@ QString Model::fullDisplayName() const { const QString n = displayName(); - if(parentModel()) + if (parentModel()) { const QString p = parentModel()->fullDisplayName(); From bd5f1b9ea18dfe9fc61563274a8f893827a42ca8 Mon Sep 17 00:00:00 2001 From: Michael Gregorius Date: Mon, 5 Jun 2023 05:44:48 +0200 Subject: [PATCH 60/70] Fix uninitialized variable "pCurPreset" (#6639) (#6723) Fix the uninitialized variable pCurPreset by setting it to nullptr. Please note that it looks as if the nullptr is now being passed to the function fluid_sfont_iteration_next_wrapper. However, the function does not use the parameter anyway and then the variable is set to the result of that function. --- plugins/Sf2Player/PatchesDialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Sf2Player/PatchesDialog.cpp b/plugins/Sf2Player/PatchesDialog.cpp index 9c9a689a0..c3ffe2d29 100644 --- a/plugins/Sf2Player/PatchesDialog.cpp +++ b/plugins/Sf2Player/PatchesDialog.cpp @@ -154,7 +154,7 @@ void PatchesDialog::setup ( fluid_synth_t * pSynth, int iChan, fluid_preset_t preset; fluid_preset_t *pCurPreset = &preset; #else - fluid_preset_t *pCurPreset; + fluid_preset_t *pCurPreset = nullptr; #endif while ((pCurPreset = fluid_sfont_iteration_next_wrapper(pSoundFont, pCurPreset))) { int iBank = fluid_preset_get_banknum(pCurPreset); From bceee6c4271016d35fda0b634ed712059114eea5 Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Mon, 5 Jun 2023 16:22:05 -0400 Subject: [PATCH 61/70] Look for libcarla_native-plugin.dll on Windows (#6726) Closes #5984 --- plugins/CarlaBase/CMakeLists.txt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/plugins/CarlaBase/CMakeLists.txt b/plugins/CarlaBase/CMakeLists.txt index f60804719..d4f7939c9 100644 --- a/plugins/CarlaBase/CMakeLists.txt +++ b/plugins/CarlaBase/CMakeLists.txt @@ -15,14 +15,13 @@ if(LMMS_HAVE_WEAKCARLA) ${CMAKE_CURRENT_SOURCE_DIR}/carla/source/backend ) + # force "lib" prefix IF(LMMS_BUILD_WIN32) - # use carla.dll - SET(CMAKE_SHARED_LIBRARY_PREFIX "") - SET(CARLA_NATIVE_LIB carla) - ELSE() - # use libcarla_native-plugin - SET(CARLA_NATIVE_LIB carla_native-plugin) + SET(CMAKE_SHARED_LIBRARY_PREFIX "lib") ENDIF() + + SET(CARLA_NATIVE_LIB carla_native-plugin) + ADD_LIBRARY(${CARLA_NATIVE_LIB} SHARED DummyCarla.cpp) TARGET_INCLUDE_DIRECTORIES(${CARLA_NATIVE_LIB} PUBLIC ${CARLA_INCLUDE_DIRS}) INSTALL(TARGETS ${CARLA_NATIVE_LIB} From 5debf982ef8c5a3a5e476d3ed492aae2ac150e8d Mon Sep 17 00:00:00 2001 From: Michael Gregorius Date: Thu, 8 Jun 2023 17:15:53 +0200 Subject: [PATCH 62/70] Add SID filter image back (#6729) Add the image for the disabled SID filter back. According to a comment in the issue it seems to have gone missing during commit c1e6b313. --- plugins/Sid/filter.png | Bin 0 -> 1422 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 plugins/Sid/filter.png diff --git a/plugins/Sid/filter.png b/plugins/Sid/filter.png new file mode 100644 index 0000000000000000000000000000000000000000..ff5c760db9b5a3ac31c164751132ec05da1cae5f GIT binary patch literal 1422 zcmV;91#$X`P)V>IRB3Hx05CEyGB7VPFflal!xDV}002aEMObu0Z*X~XX=iA307F9{ zL3DI-X<~JBX>V>IXmoUNIxjC{a%Ew3X?A5}Z*6UFZgVbga%V4WX=7z>b7gZcVtFq! zE-)|j$M56-00at2L_t(Ijdhh>Y?Eaa$A8cBzTMiwR`&ty1BVJ5IN6+?D47{f6A8x8 zXfU9Xn5Y+O)Wi$o1tBP0NJ64_-gu`m1~q|!28c1+%DOKW<~9;>2##Pk&48}kx^``! z|@Bj4^1f0YGq1#uzNET#<9vi*)iP&es?L5!c@m zRWc^C$Vb}oIRP?=qCGtH$5$dE04fhq&{{16XhhH|FS0C~)Iut+y98X$1|uk~QQ3b) z1f`st$rVE!T>-Sp`_r}^%A`|!!$X(tX!bp8)K9`dM09+W>`9aPr6F+`DlTjZHxS5{Y?^ z9XZ7QgNKR7U1XVFtp^i-6{tyv~-&yvgQ z!QeJ#W@7Y*&(qV@0YFP@865N}boe4apE`l1 zG^>k>Nu^SJ|Lxb*ZoZ%9N466Vbvjkg5k~R6)|O2?nWi+6AP@+!wXTi?kji8zOC*>} zrVw#>v;DDF-hAhM%Ga!23K4w=KwM6#MY5J1ZM^;N2d=$Rir}_Kxo=Y~BSRNm7Q1v5 znr*MoheT%p=!-b`7}PIJZm&7cPG7TByRv^iH%!IhE{hDu90UQvOq!C&Zc zNSilW5kT#hdUieY0u4<;XU*jFvh)CGYzp$+OS^gEsaS`(~tLXam7b>f&= Date: Wed, 14 Jun 2023 13:38:34 -0700 Subject: [PATCH 63/70] Partially revert #6721, improve performance of Directory::addItems (#6738) * Fix expandItems & speed up Directory addItems --- src/gui/FileBrowser.cpp | 118 +++++++++++----------------------------- 1 file changed, 32 insertions(+), 86 deletions(-) diff --git a/src/gui/FileBrowser.cpp b/src/gui/FileBrowser.cpp index 88932af19..0672cd347 100644 --- a/src/gui/FileBrowser.cpp +++ b/src/gui/FileBrowser.cpp @@ -229,22 +229,22 @@ void FileBrowser::reloadTree() -void FileBrowser::expandItems( QTreeWidgetItem * item, QList expandedDirs ) +void FileBrowser::expandItems(QTreeWidgetItem* item, QList expandedDirs) { int numChildren = item ? item->childCount() : m_fileBrowserTreeWidget->topLevelItemCount(); for (int i = 0; i < numChildren; ++i) { - QTreeWidgetItem * it = item ? item->child( i ) : m_fileBrowserTreeWidget->topLevelItem(i); + auto it = item ? item->child(i) : m_fileBrowserTreeWidget->topLevelItem(i); auto d = dynamic_cast(it); if (d) { - d->update(); - bool expand = expandedDirs.contains( d->fullName() ); - d->setExpanded( expand ); - } - if (m_recurse && it->childCount()) - { - expandItems(it, expandedDirs); + // Expanding is required when recursive to load in its contents, even if it's collapsed right afterward + if (m_recurse) { d->setExpanded(true); } + d->setExpanded(expandedDirs.contains(d->fullName())); + if (m_recurse && it->childCount()) + { + expandItems(it, expandedDirs); + } } } } @@ -1002,88 +1002,34 @@ void Directory::update() -bool Directory::addItems(const QString & path ) +bool Directory::addItems(const QString& path) { - QDir thisDir( path ); - if( !thisDir.isReadable() ) + QDir thisDir(path); + if (!thisDir.isReadable()) { return false; } + + treeWidget()->setUpdatesEnabled(false); + + QFileInfoList entries = thisDir.entryInfoList(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot, QDir::LocaleAware | QDir::DirsFirst | QDir::Name); + for (auto& entry : entries) { - return false; - } - - treeWidget()->setUpdatesEnabled( false ); - - bool added_something = false; - - // try to add all directories from file system alphabetically into the tree - QStringList files = thisDir.entryList( QDir::Dirs, QDir::Name ); - for( QStringList::const_iterator it = files.constBegin(); - it != files.constEnd(); ++it ) - { - QString cur_file = *it; - if( cur_file[0] != '.' ) + QString fileName = entry.fileName(); + if (entry.isDir()) { - bool orphan = true; - for( int i = 0; i < childCount(); ++i ) - { - auto d = dynamic_cast(child(i)); - if( d == nullptr || cur_file < d->text( 0 ) ) - { - // insert before item, we're done - insertChild( i, new Directory( cur_file, - path, m_filter ) ); - orphan = false; - m_dirCount++; - break; - } - else if( cur_file == d->text( 0 ) ) - { - // imagine we have top-level subdirs named "TripleOscillator" in - // two directories from FileBrowser::m_directories - // and imagine both have a sub folder named "xyz" - // then only add one tree widget for both - // so we don't add a new Directory - we just - // add the path to the current directory - d->addDirectory( path ); - orphan = false; - break; - } - } - if( orphan ) - { - // it has not yet been added yet, so it's (lexically) - // larger than all other dirs => append it at the bottom - addChild( new Directory( cur_file, path, - m_filter ) ); - m_dirCount++; - } - - added_something = true; + auto dir = new Directory(fileName, path, m_filter); + addChild(dir); + m_dirCount++; + } + else if (entry.isFile() && thisDir.match(m_filter, fileName.toLower())) + { + auto fileItem = new FileItem(fileName, path); + addChild(fileItem); } } - - // sorts the path alphabetically instead of just appending to the bottom (see "orphans") - if (added_something) - sortChildren(0, Qt::AscendingOrder); - - QList items; - files = thisDir.entryList( QDir::Files, QDir::Name ); - files.sort(Qt::CaseInsensitive); - for( QStringList::const_iterator it = files.constBegin(); - it != files.constEnd(); ++it ) - { - QString cur_file = *it; - if( cur_file[0] != '.' && - thisDir.match( m_filter, cur_file.toLower() ) ) - { - items << new FileItem( cur_file, path ); - added_something = true; - } - } - addChildren( items ); - - treeWidget()->setUpdatesEnabled( true ); - - return added_something; + + treeWidget()->setUpdatesEnabled(true); + + // return true if we added any child items + return childCount() > 0; } From c8546633a27bb0208268d244d4a8d43cd3c1b9b2 Mon Sep 17 00:00:00 2001 From: superpaik <68785450+superpaik@users.noreply.github.com> Date: Sat, 24 Jun 2023 04:57:52 +0200 Subject: [PATCH 64/70] Adding new FX channel while in solo (#6717) * Adding FX channel while in solo New FX channel is muted when there is a soloed FX line. Fixes #6311 * Move var initialization to constructor --- src/core/Mixer.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/core/Mixer.cpp b/src/core/Mixer.cpp index 9354687a8..b2a9f9e3f 100644 --- a/src/core/Mixer.cpp +++ b/src/core/Mixer.cpp @@ -190,11 +190,11 @@ void MixerChannel::doProcessing() Mixer::Mixer() : Model( nullptr ), JournallingObject(), - m_mixerChannels() + m_mixerChannels(), + m_lastSoloed(-1) { // create master channel createChannel(); - m_lastSoloed = -1; } @@ -224,6 +224,13 @@ int Mixer::createChannel() // reset channel state clearChannel( index ); + // if there is a soloed channel, mute the new track + if (m_lastSoloed != -1 && m_mixerChannels[m_lastSoloed]->m_soloModel.value()) + { + m_mixerChannels[index]->m_muteBeforeSolo = m_mixerChannels[index]->m_muteModel.value(); + m_mixerChannels[index]->m_muteModel.setValue(true); + } + return index; } From 405738f66f28dcb1e192fb8f3d60b0a54e1d891b Mon Sep 17 00:00:00 2001 From: Hyunjin Song Date: Sat, 24 Jun 2023 11:58:56 +0900 Subject: [PATCH 65/70] Fix STK rawwave installation in Windows builds (#6705) * Fix STK rawwave path detection and installation * Use the CMake logic for rawwave installation on Win and Mac --- cmake/apple/install_apple.sh.in | 5 ----- cmake/install/CMakeLists.txt | 10 ++++++++++ cmake/modules/FindSTK.cmake | 7 +++++++ cmake/nsis/CMakeLists.txt | 6 ------ 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/cmake/apple/install_apple.sh.in b/cmake/apple/install_apple.sh.in index e1921b1a5..df9300712 100644 --- a/cmake/apple/install_apple.sh.in +++ b/cmake/apple/install_apple.sh.in @@ -6,9 +6,6 @@ set -e -# STK rawwaves directory -STK_RAWWAVE=$(brew --prefix stk)/share/stk/rawwaves - # Place to create ".app" bundle APP="@CMAKE_BINARY_DIR@/@PROJECT_NAME_UCASE@.app" @@ -29,11 +26,9 @@ command cp "@CMAKE_BINARY_DIR@/Info.plist" "@CMAKE_INSTALL_PREFIX@/" mkdir -p "$APP/Contents/MacOS" mkdir -p "$APP/Contents/Frameworks" mkdir -p "$APP/Contents/Resources" -mkdir -p "$APP/Contents/share/stk/rawwaves" cd "@CMAKE_INSTALL_PREFIX@" cp -R ./* "$APP/Contents" cp "@CMAKE_SOURCE_DIR@/cmake/apple/"*.icns "$APP/Contents/Resources/" -cp "$STK_RAWWAVE"/*.raw "$APP/Contents/share/stk/rawwaves" > /dev/null 2>&1 # Make all libraries writable for macdeployqt cd "$APP" diff --git a/cmake/install/CMakeLists.txt b/cmake/install/CMakeLists.txt index cd4100c9b..5ee731d16 100644 --- a/cmake/install/CMakeLists.txt +++ b/cmake/install/CMakeLists.txt @@ -36,6 +36,16 @@ IF(LMMS_BUILD_WIN32 OR LMMS_INSTALL_DEPENDENCIES) ) ENDIF() +# Install STK rawwaves +if(LMMS_HAVE_STK AND (LMMS_BUILD_WIN32 OR LMMS_BUILD_APPLE)) + if(STK_RAWWAVE_ROOT) + file(GLOB RAWWAVES "${STK_RAWWAVE_ROOT}/*.raw") + install(FILES ${RAWWAVES} DESTINATION "${DATA_DIR}/stk/rawwaves") + else() + message(WARNING "Can't find STK rawwave root!") + endif() +endif() + IF(LMMS_BUILD_APPLE) INSTALL(CODE "EXECUTE_PROCESS(COMMAND chmod u+x ${CMAKE_BINARY_DIR}/install_apple.sh)") INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_BINARY_DIR}/install_apple.sh)") diff --git a/cmake/modules/FindSTK.cmake b/cmake/modules/FindSTK.cmake index 80ed0da42..0718f5039 100644 --- a/cmake/modules/FindSTK.cmake +++ b/cmake/modules/FindSTK.cmake @@ -26,6 +26,13 @@ else() endif() endif() +# find STK rawwave path +find_path(STK_RAWWAVE_ROOT + NAMES silence.raw sinewave.raw + HINTS "${STK_INCLUDE_DIR}/.." + PATH_SUFFIXES share/stk/rawwaves share/libstk/rawwaves +) + include(FindPackageHandleStandardArgs) find_package_handle_standard_args(STK REQUIRED_VARS STK_LIBRARY STK_INCLUDE_DIR diff --git a/cmake/nsis/CMakeLists.txt b/cmake/nsis/CMakeLists.txt index 9dca3495d..ee1bd45c3 100644 --- a/cmake/nsis/CMakeLists.txt +++ b/cmake/nsis/CMakeLists.txt @@ -73,12 +73,6 @@ SET(CPACK_NSIS_MUI_ICON "${CPACK_NSIS_MUI_ICON}" PARENT_SCOPE) CONFIGURE_FILE("lmms.rc.in" "${CMAKE_BINARY_DIR}/lmms.rc") CONFIGURE_FILE("zynaddsubfx.rc.in" "${CMAKE_BINARY_DIR}/plugins/ZynAddSubFx/zynaddsubfx.rc") -IF(LMMS_HAVE_STK) - FILE(GLOB RAWWAVES "${MINGW_PREFIX}/share/stk/rawwaves/*.raw") - LIST(SORT RAWWAVES) - INSTALL(FILES ${RAWWAVES} DESTINATION "${DATA_DIR}/stk/rawwaves") -ENDIF() - INSTALL(FILES "lmms.exe.manifest" DESTINATION .) INSTALL(FILES "lmms.VisualElementsManifest.xml" DESTINATION .) INSTALL(DIRECTORY "assets" DESTINATION .) From 4ea8a70de61e006651f7982f082ffbbf60fcd56b Mon Sep 17 00:00:00 2001 From: Lost Robot <34612565+LostRobotMusic@users.noreply.github.com> Date: Mon, 26 Jun 2023 17:23:47 -0700 Subject: [PATCH 66/70] Fix Equalizer LP/HP curve display (#6748) --- plugins/Eq/EqCurve.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/Eq/EqCurve.cpp b/plugins/Eq/EqCurve.cpp index 704231284..b9fa3f519 100644 --- a/plugins/Eq/EqCurve.cpp +++ b/plugins/Eq/EqCurve.cpp @@ -316,8 +316,7 @@ float EqHandle::getLowCutCurve( float x ) double c = cosf( w0 ); double s = sinf( w0 ); double resonance = getResonance(); - double A = pow( 10, yPixelToGain( EqHandle::y(), m_heigth, m_pixelsPerUnitHeight ) / 20); - double alpha = s / 2 * sqrt ( ( A +1/A ) * ( 1 / resonance -1 ) +2 ); + double alpha = s / (2 * resonance); double a0, a1, a2, b0, b1, b2; // coeffs to calculate b0 = ( 1 + c ) * 0.5; @@ -360,8 +359,7 @@ float EqHandle::getHighCutCurve( float x ) double c = cosf( w0 ); double s = sinf( w0 ); double resonance = getResonance(); - double A = pow( 10, yPixelToGain( EqHandle::y(), m_heigth, m_pixelsPerUnitHeight ) / 20 ); - double alpha = s / 2 * sqrt ( ( A + 1 / A ) * ( 1 / resonance -1 ) +2 ); + double alpha = s / (2 * resonance); double a0, a1, a2, b0, b1, b2; // coeffs to calculate b0 = ( 1 - c ) * 0.5; From 7f43e3b98240cfe4989db3089655ce6103cc34e5 Mon Sep 17 00:00:00 2001 From: chkno Date: Fri, 30 Jun 2023 05:51:43 -0700 Subject: [PATCH 67/70] Detect hiir fetch (#6755) --- cmake/modules/CheckSubmodules.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/modules/CheckSubmodules.cmake b/cmake/modules/CheckSubmodules.cmake index f36189c38..b9ea20778 100644 --- a/cmake/modules/CheckSubmodules.cmake +++ b/cmake/modules/CheckSubmodules.cmake @@ -18,7 +18,7 @@ # For details see the accompanying COPYING-CMAKE-SCRIPTS file. # Files which confirm a successful clone -SET(VALID_CRUMBS "CMakeLists.txt;Makefile;Makefile.in;Makefile.am;configure.ac;configure.py;autogen.sh;.gitignore;LICENSE;Home.md") +SET(VALID_CRUMBS "CMakeLists.txt;Makefile;Makefile.in;Makefile.am;configure.ac;configure.py;autogen.sh;.gitignore;LICENSE;Home.md;license.txt") OPTION(NO_SHALLOW_CLONE "Disable shallow cloning of submodules" OFF) From b7027fecbb5ced293eea1840d266b9a5b97990cb Mon Sep 17 00:00:00 2001 From: Dalton Messmer <33463986+messmerd@users.noreply.github.com> Date: Sat, 1 Jul 2023 22:57:09 -0400 Subject: [PATCH 68/70] Fix occasional crash when clicking Key button in piano roll with no clip (#6757) --- src/gui/editors/PianoRoll.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 8fdf958c0..adc1997b9 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -941,6 +941,7 @@ void PianoRoll::hideMidiClip( MidiClip* clip ) int PianoRoll::trackOctaveSize() const { + if (!m_midiClip) { return KeysPerOctave; } auto ut = m_midiClip->instrumentTrack()->microtuner(); return ut->enabled() ? ut->octaveSize() : KeysPerOctave; } From 1f30ffc5e4dddbd6ffb843bd8c56a8b4de859675 Mon Sep 17 00:00:00 2001 From: Aidan Mueller <10082900+aidan-mueller@users.noreply.github.com> Date: Sat, 1 Jul 2023 22:28:40 -0500 Subject: [PATCH 69/70] Fixed issue #5734 (FreeBoy Division by zero) (#6053) * Fixed issue #5734 (FreeBoy Division by zero). Added comments and used more descriptive variable names for noise channel initialization block. Also indented the nested for loop to improve code clarity. The reasons for doing this can be found in this answer: https://softwareengineering.stackexchange.com/a/362796 * Better initial div_ratio guess Allows us to skip r = 0 and a conditional in the loop below. --------- Co-authored-by: Spekular --- plugins/FreeBoy/FreeBoy.cpp | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/plugins/FreeBoy/FreeBoy.cpp b/plugins/FreeBoy/FreeBoy.cpp index f9ef2c5aa..1fd3f2513 100644 --- a/plugins/FreeBoy/FreeBoy.cpp +++ b/plugins/FreeBoy/FreeBoy.cpp @@ -358,30 +358,34 @@ void FreeBoyInstrument::playNote(NotePlayHandle* nph, sampleFrame* workingBuffer if (tfp == 0) { - //PRNG Frequency = (1048576 Hz / (ratio + 1)) / 2 ^ (shiftclockfreq + 1) - char sopt = 0; - char ropt = 1; - float fopt = 524288.0 / (ropt * std::pow(2.0, sopt + 1.0)); - float f; + // Initialize noise channel... + // PRNG Frequency = (1048576 Hz / (ratio + 1)) / 2 ^ (shiftclockfreq + 1) + // When div_ratio = 0 the ratio should be 0.5. Since s = 0 is the only case where r = 0 gives + // a unique frequency, we can start by guessing s = r = 0 here and then skip r = 0 in the loop. + char clock_freq = 0; + char div_ratio = 0; + float closest_freq = 524288.0 / (0.5 * std::pow(2.0, clock_freq + 1.0)); + // This nested for loop iterates over all possible combinations of clock frequency and dividing + // ratio and chooses the combination whose resulting frequency is closest to the note frequency for (char s = 0; s < 16; ++s) { - for (char r = 0; r < 8; ++r) + for (char r = 1; r < 8; ++r) { - f = 524288.0 / (r * std::pow(2.0, s + 1.0)); - if (std::fabs(freq - fopt) > std::fabs(freq - f)) + float f = 524288.0 / (r * std::pow(2.0, s + 1.0)); + if (std::fabs(freq - closest_freq) > std::fabs(freq - f)) { - fopt = f; - ropt = r; - sopt = s; + closest_freq = f; + div_ratio = r; + clock_freq = s; } } } - data = sopt; + data = clock_freq; data = data << 1; data += m_ch4ShiftRegWidthModel.value(); data = data << 3; - data += ropt; + data += div_ratio; papu->writeRegister(0xff22, data); //channel 4 init From 5ccc8d952ac90ab5a4abfaf7b3a29701a5dec4ed Mon Sep 17 00:00:00 2001 From: Kevin Zander Date: Sun, 2 Jul 2023 01:02:37 -0500 Subject: [PATCH 70/70] Remove redundant nameChanged signal from InstrumentTrack (#6742) --- include/InstrumentTrack.h | 1 - src/tracks/InstrumentTrack.cpp | 2 -- 2 files changed, 3 deletions(-) diff --git a/include/InstrumentTrack.h b/include/InstrumentTrack.h index 7c6d1d795..f21723363 100644 --- a/include/InstrumentTrack.h +++ b/include/InstrumentTrack.h @@ -244,7 +244,6 @@ signals: void instrumentChanged(); void midiNoteOn( const lmms::Note& ); void midiNoteOff( const lmms::Note& ); - void nameChanged(); void newNote(); void endNote(); diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index 0e75c990a..7eb6bba11 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -609,8 +609,6 @@ void InstrumentTrack::setName( const QString & _new_name ) Track::setName( _new_name ); m_midiPort.setName( name() ); m_audioPort.setName( name() ); - - emit nameChanged(); }