Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1553,7 +1553,6 @@ add_library(
src/util/color/color.cpp
src/util/color/colorpalette.cpp
src/util/color/predefinedcolorpalettes.cpp
src/util/colorcomponents.cpp
src/util/console.cpp
src/util/db/dbconnection.cpp
src/util/db/dbconnectionpool.cpp
Expand Down Expand Up @@ -1785,10 +1784,6 @@ set(
src/util/color/colorpalette.h
src/util/color/predefinedcolorpalettes.h
src/util/color/rgbcolor.h
src/util/colorcomponents.h
src/util/compatibility/qatomic.h
src/util/compatibility/qbytearray.h
src/util/compatibility/qhash.h
src/util/compatibility/qmutex.h
src/util/console.h
src/util/counter.h
Expand Down
7 changes: 3 additions & 4 deletions src/audio/frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <limits>

#include "engine/engine.h"
#include "util/compatibility/qhash.h"
#include "util/fpclassify.h"

namespace mixxx {
Expand Down Expand Up @@ -248,10 +247,10 @@ inline bool operator!=(FramePos frame1, FramePos frame2) {

QDebug operator<<(QDebug dbg, FramePos arg);

inline qhash_seed_t qHash(
inline size_t qHash(
FramePos pos,
qhash_seed_t seed = 0) {
return static_cast<qhash_seed_t>(pos.value(), seed);
size_t seed = 0) {
return static_cast<size_t>(pos.value(), seed);
}

constexpr FramePos kInvalidFramePos = FramePos(FramePos::kInvalidValue);
Expand Down
4 changes: 0 additions & 4 deletions src/controllers/controllermappingtablemodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,7 @@ class ControllerMappingTableModel : public QAbstractTableModel {
VERIFY_OR_DEBUG_ASSERT(m_pTableView) {
return nullptr;
}
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
return qobject_cast<QStyledItemDelegate*>(m_pTableView->itemDelegateForIndex(index));
#else
return qobject_cast<QStyledItemDelegate*>(m_pTableView->itemDelegate(index));
#endif
}

QVector<QHash<int, QVariant>> m_headerInfo;
Expand Down
3 changes: 1 addition & 2 deletions src/controllers/hid/hidiooutputreport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <hidapi.h>

#include "util/cmdlineargs.h"
#include "util/compatibility/qbytearray.h"
#include "util/runtimeloggingcategory.h"
#include "util/string.h"
#include "util/time.h"
Expand Down Expand Up @@ -66,7 +65,7 @@ void HidIoOutputReport::updateCachedData(const QByteArray& data,

// Deep copy with reusing the already allocated heap memory
// The first byte with the ReportID is not overwritten
qByteArrayReplaceWithPositionAndSize(&m_cachedData,
m_cachedData.replace(
kReportIdSize,
m_cachedData.size(),
data.constData(),
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/midi/midimessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ QDebug operator<<(QDebug debug, MidiOpCode midiOpCode) {
return debug;
}

qhash_seed_t qHash(MidiOpCode key, qhash_seed_t seed) {
size_t qHash(MidiOpCode key, size_t seed) {
return qHash(static_cast<uint8_t>(key), seed);
}

Expand Down
3 changes: 1 addition & 2 deletions src/controllers/midi/midimessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

#include "preferences/usersettings.h"
#include "util/always_false_v.h"
#include "util/compatibility/qhash.h"

// The second value of each OpCode will be the channel number the message
// corresponds to. So 0xB0 is a CC on the first channel, and 0xB1 is a CC
Expand Down Expand Up @@ -102,7 +101,7 @@ enum class MidiOpCode : uint8_t {
SystemReset = 0xFF,
};
QDebug operator<<(QDebug debug, MidiOpCode midiOpCode);
qhash_seed_t qHash(MidiOpCode key, qhash_seed_t seed);
size_t qHash(MidiOpCode key, size_t seed);

enum class MidiOption : uint16_t {
None = 0x0000,
Expand Down
58 changes: 1 addition & 57 deletions src/coreservices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,6 @@
#include <X11/XKBlib.h>
#endif

#if defined(Q_OS_LINUX) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <X11/Xlibint.h>
#include <QtX11Extras/QX11Info>

#include "engine/channelhandle.h"
// Xlibint.h predates C++ and defines macros which conflict
// with references to std::max and std::min
#undef max
#undef min
#endif

namespace {
const mixxx::Logger kLogger("CoreServices");
constexpr int kMicrophoneCount = 4;
Expand All @@ -100,28 +89,6 @@ void clearHelper(std::shared_ptr<T>& ref_ptr, const char* name) {
}
}

// hack around https://gitlab.freedesktop.org/xorg/lib/libx11/issues/25
// https://github.com/mixxxdj/mixxx/issues/9533
#if defined(Q_OS_LINUX) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
typedef Bool (*WireToErrorType)(Display*, XErrorEvent*, xError*);

constexpr int NUM_HANDLERS = 256;
WireToErrorType __oldHandlers[NUM_HANDLERS] = {nullptr};

Bool __xErrorHandler(Display* display, XErrorEvent* event, xError* error) {
// Call any previous handler first in case it needs to do real work.
auto code = static_cast<int>(event->error_code);
if (__oldHandlers[code] != nullptr) {
__oldHandlers[code](display, event, error);
}

// Always return false so the error does not get passed to the normal
// application defined handler.
return False;
}

#endif

#if defined(Q_OS_LINUX)
QLocale localeFromXkbSymbol(const QString& xkbLayout) {
// This maps XKB layouts to locales of keyboard mappings that are shipped with Mixxx
Expand Down Expand Up @@ -455,7 +422,7 @@ void CoreServices::initializeLogging() {
logFlags);
}

void CoreServices::initialize(QApplication* pApp) {
void CoreServices::initialize() {
VERIFY_OR_DEBUG_ASSERT(!m_isInitialized) {
return;
}
Expand All @@ -469,17 +436,6 @@ void CoreServices::initialize(QApplication* pApp) {

VersionStore::logBuildDetails();

#if defined(Q_OS_LINUX) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
// XESetWireToError will segfault if running as a Wayland client
if (pApp->platformName() == QLatin1String("xcb")) {
for (auto i = 0; i < NUM_HANDLERS; ++i) {
XESetWireToError(QX11Info::display(), i, &__xErrorHandler);
}
}
#else
Q_UNUSED(pApp);
#endif

UserSettingsPointer pConfig = m_pSettingsManager->settings();

Sandbox::setPermissionsFilePath(QDir(pConfig->getSettingsPath()).filePath("sandbox.cfg"));
Expand Down Expand Up @@ -663,31 +619,19 @@ void CoreServices::initialize(QApplication* pApp) {
pConfig->getValueString(
ConfigKey("[Library]", "SupportedFileExtensions"))
.split(',',
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
Qt::SkipEmptyParts);
#else
QString::SkipEmptyParts);
#endif

// TODO: QSet<T>::fromList(const QList<T>&) is deprecated and should be
// replaced with QSet<T>(list.begin(), list.end()).
// However, the proposed alternative has just been introduced in Qt
// 5.14. Until the minimum required Qt version of Mixxx is increased,
// we need a version check here
QSet<QString> prev_plugins =
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
QSet<QString>(prev_plugins_list.begin(), prev_plugins_list.end());
#else
QSet<QString>::fromList(prev_plugins_list);
#endif

const QList<QString> supportedFileSuffixes = SoundSourceProxy::getSupportedFileSuffixes();
auto curr_plugins =
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
QSet<QString>(supportedFileSuffixes.begin(), supportedFileSuffixes.end());
#else
QSet<QString>::fromList(supportedFileSuffixes);
#endif

rescan = rescan || (prev_plugins != curr_plugins);
pConfig->set(ConfigKey("[Library]", "SupportedFileExtensions"),
Expand Down
2 changes: 1 addition & 1 deletion src/coreservices.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class CoreServices : public QObject {
~CoreServices();

/// The secondary long run which should be called after displaying the start up screen
void initialize(QApplication* pApp);
void initialize();

std::shared_ptr<KeyboardEventFilter> getKeyboardEventFilter() const {
return m_pKeyboardEventFilter;
Expand Down
6 changes: 0 additions & 6 deletions src/dialog/dlgkeywheel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ DlgKeywheel::DlgKeywheel(QWidget* parent, const UserSettingsPointer& pConfig)
graphic->setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX);
graphic->setMinimumSize(200, 200);

#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
graphic->renderer()->setAspectRatioMode(Qt::KeepAspectRatio);
#endif

connect(closeButton,
&QAbstractButton::clicked,
Expand Down Expand Up @@ -156,11 +154,7 @@ void DlgKeywheel::updateSvg() {

if (text.isText()) {
QDomText textNode = text.toText();
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
const int keyInt = QStringView(id).sliced(2).toInt();
#else
const int keyInt = id.midRef(2).toInt();
#endif
ChromaticKey key = static_cast<ChromaticKey>(keyInt);
QString keyString = KeyUtils::keyToString(key, m_notation);
textNode.setData(keyString);
Expand Down
9 changes: 4 additions & 5 deletions src/effects/backends/effectmanifestparameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#include "effects/defs.h"
#include "util/assert.h"
#include "util/compatibility/qhash.h"

class EffectManifestParameter;
typedef QSharedPointer<EffectManifestParameter> EffectManifestParameterPointer;
Expand Down Expand Up @@ -379,12 +378,12 @@ QDebug operator<<(QDebug dbg, const EffectManifestParameter& parameter);

typedef EffectManifestParameter::ParameterType EffectParameterType;

inline qhash_seed_t qHash(const EffectParameterType& parameterType) {
return static_cast<qhash_seed_t>(parameterType);
inline size_t qHash(const EffectParameterType& parameterType) {
return static_cast<size_t>(parameterType);
}

typedef EffectManifestParameter::UnitsHint UnitsHint;

inline qhash_seed_t qHash(const UnitsHint& uhint) {
return static_cast<qhash_seed_t>(uhint);
inline size_t qHash(const UnitsHint& uhint) {
return static_cast<size_t>(uhint);
}
9 changes: 4 additions & 5 deletions src/effects/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <memory>

#include "engine/channelhandle.h"
#include "util/compatibility/qhash.h"

enum class EffectEnableState {
Disabled,
Expand All @@ -22,18 +21,18 @@ enum class EffectBackendType {
Unknown
};

inline qhash_seed_t qHash(const EffectBackendType& backendType) {
return static_cast<qhash_seed_t>(backendType);
inline size_t qHash(const EffectBackendType& backendType) {
return static_cast<size_t>(backendType);
}

enum class SignalProcessingStage {
Prefader,
Postfader
};

inline qhash_seed_t qHash(
inline size_t qHash(
SignalProcessingStage stage,
qhash_seed_t seed = 0) {
size_t seed = 0) {
return qHash(static_cast<uint>(stage), seed);
};

Expand Down
4 changes: 0 additions & 4 deletions src/effects/effectslot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,11 +488,7 @@ void EffectSlot::swapParameters(EffectParameterType type, int index1, int index2
VERIFY_OR_DEBUG_ASSERT(m_loadedParameters[type].size() > index2) {
return;
}
#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
m_loadedParameters[type].swapItemsAt(index1, index2);
#else
m_loadedParameters[type].swap(index1, index2);
#endif
loadParameters();
emit parametersChanged();
}
Expand Down
19 changes: 9 additions & 10 deletions src/engine/cachingreader/cachingreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include "moc_cachingreader.cpp"
#include "util/assert.h"
#include "util/compatibility/qatomic.h"
#include "util/counter.h"
#include "util/logger.h"
#include "util/sample.h"
Expand Down Expand Up @@ -238,7 +237,7 @@ void CachingReader::process() {
auto* pChunk = update.takeFromWorker();
if (pChunk) {
// Result of a read request (with a chunk)
DEBUG_ASSERT(atomicLoadRelaxed(m_state) != STATE_IDLE);
DEBUG_ASSERT(m_state.loadRelaxed() != STATE_IDLE);
DEBUG_ASSERT(
update.status == CHUNK_READ_SUCCESS ||
update.status == CHUNK_READ_EOF ||
Expand All @@ -250,7 +249,7 @@ void CachingReader::process() {
freeChunk(pChunk);
continue;
}
DEBUG_ASSERT(atomicLoadRelaxed(m_state) == STATE_TRACK_LOADED);
DEBUG_ASSERT(m_state.loadRelaxed() == STATE_TRACK_LOADED);
if (update.status == CHUNK_READ_SUCCESS) {
// Insert or freshen the chunk in the MRU/LRU list after
// obtaining ownership from the worker.
Expand All @@ -274,12 +273,12 @@ void CachingReader::process() {
// or the cache has been already cleared.
// In case of two consecutive load events, we receive two consecutive
// TRACK_LOADED without a chunk in between, assert this here.
DEBUG_ASSERT(atomicLoadRelaxed(m_state) == STATE_TRACK_LOADING ||
(atomicLoadRelaxed(m_state) == STATE_TRACK_LOADED &&
DEBUG_ASSERT(m_state.loadRelaxed() == STATE_TRACK_LOADING ||
(m_state.loadRelaxed() == STATE_TRACK_LOADED &&
!m_mruCachingReaderChunk && !m_lruCachingReaderChunk));
// now purge also the recently used chunk list from the old track.
if (m_mruCachingReaderChunk || m_lruCachingReaderChunk) {
DEBUG_ASSERT(atomicLoadRelaxed(m_state) == STATE_TRACK_LOADING);
DEBUG_ASSERT(m_state.loadRelaxed() == STATE_TRACK_LOADING);
freeAllChunks();
}
// Reset the readable frame index range
Expand All @@ -292,8 +291,8 @@ void CachingReader::process() {
// be the very next status update.
if (!m_state.testAndSetRelease(STATE_TRACK_UNLOADING, STATE_IDLE)) {
DEBUG_ASSERT(
atomicLoadRelaxed(m_state) == STATE_TRACK_LOADING ||
atomicLoadRelaxed(m_state) == STATE_IDLE);
m_state.loadRelaxed() == STATE_TRACK_LOADING ||
m_state.loadRelaxed() == STATE_IDLE);
}
}
}
Expand Down Expand Up @@ -334,7 +333,7 @@ CachingReader::ReadResult CachingReader::read(SINT startSample,
}

// If no track is loaded, don't do anything.
if (atomicLoadRelaxed(m_state) != STATE_TRACK_LOADED) {
if (m_state.loadRelaxed() != STATE_TRACK_LOADED) {
return ReadResult::UNAVAILABLE;
}

Expand Down Expand Up @@ -538,7 +537,7 @@ CachingReader::ReadResult CachingReader::read(SINT startSample,

void CachingReader::hintAndMaybeWake(const HintVector& hintList) {
// If no file is loaded, skip.
if (atomicLoadRelaxed(m_state) != STATE_TRACK_LOADED) {
if (m_state.loadRelaxed() != STATE_TRACK_LOADED) {
return;
}

Expand Down
Loading
Loading