summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/clazy.yml25
-rw-r--r--.travis.yml4
-rw-r--r--CMakeLists.txt26
-rw-r--r--src/analyzer/analyzerbeats.cpp10
-rw-r--r--src/analyzer/analyzerkey.cpp10
-rw-r--r--src/broadcast/broadcastmanager.cpp8
-rw-r--r--src/control/controlobjectscript.cpp2
-rw-r--r--src/controllers/controllerinputmappingtablemodel.cpp2
-rw-r--r--src/controllers/controllermanager.cpp2
-rw-r--r--src/controllers/controlleroutputmappingtablemodel.cpp2
-rw-r--r--src/controllers/controllerpresetinfoenumerator.cpp2
-rw-r--r--src/controllers/hid/hidblacklist.h18
-rw-r--r--src/controllers/hid/hiddenylist.h17
-rw-r--r--src/controllers/hid/hidenumerator.cpp93
-rw-r--r--src/controllers/midi/portmidienumerator.cpp118
-rw-r--r--src/dialog/dlgreplacecuecolor.cpp2
-rw-r--r--src/effects/effect.cpp2
-rw-r--r--src/effects/effectbuttonparameterslot.cpp12
-rw-r--r--src/effects/effectchainmanager.cpp8
-rw-r--r--src/effects/effectchainslot.cpp6
-rw-r--r--src/effects/effectrack.cpp7
-rw-r--r--src/effects/effectslot.cpp17
-rw-r--r--src/effects/effectsmanager.cpp2
-rw-r--r--src/encoder/encoderflacsettings.cpp2
-rw-r--r--src/encoder/encodermp3settings.cpp2
-rw-r--r--src/encoder/encoderopussettings.cpp4
-rw-r--r--src/encoder/encoderwavesettings.cpp2
-rw-r--r--src/engine/controls/cuecontrol.cpp15
-rw-r--r--src/engine/effects/engineeffectchain.cpp4
-rw-r--r--src/engine/effects/engineeffectrack.cpp4
-rw-r--r--src/engine/sidechain/enginenetworkstream.cpp4
-rw-r--r--src/engine/sync/enginesync.cpp4
-rw-r--r--src/errordialoghandler.cpp3
-rw-r--r--src/library/autodj/autodjprocessor.cpp2
-rw-r--r--src/library/baseplaylistfeature.cpp3
-rw-r--r--src/library/basesqltablemodel.cpp2
-rw-r--r--src/library/basetracktablemodel.cpp15
-rw-r--r--src/library/dao/trackdao.cpp40
-rw-r--r--src/library/dao/trackdao.h10
-rw-r--r--src/library/library.cpp5
-rw-r--r--src/library/rekordbox/rekordboxfeature.cpp5
-rw-r--r--src/library/serato/seratofeature.cpp2
-rw-r--r--src/library/trackcollection.cpp2
-rw-r--r--src/library/trackcollectionmanager.cpp8
-rw-r--r--src/mixxx.cpp46
-rw-r--r--src/musicbrainz/web/acoustidlookuptask.cpp4
-rw-r--r--src/preferences/broadcastprofile.cpp6
-rw-r--r--src/preferences/broadcastsettings.cpp10
-rw-r--r--src/preferences/broadcastsettingsmodel.cpp27
-rw-r--r--src/preferences/colorpalettesettings.cpp22
-rw-r--r--src/preferences/dialog/dlgprefautodj.cpp20
-rw-r--r--src/preferences/dialog/dlgprefbeats.cpp2
-rw-r--r--src/preferences/dialog/dlgprefbroadcast.cpp3
-rw-r--r--src/preferences/dialog/dlgprefcolors.cpp3
-rw-r--r--src/preferences/dialog/dlgprefdeck.cpp18
-rw-r--r--src/preferences/dialog/dlgprefeffects.cpp6
-rw-r--r--src/preferences/dialog/dlgprefeq.cpp12
-rw-r--r--src/preferences/dialog/dlgprefinterface.h6
-rw-r--r--src/preferences/dialog/dlgprefkey.cpp2
-rw-r--r--src/preferences/dialog/dlgprefrecord.cpp12
-rw-r--r--src/preferences/dialog/dlgprefreplaygain.cpp43
-rw-r--r--src/preferences/dialog/dlgprefsounditem.cpp12
-rw-r--r--src/preferences/effectsettingsmodel.cpp2
-rw-r--r--src/skin/legacyskinparser.cpp133
-rw-r--r--src/skin/skinloader.cpp3
-rw-r--r--src/soundio/sounddevicenetwork.cpp2
-rw-r--r--src/soundio/soundmanager.cpp4
-rw-r--r--src/soundio/soundmanagerconfig.cpp51
-rw-r--r--src/sources/libfaadloader.cpp2
-rw-r--r--src/sources/soundsourceproxy.cpp3
-rw-r--r--src/test/cue_test.cpp6
-rw-r--r--src/test/mixxxtest.cpp3
-rw-r--r--src/test/soundproxy_test.cpp58
-rw-r--r--src/test/trackdao_test.cpp2
-rw-r--r--src/test/trackexport_test.h17
-rw-r--r--src/track/cue.cpp5
-rw-r--r--src/track/cue.h3
-rw-r--r--src/track/serato/markers2.cpp14
-rw-r--r--src/track/serato/tags.cpp6
-rw-r--r--src/track/track.cpp14
-rw-r--r--src/util/qt.h14
-rw-r--r--src/waveform/renderers/waveformmark.cpp2
-rw-r--r--src/waveform/renderers/waveformwidgetrenderer.cpp9
-rw-r--r--src/widget/wbasewidget.cpp26
-rw-r--r--src/widget/weffectpushbutton.cpp15
-rw-r--r--src/widget/wmainmenubar.cpp4
-rw-r--r--src/widget/woverview.cpp4
-rw-r--r--src/widget/wsplitter.cpp3
-rw-r--r--src/widget/wtrackmenu.cpp3
-rw-r--r--src/widget/wtracktableviewheader.cpp2
-rw-r--r--src/widget/wwaveformviewer.cpp2
91 files changed, 677 insertions, 522 deletions
diff --git a/.github/workflows/clazy.yml b/.github/workflows/clazy.yml
new file mode 100644
index 0000000000..3b07644b6f
--- /dev/null
+++ b/.github/workflows/clazy.yml
@@ -0,0 +1,25 @@
+name: clazy
+
+on:
+ push:
+ pull_request:
+
+jobs:
+ clazy:
+ runs-on: ubuntu-20.04
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install build dependencies
+ run: sudo apt-get update && sudo apt-get install -y --no-install-recommends libavformat-dev libchromaprint-dev libebur128-dev libfftw3-dev libflac-dev libid3tag0-dev liblilv-dev libmad0-dev libmodplug-dev libmp3lame-dev libopus-dev libopusfile-dev libportmidi-dev libprotobuf-dev libqt5opengl5-dev libqt5sql5-sqlite libqt5svg5-dev libqt5x11extras5-dev librubberband-dev libshout3-dev libsndfile1-dev libsoundtouch-dev libsqlite3-dev libtag1-dev libupower-glib-dev libusb-1.0-0-dev libwavpack-dev portaudio19-dev protobuf-compiler qt5-default qtscript5-dev qt5keychain-dev clazy cmake
+ - name: Build
+ run: |
+ mkdir cmake_build
+ cd cmake_build
+ # Disable optimizations as workaround for Clang 9 bug: https://bugs.llvm.org/show_bug.cgi?id=45034
+ cmake -DCMAKE_BUILD_TYPE=Debug -DWARNINGS_FATAL=ON -DOPTIMIZE=off -DBATTERY=ON -DBROADCAST=ON -DBULK=ON -DHID=ON -DLILV=ON -DOPUS=ON -DQTKEYCHAIN=ON -DVINYLCONTROL=ON -DFFMPEG=ON -DKEYFINDER=ON -DLOCALECOMPARE=ON -DMAD=ON -DMODPLUG=ON -DWAVPACK=ON ..
+ cmake --build . -j $(nproc)
+ env:
+ LD: clang++
+ CC: clang
+ CXX: clazy
+ CLAZY_CHECKS: range-loop
diff --git a/.travis.yml b/.travis.yml
index 8328ef8d68..ebbc68a195 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -149,7 +149,7 @@ jobs:
- ccache
env: >-
MIXXX_ENVPATH="${HOME}/buildenv"
- CMAKEFLAGS_EXTRA="-DCOREAUDIO=ON -DHSS1394=ON -DMACOS_BUNDLE=ON"
+ CMAKEFLAGS_EXTRA="-DCOREAUDIO=ON -DHSS1394=ON"
PATH="/usr/local/opt/ccache/bin:$PATH"
CMAKE_BUILD_PARALLEL_LEVEL=4
CTEST_PARALLEL_LEVEL=1
@@ -182,7 +182,7 @@ jobs:
install:
- mkdir cmake_build
- cd cmake_build
- - cmake -L $CMAKEFLAGS $CMAKEFLAGS_EXTRA -DCMAKE_PREFIX_PATH=${MIXXX_ENVPATH} -DQt5_DIR=${QT_DIR} -DAPPLE_CODESIGN_IDENTITY=${APPLE_CODESIGN_IDENTITY} ..
+ - cmake -L $CMAKEFLAGS $CMAKEFLAGS_EXTRA -DMACOS_BUNDLE=ON -DCMAKE_PREFIX_PATH=${MIXXX_ENVPATH} -DQt5_DIR=${QT_DIR} -DAPPLE_CODESIGN_IDENTITY=${APPLE_CODESIGN_IDENTITY} ..
- cmake --build .
- cpack -G DragNDrop -V
# cpack codesigns the Mixxx.app inside the DMG package, but the DMG package also needs to be signed
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bd74736d06..2c7aa95671 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -979,6 +979,15 @@ target_compile_definitions(mixxx-lib PUBLIC
$<$<NOT:$<CONFIG:Debug>>:NDEBUG>
)
+# Mac-specific options
+if(APPLE)
+ option(MACOS_BUNDLE "Install files to proper locations to make an .app bundle" OFF)
+ option(MACAPPSTORE "Build for Mac App Store" OFF)
+ if(MACAPPSTORE)
+ target_compile_definitions(mixxx-lib PUBLIC __MACAPPSTORE__)
+ endif()
+endif()
+
#
# Installation directories
#
@@ -1038,8 +1047,10 @@ elseif(UNIX)
target_compile_definitions(mixxx-lib PUBLIC __APPLE__)
else()
target_compile_definitions(mixxx-lib PRIVATE __UNIX__)
+ # UNIX_SHARE_PATH must be set to the absolute path
+ # including the install prefix!
target_compile_definitions(
- mixxx-lib PUBLIC UNIX_SHARE_PATH="${MIXXX_INSTALL_DATADIR}")
+ mixxx-lib PUBLIC UNIX_SHARE_PATH="${CMAKE_INSTALL_PREFIX}/${MIXXX_INSTALL_DATADIR}")
if(CMAKE_SYSTEM_NAME STREQUAL Linux)
target_compile_definitions(mixxx-lib PUBLIC __LINUX__)
elseif(CMAKE_SYSTEM_NAME MATCHES "^.*BSD$")
@@ -1062,7 +1073,7 @@ if (APPLE)
set(MACOS_BUNDLE_VERSION "${CMAKE_PROJECT_VERSION}")
set(MACOS_BUNDLE_SHORTVERSION "${CMAKE_PROJECT_VERSION}")
set(MACOS_BUNDLE_MINOSVERSION "10.11.0")
-
+
set_target_properties(mixxx PROPERTIES
MACOSX_BUNDLE true
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos_bundle.plist.in"
@@ -2246,15 +2257,6 @@ if(MAD)
target_link_libraries(mixxx-lib PUBLIC MAD::MAD ID3Tag::ID3Tag)
endif()
-# Mac App Store
-if(APPLE)
- option(MACAPPSTORE "Build for Mac App Store" OFF)
- if(MACAPPSTORE)
- target_compile_definitions(mixxx-lib PUBLIC __MACAPPSTORE__)
- endif()
- option(MACOS_BUNDLE "Install files to proper locations to make an .app bundle" OFF)
-endif()
-
# Media Foundation AAC Decoder Plugin
find_package(MediaFoundation)
cmake_dependent_option(MEDIAFOUNDATION "Media Foundation AAC decoder plugin (Windows Vista with KB2117917 or Windows 7 required)" ON "MediaFoundation_FOUND" OFF)
@@ -2411,7 +2413,7 @@ set(CPACK_PACKAGE_VENDOR "Mixxx Project")
set(CPACK_PACKAGE_CONTACT "RJ Skerry-Ryan <rryan@mixxx.org>")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cpack_package_description.txt")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Mixxx")
-set(CPACK_PACKAGE_EXECUTABLES "mixxx")
+set(CPACK_PACKAGE_EXECUTABLES "mixxx;Mixxx")
set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/res/images/mixxx_install_logo.bmp")
set(CPACK_PACKAGE_HOMEPAGE_URL "https://www.mixxx.org/")
set(CPACK_PACKAGE_FILE_NAME "Mixxx-${GIT_BRANCH}-r${GIT_COMMIT_COUNT}-${GIT_COMMIT_HASH}")
diff --git a/src/analyzer/analyzerbeats.cpp b/src/analyzer/analyzerbeats.cpp
index 953e7af77f..62b98115cb 100644
--- a/src/analyzer/analyzerbeats.cpp
+++ b/src/analyzer/analyzerbeats.cpp
@@ -25,8 +25,9 @@ QList<mixxx::AnalyzerPluginInfo> AnalyzerBeats::availablePlugins() {
// static
mixxx::AnalyzerPluginInfo AnalyzerBeats::defaultPlugin() {
- DEBUG_ASSERT(availablePlugins().size() > 0);
- return availablePlugins().at(0);
+ const auto plugins = availablePlugins();
+ DEBUG_ASSERT(!plugins.isEmpty());
+ return plugins.at(0);
}
AnalyzerBeats::AnalyzerBeats(UserSettingsPointer pConfig, bool enforceBpmDetection)
@@ -72,10 +73,11 @@ bool AnalyzerBeats::initialize(TrackPointer tio, int sampleRate, int totalSample
m_bPreferencesReanalyzeImported = m_bpmSettings.getReanalyzeImported();
m_bPreferencesFastAnalysis = m_bpmSettings.getFastAnalysis();
- if (availablePlugins().size() > 0) {
+ const auto plugins = availablePlugins();
+ if (!plugins.isEmpty()) {
m_pluginId = defaultPlugin().id;
QString pluginId = m_bpmSettings.getBeatPluginId();
- for (const auto& info : availablePlugins()) {
+ for (const auto& info : plugins) {
if (info.id == pluginId) {
m_pluginId = pluginId; // configured Plug-In available
break;
diff --git a/src/analyzer/analyzerkey.cpp b/src/analyzer/analyzerkey.cpp
index 38e3bc2c89..fc9bb3ee09 100644
--- a/src/analyzer/analyzerkey.cpp
+++ b/src/analyzer/analyzerkey.cpp
@@ -25,8 +25,9 @@ QList<mixxx::AnalyzerPluginInfo> AnalyzerKey::availablePlugins() {
// static
mixxx::AnalyzerPluginInfo AnalyzerKey::defaultPlugin() {
- DEBUG_ASSERT(availablePlugins().size() > 0);
- return availablePlugins().at(0);
+ const auto plugins = availablePlugins();
+ DEBUG_ASSERT(!plugins.isEmpty());
+ return plugins.at(0);
}
AnalyzerKey::AnalyzerKey(KeyDetectionSettings keySettings)
@@ -54,10 +55,11 @@ bool AnalyzerKey::initialize(TrackPointer tio, int sampleRate, int totalSamples)
m_bPreferencesFastAnalysisEnabled = m_keySettings.getFastAnalysis();
m_bPreferencesReanalyzeEnabled = m_keySettings.getReanalyzeWhenSettingsChange();
- if (availablePlugins().size() > 0) {
+ const auto plugins = availablePlugins();
+ if (!plugins.isEmpty()) {
m_pluginId = defaultPlugin().id;
QString pluginId = m_keySettings.getKeyPluginId();
- for (const auto& info : availablePlugins()) {
+ for (const auto& info : plugins) {
if (info.id == pluginId) {
m_pluginId = pluginId; // configured Plug-In available
break;
diff --git a/src/broadcast/broadcastmanager.cpp b/src/broadcast/broadcastmanager.cpp
index 71958f08c3..0831d806cf 100644
--- a/src/broadcast/broadcastmanager.cpp
+++ b/src/broadcast/broadcastmanager.cpp
@@ -43,7 +43,7 @@ BroadcastManager::BroadcastManager(SettingsManager* pSettingsManager,
// Initialize connections list from the current state of BroadcastSettings
QList<BroadcastProfilePtr> profiles = m_pBroadcastSettings->profiles();
- for(BroadcastProfilePtr profile : profiles) {
+ for (const BroadcastProfilePtr& profile : profiles) {
addConnection(profile);
}
@@ -99,7 +99,7 @@ void BroadcastManager::slotControlEnabled(double v) {
if (v > 0.0) {
bool atLeastOneEnabled = false;
QList<BroadcastProfilePtr> profiles = m_pBroadcastSettings->profiles();
- for(BroadcastProfilePtr profile : profiles) {
+ for (const BroadcastProfilePtr& profile : profiles) {
if (profile->getEnabled()) {
atLeastOneEnabled = true;
break;
@@ -138,7 +138,7 @@ void BroadcastManager::slotProfileRemoved(BroadcastProfilePtr profile) {
void BroadcastManager::slotProfilesChanged() {
QVector<NetworkOutputStreamWorkerPtr> workers = m_pNetworkStream->outputWorkers();
- for(NetworkOutputStreamWorkerPtr pWorker : workers) {
+ for (const NetworkOutputStreamWorkerPtr& pWorker : workers) {
ShoutConnectionPtr connection = qSharedPointerCast<ShoutConnection>(pWorker);
if (connection) {
BroadcastProfilePtr profile = connection->profile();
@@ -197,7 +197,7 @@ bool BroadcastManager::removeConnection(BroadcastProfilePtr profile) {
ShoutConnectionPtr BroadcastManager::findConnectionForProfile(BroadcastProfilePtr profile) {
QVector<NetworkOutputStreamWorkerPtr> workers = m_pNetworkStream->outputWorkers();
- for(NetworkOutputStreamWorkerPtr pWorker : workers) {
+ for (const NetworkOutputStreamWorkerPtr& pWorker : workers) {
ShoutConnectionPtr connection = qSharedPointerCast<ShoutConnection>(pWorker);
if (connection.isNull())
continue;
diff --git a/src/control/controlobjectscript.cpp b/src/control/controlobjectscript.cpp
index d95d0c0176..429a4d0230 100644
--- a/src/control/controlobjectscript.cpp
+++ b/src/control/controlobjectscript.cpp
@@ -22,7 +22,7 @@ bool ControlObjectScript::addScriptConnection(const ScriptConnection& conn) {
Qt::QueuedConnection);
}
- for (const auto& priorConnection: m_scriptConnections) {
+ for (const auto& priorConnection : qAsConst(m_scriptConnections)) {
if (conn == priorConnection) {
qWarning() << "Connection " + conn.id.toString() +
" already connected to (" +
diff --git a/src/controllers/controllerinputmappingtablemodel.cpp b/src/controllers/controllerinputmappingtablemodel.cpp
index cd143383aa..73db610044 100644
--- a/src/controllers/controllerinputmappingtablemodel.cpp
+++ b/src/controllers/controllerinputmappingtablemodel.cpp
@@ -19,7 +19,7 @@ void ControllerInputMappingTableModel::apply() {
// Clear existing input mappings and insert all the input mappings in
// the table into the preset.
QMultiHash<uint16_t, MidiInputMapping> mappings;
- for (const MidiInputMapping& mapping : m_midiInputMappings) {
+ for (const MidiInputMapping& mapping : qAsConst(m_midiInputMappings)) {
// There can be multiple input mappings for the same input
// MidiKey, so we need to use a QMultiHash here.
mappings.insert(mapping.key.key, mapping);
diff --git a/src/controllers/controllermanager.cpp b/src/controllers/controllermanager.cpp
index ef113ce820..bf68c1513d 100644
--- a/src/controllers/controllermanager.cpp
+++ b/src/controllers/controllermanager.cpp
@@ -347,7 +347,7 @@ void ControllerManager::pollDevices() {
}
mixxx::Duration start = mixxx::Time::elapsed();
- for (Controller* pDevice : m_controllers) {
+ for (Controller* pDevice : qAsConst(m_controllers)) {
if (pDevice->isOpen() && pDevice->isPolling()) {
pDevice->poll();
}
diff --git a/src/controllers/controlleroutputmappingtablemodel.cpp b/src/controllers/controlleroutputmappingtablemodel.cpp
index 1ae8b1dd73..676442cb1e 100644
--- a/src/controllers/controlleroutputmappingtablemodel.cpp
+++ b/src/controllers/controlleroutputmappingtablemodel.cpp
@@ -19,7 +19,7 @@ void ControllerOutputMappingTableModel::apply() {
// Clear existing output mappings and insert all the output mappings in
// the table in