Skip to content

Commit

Permalink
Merge branch '2.3' of [email protected]:mixxxdj/mixxx.git
Browse files Browse the repository at this point in the history
  • Loading branch information
uklotzde committed Jun 1, 2020
2 parents 19ae645 + 80f1c2d commit 22f9f20
Show file tree
Hide file tree
Showing 38 changed files with 1,294 additions and 1,212 deletions.
888 changes: 470 additions & 418 deletions res/controllers/Denon-MC6000MK2-scripts.js

Large diffs are not rendered by default.

108 changes: 54 additions & 54 deletions res/controllers/Denon-MC6000MK2.midi.xml

Large diffs are not rendered by default.

1,285 changes: 642 additions & 643 deletions res/controllers/Numark-N4-scripts.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions res/skins/LateNight/skin_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ Description:
<SetVariable name="Setting">[Skin],show_intro_outro_cues</SetVariable>
</Template>

<!-- Cue shift buttons in beatgrid editing section -->
<Template src="skin:skin_settings_button_2state.xml">
<SetVariable name="TooltipId">show_intro_outro_cues</SetVariable>
<SetVariable name="Text">Hotcue Shift Buttons</SetVariable>
<SetVariable name="Setting">[Skin],timing_shift_buttons</SetVariable>
</Template>

<!-- Rate Control toggle -->
<Template src="skin:skin_settings_button_2state.xml">
<SetVariable name="TooltipId">rate_toggle</SetVariable>
Expand Down
2 changes: 1 addition & 1 deletion src/analyzer/analyzerebur128.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class AnalyzerEbur128 : public Analyzer {
public:
AnalyzerEbur128(UserSettingsPointer pConfig);
virtual ~AnalyzerEbur128();
~AnalyzerEbur128() override;

static bool isEnabled(const ReplayGainSettings& rgSettings) {
return rgSettings.isAnalyzerEnabled(2);
Expand Down
2 changes: 1 addition & 1 deletion src/analyzer/analyzergain.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ReplayGain;
class AnalyzerGain : public Analyzer {
public:
AnalyzerGain(UserSettingsPointer pConfig);
virtual ~AnalyzerGain();
~AnalyzerGain() override;

static bool isEnabled(const ReplayGainSettings& rgSettings) {
return rgSettings.isAnalyzerEnabled(1);
Expand Down
6 changes: 3 additions & 3 deletions src/effects/effectsmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
ChannelHandleFactoryPointer pChannelHandleFactory)
: QObject(pParent),
m_pChannelHandleFactory(pChannelHandleFactory),
m_pEffectChainManager(new EffectChainManager(pConfig, this)),
Expand Down
9 changes: 5 additions & 4 deletions src/effects/effectsmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
ChannelHandleFactoryPointer pChannelHandleFactory);
virtual ~EffectsManager();

EngineEffectsManager* getEngineEffectsManager() {
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -120,7 +121,7 @@ class EffectsManager : public QObject {
void processEffectsResponses();
void collectGarbage(const EffectsRequest* pResponse);

ChannelHandleFactory* m_pChannelHandleFactory;
ChannelHandleFactoryPointer m_pChannelHandleFactory;

EffectChainManager* m_pEffectChainManager;
QList<EffectsBackend*> m_effectsBackends;
Expand Down
5 changes: 4 additions & 1 deletion src/engine/channelhandle.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
// A helper class, ChannelHandleFactory, keeps a running count of handles that
// have been assigned.

#include <QtDebug>
#include <QHash>
#include <QString>
#include <QVarLengthArray>
#include <QtDebug>
#include <memory>

#include "util/assert.h"

Expand Down Expand Up @@ -147,6 +148,8 @@ class ChannelHandleFactory {
QHash<ChannelHandle, QString> m_handleToGroup;
};

typedef std::shared_ptr<ChannelHandleFactory> ChannelHandleFactoryPointer;

// 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
Expand Down
9 changes: 5 additions & 4 deletions src/engine/enginemaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
ChannelHandleFactoryPointer pChannelHandleFactory,
bool bEnableSidechain)
: m_pChannelHandleFactory(pChannelHandleFactory),
m_pEngineEffectsManager(pEffectsManager ? pEffectsManager->getEngineEffectsManager() : NULL),
m_masterGainOld(0.0),
Expand Down Expand Up @@ -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]);
}
Expand Down
10 changes: 5 additions & 5 deletions src/engine/enginemaster.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
ChannelHandleFactoryPointer pChannelHandleFactory,
bool bEnableSidechain);
virtual ~EngineMaster();

// Get access to the sample buffers. None of these are thread safe. Only to
Expand Down Expand Up @@ -270,7 +270,7 @@ class EngineMaster : public QObject, public AudioSource {
// respective output.
void processChannels(int iBufferSize);

ChannelHandleFactory* m_pChannelHandleFactory;
ChannelHandleFactoryPointer m_pChannelHandleFactory;
void applyMasterEffects();
void processHeadphones(const double masterMixGainInHeadphones);
bool sidechainMixRequired() const;
Expand Down
2 changes: 1 addition & 1 deletion src/engine/sidechain/enginesidechain.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class EngineSideChain : public QThread, public AudioDestination {
Q_OBJECT
public:
EngineSideChain(UserSettingsPointer pConfig, CSAMPLE* sidechainMix);
virtual ~EngineSideChain();
~EngineSideChain() override;

// Not thread-safe, wait-free. Submit buffer of samples to the sidechain for
// processing. Should only be called from a single writer thread (typically
Expand Down
3 changes: 0 additions & 3 deletions src/engine/sidechain/networkinputstreamworker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
NetworkInputStreamWorker::NetworkInputStreamWorker() {
}

NetworkInputStreamWorker::~NetworkInputStreamWorker() {
}

void NetworkInputStreamWorker::setSourceFifo(FIFO<CSAMPLE>* pFifo) {
(void)pFifo;
}
2 changes: 1 addition & 1 deletion src/engine/sidechain/networkinputstreamworker.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class NetworkInputStreamWorker {
public:
NetworkInputStreamWorker();
virtual ~NetworkInputStreamWorker();
virtual ~NetworkInputStreamWorker() = default;

void setSourceFifo(FIFO<CSAMPLE>* pFifo);
};
Expand Down
3 changes: 0 additions & 3 deletions src/engine/sidechain/networkoutputstreamworker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ NetworkOutputStreamWorker::NetworkOutputStreamWorker()
m_outputDrift(false) {
}

NetworkOutputStreamWorker::~NetworkOutputStreamWorker() {
}

void NetworkOutputStreamWorker::outputAvailable() {
}

Expand Down
2 changes: 1 addition & 1 deletion src/engine/sidechain/networkoutputstreamworker.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ enum NetworkOutputStreamWorkerStates {
class NetworkOutputStreamWorker {
public:
NetworkOutputStreamWorker();
virtual ~NetworkOutputStreamWorker();
virtual ~NetworkOutputStreamWorker() = default;

virtual void process(const CSAMPLE* pBuffer, const int iBufferSize) = 0;
virtual void shutdown() = 0;
Expand Down
3 changes: 1 addition & 2 deletions src/engine/sidechain/shoutconnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ShoutConnection
Q_OBJECT
public:
ShoutConnection(BroadcastProfilePtr profile, UserSettingsPointer pConfig);
virtual ~ShoutConnection();
~ShoutConnection() override;

// This is called by the Engine implementation for each sample. Encode and
// send the stream, as well as check for metadata changes.
Expand Down Expand Up @@ -167,4 +167,3 @@ class ShoutConnection
typedef QSharedPointer<ShoutConnection> ShoutConnectionPtr;

#endif // ENGINE_SIDECHAIN_SHOUTCONNECTION_H

2 changes: 1 addition & 1 deletion src/engine/sidechain/sidechainworker.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class SideChainWorker {
public:
SideChainWorker() { }
virtual ~SideChainWorker() { }
virtual ~SideChainWorker() = default;
virtual void process(const CSAMPLE* pBuffer, const int iBufferSize) = 0;
virtual void shutdown() = 0;
};
Expand Down
3 changes: 3 additions & 0 deletions src/engine/sync/synccontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}

Expand Down
2 changes: 1 addition & 1 deletion src/errordialoghandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class ErrorDialogHandler : public QObject {
}
static void setEnabled(bool enabled);

virtual ~ErrorDialogHandler();
~ErrorDialogHandler() override;
// Call this to get a new instance of ErrorDialogProperties to populate with
// data
ErrorDialogProperties* newDialogProperties();
Expand Down
19 changes: 11 additions & 8 deletions src/mixxx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -252,12 +250,18 @@ void MixxxMainWindow::initialize(QApplication* pApp, const CmdlineArgs& args) {
exit(-1);
}

auto pChannelHandleFactory = std::make_shared<ChannelHandleFactory>();

// 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.
Expand Down Expand Up @@ -850,7 +854,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
Expand Down Expand Up @@ -1094,8 +1098,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<WMainMenuBar>(this, m_pSettingsManager->settings(), m_pKbdConfig);
setMenuBar(m_pMenuBar);
}

Expand Down
4 changes: 1 addition & 3 deletions src/mixxx.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,6 @@ class MixxxMainWindow : public QMainWindow {

SettingsManager* m_pSettingsManager;

ChannelHandleFactory* m_pChannelHandleFactory;

// The effects processing system
EffectsManager* m_pEffectsManager;

Expand Down Expand Up @@ -183,7 +181,7 @@ class MixxxMainWindow : public QMainWindow {
// The library management object
Library* m_pLibrary;

WMainMenuBar* m_pMenuBar;
parented_ptr<WMainMenuBar> m_pMenuBar;

DlgDeveloperTools* m_pDeveloperToolsDlg;

Expand Down
12 changes: 6 additions & 6 deletions src/preferences/dialog/dlgprefinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ DlgPrefInterface::DlgPrefInterface(QWidget * parent, MixxxMainWindow * mixxx,
// Screensaver mode
//
comboBoxScreensaver->clear();
comboBoxScreensaver->addItem(tr("Allow screensaver to run"),
static_cast<int>(mixxx::ScreenSaverPreference::PREVENT_OFF));
comboBoxScreensaver->addItem(tr("Prevent screensaver from running"),
static_cast<int>(mixxx::ScreenSaverPreference::PREVENT_ON));
comboBoxScreensaver->addItem(tr("Prevent screensaver while playing"),
static_cast<int>(mixxx::ScreenSaverPreference::PREVENT_ON_PLAY));
comboBoxScreensaver->addItem(tr("Allow screensaver to run"),
static_cast<int>(mixxx::ScreenSaverPreference::PREVENT_OFF));
comboBoxScreensaver->addItem(tr("Prevent screensaver from running"),
static_cast<int>(mixxx::ScreenSaverPreference::PREVENT_ON));
comboBoxScreensaver->addItem(tr("Prevent screensaver while playing"),
static_cast<int>(mixxx::ScreenSaverPreference::PREVENT_ON_PLAY));

int inhibitsettings = static_cast<int>(mixxx->getInhibitScreensaver());
comboBoxScreensaver->setCurrentIndex(comboBoxScreensaver->findData(inhibitsettings));
Expand Down
8 changes: 7 additions & 1 deletion src/skin/colorschemeparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ void ColorSchemeParser::setupLegacyColorSchemes(QDomElement docElem,
}
}

if (!bSelectedColorSchemeFound) {
// If we didn't find a matching color scheme, pick the first one
schemeNode = schemesNode.firstChild();
bSelectedColorSchemeFound = !schemeNode.isNull();
}

if (bSelectedColorSchemeFound) {
QSharedPointer<ImgSource> imsrc =
QSharedPointer<ImgSource>(parseFilters(schemeNode.namedItem("Filters")));
Expand All @@ -50,12 +56,12 @@ void ColorSchemeParser::setupLegacyColorSchemes(QDomElement docElem,
// iterates over all <SetVariable> nodes in the selected color scheme node
pContext->updateVariables(schemeNode);


if (pStyle) {
*pStyle = LegacySkinParser::getStyleFromNode(schemeNode);
}
}
}

if (!bSelectedColorSchemeFound) {
QSharedPointer<ImgSource> imsrc =
QSharedPointer<ImgSource>(new ImgLoader());
Expand Down
20 changes: 11 additions & 9 deletions src/skin/legacyskinparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,19 +230,21 @@ QDomElement LegacySkinParser::openSkin(const QString& skinPath) {
QList<QString> LegacySkinParser::getSchemeList(const QString& qSkinPath) {

QDomElement docElem = openSkin(qSkinPath);
QList<QString> schlist;
QList<QString> schemeList;

QDomNode colsch = docElem.namedItem("Schemes");
if (!colsch.isNull() && colsch.isElement()) {
QDomNode sch = colsch.firstChild();
QDomNode colScheme = docElem.namedItem("Schemes");
if (!colScheme.isNull() && colScheme.isElement()) {
QDomNode scheme = colScheme.firstChild();

while (!sch.isNull()) {
QString thisname = XmlParse::selectNodeQString(sch, "Name");
schlist.append(thisname);
sch = sch.nextSibling();
while (!scheme.isNull()) {
if (scheme.isElement()) {
QString schemeName = XmlParse::selectNodeQString(scheme, "Name");
schemeList.append(schemeName);
}
scheme = scheme.nextSibling();
}
}
return schlist;
return schemeList;
}

// static
Expand Down
Loading

0 comments on commit 22f9f20

Please sign in to comment.