Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/2.4' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed Apr 13, 2024
2 parents e3c88e5 + 72742d9 commit fb32929
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 36 deletions.
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2615,6 +2615,14 @@ if(IOS)
target_link_libraries(mixxx-lib PRIVATE "-framework OpenGLES")
target_compile_definitions(mixxx-lib PUBLIC QT_OPENGL_ES_2)
else()
if(APPLE)
# Prefer the system-provided OpenGL framework on macOS to avoid accidentally
# linking some other implementation, e.g. /usr/X11R6/lib/libGL.dylib if the
# user has XQuartz installed, due to vcpkg setting CMAKE_FIND_FRAMEWORK to
# LAST (see https://cmake.org/cmake/help/latest/variable/CMAKE_FIND_FRAMEWORK.html)
set(_previous_find_framework ${CMAKE_FIND_FRAMEWORK})
set(CMAKE_FIND_FRAMEWORK FIRST)
endif()
set(OpenGL_GL_PREFERENCE "GLVND")
find_package(OpenGL REQUIRED)
if(EMSCRIPTEN)
Expand All @@ -2628,6 +2636,10 @@ else()
else()
target_link_libraries(mixxx-lib PRIVATE OpenGL::GL)
endif()
if(APPLE)
# Restore the previous CMAKE_FIND_FRAMEWORK value
set(CMAKE_FIND_FRAMEWORK ${_previous_find_framework})
endif()
endif()

# Ogg
Expand Down
4 changes: 3 additions & 1 deletion src/dialog/dlgabout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ DlgAbout::DlgAbout()
<< "djantti"
<< "Eugene Erokhin"
<< "Ben Duval"
<< "Nicolau Leal Werneck"
<< "David Guglielmi"
<< "Chris H. Meyer"
<< "Daniel Fernandes"
<< "Gr&eacute;goire Locqueville"
<< "grizeldi";
Expand Down Expand Up @@ -302,7 +305,6 @@ DlgAbout::DlgAbout()
<< "Russ Mannex"
<< "Brendan Austin"
<< "Lorenz Drescher"
<< "David Guglielmi"
<< "James Atwill"
<< "Alex Barker"
<< "Jean Claveau"
Expand Down
24 changes: 4 additions & 20 deletions src/effects/backends/effectsbackendmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,28 +96,12 @@ EffectManifestPointer EffectsBackendManager::getManifest(
return pEffectsBackend->getManifest(id);
}

const QString EffectsBackendManager::getDisplayNameForEffectPreset(
EffectPresetPointer pPreset) const {
// "---" id displayed when no effect is loaded
QString displayName(kNoEffectString);
if (!pPreset || pPreset->isEmpty()) {
return displayName;
}

bool manifestFound = false;
for (const auto& pManifest : std::as_const(m_manifests)) {
if (pManifest->id() == pPreset->id() &&
pManifest->backendType() == pPreset->backendType()) {
displayName = pManifest->name();
manifestFound = true;
break;
}
}
if (!manifestFound) {
EffectManifestPointer EffectsBackendManager::getManifest(EffectPresetPointer pPreset) const {
EffectManifestPointer pManifest = getManifest(pPreset->id(), pPreset->backendType());
if (!pManifest) {
qWarning() << "Failed to find manifest for effect preset " << pPreset->id();
DEBUG_ASSERT(false);
}
return displayName;
return pManifest;
}

std::unique_ptr<EffectProcessor> EffectsBackendManager::createProcessor(
Expand Down
2 changes: 1 addition & 1 deletion src/effects/backends/effectsbackendmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class EffectsBackendManager {
/// returns a pointer to the manifest or a null pointer in case a
/// the previously stored backend or effect is no longer available
EffectManifestPointer getManifest(const QString& id, EffectBackendType backendType) const;
const QString getDisplayNameForEffectPreset(EffectPresetPointer pPreset) const;
EffectManifestPointer getManifest(EffectPresetPointer pPreset) const;

std::unique_ptr<EffectProcessor> createProcessor(const EffectManifestPointer pManifest);

Expand Down
8 changes: 5 additions & 3 deletions src/effects/effectslot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,14 @@ EffectParameterSlotBasePointer EffectSlot::getEffectParameterSlot(
}

void EffectSlot::loadEffectFromPreset(const EffectPresetPointer pPreset) {
if (!pPreset || pPreset->isEmpty()) {
EffectManifestPointer pManifest;
if (pPreset && !pPreset->isEmpty()) {
pManifest = m_pBackendManager->getManifest(pPreset);
}
if (!pManifest) {
loadEffectInner(nullptr, nullptr, true);
return;
}
EffectManifestPointer pManifest = m_pBackendManager->getManifest(
pPreset->id(), pPreset->backendType());
loadEffectInner(pManifest, pPreset, true);
}

Expand Down
14 changes: 7 additions & 7 deletions src/preferences/dialog/dlgprefeffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,17 +243,17 @@ void DlgPrefEffects::slotChainPresetSelectionChanged(const QItemSelection& selec
}

for (int i = 0; i < m_effectsLabels.size(); ++i) {
EffectManifestPointer pManifest;
if (i < pChainPreset->effectPresets().size()) {
EffectPresetPointer pEffectPreset = pChainPreset->effectPresets().at(i);
if (!pEffectPreset->isEmpty()) {
QString displayName =
m_pBackendManager->getDisplayNameForEffectPreset(
pEffectPreset);
// Code uses 0-indexed numbers; users see 1 indexed numbers
m_effectsLabels[i]->setText(QString::number(i + 1) + ": " + displayName);
} else {
m_effectsLabels[i]->setText(QString::number(i + 1) + ": " + kNoEffectString);
pManifest = m_pBackendManager->getManifest(pEffectPreset);
}
}
if (pManifest) {
QString displayName = pManifest->name();
// Code uses 0-indexed numbers; users see 1 indexed numbers
m_effectsLabels[i]->setText(QString::number(i + 1) + ": " + displayName);
} else {
m_effectsLabels[i]->setText(QString::number(i + 1) + ": " + kNoEffectString);
}
Expand Down
7 changes: 5 additions & 2 deletions src/widget/weffectchainpresetbutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void WEffectChainPresetButton::populateMenu() {
m_pMenu->clear();

// Chain preset items
const EffectsBackendManagerPointer bem = m_pEffectsManager->getBackendManager();
const EffectsBackendManagerPointer pBackendManager = m_pEffectsManager->getBackendManager();
bool presetIsReadOnly = true;
QStringList effectNames;
for (const auto& pChainPreset : m_pChainPresetManager->getPresetsSorted()) {
Expand All @@ -72,7 +72,10 @@ void WEffectChainPresetButton::populateMenu() {
QStringLiteral("<b>") + pChainPreset->name() + QStringLiteral("</b>");
for (const auto& pEffectPreset : pChainPreset->effectPresets()) {
if (!pEffectPreset->isEmpty()) {
effectNames.append(bem->getDisplayNameForEffectPreset(pEffectPreset));
EffectManifestPointer pManifest = pBackendManager->getManifest(pEffectPreset);
if (pManifest) {
effectNames.append(pManifest->name());
}
}
}
if (effectNames.size() > 1) {
Expand Down
7 changes: 5 additions & 2 deletions src/widget/weffectchainpresetselector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void WEffectChainPresetSelector::populate() {
presetList = m_pEffectsManager->getChainPresetManager()->getPresetsSorted();
}

const EffectsBackendManagerPointer bem = m_pEffectsManager->getBackendManager();
const EffectsBackendManagerPointer pBackendManager = m_pEffectsManager->getBackendManager();
QStringList effectNames;
for (int i = 0; i < presetList.size(); i++) {
auto pChainPreset = presetList.at(i);
Expand All @@ -89,7 +89,10 @@ void WEffectChainPresetSelector::populate() {
QStringLiteral("<b>") + pChainPreset->name() + QStringLiteral("</b>");
for (const auto& pEffectPreset : pChainPreset->effectPresets()) {
if (!pEffectPreset->isEmpty()) {
effectNames.append(bem->getDisplayNameForEffectPreset(pEffectPreset));
EffectManifestPointer pManifest = pBackendManager->getManifest(pEffectPreset);
if (pManifest) {
effectNames.append(pManifest->name());
}
}
}
if (effectNames.size() > 1) {
Expand Down

0 comments on commit fb32929

Please sign in to comment.