From fccf48f5af1fced9af1f2d3fc0781607cb36d919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Mon, 11 May 2020 23:23:51 +0200 Subject: [PATCH 01/23] Don't use a non const references in WaveformWidgetFactory::setWidgetType() --- src/waveform/waveformwidgetfactory.cpp | 25 ++++++++++++++++--------- src/waveform/waveformwidgetfactory.h | 4 +++- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/waveform/waveformwidgetfactory.cpp b/src/waveform/waveformwidgetfactory.cpp index 0c0c3037c82..c3354c8e7e6 100644 --- a/src/waveform/waveformwidgetfactory.cpp +++ b/src/waveform/waveformwidgetfactory.cpp @@ -316,8 +316,8 @@ bool WaveformWidgetFactory::setConfig(UserSettingsPointer config) { m_config->getValueString(ConfigKey("[Waveform]","WaveformType")).toInt(&ok)); // Store the widget type on m_configType for later initialization. // We will initialize the objects later because of a problem with GL on QT 5.14.2 on Windows - if (!ok || !setWidgetType(type, m_configType)) { - setWidgetType(autoChooseWidgetType(), m_configType); + if (!ok || !setWidgetType(type, &m_configType)) { + setWidgetType(autoChooseWidgetType(), &m_configType); } for (int i = 0; i < FilterCount; i++) { @@ -449,28 +449,35 @@ int WaveformWidgetFactory::getVSyncType() { } bool WaveformWidgetFactory::setWidgetType(WaveformWidgetType::Type type) { - return setWidgetType(type, m_type); + return setWidgetType(type, &m_type); } -bool WaveformWidgetFactory::setWidgetType(WaveformWidgetType::Type type, WaveformWidgetType::Type& currentType) { - if (type == currentType) +bool WaveformWidgetFactory::setWidgetType( + WaveformWidgetType::Type type, + WaveformWidgetType::Type* pCurrentType) { + if (type == *pCurrentType) { return true; + } // check if type is acceptable int index = findHandleIndexFromType(type); if (index > -1) { // type is acceptable - currentType = type; + *pCurrentType = type; if (m_config) { - m_config->setValue(ConfigKey("[Waveform]", "WaveformType"), static_cast(currentType)); + m_config->setValue( + ConfigKey("[Waveform]", "WaveformType"), + static_cast(*pCurrentType)); } return true; } // fallback - currentType = WaveformWidgetType::EmptyWaveform; + *pCurrentType = WaveformWidgetType::EmptyWaveform; if (m_config) { - m_config->setValue(ConfigKey("[Waveform]", "WaveformType"), static_cast(currentType)); + m_config->setValue( + ConfigKey("[Waveform]", "WaveformType"), + static_cast(*pCurrentType)); } return false; } diff --git a/src/waveform/waveformwidgetfactory.h b/src/waveform/waveformwidgetfactory.h index 83e26c579f0..7b09932fdec 100644 --- a/src/waveform/waveformwidgetfactory.h +++ b/src/waveform/waveformwidgetfactory.h @@ -96,7 +96,9 @@ class WaveformWidgetFactory : public QObject, public Singleton Date: Mon, 11 May 2020 23:26:09 +0200 Subject: [PATCH 02/23] Initalize m_configType --- src/waveform/waveformwidgetfactory.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/waveform/waveformwidgetfactory.cpp b/src/waveform/waveformwidgetfactory.cpp index c3354c8e7e6..8f26efc76a8 100644 --- a/src/waveform/waveformwidgetfactory.cpp +++ b/src/waveform/waveformwidgetfactory.cpp @@ -99,6 +99,7 @@ WaveformWidgetFactory::WaveformWidgetFactory() // Concretely, we want to set a non-GL waveform when loading the skin so that the window // loads correctly. : m_type(WaveformWidgetType::EmptyWaveform), + m_configType(WaveformWidgetType::EmptyWaveform), m_config(0), m_skipRender(false), m_frameRate(30), From 00e572ecce030c0675905e0732492f4c3537576a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Mon, 11 May 2020 23:37:04 +0200 Subject: [PATCH 03/23] Initalize m_displayFormat --- src/widget/wnumberpos.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/widget/wnumberpos.cpp b/src/widget/wnumberpos.cpp index ffe534b158d..2cc1ca1e597 100644 --- a/src/widget/wnumberpos.cpp +++ b/src/widget/wnumberpos.cpp @@ -8,6 +8,7 @@ WNumberPos::WNumberPos(const char* group, QWidget* parent) : WNumber(parent), + m_displayFormat(TrackTime::DisplayFormat::TRADITIONAL), m_dOldTimeElapsed(0.0) { m_pTimeElapsed = new ControlProxy(group, "time_elapsed", this); m_pTimeElapsed->connectValueChanged(this, &WNumberPos::slotSetTimeElapsed); From e6922a6ab36c8089d276b01476d3e83acd91a21e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Tue, 12 May 2020 00:17:22 +0200 Subject: [PATCH 04/23] Make use of QStringLiteral to fix a Valgrind issue --- src/util/duration.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/duration.cpp b/src/util/duration.cpp index 134a58e625a..17e1d253839 100644 --- a/src/util/duration.cpp +++ b/src/util/duration.cpp @@ -40,12 +40,12 @@ QString DurationBase::formatTime(double dSeconds, Precision precision) { QTime t = QTime(0, 0).addMSecs(dSeconds * kMillisPerSecond); QString formatString = - QLatin1String(t.hour() > 0 && days < 1 ? "hh:mm:ss" : "mm:ss") % - QLatin1String(Precision::SECONDS == precision ? "" : ".zzz"); + (t.hour() > 0 && days < 1 ? QStringLiteral("hh:mm:ss") : QStringLiteral("mm:ss")) + + (Precision::SECONDS == precision ? QString() : QStringLiteral(".zzz")); QString durationString = t.toString(formatString); if (days > 0) { - durationString = QString("%1:").arg(days * 24 + t.hour()) % durationString; + durationString = QString::number(days * 24 + t.hour()) + QChar(':') + durationString; } // remove leading 0 if (durationString.at(0) == '0' && durationString.at(1) != ':') { From 88714c1b3b2e91f596086bf406a1ccf810e673d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Fri, 15 May 2020 23:44:04 +0200 Subject: [PATCH 05/23] Initalize m_prevLocalBpm --- src/engine/sync/synccontrol.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/engine/sync/synccontrol.cpp b/src/engine/sync/synccontrol.cpp index 2160bcf7964..8c319fac8d8 100644 --- a/src/engine/sync/synccontrol.cpp +++ b/src/engine/sync/synccontrol.cpp @@ -75,6 +75,9 @@ SyncControl::SyncControl(const QString& group, UserSettingsPointer pConfig, m_pQuantize = new ControlProxy(group, "quantize", this); + // Adopt an invalid to not ignore the first call setLocalBpm() + m_prevLocalBpm.setValue(-1); + // BPMControl and RateControl will be initialized later. } From 54f744f8e534bcb567dc78610367859354e7ba46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Sat, 16 May 2020 14:14:21 +0200 Subject: [PATCH 06/23] Make m_pMenuBar a parented_ptr --- src/mixxx.cpp | 5 ++--- src/mixxx.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/mixxx.cpp b/src/mixxx.cpp index cb2aad1b128..b8517438e07 100644 --- a/src/mixxx.cpp +++ b/src/mixxx.cpp @@ -850,7 +850,7 @@ bool MixxxMainWindow::initializeDatabase() { void MixxxMainWindow::initializeWindow() { // be sure createMenuBar() is called first - DEBUG_ASSERT(m_pMenuBar != nullptr); + DEBUG_ASSERT(m_pMenuBar); QPalette Pal(palette()); // safe default QMenuBar background @@ -1094,8 +1094,7 @@ void MixxxMainWindow::slotUpdateWindowTitle(TrackPointer pTrack) { void MixxxMainWindow::createMenuBar() { ScopedTimer t("MixxxMainWindow::createMenuBar"); DEBUG_ASSERT(m_pKbdConfig != nullptr); - m_pMenuBar = new WMainMenuBar(this, m_pSettingsManager->settings(), - m_pKbdConfig); + m_pMenuBar = make_parented(this, m_pSettingsManager->settings(), m_pKbdConfig); setMenuBar(m_pMenuBar); } diff --git a/src/mixxx.h b/src/mixxx.h index c09a6475482..6367921457b 100644 --- a/src/mixxx.h +++ b/src/mixxx.h @@ -183,7 +183,7 @@ class MixxxMainWindow : public QMainWindow { // The library management object Library* m_pLibrary; - WMainMenuBar* m_pMenuBar; + parented_ptr m_pMenuBar; DlgDeveloperTools* m_pDeveloperToolsDlg; From 210ff109e542ded6f6d4e00bb9c59997d794375f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Sat, 16 May 2020 14:15:24 +0200 Subject: [PATCH 07/23] don't leak ChannelHandleFactory --- src/effects/effectsmanager.cpp | 6 +++--- src/effects/effectsmanager.h | 9 +++++---- src/engine/channelhandle.h | 5 ++++- src/engine/enginemaster.cpp | 8 ++++---- src/engine/enginemaster.h | 10 +++++----- src/mixxx.cpp | 15 ++++++++++----- src/mixxx.h | 2 -- src/test/baseeffecttest.h | 10 +++++----- src/test/signalpathtest.h | 19 +++++++++++-------- 9 files changed, 47 insertions(+), 37 deletions(-) diff --git a/src/effects/effectsmanager.cpp b/src/effects/effectsmanager.cpp index 52acfabe9d6..b42ea35e22d 100644 --- a/src/effects/effectsmanager.cpp +++ b/src/effects/effectsmanager.cpp @@ -19,9 +19,9 @@ const QString kGroupClose = "]"; const unsigned int kEffectMessagPipeFifoSize = 2048; } // anonymous namespace - -EffectsManager::EffectsManager(QObject* pParent, UserSettingsPointer pConfig, - ChannelHandleFactory* pChannelHandleFactory) +EffectsManager::EffectsManager(QObject* pParent, + UserSettingsPointer pConfig, + ChannelHandleFactoryPtr pChannelHandleFactory) : QObject(pParent), m_pChannelHandleFactory(pChannelHandleFactory), m_pEffectChainManager(new EffectChainManager(pConfig, this)), diff --git a/src/effects/effectsmanager.h b/src/effects/effectsmanager.h index 24f4cd9024c..b6ff6f183c2 100644 --- a/src/effects/effectsmanager.h +++ b/src/effects/effectsmanager.h @@ -26,8 +26,9 @@ class EffectsManager : public QObject { public: typedef bool (*EffectManifestFilterFnc)(EffectManifest* pManifest); - EffectsManager(QObject* pParent, UserSettingsPointer pConfig, - ChannelHandleFactory* pChannelHandleFactory); + EffectsManager(QObject* pParent, + UserSettingsPointer pConfig, + ChannelHandleFactoryPtr pChannelHandleFactory); virtual ~EffectsManager(); EngineEffectsManager* getEngineEffectsManager() { @@ -92,7 +93,7 @@ class EffectsManager : public QObject { EffectPointer instantiateEffect(const QString& effectId); void setEffectVisibility(EffectManifestPointer pManifest, bool visibility); - bool getEffectVisibility(EffectManifestPointer pManifest); + bool getEffectVisibility(EffectManifestPointer pManifest); // Temporary, but for setting up all the default EffectChains and EffectRacks void setup(); @@ -120,7 +121,7 @@ class EffectsManager : public QObject { void processEffectsResponses(); void collectGarbage(const EffectsRequest* pResponse); - ChannelHandleFactory* m_pChannelHandleFactory; + ChannelHandleFactoryPtr m_pChannelHandleFactory; EffectChainManager* m_pEffectChainManager; QList m_effectsBackends; diff --git a/src/engine/channelhandle.h b/src/engine/channelhandle.h index 239f0c20dc3..5548f857e3c 100644 --- a/src/engine/channelhandle.h +++ b/src/engine/channelhandle.h @@ -16,10 +16,11 @@ // A helper class, ChannelHandleFactory, keeps a running count of handles that // have been assigned. -#include #include #include #include +#include +#include #include "util/assert.h" @@ -143,6 +144,8 @@ class ChannelHandleFactory { QHash m_handleToGroup; }; +typedef std::shared_ptr ChannelHandleFactoryPtr; + // An associative container mapping ChannelHandle to a template type T. Backed // by a QVarLengthArray with ChannelHandleMap::kMaxExpectedGroups pre-allocated // entries. Insertions are amortized O(1) time (if less than kMaxExpectedGroups diff --git a/src/engine/enginemaster.cpp b/src/engine/enginemaster.cpp index 071a5105494..9f29c60351b 100644 --- a/src/engine/enginemaster.cpp +++ b/src/engine/enginemaster.cpp @@ -30,10 +30,10 @@ #include "util/trace.h" EngineMaster::EngineMaster(UserSettingsPointer pConfig, - const char* group, - EffectsManager* pEffectsManager, - ChannelHandleFactory* pChannelHandleFactory, - bool bEnableSidechain) + const char* group, + EffectsManager* pEffectsManager, + ChannelHandleFactoryPtr pChannelHandleFactory, + bool bEnableSidechain) : m_pChannelHandleFactory(pChannelHandleFactory), m_pEngineEffectsManager(pEffectsManager ? pEffectsManager->getEngineEffectsManager() : NULL), m_masterGainOld(0.0), diff --git a/src/engine/enginemaster.h b/src/engine/enginemaster.h index 094e358bfb7..e3be69ff7ce 100644 --- a/src/engine/enginemaster.h +++ b/src/engine/enginemaster.h @@ -56,10 +56,10 @@ class EngineMaster : public QObject, public AudioSource { Q_OBJECT public: EngineMaster(UserSettingsPointer pConfig, - const char* pGroup, - EffectsManager* pEffectsManager, - ChannelHandleFactory* pChannelHandleFactory, - bool bEnableSidechain); + const char* pGroup, + EffectsManager* pEffectsManager, + ChannelHandleFactoryPtr pChannelHandleFactory, + bool bEnableSidechain); virtual ~EngineMaster(); // Get access to the sample buffers. None of these are thread safe. Only to @@ -270,7 +270,7 @@ class EngineMaster : public QObject, public AudioSource { // respective output. void processChannels(int iBufferSize); - ChannelHandleFactory* m_pChannelHandleFactory; + ChannelHandleFactoryPtr m_pChannelHandleFactory; void applyMasterEffects(); void processHeadphones(const double masterMixGainInHeadphones); bool sidechainMixRequired() const; diff --git a/src/mixxx.cpp b/src/mixxx.cpp index b8517438e07..499c5e9d381 100644 --- a/src/mixxx.cpp +++ b/src/mixxx.cpp @@ -238,8 +238,6 @@ void MixxxMainWindow::initialize(QApplication* pApp, const CmdlineArgs& args) { setAttribute(Qt::WA_AcceptTouchEvents); m_pTouchShift = new ControlPushButton(ConfigKey("[Controls]", "touch_shift")); - m_pChannelHandleFactory = new ChannelHandleFactory(); - m_pDbConnectionPool = MixxxDb(pConfig).connectionPool(); if (!m_pDbConnectionPool) { // TODO(XXX) something a little more elegant @@ -252,12 +250,19 @@ void MixxxMainWindow::initialize(QApplication* pApp, const CmdlineArgs& args) { exit(-1); } + ChannelHandleFactoryPtr pChannelHandleFactory = + std::make_shared(); + // Create the Effects subsystem. - m_pEffectsManager = new EffectsManager(this, pConfig, m_pChannelHandleFactory); + m_pEffectsManager = new EffectsManager(this, pConfig, pChannelHandleFactory); // Starting the master (mixing of the channels and effects): - m_pEngine = new EngineMaster(pConfig, "[Master]", m_pEffectsManager, - m_pChannelHandleFactory, true); + m_pEngine = new EngineMaster( + pConfig, + "[Master]", + m_pEffectsManager, + pChannelHandleFactory, + true); // Create effect backends. We do this after creating EngineMaster to allow // effect backends to refer to controls that are produced by the engine. diff --git a/src/mixxx.h b/src/mixxx.h index 6367921457b..765a7c065c5 100644 --- a/src/mixxx.h +++ b/src/mixxx.h @@ -144,8 +144,6 @@ class MixxxMainWindow : public QMainWindow { SettingsManager* m_pSettingsManager; - ChannelHandleFactory* m_pChannelHandleFactory; - // The effects processing system EffectsManager* m_pEffectsManager; diff --git a/src/test/baseeffecttest.h b/src/test/baseeffecttest.h index 0102f5fc8dd..3d9a0f5f4d9 100644 --- a/src/test/baseeffecttest.h +++ b/src/test/baseeffecttest.h @@ -61,10 +61,10 @@ class MockEffectInstantiator : public EffectInstantiator { class BaseEffectTest : public MixxxTest { protected: - BaseEffectTest() : m_pChannelHandleFactory(new ChannelHandleFactory()), - m_pTestBackend(nullptr), - m_pEffectsManager(new EffectsManager(nullptr, config(), - m_pChannelHandleFactory)) { + BaseEffectTest() + : m_pChannelHandleFactory(std::make_shared()), + m_pTestBackend(nullptr), + m_pEffectsManager(new EffectsManager(nullptr, config(), m_pChannelHandleFactory)) { } void registerTestBackend() { @@ -74,7 +74,7 @@ class BaseEffectTest : public MixxxTest { void registerTestEffect(EffectManifestPointer pManifest, bool willAddToEngine); - ChannelHandleFactory* m_pChannelHandleFactory; + ChannelHandleFactoryPtr m_pChannelHandleFactory; // Deleted by EffectsManager. Do not delete. TestEffectBackend* m_pTestBackend; diff --git a/src/test/signalpathtest.h b/src/test/signalpathtest.h index b22e37e10e9..605339dc2cb 100644 --- a/src/test/signalpathtest.h +++ b/src/test/signalpathtest.h @@ -36,12 +36,15 @@ using ::testing::_; class TestEngineMaster : public EngineMaster { public: TestEngineMaster(UserSettingsPointer _config, - const char* group, - EffectsManager* pEffectsManager, - ChannelHandleFactory* pChannelHandleFactory, - bool bEnableSidechain) - : EngineMaster(_config, group, pEffectsManager, pChannelHandleFactory, - bEnableSidechain) { + const char* group, + EffectsManager* pEffectsManager, + ChannelHandleFactoryPtr pChannelHandleFactory, + bool bEnableSidechain) + : EngineMaster(_config, + group, + pEffectsManager, + pChannelHandleFactory, + bEnableSidechain) { m_pMasterEnabled->forceSet(1); m_pHeadphoneEnabled->forceSet(1); m_pBoothEnabled->forceSet(1); @@ -56,7 +59,7 @@ class BaseSignalPathTest : public MixxxTest { protected: BaseSignalPathTest() { m_pGuiTick = std::make_unique(); - m_pChannelHandleFactory = new ChannelHandleFactory(); + m_pChannelHandleFactory = std::make_shared(); m_pNumDecks = new ControlObject(ConfigKey("[Master]", "num_decks")); m_pEffectsManager = new EffectsManager(NULL, config(), m_pChannelHandleFactory); m_pVisualsManager = new VisualsManager(); @@ -200,7 +203,7 @@ class BaseSignalPathTest : public MixxxTest { m_pEngineMaster->process(kProcessBufferSize); } - ChannelHandleFactory* m_pChannelHandleFactory; + ChannelHandleFactoryPtr m_pChannelHandleFactory; ControlObject* m_pNumDecks; std::unique_ptr m_pGuiTick; VisualsManager* m_pVisualsManager; From 67ca1b234038098568932d068ed2415bc5678daf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Sat, 16 May 2020 14:44:34 +0200 Subject: [PATCH 08/23] Don't leak m_pStyle --- src/widget/wcolorpicker.cpp | 5 ++++- src/widget/wcolorpicker.h | 8 +++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/widget/wcolorpicker.cpp b/src/widget/wcolorpicker.cpp index 722d08e0916..9a849d78328 100644 --- a/src/widget/wcolorpicker.cpp +++ b/src/widget/wcolorpicker.cpp @@ -60,7 +60,10 @@ WColorPicker::WColorPicker(Options options, const ColorPalette& palette, QWidget // from the rest of the application (when not styled via QSS), but that's // better than having buttons without any colors (which would make the // color picker unusable). - m_pStyle = QStyleFactory::create(QString("fusion")); + QStyle* pStyle = QStyleFactory::create(QString("fusion")); + pStyle->setParent(this); + m_pStyle = parented_ptr(pStyle); + setLayout(pLayout); addColorButtons(); diff --git a/src/widget/wcolorpicker.h b/src/widget/wcolorpicker.h index 679f235b560..52f5aa4c56b 100644 --- a/src/widget/wcolorpicker.h +++ b/src/widget/wcolorpicker.h @@ -1,13 +1,15 @@ #pragma once #include -#include #include -#include +#include +#include #include +#include #include "util/color/color.h" #include "util/color/colorpalette.h" +#include "util/parented_ptr.h" class WColorPicker : public QWidget { Q_OBJECT @@ -44,7 +46,7 @@ class WColorPicker : public QWidget { QPushButton* m_pNoColorButton; QPushButton* m_pCustomColorButton; QList m_colorButtons; - QStyle* m_pStyle; + parented_ptr m_pStyle; }; Q_DECLARE_OPERATORS_FOR_FLAGS(WColorPicker::Options); From 8d6bc9586cde9202402f72ecd7f8f52a1fbd8e34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Sun, 17 May 2020 11:28:28 +0200 Subject: [PATCH 09/23] make use of auto and replace Ptr by Pointer in typedef --- src/effects/effectsmanager.cpp | 2 +- src/effects/effectsmanager.h | 4 ++-- src/engine/channelhandle.h | 2 +- src/engine/enginemaster.cpp | 2 +- src/engine/enginemaster.h | 4 ++-- src/mixxx.cpp | 3 +-- src/test/baseeffecttest.h | 2 +- src/test/signalpathtest.h | 4 ++-- 8 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/effects/effectsmanager.cpp b/src/effects/effectsmanager.cpp index b42ea35e22d..8858c46b4ab 100644 --- a/src/effects/effectsmanager.cpp +++ b/src/effects/effectsmanager.cpp @@ -21,7 +21,7 @@ const unsigned int kEffectMessagPipeFifoSize = 2048; EffectsManager::EffectsManager(QObject* pParent, UserSettingsPointer pConfig, - ChannelHandleFactoryPtr pChannelHandleFactory) + ChannelHandleFactoryPointer pChannelHandleFactory) : QObject(pParent), m_pChannelHandleFactory(pChannelHandleFactory), m_pEffectChainManager(new EffectChainManager(pConfig, this)), diff --git a/src/effects/effectsmanager.h b/src/effects/effectsmanager.h index b6ff6f183c2..0afd5e54751 100644 --- a/src/effects/effectsmanager.h +++ b/src/effects/effectsmanager.h @@ -28,7 +28,7 @@ class EffectsManager : public QObject { EffectsManager(QObject* pParent, UserSettingsPointer pConfig, - ChannelHandleFactoryPtr pChannelHandleFactory); + ChannelHandleFactoryPointer pChannelHandleFactory); virtual ~EffectsManager(); EngineEffectsManager* getEngineEffectsManager() { @@ -121,7 +121,7 @@ class EffectsManager : public QObject { void processEffectsResponses(); void collectGarbage(const EffectsRequest* pResponse); - ChannelHandleFactoryPtr m_pChannelHandleFactory; + ChannelHandleFactoryPointer m_pChannelHandleFactory; EffectChainManager* m_pEffectChainManager; QList m_effectsBackends; diff --git a/src/engine/channelhandle.h b/src/engine/channelhandle.h index 5548f857e3c..91f7d14dc32 100644 --- a/src/engine/channelhandle.h +++ b/src/engine/channelhandle.h @@ -144,7 +144,7 @@ class ChannelHandleFactory { QHash m_handleToGroup; }; -typedef std::shared_ptr ChannelHandleFactoryPtr; +typedef std::shared_ptr ChannelHandleFactoryPointer; // An associative container mapping ChannelHandle to a template type T. Backed // by a QVarLengthArray with ChannelHandleMap::kMaxExpectedGroups pre-allocated diff --git a/src/engine/enginemaster.cpp b/src/engine/enginemaster.cpp index 9f29c60351b..ebb690dc124 100644 --- a/src/engine/enginemaster.cpp +++ b/src/engine/enginemaster.cpp @@ -32,7 +32,7 @@ EngineMaster::EngineMaster(UserSettingsPointer pConfig, const char* group, EffectsManager* pEffectsManager, - ChannelHandleFactoryPtr pChannelHandleFactory, + ChannelHandleFactoryPointer pChannelHandleFactory, bool bEnableSidechain) : m_pChannelHandleFactory(pChannelHandleFactory), m_pEngineEffectsManager(pEffectsManager ? pEffectsManager->getEngineEffectsManager() : NULL), diff --git a/src/engine/enginemaster.h b/src/engine/enginemaster.h index e3be69ff7ce..73b4edb9397 100644 --- a/src/engine/enginemaster.h +++ b/src/engine/enginemaster.h @@ -58,7 +58,7 @@ class EngineMaster : public QObject, public AudioSource { EngineMaster(UserSettingsPointer pConfig, const char* pGroup, EffectsManager* pEffectsManager, - ChannelHandleFactoryPtr pChannelHandleFactory, + ChannelHandleFactoryPointer pChannelHandleFactory, bool bEnableSidechain); virtual ~EngineMaster(); @@ -270,7 +270,7 @@ class EngineMaster : public QObject, public AudioSource { // respective output. void processChannels(int iBufferSize); - ChannelHandleFactoryPtr m_pChannelHandleFactory; + ChannelHandleFactoryPointer m_pChannelHandleFactory; void applyMasterEffects(); void processHeadphones(const double masterMixGainInHeadphones); bool sidechainMixRequired() const; diff --git a/src/mixxx.cpp b/src/mixxx.cpp index 499c5e9d381..40d83cd7dff 100644 --- a/src/mixxx.cpp +++ b/src/mixxx.cpp @@ -250,8 +250,7 @@ void MixxxMainWindow::initialize(QApplication* pApp, const CmdlineArgs& args) { exit(-1); } - ChannelHandleFactoryPtr pChannelHandleFactory = - std::make_shared(); + auto pChannelHandleFactory = std::make_shared(); // Create the Effects subsystem. m_pEffectsManager = new EffectsManager(this, pConfig, pChannelHandleFactory); diff --git a/src/test/baseeffecttest.h b/src/test/baseeffecttest.h index 3d9a0f5f4d9..566f3d00257 100644 --- a/src/test/baseeffecttest.h +++ b/src/test/baseeffecttest.h @@ -74,7 +74,7 @@ class BaseEffectTest : public MixxxTest { void registerTestEffect(EffectManifestPointer pManifest, bool willAddToEngine); - ChannelHandleFactoryPtr m_pChannelHandleFactory; + ChannelHandleFactoryPointer m_pChannelHandleFactory; // Deleted by EffectsManager. Do not delete. TestEffectBackend* m_pTestBackend; diff --git a/src/test/signalpathtest.h b/src/test/signalpathtest.h index 605339dc2cb..883bfcff36b 100644 --- a/src/test/signalpathtest.h +++ b/src/test/signalpathtest.h @@ -38,7 +38,7 @@ class TestEngineMaster : public EngineMaster { TestEngineMaster(UserSettingsPointer _config, const char* group, EffectsManager* pEffectsManager, - ChannelHandleFactoryPtr pChannelHandleFactory, + ChannelHandleFactoryPointer pChannelHandleFactory, bool bEnableSidechain) : EngineMaster(_config, group, @@ -203,7 +203,7 @@ class BaseSignalPathTest : public MixxxTest { m_pEngineMaster->process(kProcessBufferSize); } - ChannelHandleFactoryPtr m_pChannelHandleFactory; + ChannelHandleFactoryPointer m_pChannelHandleFactory; ControlObject* m_pNumDecks; std::unique_ptr m_pGuiTick; VisualsManager* m_pVisualsManager; From b6e7e1c76d659f07af24ea3929abbf8b50923e4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Sun, 17 May 2020 21:50:04 +0200 Subject: [PATCH 10/23] free m_pSidechainMix --- src/engine/enginemaster.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/engine/enginemaster.cpp b/src/engine/enginemaster.cpp index ebb690dc124..033302e0859 100644 --- a/src/engine/enginemaster.cpp +++ b/src/engine/enginemaster.cpp @@ -236,6 +236,7 @@ EngineMaster::~EngineMaster() { SampleUtil::free(m_pBooth); SampleUtil::free(m_pTalkover); SampleUtil::free(m_pTalkoverHeadphones); + SampleUtil::free(m_pSidechainMix); for (int o = EngineChannel::LEFT; o <= EngineChannel::RIGHT; o++) { SampleUtil::free(m_pOutputBusBuffers[o]); } From 9d1721d58a6f55d15a26550dbd4e20b75c92c35f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Sun, 17 May 2020 22:16:21 +0200 Subject: [PATCH 11/23] Add missing g_clear_object(&device); --- src/util/battery/batterylinux.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util/battery/batterylinux.cpp b/src/util/battery/batterylinux.cpp index aa96a510d97..3beee852f82 100644 --- a/src/util/battery/batterylinux.cpp +++ b/src/util/battery/batterylinux.cpp @@ -42,6 +42,7 @@ void BatteryLinux::read() { "time-to-empty", &timeToEmpty, "time-to-full", &timeToFull, NULL); + g_clear_object(&device); if (!isPresent || kind != UP_DEVICE_KIND_BATTERY) { return; From 6872054be1ffced98d1b9d17d63524f2fed49a32 Mon Sep 17 00:00:00 2001 From: ronso0 Date: Fri, 29 May 2020 16:07:27 +0200 Subject: [PATCH 12/23] add Hotcue Shift toggle to LateNight --- res/skins/LateNight/skin_settings.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/res/skins/LateNight/skin_settings.xml b/res/skins/LateNight/skin_settings.xml index fc8ed32112c..5c6b6ef2825 100644 --- a/res/skins/LateNight/skin_settings.xml +++ b/res/skins/LateNight/skin_settings.xml @@ -73,6 +73,13 @@ Description: [Skin],show_intro_outro_cues + + +