Skip to content

Commit

Permalink
Use constants instead of macros
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed Oct 10, 2023
1 parent 4b6e4be commit 1549eda
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/engine/sync/enginesync.cpp
Expand Up @@ -254,7 +254,7 @@ Syncable* EngineSync::pickLeader(Syncable* enabling_syncable) {
}

const SyncLockAlgorithm picker = static_cast<SyncLockAlgorithm>(
m_pConfig->getValue<int>(ConfigKey(BPM_CONFIG_GROUP, SYNC_LOCK_ALGORITHM_CONFIG_KEY),
m_pConfig->getValue<int>(ConfigKey(kBpmConfigGroup, kSyncLockAlorithmConfigKey),
PREFER_SOFT_LEADER));
switch (picker) {
case PREFER_SOFT_LEADER:
Expand Down
6 changes: 4 additions & 2 deletions src/engine/sync/enginesync.h
Expand Up @@ -2,15 +2,17 @@

#include <gtest/gtest_prod.h>

#include <QStrring>

Check failure on line 5 in src/engine/sync/enginesync.h

View workflow job for this annotation

GitHub Actions / clazy

'QStrring' file not found

Check failure on line 5 in src/engine/sync/enginesync.h

View workflow job for this annotation

GitHub Actions / clazy

'QStrring' file not found

Check failure on line 5 in src/engine/sync/enginesync.h

View workflow job for this annotation

GitHub Actions / clazy

'QStrring' file not found

Check failure on line 5 in src/engine/sync/enginesync.h

View workflow job for this annotation

GitHub Actions / clazy

'QStrring' file not found

Check failure on line 5 in src/engine/sync/enginesync.h

View workflow job for this annotation

GitHub Actions / clazy

'QStrring' file not found

Check failure on line 5 in src/engine/sync/enginesync.h

View workflow job for this annotation

GitHub Actions / clazy

'QStrring' file not found

Check failure on line 5 in src/engine/sync/enginesync.h

View workflow job for this annotation

GitHub Actions / clazy

'QStrring' file not found

Check failure on line 5 in src/engine/sync/enginesync.h

View workflow job for this annotation

GitHub Actions / clazy

'QStrring' file not found

Check failure on line 5 in src/engine/sync/enginesync.h

View workflow job for this annotation

GitHub Actions / clang-tidy

'QStrring' file not found [clang-diagnostic-error]

Check failure on line 5 in src/engine/sync/enginesync.h

View workflow job for this annotation

GitHub Actions / clang-tidy

'QStrring' file not found [clang-diagnostic-error]

Check failure on line 5 in src/engine/sync/enginesync.h

View workflow job for this annotation

GitHub Actions / clang-tidy

'QStrring' file not found [clang-diagnostic-error]

Check failure on line 5 in src/engine/sync/enginesync.h

View workflow job for this annotation

GitHub Actions / Ubuntu 22.04 (gcc)

QStrring: No such file or directory

Check failure on line 5 in src/engine/sync/enginesync.h

View workflow job for this annotation

GitHub Actions / coverage

QStrring: No such file or directory

Check failure on line 5 in src/engine/sync/enginesync.h

View workflow job for this annotation

GitHub Actions / coverage

QStrring: No such file or directory

Check failure on line 5 in src/engine/sync/enginesync.h

View workflow job for this annotation

GitHub Actions / coverage

QStrring: No such file or directory

Check failure on line 5 in src/engine/sync/enginesync.h

View workflow job for this annotation

GitHub Actions / coverage

QStrring: No such file or directory

Check failure on line 5 in src/engine/sync/enginesync.h

View workflow job for this annotation

GitHub Actions / coverage

QStrring: No such file or directory

Check failure on line 5 in src/engine/sync/enginesync.h

View workflow job for this annotation

GitHub Actions / coverage

QStrring: No such file or directory

Check failure on line 5 in src/engine/sync/enginesync.h

View workflow job for this annotation

GitHub Actions / coverage

QStrring: No such file or directory

Check failure on line 5 in src/engine/sync/enginesync.h

View workflow job for this annotation

GitHub Actions / coverage

QStrring: No such file or directory

Check failure on line 5 in src/engine/sync/enginesync.h

View workflow job for this annotation

GitHub Actions / Ubuntu 22.04 (Qt 6.2, gcc)

QStrring: No such file or directory

#include "audio/types.h"
#include "engine/sync/syncable.h"
#include "preferences/usersettings.h"

class InternalClock;
class EngineChannel;

#define BPM_CONFIG_GROUP "[BPM]"
#define SYNC_LOCK_ALGORITHM_CONFIG_KEY "sync_lock_algorithm"
const QString kBpmConfigGroup = QStringLiteral("[BPM]");
const QString kSyncLockAlgorithmConfigKey = QStringLiteral("sync_lock_algorithm");

/// EngineSync is the heart of the Mixxx Sync Lock engine. It knows which objects
/// (Decks, Internal Clock, etc) are participating in Sync and what their statuses
Expand Down
6 changes: 3 additions & 3 deletions src/preferences/dialog/dlgprefdeck.cpp
Expand Up @@ -466,7 +466,7 @@ void DlgPrefDeck::slotUpdate() {

const EngineSync::SyncLockAlgorithm syncLockAlgorithm =
static_cast<EngineSync::SyncLockAlgorithm>(m_pConfig->getValue<int>(
ConfigKey(BPM_CONFIG_GROUP, SYNC_LOCK_ALGORITHM_CONFIG_KEY),
ConfigKey(kBpmConfigGroup, kSyncLockAlgorithmConfigKey),
EngineSync::SyncLockAlgorithm::PREFER_SOFT_LEADER));
if (syncLockAlgorithm == EngineSync::SyncLockAlgorithm::PREFER_SOFT_LEADER) {
radioButtonSoftLeader->setChecked(true);
Expand Down Expand Up @@ -741,10 +741,10 @@ void DlgPrefDeck::slotApply() {
ConfigValue(configSPAutoReset));

if (radioButtonSoftLeader->isChecked()) {
m_pConfig->setValue(ConfigKey(BPM_CONFIG_GROUP, SYNC_LOCK_ALGORITHM_CONFIG_KEY),
m_pConfig->setValue(ConfigKey(kBpmConfigGroup, kSyncLockAlgorithmConfigKey),
static_cast<int>(EngineSync::SyncLockAlgorithm::PREFER_SOFT_LEADER));
} else {
m_pConfig->setValue(ConfigKey(BPM_CONFIG_GROUP, SYNC_LOCK_ALGORITHM_CONFIG_KEY),
m_pConfig->setValue(ConfigKey(kBpmConfigGroup, kSyncLockAlgorithmConfigKey),
static_cast<int>(EngineSync::SyncLockAlgorithm::PREFER_LOCK_BPM));
}

Expand Down

0 comments on commit 1549eda

Please sign in to comment.