diff --git a/include/ComboBoxModel.h b/include/ComboBoxModel.h index e90d804e2df..a6df2964f4f 100644 --- a/include/ComboBoxModel.h +++ b/include/ComboBoxModel.h @@ -30,11 +30,12 @@ #include #include "AutomatableModel.h" -#include "embed.h" namespace lmms { +class PixmapLoader; + class LMMS_EXPORT ComboBoxModel : public IntModel { Q_OBJECT @@ -42,19 +43,15 @@ class LMMS_EXPORT ComboBoxModel : public IntModel public: ComboBoxModel( Model* parent = nullptr, const QString& displayName = QString(), - bool isDefaultConstructed = false ) : - IntModel( 0, 0, 0, parent, displayName, isDefaultConstructed ) - { - } + bool isDefaultConstructed = false ); - ~ComboBoxModel() override - { - clear(); - } + ~ComboBoxModel() override; - void addItem( QString item, std::unique_ptr loader = nullptr ); + void addItem( QString item ); + void addItem( QString item, std::unique_ptr loader ); - void replaceItem(std::size_t index, QString item, std::unique_ptr loader = nullptr); + void replaceItem(std::size_t index, QString item); + void replaceItem(std::size_t index, QString item, std::unique_ptr loader ); void clear(); diff --git a/include/MixerView.h b/include/MixerView.h index 2bb5ed4170f..d7a04ee2638 100644 --- a/include/MixerView.h +++ b/include/MixerView.h @@ -34,7 +34,6 @@ #include "Engine.h" #include "Fader.h" #include "PixmapButton.h" -#include "embed.h" #include "EffectRackView.h" class QButtonGroup; diff --git a/plugins/DualFilter/DualFilterControlDialog.cpp b/plugins/DualFilter/DualFilterControlDialog.cpp index d316e337213..79bbedbb6c0 100644 --- a/plugins/DualFilter/DualFilterControlDialog.cpp +++ b/plugins/DualFilter/DualFilterControlDialog.cpp @@ -24,6 +24,7 @@ */ +#include "embed.h" #include "DualFilterControlDialog.h" #include "DualFilterControls.h" #include "Knob.h" diff --git a/plugins/LadspaEffect/cmt/CMakeLists.txt b/plugins/LadspaEffect/cmt/CMakeLists.txt index 75dba319d6c..2e5b377f35d 100644 --- a/plugins/LadspaEffect/cmt/CMakeLists.txt +++ b/plugins/LadspaEffect/cmt/CMakeLists.txt @@ -5,6 +5,7 @@ ADD_LIBRARY(cmt MODULE ${SOURCES}) INSTALL(TARGETS cmt LIBRARY DESTINATION "${PLUGIN_DIR}/ladspa") SET_TARGET_PROPERTIES(cmt PROPERTIES PREFIX "") +SET_TARGET_PROPERTIES(cmt PROPERTIES UNITY_BUILD OFF) target_compile_options(cmt PRIVATE -Wall -O3 -fno-strict-aliasing) if(LMMS_BUILD_WIN32) diff --git a/plugins/MidiExport/MidiExport.cpp b/plugins/MidiExport/MidiExport.cpp index df968e36ab3..876d125f3a8 100644 --- a/plugins/MidiExport/MidiExport.cpp +++ b/plugins/MidiExport/MidiExport.cpp @@ -27,6 +27,8 @@ #include "MidiExport.h" +#include + #include "TrackContainer.h" #include "DataFile.h" #include "InstrumentTrack.h" diff --git a/plugins/MidiImport/portsmf/algrd_internal.h b/plugins/MidiImport/portsmf/algrd_internal.h index 56a9cdc46af..7f3126decb9 100644 --- a/plugins/MidiImport/portsmf/algrd_internal.h +++ b/plugins/MidiImport/portsmf/algrd_internal.h @@ -1,4 +1,5 @@ /* algread_internal.h -- interface between allegro.cpp and allegrord.cpp */ +#pragma once #include "allegro.h" diff --git a/plugins/MidiImport/portsmf/algsmfrd_internal.h b/plugins/MidiImport/portsmf/algsmfrd_internal.h index 65e7ac8744c..23986308d56 100644 --- a/plugins/MidiImport/portsmf/algsmfrd_internal.h +++ b/plugins/MidiImport/portsmf/algsmfrd_internal.h @@ -1,4 +1,5 @@ /* algsmfrd_internal.h -- interface from allegrosmfrd.cpp to allegro.cpp */ +#pragma once #include "allegro.h" diff --git a/plugins/MidiImport/portsmf/mfmidi.h b/plugins/MidiImport/portsmf/mfmidi.h index f1972124635..2aec6a4d914 100644 --- a/plugins/MidiImport/portsmf/mfmidi.h +++ b/plugins/MidiImport/portsmf/mfmidi.h @@ -1,3 +1,4 @@ +#pragma once #include #define NOTEOFF 0x80 diff --git a/plugins/MidiImport/portsmf/strparse.h b/plugins/MidiImport/portsmf/strparse.h index 046b1ddd381..1bac2a6b6aa 100644 --- a/plugins/MidiImport/portsmf/strparse.h +++ b/plugins/MidiImport/portsmf/strparse.h @@ -1,4 +1,5 @@ // strparse.h -- header for String_parse class +#pragma once class String_parse { public: diff --git a/plugins/MidiImport/portsmf/trace.h b/plugins/MidiImport/portsmf/trace.h index 52a23a69b82..7e94f59bbd0 100644 --- a/plugins/MidiImport/portsmf/trace.h +++ b/plugins/MidiImport/portsmf/trace.h @@ -1,2 +1,3 @@ +#pragma once void trace(char *format, ...); diff --git a/plugins/Monstro/Monstro.cpp b/plugins/Monstro/Monstro.cpp index 2201e4ed90b..3deda58f19f 100644 --- a/plugins/Monstro/Monstro.cpp +++ b/plugins/Monstro/Monstro.cpp @@ -62,6 +62,32 @@ Plugin::Descriptor PLUGIN_EXPORT monstro_plugin_descriptor = } +// +// UI Macros +// + +#define makeknob( name, x, y, hint, unit, oname ) \ + name = new Knob( KnobType::Styled, view ); \ + name ->move( x, y ); \ + name ->setHintText( hint, unit ); \ + name ->setObjectName( oname ); \ + name ->setFixedSize( 20, 20 ); + +#define maketsknob( name, x, y, hint, unit, oname ) \ + name = new TempoSyncKnob( KnobType::Styled, view ); \ + name ->move( x, y ); \ + name ->setHintText( hint, unit ); \ + name ->setObjectName( oname ); \ + name ->setFixedSize( 20, 20 ); + +#define maketinyled( name, x, y, ttip ) \ + name = new PixmapButton( view, nullptr ); \ + name -> setCheckable( true ); \ + name -> move( x, y ); \ + name -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "tinyled_on" ) ); \ + name -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "tinyled_off" ) ); \ + name->setToolTip(ttip); + MonstroSynth::MonstroSynth( MonstroInstrument * _i, NotePlayHandle * _nph ) : diff --git a/plugins/Monstro/Monstro.h b/plugins/Monstro/Monstro.h index 21efedaf314..c42218d3f6c 100644 --- a/plugins/Monstro/Monstro.h +++ b/plugins/Monstro/Monstro.h @@ -38,32 +38,6 @@ #include "lmms_math.h" #include "BandLimitedWave.h" -// -// UI Macros -// - -#define makeknob( name, x, y, hint, unit, oname ) \ - name = new Knob( KnobType::Styled, view ); \ - name ->move( x, y ); \ - name ->setHintText( hint, unit ); \ - name ->setObjectName( oname ); \ - name ->setFixedSize( 20, 20 ); - -#define maketsknob( name, x, y, hint, unit, oname ) \ - name = new TempoSyncKnob( KnobType::Styled, view ); \ - name ->move( x, y ); \ - name ->setHintText( hint, unit ); \ - name ->setObjectName( oname ); \ - name ->setFixedSize( 20, 20 ); - -#define maketinyled( name, x, y, ttip ) \ - name = new PixmapButton( view, nullptr ); \ - name -> setCheckable( true ); \ - name -> move( x, y ); \ - name -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "tinyled_on" ) ); \ - name -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "tinyled_off" ) ); \ - name->setToolTip(ttip); - namespace lmms { diff --git a/plugins/ReverbSC/base.h b/plugins/ReverbSC/base.h index 74c535cdc1b..b8fba5fa29a 100644 --- a/plugins/ReverbSC/base.h +++ b/plugins/ReverbSC/base.h @@ -1,3 +1,4 @@ +#pragma once #include #include diff --git a/plugins/ReverbSC/dcblock.h b/plugins/ReverbSC/dcblock.h index d98d5856654..6b50ba174f5 100644 --- a/plugins/ReverbSC/dcblock.h +++ b/plugins/ReverbSC/dcblock.h @@ -1,3 +1,4 @@ +#pragma once typedef struct { SPFLOAT gg; SPFLOAT outputs; diff --git a/plugins/ReverbSC/revsc.h b/plugins/ReverbSC/revsc.h index 7bf07e7bfb9..b65f8b84804 100644 --- a/plugins/ReverbSC/revsc.h +++ b/plugins/ReverbSC/revsc.h @@ -1,3 +1,4 @@ +#pragma once typedef struct { int writePos; int bufferSize; diff --git a/plugins/SpectrumAnalyzer/SaControls.h b/plugins/SpectrumAnalyzer/SaControls.h index 48d8ee96ea9..4225f80b8aa 100644 --- a/plugins/SpectrumAnalyzer/SaControls.h +++ b/plugins/SpectrumAnalyzer/SaControls.h @@ -25,6 +25,8 @@ #ifndef SACONTROLS_H #define SACONTROLS_H +#include + #include "ComboBoxModel.h" #include "EffectControls.h" diff --git a/plugins/SpectrumAnalyzer/SaControlsDialog.cpp b/plugins/SpectrumAnalyzer/SaControlsDialog.cpp index eb09c793a9f..30b4367cc68 100644 --- a/plugins/SpectrumAnalyzer/SaControlsDialog.cpp +++ b/plugins/SpectrumAnalyzer/SaControlsDialog.cpp @@ -30,6 +30,7 @@ #include #include +#include "embed.h" #include "ComboBox.h" #include "ComboBoxModel.h" #include "Knob.h" diff --git a/plugins/ZynAddSubFx/CMakeLists.txt b/plugins/ZynAddSubFx/CMakeLists.txt index 3369a793865..7fd8133926a 100644 --- a/plugins/ZynAddSubFx/CMakeLists.txt +++ b/plugins/ZynAddSubFx/CMakeLists.txt @@ -23,9 +23,8 @@ if(NOT MSVC AND (LMMS_HOST_X86 OR LMMS_HOST_X86_64)) ADD_DEFINITIONS(-DASM_F2I_YES) endif() -# build ZynAddSubFX with full optimizations if(NOT MSVC) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wno-write-strings -Wno-deprecated-declarations -fpermissive") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -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") diff --git a/src/core/ComboBoxModel.cpp b/src/core/ComboBoxModel.cpp index f1b1c6b2e0f..a8b880ca4a4 100644 --- a/src/core/ComboBoxModel.cpp +++ b/src/core/ComboBoxModel.cpp @@ -26,18 +26,41 @@ #include +#include "embed.h" + namespace lmms { using std::unique_ptr; using std::move; +ComboBoxModel::ComboBoxModel(Model* parent, const QString& displayName, bool isDefaultConstructed) + : + IntModel( 0, 0, 0, parent, displayName, isDefaultConstructed ) +{ +} + +ComboBoxModel::~ComboBoxModel() +{ + clear(); +} + +void ComboBoxModel::addItem(QString item) +{ + addItem( item, nullptr ); +} + void ComboBoxModel::addItem( QString item, unique_ptr loader ) { m_items.emplace_back( move(item), move(loader) ); setRange( 0, m_items.size() - 1 ); } +void ComboBoxModel::replaceItem(std::size_t index, QString item) +{ + replaceItem(index, item, nullptr); +} + void ComboBoxModel::replaceItem(std::size_t index, QString item, unique_ptr loader) { diff --git a/src/gui/GuiApplication.cpp b/src/gui/GuiApplication.cpp index 3370cbc6ebf..b1446e6a9fa 100644 --- a/src/gui/GuiApplication.cpp +++ b/src/gui/GuiApplication.cpp @@ -26,6 +26,7 @@ #include "lmmsversion.h" +#include "embed.h" #include "LmmsStyle.h" #include "LmmsPalette.h" diff --git a/src/gui/LinkedModelGroupViews.cpp b/src/gui/LinkedModelGroupViews.cpp index f77edcdb9de..3439e53db19 100644 --- a/src/gui/LinkedModelGroupViews.cpp +++ b/src/gui/LinkedModelGroupViews.cpp @@ -25,6 +25,7 @@ #include "LinkedModelGroupViews.h" #include +#include "embed.h" #include "Controls.h" #include "ControlLayout.h" #include "LinkedModelGroups.h" diff --git a/src/gui/MixerView.cpp b/src/gui/MixerView.cpp index 018e72c2b20..20e495c60a2 100644 --- a/src/gui/MixerView.cpp +++ b/src/gui/MixerView.cpp @@ -33,6 +33,7 @@ #include "lmms_math.h" +#include "embed.h" #include "MixerView.h" #include "Knob.h" #include "MixerLine.h" diff --git a/src/gui/clips/MidiClipView.cpp b/src/gui/clips/MidiClipView.cpp index 151df8d3c3c..842ce7e4444 100644 --- a/src/gui/clips/MidiClipView.cpp +++ b/src/gui/clips/MidiClipView.cpp @@ -31,6 +31,7 @@ #include #include +#include "embed.h" #include "ConfigManager.h" #include "DeprecationHelper.h" #include "GuiApplication.h" diff --git a/src/gui/clips/PatternClipView.cpp b/src/gui/clips/PatternClipView.cpp index bf12440c722..c0af6067745 100644 --- a/src/gui/clips/PatternClipView.cpp +++ b/src/gui/clips/PatternClipView.cpp @@ -28,6 +28,7 @@ #include #include +#include "embed.h" #include "Engine.h" #include "GuiApplication.h" #include "MainWindow.h" diff --git a/src/gui/instrument/InstrumentTuningView.cpp b/src/gui/instrument/InstrumentTuningView.cpp index 355d7d18c73..d7a01893efe 100644 --- a/src/gui/instrument/InstrumentTuningView.cpp +++ b/src/gui/instrument/InstrumentTuningView.cpp @@ -30,6 +30,7 @@ #include #include +#include "embed.h" #include "ComboBox.h" #include "GroupBox.h" #include "GuiApplication.h" diff --git a/src/gui/tracks/InstrumentTrackView.cpp b/src/gui/tracks/InstrumentTrackView.cpp index 87c0f044944..04d1628242c 100644 --- a/src/gui/tracks/InstrumentTrackView.cpp +++ b/src/gui/tracks/InstrumentTrackView.cpp @@ -31,6 +31,7 @@ #include #include +#include "embed.h" #include "AudioEngine.h" #include "ConfigManager.h" #include "Engine.h" diff --git a/src/gui/tracks/PatternTrackView.cpp b/src/gui/tracks/PatternTrackView.cpp index be039ba79e5..1f1aa75eca2 100644 --- a/src/gui/tracks/PatternTrackView.cpp +++ b/src/gui/tracks/PatternTrackView.cpp @@ -24,6 +24,7 @@ #include "PatternTrackView.h" +#include "embed.h" #include "Engine.h" #include "GuiApplication.h" #include "PatternEditor.h" diff --git a/src/gui/tracks/TrackContentWidget.cpp b/src/gui/tracks/TrackContentWidget.cpp index 619eff8317b..f92b2602f1b 100644 --- a/src/gui/tracks/TrackContentWidget.cpp +++ b/src/gui/tracks/TrackContentWidget.cpp @@ -29,6 +29,7 @@ #include #include +#include "embed.h" #include "AutomationClip.h" #include "Clipboard.h" #include "DataFile.h"