Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into 2025/add/reverbTail
Browse files Browse the repository at this point in the history
  • Loading branch information
mrnicegyu11 committed Feb 10, 2025
2 parents 3f1f385 + 799ff78 commit fe00dbf
Show file tree
Hide file tree
Showing 140 changed files with 118,003 additions and 97,321 deletions.
21 changes: 19 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2768,7 +2768,7 @@ option(ENGINEPRIME "Support for library export to Denon Engine Prime" ON)
if(ENGINEPRIME)
# libdjinterop does not currently have a stable ABI, so we fetch sources for a specific tag, build here, and link
# statically. This situation should be reviewed once libdjinterop hits version 1.x.
set(LIBDJINTEROP_VERSION 0.22.1)
set(LIBDJINTEROP_VERSION 0.24.3)
# Look whether an existing installation of libdjinterop matches the required version.
find_package(DjInterop ${LIBDJINTEROP_VERSION} EXACT CONFIG)
if(NOT DjInterop_FOUND)
Expand Down Expand Up @@ -2831,7 +2831,7 @@ if(ENGINEPRIME)
"https://github.com/xsco/libdjinterop/archive/refs/tags/${LIBDJINTEROP_VERSION}.tar.gz"
"https://launchpad.net/~xsco/+archive/ubuntu/djinterop/+sourcefiles/libdjinterop/${LIBDJINTEROP_VERSION}-0ubuntu1/libdjinterop_${LIBDJINTEROP_VERSION}.orig.tar.gz"
URL_HASH
SHA256=e811158d42c3864f5b682bcf76e0af78278050439d82d14d592dd0a391da6b20
SHA256=df41fe39bed9d16d27a3649d237b68edd2cdb6fc71a82cae5cd746d4e4ef6578
DOWNLOAD_DIR "${CMAKE_CURRENT_BINARY_DIR}/downloads"
DOWNLOAD_NAME "libdjinterop-${LIBDJINTEROP_VERSION}.tar.gz"
INSTALL_DIR ${DJINTEROP_INSTALL_DIR}
Expand Down Expand Up @@ -2886,6 +2886,13 @@ if(ENGINEPRIME)
IMPORTED_LOCATION "${DJINTEROP_INSTALL_DIR}/${DJINTEROP_LIBRARY}"
)
add_dependencies(mixxx-libdjinterop libdjinterop)
# Add the local include directory explicitly before linking the library
# to make sure not the system provided headers are used
target_include_directories(
mixxx-lib
BEFORE
PRIVATE "${DJINTEROP_INSTALL_DIR}/include"
)
target_link_libraries(mixxx-lib PRIVATE mixxx-libdjinterop)
endif()

Expand Down Expand Up @@ -3254,6 +3261,16 @@ if(QT_EXTRA_COMPONENTS)
endif()

if(QML)
if(QT_KNOWN_POLICY_QTP0004)
# See: https://doc.qt.io/qt-6/qt-cmake-policy-qtp0004.html
# OLD (Qt < 6.8) requires to import qml modules with a folder e.g.:
# fragmentShader: "qrc:/shaders/rgbsignal_qml.frag.qsb"
# For using NEW, we need to back-port:
# https://github.com/qt/qtdeclarative/commit/6314d305ee0d9064ca848980ef2dab1793c191b8
# until Qt 6.8 lands in all supported distros
qt6_policy(SET QTP0004 OLD)
endif()

add_subdirectory(res/shaders)

set(QT_QML_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/qml)
Expand Down
2 changes: 1 addition & 1 deletion res/controllers/Traktor-Kontrol-S3-hid-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ TraktorS3.QuickEffectModeChannelColors = false;
// * Hold shift to move the pitch slider without adjusting the rate
// * Hold keylock and move the pitch slider to adjust musical pitch
// * keylock will still toggle on, but on release, not press.
TraktorS3.PitchSliderRelativeMode = true;
TraktorS3.PitchSliderRelativeMode = false;

// The Samplers can operate two ways.
// With SamplerModePressAndHold = false, tapping a Sampler button will start the
Expand Down
1,302 changes: 654 additions & 648 deletions res/translations/mixxx.ts

Large diffs are not rendered by default.

3,326 changes: 1,832 additions & 1,494 deletions res/translations/mixxx_ar.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_ast.qm
Binary file not shown.
3,593 changes: 1,982 additions & 1,611 deletions res/translations/mixxx_ast.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_bg.qm
Binary file not shown.
Binary file modified res/translations/mixxx_ca.qm
Binary file not shown.
3,731 changes: 2,043 additions & 1,688 deletions res/translations/mixxx_ca.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_cs.qm
Binary file not shown.
3,626 changes: 1,988 additions & 1,638 deletions res/translations/mixxx_cs.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_da.qm
Binary file not shown.
3,579 changes: 1,975 additions & 1,604 deletions res/translations/mixxx_da.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_de.qm
Binary file not shown.
3,551 changes: 1,932 additions & 1,619 deletions res/translations/mixxx_de.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_el.qm
Binary file not shown.
3,603 changes: 1,987 additions & 1,616 deletions res/translations/mixxx_el.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_en_CA.qm
Binary file not shown.
3,686 changes: 2,018 additions & 1,668 deletions res/translations/mixxx_en_CA.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_en_GB.qm
Binary file not shown.
3,686 changes: 2,018 additions & 1,668 deletions res/translations/mixxx_en_GB.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_eo.qm
Binary file not shown.
3,595 changes: 1,983 additions & 1,612 deletions res/translations/mixxx_eo.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_es.qm
Binary file not shown.
4,362 changes: 2,382 additions & 1,980 deletions res/translations/mixxx_es.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_es_419.qm
Binary file not shown.
4,452 changes: 2,427 additions & 2,025 deletions res/translations/mixxx_es_419.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_es_AR.qm
Binary file not shown.
4,384 changes: 2,393 additions & 1,991 deletions res/translations/mixxx_es_AR.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_es_CO.qm
Binary file not shown.
4,386 changes: 2,394 additions & 1,992 deletions res/translations/mixxx_es_CO.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_es_ES.qm
Binary file not shown.
4,432 changes: 2,415 additions & 2,017 deletions res/translations/mixxx_es_ES.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_es_MX.qm
Binary file not shown.
4,318 changes: 2,360 additions & 1,958 deletions res/translations/mixxx_es_MX.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_et.qm
Binary file not shown.
3,593 changes: 1,982 additions & 1,611 deletions res/translations/mixxx_et.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_eu.qm
Binary file not shown.
3,599 changes: 1,985 additions & 1,614 deletions res/translations/mixxx_eu.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_fa.qm
Binary file not shown.
3,593 changes: 1,982 additions & 1,611 deletions res/translations/mixxx_fa.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_fi.qm
Binary file not shown.
3,593 changes: 1,982 additions & 1,611 deletions res/translations/mixxx_fi.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_fr.qm
Binary file not shown.
3,508 changes: 1,922 additions & 1,586 deletions res/translations/mixxx_fr.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_fr_CA.qm
Binary file not shown.
Binary file modified res/translations/mixxx_fr_CI.qm
Binary file not shown.
3,326 changes: 1,832 additions & 1,494 deletions res/translations/mixxx_ga.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_gl.qm
Binary file not shown.
3,603 changes: 1,987 additions & 1,616 deletions res/translations/mixxx_gl.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_he.qm
Binary file not shown.
3,597 changes: 1,984 additions & 1,613 deletions res/translations/mixxx_he.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_hr.qm
Binary file not shown.
3,579 changes: 1,975 additions & 1,604 deletions res/translations/mixxx_hr.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_hu.qm
Binary file not shown.
3,601 changes: 1,986 additions & 1,615 deletions res/translations/mixxx_hu.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_id.qm
Binary file not shown.
3,597 changes: 1,984 additions & 1,613 deletions res/translations/mixxx_id.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_it.qm
Binary file not shown.
3,527 changes: 1,918 additions & 1,609 deletions res/translations/mixxx_it.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_ja.qm
Binary file not shown.
3,722 changes: 2,047 additions & 1,675 deletions res/translations/mixxx_ja.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_ko.qm
Binary file not shown.
3,583 changes: 1,977 additions & 1,606 deletions res/translations/mixxx_ko.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_lb.qm
Binary file not shown.
3,593 changes: 1,982 additions & 1,611 deletions res/translations/mixxx_lb.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_lt.qm
Binary file not shown.
3,328 changes: 1,833 additions & 1,495 deletions res/translations/mixxx_lt.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_lv.qm
Binary file not shown.
3,326 changes: 1,832 additions & 1,494 deletions res/translations/mixxx_lv.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_ml.qm
Binary file not shown.
3,593 changes: 1,982 additions & 1,611 deletions res/translations/mixxx_ml.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_nb.qm
Binary file not shown.
3,593 changes: 1,982 additions & 1,611 deletions res/translations/mixxx_nb.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_nl.qm
Binary file not shown.
3,489 changes: 1,900 additions & 1,589 deletions res/translations/mixxx_nl.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_pl.qm
Binary file not shown.
3,759 changes: 2,055 additions & 1,704 deletions res/translations/mixxx_pl.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_pt.qm
Binary file not shown.
3,617 changes: 1,994 additions & 1,623 deletions res/translations/mixxx_pt.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_pt_BR.qm
Binary file not shown.
3,641 changes: 2,006 additions & 1,635 deletions res/translations/mixxx_pt_BR.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_pt_PT.qm
Binary file not shown.
3,617 changes: 1,994 additions & 1,623 deletions res/translations/mixxx_pt_PT.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_ro.qm
Binary file not shown.
3,603 changes: 1,987 additions & 1,616 deletions res/translations/mixxx_ro.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_ru.qm
Binary file not shown.
3,630 changes: 1,989 additions & 1,641 deletions res/translations/mixxx_ru.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_si.qm
Binary file not shown.
3,998 changes: 2,188 additions & 1,810 deletions res/translations/mixxx_si.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_sk.qm
Binary file not shown.
3,595 changes: 1,983 additions & 1,612 deletions res/translations/mixxx_sk.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_sl.qm
Binary file not shown.
3,732 changes: 2,042 additions & 1,690 deletions res/translations/mixxx_sl.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_sn.qm
Binary file not shown.
3,595 changes: 1,983 additions & 1,612 deletions res/translations/mixxx_sn.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_sq_AL.qm
Binary file not shown.
3,579 changes: 1,975 additions & 1,604 deletions res/translations/mixxx_sq_AL.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_sr.qm
Binary file not shown.
3,604 changes: 1,987 additions & 1,617 deletions res/translations/mixxx_sr.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_sv.qm
Binary file not shown.
3,603 changes: 1,987 additions & 1,616 deletions res/translations/mixxx_sv.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_tr.qm
Binary file not shown.
3,611 changes: 1,991 additions & 1,620 deletions res/translations/mixxx_tr.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_uk.qm
Binary file not shown.
3,757 changes: 2,064 additions & 1,693 deletions res/translations/mixxx_uk.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_vi.qm
Binary file not shown.
3,603 changes: 1,987 additions & 1,616 deletions res/translations/mixxx_vi.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_zh.qm
Binary file not shown.
5,468 changes: 2,940 additions & 2,528 deletions res/translations/mixxx_zh.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_zh_CN.qm
Binary file not shown.
5,472 changes: 2,942 additions & 2,530 deletions res/translations/mixxx_zh_CN.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_zh_HK.qm
Binary file not shown.
5,472 changes: 2,942 additions & 2,530 deletions res/translations/mixxx_zh_HK.ts

Large diffs are not rendered by default.

Binary file modified res/translations/mixxx_zh_TW.qm
Binary file not shown.
5,472 changes: 2,942 additions & 2,530 deletions res/translations/mixxx_zh_TW.ts

Large diffs are not rendered by default.

29 changes: 17 additions & 12 deletions res/translations/source_copy_allow_list.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,14 @@ ca,de,el,en_CA,en_GB,es*,fr_CA,fr_CI,hu,it,nl,pt*,sl,sv Res
* Stem #%1
* FPS: n/a
* <i>FPS: %0/%1</i>
de,hu,bs,cs,da,es_419,es_AR,es_CO,es_CR,es_EC,es_MX,es_PA,es_UY,et,fr,hr,id,it,lb,ms,nb,nl,nn,oc,pl,pt,pt_PT,ro,sk,sl,sv,vi Album
* \u276f
* \u276e
de,hu,bs,cs,da,fr,hr,id,it,lb,ms,nb,nl,nn,oc,pl,ro,sk,sl,sv,vi Album
de,da,fr,lb,ms,nl,oc,sv Genre
de,it,pl Bitrate:
es,es_419,es_AR,es_CO,es_MX,ca,es_ES Error:
pt_BR,de,el,es_419,es_AR,es_CO,es_CR,es_EC,es_MX,es_PA,es_UY,id,it,nl,ro Deck %1
hu,da,de,el,es_419,es_AR,es_CO,es_CR,es_EC,es_MX,es_PA,es_UY,eu,id,nb,nl,pl,pt*,ro,sn,tr,vi Sampler %1
pt_BR,de,el,id,it,nl,ro Deck %1
hu,da,de,el,eu,id,nb,nl,pl,pt*,ro,sn,tr,vi Sampler %1
hu,id,nl,sn Auxiliary %1
* Crossfader
* Cue
Expand Down Expand Up @@ -214,9 +216,9 @@ pt,pt_BR,ca,de,fr,it,nl,pl,pt_PT,sl,sv Tremolo
pt_BR,da,de,id,it,nl,pt,ro Mixer
pt_BR,de,it,nl,pt_PT Reloop
de,es*,nl,pt_BR,vi Hotcues
de,es_CR,es_EC,es_PA,es_UY,it,nl,pt_BR,pt_PT,vi,pl Hotcues %1-%2
de,es* Hotcues %1-%2
nl,pl Hotcue index
de,it,nl,pl Hotcue #%1
de,it,nl,pl,es_ES Hotcue #%1
fr,de,sv Information
fr,es* Simple
ca,es* Color
Expand Down Expand Up @@ -302,7 +304,7 @@ ca,cs,de,es*,et,fi,fr,gl,it,nl,pt*,sl,sv,tr Tempo
* MESA vblank_mode = 1
ca,de,fr,it,nl,pl,sv Intro
cs,de,fr,sl Formant
da,es,es_ES,eu,fr,hu,id,it,lv,nb,oc,pl,pt*,ro,ru,sk,sv Auto DJ
da,es,eu,fr,hu,id,it,lv,nb,oc,pl,pt*,ro,ru,sk,sv Auto DJ
da,fr,nb,nl,nn Type
de,nl,pl,sv Status
da,de,it,nl Computer
Expand Down Expand Up @@ -361,14 +363,14 @@ es*,fr,it,nl,pt* &Ok
es*,pt_BR Switch
es*,pt* Manual
et,hr,it,tr,vi BPM Tap
fr,it,nl pt
fr,it,nl,zh* pt
it Password
nl,sv,vi Equalizers
nl,it Controllers
nl Audio Buffer
nl,sv OpenGL Direct Rendering
nl Hard Clip
nl Hard
nl,zh* Hard Clip
nl,zh* Hard
sv (status text)
da Input
de,nl Moog Filter
Expand All @@ -387,7 +389,7 @@ de,es*,it,nl,pt_BR,ro,vi Hotcue
de Loop-In Marker
de Loop-Out Marker
de,it Beatloop
nl,it Booth
nl,it,zh* Booth
de,it,nl,pt_BR,ro Deck
de,fr,it,nl,pl Echo
de,it,nl,sv Feedback
Expand Down Expand Up @@ -427,8 +429,8 @@ de,nl Track
de,nl Tracks
it legacy
nl Waveform type
es*,it,nl Knee (dBFS)
es*,it,nl Knee
es*,it,nl,zh* Knee (dBFS)
es*,it,nl,zh* Knee
es*,nl Release
it,nl Auto Makeup Gain
it,nl Makeup
Expand All @@ -437,3 +439,6 @@ nl &Reset
nl Compressor
nl Release (ms)
it Tempo Tap
zh* Soft Clipping
zh* Hard Clipping
es,es_419,es_AR,es_CO,es_ES,es_MX No
4 changes: 2 additions & 2 deletions src/controllers/bulk/bulkcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ QString BulkController::mappingExtension() {
}

void BulkController::setMapping(std::shared_ptr<LegacyControllerMapping> pMapping) {
m_pMapping = downcastAndTakeOwnership<LegacyHidControllerMapping>(std::move(pMapping));
m_pMapping = downcastAndClone<LegacyHidControllerMapping>(pMapping.get());
}

std::shared_ptr<LegacyControllerMapping> BulkController::cloneMapping() {
if (!m_pMapping) {
return nullptr;
}
return m_pMapping->clone();
return std::make_shared<LegacyHidControllerMapping>(*m_pMapping);
}

bool BulkController::matchMapping(const MappingInfo& mapping) {
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/bulk/bulkcontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,5 @@ class BulkController : public Controller {

QString m_sUID;
BulkReader* m_pReader;
std::shared_ptr<LegacyHidControllerMapping> m_pMapping;
std::unique_ptr<LegacyHidControllerMapping> m_pMapping;
};
22 changes: 9 additions & 13 deletions src/controllers/controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,24 +112,20 @@ class Controller : public QObject {

protected:
template<typename SpecificMappingType>
std::shared_ptr<SpecificMappingType> downcastAndTakeOwnership(
std::shared_ptr<LegacyControllerMapping>&& pMapping) {
requires(std::is_final_v<SpecificMappingType> == true)
std::unique_ptr<SpecificMappingType> downcastAndClone(const LegacyControllerMapping* pMapping) {
// When unsetting a mapping (select 'No mapping') we receive a nullptr
if (pMapping == nullptr) {
if (!pMapping) {
return nullptr;
}
// Controller cannot take ownership if pMapping is referenced elsewhere because
// the controller polling thread needs exclusive accesses to the non-thread safe
// LegacyControllerMapping.
// Trying to cast a std::shared_ptr to a std::unique_ptr is not worth the trouble.
VERIFY_OR_DEBUG_ASSERT(pMapping.use_count() == 1) {
return nullptr;
}
auto pDowncastedMapping = std::dynamic_pointer_cast<SpecificMappingType>(pMapping);
VERIFY_OR_DEBUG_ASSERT(pDowncastedMapping) {
auto* pSpecifiedMapping = dynamic_cast<const SpecificMappingType*>(pMapping);
VERIFY_OR_DEBUG_ASSERT(pSpecifiedMapping) {
return nullptr;
}
return pDowncastedMapping;
// Controller cannot take ownership if pMapping is referenced elsewhere because
// the controller polling thread needs exclusive accesses to the non-thread safe
// LegacyControllerMapping. So we do a deep copy here.
return std::make_unique<SpecificMappingType>(*pSpecifiedMapping);
}

// The length parameter is here for backwards compatibility for when scripts
Expand Down
4 changes: 2 additions & 2 deletions src/controllers/controllermanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ void ControllerManager::slotSetUpDevices() {
pMapping->loadSettings(m_pConfig, pController->getName());

// This runs on the main thread but LegacyControllerMapping is not thread safe, so clone it.
pController->setMapping(pMapping->clone());
pController->setMapping(std::move(pMapping));

// If we are in safe mode, skip opening controllers.
if (CmdlineArgs::Instance().getSafeMode()) {
Expand Down Expand Up @@ -440,7 +440,7 @@ void ControllerManager::slotApplyMapping(Controller* pController,
m_pConfig->set(key, pMapping->filePath());

// This runs on the main thread but LegacyControllerMapping is not thread safe, so clone it.
pController->setMapping(pMapping->clone());
pController->setMapping(std::move(pMapping));

if (bEnabled) {
openController(pController);
Expand Down
42 changes: 25 additions & 17 deletions src/controllers/dlgprefcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,6 @@ void DlgPrefController::showLearningWizard() {
&DlgControllerLearning::stopListeningForClicks,
pControllerLearning,
&ControllerLearningEventFilter::stopListening);
connect(m_pDlgControllerLearning,
&DlgControllerLearning::stopLearning,
this,
&DlgPrefController::show);
connect(m_pDlgControllerLearning,
&DlgControllerLearning::inputMappingsLearned,
this,
Expand All @@ -395,6 +391,7 @@ void DlgPrefController::slotStopLearning() {
}

applyMappingChanges();

if (m_pMapping->filePath().isEmpty()) {
// This mapping was created when the learning wizard was started
if (m_pMapping->isDirty()) {
Expand All @@ -421,6 +418,7 @@ void DlgPrefController::slotStopLearning() {
}
}

// This will show() -> slotUpdate() -> enumerateMappings() etc.
emit mappingEnded();
}

Expand Down Expand Up @@ -464,23 +462,23 @@ QString DlgPrefController::mappingSupportLinks(
if (!forumLink.isEmpty()) {
linkList << coloredLinkString(
m_pLinkColor,
"Mixxx Forums",
"Mixxx&nbsp;Forums",
forumLink);
}

QString wikiLink = pMapping->wikilink();
if (!wikiLink.isEmpty()) {
linkList << coloredLinkString(
m_pLinkColor,
"Mixxx Wiki",
"Mixxx&nbsp;Wiki",
wikiLink);
}

QString manualLink = pMapping->manualLink();
if (!manualLink.isEmpty()) {
linkList << coloredLinkString(
m_pLinkColor,
"Mixxx Manual",
"Mixxx&nbsp;Manual",
manualLink);
}

Expand All @@ -490,8 +488,8 @@ QString DlgPrefController::mappingSupportLinks(
m_pLinkColor,
tr("Troubleshooting"),
MIXXX_WIKI_MIDI_SCRIPTING_URL);

return QString(linkList.join("&nbsp;&nbsp;"));
// Without &nbsp; would be rendered as regular whitespace (thin, &ensp;)
return QString(linkList.join("&emsp;&nbsp;"));
}

QString DlgPrefController::mappingFileLinks(
Expand Down Expand Up @@ -616,9 +614,10 @@ void DlgPrefController::slotUpdate() {
// Force updating the controller settings
slotMappingSelected(m_ui.comboBoxMapping->currentIndex());

// enumeratePresets calls slotPresetSelected which will check the m_ui.chkEnabledDevice
// checkbox if there is a valid mapping saved in the mixxx.cfg file. However, the
// checkbox should only be checked if the device is currently enabled.
// enumerateMappings() calls slotMappingSelected() which will tick the 'Enabled'
// checkbox if there is a valid mapping saved in the mixxx.cfg file.
// However, the checkbox should only be checked if the device is currently enabled.
// TODO fix in slotMappingSelected()?
m_ui.chkEnabledDevice->setChecked(m_pController->isOpen());

// If the controller is not mappable, disable the input and output mapping
Expand Down Expand Up @@ -729,6 +728,10 @@ QString DlgPrefController::mappingFilePathFromIndex(int index) const {
}

void DlgPrefController::slotMappingSelected(int chosenIndex) {
// Note that this is also called by slotUpdate() after MIDI learning finished
// and we may have pending changes. Force-reloading the mapping from file
// would wipe those so we need to make sure to return before
// LegacyControllerMappingFileHandler::loadMapping()
QString mappingFilePath = mappingFilePathFromIndex(chosenIndex);
if (mappingFilePath.isEmpty()) {
// User picked "No Mapping" item
Expand All @@ -754,10 +757,16 @@ void DlgPrefController::slotMappingSelected(int chosenIndex) {
}

// Check if the mapping is different from the configured mapping
if (m_GuiInitialized &&
m_pControllerManager->getConfiguredMappingFileForDevice(
if (m_GuiInitialized) {
if (m_pControllerManager->getConfiguredMappingFileForDevice(
m_pController->getName()) != mappingFilePath) {
setDirty(true);
setDirty(true);
} else if (m_pMapping && m_pMapping->isDirty()) {
// We have pending changes, don't reload the mapping from file!
// This is called by show()/slotUpdate() after MIDI learning ended
// and there is no need to update the GUI.
return;
}
}

applyMappingChanges();
Expand All @@ -784,9 +793,8 @@ void DlgPrefController::slotMappingSelected(int chosenIndex) {
// We might have saved the previous preset with a new name, so update
// the preset combobox.
enumerateMappings(mappingFilePath);
} else {
slotShowMapping(pMapping);
}
slotShowMapping(pMapping);

// These tabs are only usable for MIDI controllers
bool showMidiTabs = m_pController->getDataRepresentationProtocol() ==
Expand Down
4 changes: 2 additions & 2 deletions src/controllers/hid/hidcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ QString HidController::mappingExtension() {
}

void HidController::setMapping(std::shared_ptr<LegacyControllerMapping> pMapping) {
m_pMapping = downcastAndTakeOwnership<LegacyHidControllerMapping>(std::move(pMapping));
m_pMapping = downcastAndClone<LegacyHidControllerMapping>(pMapping.get());
}

std::shared_ptr<LegacyControllerMapping> HidController::cloneMapping() {
if (!m_pMapping) {
return nullptr;
}
return m_pMapping->clone();
return std::make_shared<LegacyHidControllerMapping>(*m_pMapping);
}

bool HidController::matchMapping(const MappingInfo& mapping) {
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/hid/hidcontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class HidController final : public Controller {
const mixxx::hid::DeviceInfo m_deviceInfo;

std::unique_ptr<HidIoThread> m_pHidIoThread;
std::shared_ptr<LegacyHidControllerMapping> m_pMapping;
std::unique_ptr<LegacyHidControllerMapping> m_pMapping;

friend class HidControllerJSProxy;
};
Expand Down
6 changes: 1 addition & 5 deletions src/controllers/hid/legacyhidcontrollermapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@

/// This class represents a HID or Bulk controller mapping, containing the data
/// elements that make it up.
class LegacyHidControllerMapping : public LegacyControllerMapping {
class LegacyHidControllerMapping final : public LegacyControllerMapping {
public:
LegacyHidControllerMapping() {
}
~LegacyHidControllerMapping() override {
}

std::shared_ptr<LegacyControllerMapping> clone() const override {
return std::make_shared<LegacyHidControllerMapping>(*this);
}

bool saveMapping(const QString& fileName) const override;

bool isMappable() const override;
Expand Down
Loading

0 comments on commit fe00dbf

Please sign in to comment.