Skip to content

Commit

Permalink
Merge branch '2.4' of github.com:mixxxdj/mixxx
Browse files Browse the repository at this point in the history
  • Loading branch information
Holzhaus committed Sep 13, 2023
2 parents 89d215f + 3512199 commit 8963e08
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 34 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
..
working-directory: build
- name: Set up problem matcher
uses: ammaraskar/gcc-problem-matcher@master
uses: ammaraskar/gcc-problem-matcher@0.2.0
- name: Build
# Do not abort on errors and build/check the whole project
run: cmake --build . -j $(nproc) -- --keep-going
Expand Down Expand Up @@ -149,7 +149,7 @@ jobs:
- name: "Upload Coverage Report to coveralls.io"
if: matrix.name == 'coverage'
continue-on-error: true
uses: coverallsapp/github-action@master
uses: coverallsapp/github-action@v2.2.3
with:
flag-name: ubuntu-22.04
path-to-lcov: build/lcov.info
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ jobs:
WINDOWS_CODESIGN_SECURE_FILE_SECRET: ${{ secrets.WINDOWS_CODESIGN_SECURE_FILE_SECRET }}
if: runner.os == 'Windows' && env.WINDOWS_CODESIGN_SECURE_FILE_SALT != null && env.WINDOWS_CODESIGN_SECURE_FILE_SECRET != null
run: |
iex ((New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/appveyor/secure-file/master/install.ps1'))
iex ((New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/appveyor/secure-file/fc44f5c5f2fb184fe738814f373c16cb69c30929/install.ps1'))
appveyor-tools/secure-file -decrypt "$Env:WINDOWS_CODESIGN_CERTIFICATE_PATH.enc" -secret "$Env:WINDOWS_CODESIGN_SECURE_FILE_SECRET" -salt "$Env:WINDOWS_CODESIGN_SECURE_FILE_SALT"
Add-Content -Path "$Env:GITHUB_ENV" -Value "WINDOWS_CODESIGN_CERTIFICATE_PATH=$Env:WINDOWS_CODESIGN_CERTIFICATE_PATH"
Add-Content -Path "$Env:GITHUB_ENV" -Value "WINDOWS_CODESIGN_CERTIFICATE_PASSWORD=$Env:WINDOWS_CODESIGN_CERTIFICATE_PASSWORD"
Expand Down Expand Up @@ -302,11 +302,11 @@ jobs:

- name: "[Ubuntu/macOS] Set up gcc/clang problem matcher"
if: runner.os != 'Windows'
uses: ammaraskar/gcc-problem-matcher@master
uses: ammaraskar/gcc-problem-matcher@0.2.0

- name: "[Windows] Set up MSVC problem matcher"
if: runner.os == 'Windows'
uses: ammaraskar/msvc-problem-matcher@master
uses: ammaraskar/msvc-problem-matcher@0.2.0

- name: "Build"
run: cmake --build . --config RelWithDebInfo
Expand Down
4 changes: 4 additions & 0 deletions src/control/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ void ControlDoublePrivate::setUserConfig(const UserSettingsPointer& pConfig) {
// static
void ControlDoublePrivate::insertAlias(const ConfigKey& alias, const ConfigKey& key) {
MMutexLocker locker(&s_qCOHashMutex);
VERIFY_OR_DEBUG_ASSERT(alias != key) {
qWarning() << "cannot create alias with identical key" << key;
return;
}

auto it = s_qCOHash.constFind(key);
VERIFY_OR_DEBUG_ASSERT(it != s_qCOHash.constEnd()) {
Expand Down
4 changes: 4 additions & 0 deletions src/control/controlobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ class ControlObject : public QObject {
return m_pControl ? m_pControl->getKbdRepeatable() : false;
}

void addAlias(const ConfigKey& aliasKey) const {
ControlDoublePrivate::insertAlias(aliasKey, m_key);
}

// Return the key of the object
inline ConfigKey getKey() const {
return m_key;
Expand Down
9 changes: 3 additions & 6 deletions src/effects/effectchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,15 @@ EffectChain::EffectChain(const QString& group,
&ControlObject::valueChanged,
this,
&EffectChain::slotControlNextChainPreset);
ControlDoublePrivate::insertAlias(ConfigKey(m_group, "next_chain"),
ConfigKey(m_group, "next_chain_preset"));
m_pControlNextChainPreset->addAlias(ConfigKey(m_group, QStringLiteral("next_chain")));

m_pControlPrevChainPreset = std::make_unique<ControlPushButton>(
ConfigKey(m_group, "prev_chain_preset"));
connect(m_pControlPrevChainPreset.get(),
&ControlObject::valueChanged,
this,
&EffectChain::slotControlPrevChainPreset);
ControlDoublePrivate::insertAlias(ConfigKey(m_group, "prev_chain"),
ConfigKey(m_group, "prev_chain_preset"));
m_pControlPrevChainPreset->addAlias(ConfigKey(m_group, QStringLiteral("prev_chain")));

// Ignoring no-ops is important since this is for +/- tickers.
m_pControlChainPresetSelector = std::make_unique<ControlEncoder>(
Expand All @@ -127,8 +125,7 @@ EffectChain::EffectChain(const QString& group,
&ControlObject::valueChanged,
this,
&EffectChain::slotControlChainPresetSelector);
ControlDoublePrivate::insertAlias(ConfigKey(m_group, "chain_selector"),
ConfigKey(m_group, "chain_preset_selector"));
m_pControlChainPresetSelector->addAlias(ConfigKey(m_group, QStringLiteral("chain_selector")));

// ControlObjects for skin <-> controller mapping interaction.
// Refer to comment in header for full explanation.
Expand Down
3 changes: 1 addition & 2 deletions src/engine/channels/engineaux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ EngineAux::EngineAux(const ChannelHandleAndGroup& handleGroup, EffectsManager* p
m_pPregain(new ControlAudioTaperPot(ConfigKey(getGroup(), "pregain"), -12, 12, 0.5)) {
// Make input_configured read-only.
m_pInputConfigured->setReadOnly();
ControlDoublePrivate::insertAlias(ConfigKey(getGroup(), "enabled"),
ConfigKey(getGroup(), "input_configured"));
m_pInputConfigured->addAlias(ConfigKey(getGroup(), QStringLiteral("enabled")));

// by default Aux is disabled on the main and disabled on PFL. User
// can over-ride by setting the "pfl" or "main_mix" controls.
Expand Down
3 changes: 1 addition & 2 deletions src/engine/channels/enginechannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ EngineChannel::EngineChannel(const ChannelHandleAndGroup& handleGroup,
m_pPFL->setButtonMode(ControlPushButton::TOGGLE);
m_pMainMix = new ControlPushButton(ConfigKey(getGroup(), "main_mix"));
m_pMainMix->setButtonMode(ControlPushButton::POWERWINDOW);
ControlDoublePrivate::insertAlias(
ConfigKey(getGroup(), "master"), ConfigKey(getGroup(), "main_mix"));
m_pMainMix->addAlias(ConfigKey(getGroup(), QStringLiteral("master")));
m_pOrientation = new ControlPushButton(ConfigKey(getGroup(), "orientation"));
m_pOrientation->setButtonMode(ControlPushButton::TOGGLE);
m_pOrientation->setStates(3);
Expand Down
3 changes: 1 addition & 2 deletions src/engine/channels/enginemicrophone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ EngineMicrophone::EngineMicrophone(const ChannelHandleAndGroup& handleGroup,
m_pPregain(new ControlAudioTaperPot(ConfigKey(getGroup(), "pregain"), -12, 12, 0.5)) {
// Make input_configured read-only.
m_pInputConfigured->setReadOnly();
ControlDoublePrivate::insertAlias(ConfigKey(getGroup(), "enabled"),
ConfigKey(getGroup(), "input_configured"));
m_pInputConfigured->addAlias(ConfigKey(getGroup(), QStringLiteral("enabled")));

setMainMix(false); // Use "talkover" button to enable microphones
}
Expand Down
3 changes: 1 addition & 2 deletions src/engine/controls/cuecontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2447,8 +2447,7 @@ HotcueControl::HotcueControl(const QString& group, int hotcueIndex)
m_pHotcueStatus->setReadOnly();

// Add an alias for the legacy hotcue_X_enabled CO
ControlDoublePrivate::insertAlias(keyForControl(QStringLiteral("enabled")),
keyForControl(QStringLiteral("status")));
m_pHotcueStatus->addAlias(keyForControl(QStringLiteral("enabled")));

m_hotcueType = std::make_unique<ControlObject>(keyForControl(QStringLiteral("type")));
m_hotcueType->setReadOnly();
Expand Down
3 changes: 1 addition & 2 deletions src/engine/controls/loopingcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ LoopingControl::LoopingControl(const QString& group,
Qt::DirectConnection);
m_pReloopToggleButton->set(0);
// The old reloop_exit name was confusing. This CO does both entering and exiting.
ControlDoublePrivate::insertAlias(ConfigKey(group, "reloop_exit"),
ConfigKey(group, "reloop_toggle"));
m_pReloopToggleButton->addAlias(ConfigKey(group, QStringLiteral("reloop_exit")));

m_pReloopAndStopButton = new ControlPushButton(ConfigKey(group, "reloop_andstop"));
connect(m_pReloopAndStopButton, &ControlObject::valueChanged,
Expand Down
1 change: 0 additions & 1 deletion src/engine/enginebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1389,7 +1389,6 @@ mixxx::audio::FramePos EngineBuffer::queuedSeekPosition() const {
void EngineBuffer::updateIndicators(double speed, int iBufferSize) {
if (!m_playPos.isValid() ||
!m_trackSampleRateOld.isValid() ||
m_tempo_ratio_old == 0 ||
m_pPassthroughEnabled->toBool()) {
// Skip indicator updates with invalid values to prevent undefined behavior,
// e.g. in WaveformRenderBeat::draw().
Expand Down
6 changes: 2 additions & 4 deletions src/engine/enginemixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ EngineMixer::EngineMixer(

// Legacy: the main "gain" control used to be named "volume" in Mixxx
// 1.11.0 and earlier. See issue #7413.
ControlDoublePrivate::insertAlias(ConfigKey(group, "volume"),
ConfigKey(group, "gain"));
m_pMainGain->addAlias(ConfigKey(group, QStringLiteral("volume")));

// VU meter:
m_pVumeter = new EngineVuMeter(group);
Expand All @@ -119,8 +118,7 @@ EngineMixer::EngineMixer(

// Legacy: the headphone "headGain" control used to be named "headVolume" in
// Mixxx 1.11.0 and earlier. See issue #7413.
ControlDoublePrivate::insertAlias(ConfigKey(group, "headVolume"),
ConfigKey(group, "headGain"));
m_pHeadGain->addAlias(ConfigKey(group, QStringLiteral("headVolume")));

// Headphone mix (left/right)
m_pHeadMix = new ControlPotmeter(ConfigKey(group, "headMix"),-1.,1.);
Expand Down
3 changes: 1 addition & 2 deletions src/engine/sync/internalclock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ InternalClock::InternalClock(const QString& group, SyncableListener* pEngineSync
m_pSyncLeaderEnabled->setStates(3);
m_pSyncLeaderEnabled->connectValueChangeRequest(
this, &InternalClock::slotSyncLeaderEnabledChangeRequest, Qt::DirectConnection);
ControlDoublePrivate::insertAlias(ConfigKey(m_group, "sync_master"),
ConfigKey(m_group, "sync_leader"));
m_pSyncLeaderEnabled->addAlias(ConfigKey(m_group, QStringLiteral("sync_master")));
}

InternalClock::~InternalClock() {
Expand Down
3 changes: 1 addition & 2 deletions src/engine/sync/synccontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ SyncControl::SyncControl(const QString& group,
m_pSyncLeaderEnabled->setStates(3);
m_pSyncLeaderEnabled->connectValueChangeRequest(
this, &SyncControl::slotSyncLeaderEnabledChangeRequest, Qt::DirectConnection);
ControlDoublePrivate::insertAlias(ConfigKey(group, "sync_master"),
ConfigKey(group, "sync_leader"));
m_pSyncLeaderEnabled->addAlias(ConfigKey(group, QStringLiteral("sync_master")));

m_pSyncEnabled.reset(
new ControlPushButton(ConfigKey(group, "sync_enabled")));
Expand Down
7 changes: 4 additions & 3 deletions src/library/librarycontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ LibraryControl::LibraryControl(Library* pLibrary)

// Auto DJ controls
m_pAutoDjAddTop = std::make_unique<ControlPushButton>(ConfigKey("[Library]","AutoDjAddTop"));
m_pAutoDjAddTop->addAlias(ConfigKey(
QStringLiteral("[Playlist]"), QStringLiteral("AutoDjAddTop")));
#ifndef MIXXX_USE_QML
connect(m_pAutoDjAddTop.get(),
&ControlPushButton::valueChanged,
Expand All @@ -203,6 +205,8 @@ LibraryControl::LibraryControl(Library* pLibrary)
#endif

m_pAutoDjAddBottom = std::make_unique<ControlPushButton>(ConfigKey("[Library]","AutoDjAddBottom"));
m_pAutoDjAddBottom->addAlias(ConfigKey(
QStringLiteral("[Playlist]"), QStringLiteral("AutoDjAddBottom")));
#ifndef MIXXX_USE_QML
connect(m_pAutoDjAddBottom.get(),
&ControlPushButton::valueChanged,
Expand Down Expand Up @@ -414,9 +418,6 @@ LibraryControl::LibraryControl(Library* pLibrary)
this,
&LibraryControl::slotLoadSelectedIntoFirstStopped);

ControlDoublePrivate::insertAlias(ConfigKey("[Playlist]", "AutoDjAddTop"), ConfigKey("[Library]", "AutoDjAddTop"));
ControlDoublePrivate::insertAlias(ConfigKey("[Playlist]", "AutoDjAddBottom"), ConfigKey("[Library]", "AutoDjAddBottom"));

#ifndef MIXXX_USE_QML
QApplication* app = qApp;
// Update controls if any widget in any Mixxx window gets or loses focus
Expand Down
2 changes: 1 addition & 1 deletion src/test/controlobjecttest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ TEST_F(ControlObjectTest, AliasRetrieval) {
auto co = std::make_unique<ControlObject>(ck);

// Insert the alias before it is going to be used
ControlDoublePrivate::insertAlias(ckAlias, ck);
co->addAlias(ckAlias);

// Check if getControl on alias returns us the original ControlObject
EXPECT_EQ(ControlObject::getControl(ckAlias), co.get());
Expand Down

0 comments on commit 8963e08

Please sign in to comment.