Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/2.5' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed Jul 9, 2024
2 parents 77b5309 + 2e26433 commit d9d23dc
Show file tree
Hide file tree
Showing 19 changed files with 172 additions and 74 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ jobs:
env:
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
if: runner.os == 'Windows' && env.AZURE_TENANT_ID
uses: azure/azure-code-[email protected].0
uses: azure/trusted-[email protected].20
with:
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
Expand Down Expand Up @@ -371,7 +371,7 @@ jobs:
env:
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
if: runner.os == 'Windows' && env.AZURE_TENANT_ID
uses: azure/azure-code-[email protected].0
uses: azure/trusted-[email protected].20
with:
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
Expand Down
1 change: 1 addition & 0 deletions res/skins/Deere/mixer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@
<WidgetGroup>
<ObjectName>Crossfader</ObjectName>
<SizePolicy>me,min</SizePolicy>
<MaximumSize>200,</MaximumSize>
<Layout>horizontal</Layout>
<Children>
<SliderComposed>
Expand Down
3 changes: 2 additions & 1 deletion src/effects/effectsmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,8 @@ void EffectsManager::saveEffectsXml() {
quickEffectChainPresets,
standardEffectChainPresets,
outputChainPreset});
m_pVisibleEffectsList->saveEffectsXml(&doc);

m_pVisibleEffectsList->saveEffectsXml(&doc, m_pBackendManager);

QDir settingsPath(m_pConfig->getSettingsPath());
if (!settingsPath.exists()) {
Expand Down
1 change: 1 addition & 0 deletions src/effects/presets/effectxmlelements.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const QString kEqualizerEffects(QStringLiteral("EqualizerEffects"));
const QString kChainPresetName(QStringLiteral("ChainPresetName"));

const QString kVisibleEffects(QStringLiteral("VisibleEffects"));
const QString kHiddenEffects(QStringLiteral("HiddenEffects"));

const QString kChainsRoot(QStringLiteral("Chains"));
const QString kChain(QStringLiteral("EffectChain"));
Expand Down
53 changes: 44 additions & 9 deletions src/effects/visibleeffectslist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,37 @@ const EffectManifestPointer VisibleEffectsList::previous(
}

void VisibleEffectsList::readEffectsXml(
const QDomDocument& doc, EffectsBackendManagerPointer pBackendManager) {
const QDomDocument& doc,
EffectsBackendManagerPointer pBackendManager) {
QList<EffectManifestPointer> visibleEffects = readEffectsList(
doc,
pBackendManager,
EffectXml::kVisibleEffects);
const QList<EffectManifestPointer> hiddenEffects = readEffectsList(
doc,
pBackendManager,
EffectXml::kHiddenEffects);

// New effects will remain hidden since they are neither in the VisibleEffects
// nor in the newly introduced HiddenEffects list.
// Unhide all effects that are not in either list.
const auto manifests = pBackendManager->getManifestsForBackend(EffectBackendType::BuiltIn);
for (const EffectManifestPointer& pManifest : std::as_const(manifests)) {
if (!visibleEffects.contains(pManifest) &&
!hiddenEffects.contains(pManifest)) {
// pre-pend so un-hidden effects are discoverable
visibleEffects.prepend(pManifest);
}
}
setList(visibleEffects);
}

QList<EffectManifestPointer> VisibleEffectsList::readEffectsList(
const QDomDocument& doc,
EffectsBackendManagerPointer pBackendManager,
const QString& xmlElementName) {
QDomElement root = doc.documentElement();
QDomElement visibleEffectsElement = XmlParse::selectElement(root, EffectXml::kVisibleEffects);
QDomElement visibleEffectsElement = XmlParse::selectElement(root, xmlElementName);
QDomNodeList effectsElementsList = visibleEffectsElement.elementsByTagName(EffectXml::kEffect);
QList<EffectManifestPointer> list;

Expand All @@ -67,19 +95,26 @@ void VisibleEffectsList::readEffectsXml(
}
}
}
return list;
}

if (!list.isEmpty()) {
setList(list);
} else {
setList(pBackendManager->getManifestsForBackend(EffectBackendType::BuiltIn));
void VisibleEffectsList::saveEffectsXml(QDomDocument* pDoc,
EffectsBackendManagerPointer pBackendManager) {
saveEffectsListXml(pDoc, m_list, EffectXml::kVisibleEffects);
auto hiddenEffects = pBackendManager->getManifests();
for (const auto& pManifest : std::as_const(m_list)) {
hiddenEffects.removeAll(pManifest);
}
saveEffectsListXml(pDoc, hiddenEffects, EffectXml::kHiddenEffects);
}

void VisibleEffectsList::saveEffectsXml(QDomDocument* pDoc) {
void VisibleEffectsList::saveEffectsListXml(QDomDocument* pDoc,
const QList<EffectManifestPointer>& list,
const QString& xmlElementName) {
QDomElement root = pDoc->documentElement();
QDomElement visibleEffectsElement = pDoc->createElement(EffectXml::kVisibleEffects);
QDomElement visibleEffectsElement = pDoc->createElement(xmlElementName);
root.appendChild(visibleEffectsElement);
for (const auto& pManifest : std::as_const(m_list)) {
for (const auto& pManifest : std::as_const(list)) {
VERIFY_OR_DEBUG_ASSERT(pManifest) {
continue;
}
Expand Down
13 changes: 11 additions & 2 deletions src/effects/visibleeffectslist.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,21 @@ class VisibleEffectsList : public QObject {
const EffectManifestPointer previous(const EffectManifestPointer pManifest) const;

void setList(const QList<EffectManifestPointer>& newList);
void readEffectsXml(const QDomDocument& doc, EffectsBackendManagerPointer pBackendManager);
void saveEffectsXml(QDomDocument* pDoc);
void readEffectsXml(const QDomDocument& doc,
EffectsBackendManagerPointer pBackendManager);
void saveEffectsXml(QDomDocument* pDoc,
EffectsBackendManagerPointer pBackendManager);

signals:
void visibleEffectsListChanged();

private:
QList<EffectManifestPointer> readEffectsList(const QDomDocument& doc,
EffectsBackendManagerPointer pBackendManager,
const QString& xmlElementName);
void saveEffectsListXml(QDomDocument* pDoc,
const QList<EffectManifestPointer>& list,
const QString& xmlElementName);

QList<EffectManifestPointer> m_list;
};
4 changes: 4 additions & 0 deletions src/library/export/engineprimeexportjob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,10 @@ EnginePrimeExportJob::EnginePrimeExportJob(
}
}

// out-of-line declaration because we can't generate dtor in
// header with unique_ptr's of incomplete types.
EnginePrimeExportJob::~EnginePrimeExportJob() = default;

void EnginePrimeExportJob::loadIds(const QSet<CrateId>& crateIds) {
DEBUG_ASSERT_QOBJECT_THREAD_AFFINITY(m_pTrackCollectionManager);

Expand Down
2 changes: 2 additions & 0 deletions src/library/export/engineprimeexportjob.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class EnginePrimeExportJob : public QThread {
TrackCollectionManager* pTrackCollectionManager,
QSharedPointer<EnginePrimeExportRequest> pRequest);

~EnginePrimeExportJob() override;

/// Run the export job.
void run() override;

Expand Down
3 changes: 2 additions & 1 deletion src/library/librarytablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,6 @@ TrackModel::Capabilities LibraryTableModel::getCapabilities() const {
Capability::Hide |
Capability::ResetPlayed |
Capability::RemoveFromDisk |
Capability::Analyze;
Capability::Analyze |
Capability::Properties;
}
4 changes: 3 additions & 1 deletion src/library/missing_hidden/hiddentablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ Qt::ItemFlags HiddenTableModel::flags(const QModelIndex& index) const {
TrackModel::Capabilities HiddenTableModel::getCapabilities() const {
return Capability::Purge |
Capability::Unhide |
Capability::RemoveFromDisk;
Capability::RemoveFromDisk |
Capability::EditMetadata |
Capability::Properties;
}

QString HiddenTableModel::modelKey(bool noSearch) const {
Expand Down
2 changes: 1 addition & 1 deletion src/library/missing_hidden/missingtablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Qt::ItemFlags MissingTableModel::flags(const QModelIndex &index) const {
}

TrackModel::Capabilities MissingTableModel::getCapabilities() const {
return Capability::Purge;
return Capability::Purge | Capability::Properties;
}

QString MissingTableModel::modelKey(bool noSearch) const {
Expand Down
3 changes: 2 additions & 1 deletion src/library/playlisttablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,8 @@ TrackModel::Capabilities PlaylistTableModel::getCapabilities() const {
Capability::ResetPlayed |
Capability::RemoveFromDisk |
Capability::Hide |
Capability::Analyze;
Capability::Analyze |
Capability::Properties;

if (m_iPlaylistId !=
m_pTrackCollectionManager->internalCollection()
Expand Down
1 change: 1 addition & 0 deletions src/library/trackmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class TrackModel {
RemoveCrate = 1u << 15u,
RemoveFromDisk = 1u << 16u,
Analyze = 1u << 17u,
Properties = 1u << 18u,
};
Q_DECLARE_FLAGS(Capabilities, Capability)

Expand Down
3 changes: 2 additions & 1 deletion src/library/trackset/crate/cratetablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ TrackModel::Capabilities CrateTableModel::getCapabilities() const {
Capability::ResetPlayed |
Capability::Hide |
Capability::RemoveFromDisk |
Capability::Analyze;
Capability::Analyze |
Capability::Properties;

if (m_selectedCrate.isValid()) {
Crate crate;
Expand Down
68 changes: 47 additions & 21 deletions src/preferences/dialog/dlgprefwaveform.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
#include "preferences/dialog/dlgprefwaveform.h"

#include "control/controlobject.h"
#include <QMetaEnum>

#include "control/controlpushbutton.h"
#include "library/dao/analysisdao.h"
#include "library/library.h"
#include "moc_dlgprefwaveform.cpp"
#include "preferences/waveformsettings.h"
#include "util/db/dbconnectionpooled.h"
#include "waveform/renderers/waveformwidgetrenderer.h"
#include "waveform/waveformwidgetfactory.h"
#include "widget/woverview.h"

namespace {
const ConfigKey kOverviewTypeCfgKey(QStringLiteral("[Waveform]"),
QStringLiteral("WaveformOverviewType"));
} // namespace

DlgPrefWaveform::DlgPrefWaveform(
QWidget* pParent,
Expand All @@ -19,13 +27,27 @@ DlgPrefWaveform::DlgPrefWaveform(
setupUi(this);

Check failure on line 27 in src/preferences/dialog/dlgprefwaveform.cpp

View workflow job for this annotation

GitHub Actions / macOS 12 arm64

cannot initialize object parameter of type 'Ui_DlgPrefWaveformDlg' with an expression of type 'DlgPrefWaveform'

Check failure on line 27 in src/preferences/dialog/dlgprefwaveform.cpp

View workflow job for this annotation

GitHub Actions / macOS 12 x64

cannot initialize object parameter of type 'Ui_DlgPrefWaveformDlg' with an expression of type 'DlgPrefWaveform'

Check failure on line 27 in src/preferences/dialog/dlgprefwaveform.cpp

View workflow job for this annotation

GitHub Actions / clazy

cannot initialize object parameter of type 'Ui_DlgPrefWaveformDlg' with an expression of type 'DlgPrefWaveform'

// Waveform overview init
waveformOverviewComboBox->addItem(tr("Filtered")); // "0"
waveformOverviewComboBox->addItem(tr("HSV")); // "1"
waveformOverviewComboBox->addItem(tr("RGB")); // "2"
m_pTypeControl = std::make_unique<ControlObject>(
ConfigKey(QStringLiteral("[Waveform]"),
QStringLiteral("WaveformOverviewType")));
waveformOverviewComboBox->addItem(
tr("Filtered"), QVariant::fromValue(WOverview::Type::Filtered));
waveformOverviewComboBox->addItem(tr("HSV"), QVariant::fromValue(WOverview::Type::HSV));
waveformOverviewComboBox->addItem(tr("RGB"), QVariant::fromValue(WOverview::Type::RGB));
m_pTypeControl = std::make_unique<ControlPushButton>(kOverviewTypeCfgKey);
m_pTypeControl->setStates(QMetaEnum::fromType<WOverview::Type>().keyCount());
m_pTypeControl->setReadOnly();
// Update the control with the config value
WOverview::Type overviewType =
m_pConfig->getValue<WOverview::Type>(kOverviewTypeCfgKey, WOverview::Type::RGB);
int cfgTypeIndex = waveformOverviewComboBox->findData(QVariant::fromValue(overviewType));
if (cfgTypeIndex == -1) {
// Invalid config value, set default type RGB and write it to config
waveformOverviewComboBox->setCurrentIndex(
waveformOverviewComboBox->findData(QVariant::fromValue(WOverview::Type::RGB)));
m_pConfig->setValue(kOverviewTypeCfgKey, cfgTypeIndex);
} else {
waveformOverviewComboBox->setCurrentIndex(cfgTypeIndex);
}
// Set the control used by WOverview
m_pTypeControl->forceSet(cfgTypeIndex);

// Populate waveform options.
WaveformWidgetFactory* factory = WaveformWidgetFactory::instance();
Expand Down Expand Up @@ -272,13 +294,14 @@ void DlgPrefWaveform::slotUpdate() {
factory->getUntilMarkAlign()));
untilMarkTextPointSizeSpinBox->setValue(factory->getUntilMarkTextPointSize());

// By default we set RGB woverview = "2"
int overviewType = m_pConfig->getValue(
ConfigKey("[Waveform]","WaveformOverviewType"), 2);
if (overviewType != waveformOverviewComboBox->currentIndex()) {
waveformOverviewComboBox->setCurrentIndex(overviewType);
WOverview::Type cfgOverviewType =
m_pConfig->getValue<WOverview::Type>(kOverviewTypeCfgKey, WOverview::Type::RGB);
// Assumes the combobox index is in sync with the ControlPushButton
if (cfgOverviewType != waveformOverviewComboBox->currentData().value<WOverview::Type>()) {
int cfgOverviewTypeIndex =
waveformOverviewComboBox->findData(QVariant::fromValue(cfgOverviewType));
waveformOverviewComboBox->setCurrentIndex(cfgOverviewTypeIndex);
}
slotSetWaveformOverviewType(overviewType);

bool drawOverviewMinuteMarkers = m_pConfig->getValue(
ConfigKey("[Waveform]", "DrawOverviewMinuteMarkers"), true);
Expand All @@ -293,10 +316,6 @@ void DlgPrefWaveform::slotUpdate() {
}

void DlgPrefWaveform::slotApply() {
ConfigValue overviewtype = ConfigValue(waveformOverviewComboBox->currentIndex());
if (overviewtype != m_pConfig->get(ConfigKey("[Waveform]", "WaveformOverviewType"))) {
m_pConfig->set(ConfigKey("[Waveform]", "WaveformOverviewType"), overviewtype);
}
WaveformSettings waveformSettings(m_pConfig);
waveformSettings.setWaveformCachingEnabled(enableWaveformCaching->isChecked());
waveformSettings.setWaveformGenerationWithAnalysisEnabled(
Expand Down Expand Up @@ -338,7 +357,8 @@ void DlgPrefWaveform::slotResetToDefaults() {
synchronizeZoomCheckBox->setChecked(true);

// RGB overview.
waveformOverviewComboBox->setCurrentIndex(2);
waveformOverviewComboBox->setCurrentIndex(
waveformOverviewComboBox->findData(QVariant::fromValue(WOverview::Type::RGB)));

// Don't normalize overview.
normalizeOverviewCheckBox->setChecked(false);
Expand Down Expand Up @@ -517,9 +537,13 @@ void DlgPrefWaveform::updateEnableUntilMark() {
requiresGLSLLabel->setVisible(!enabled);
}

void DlgPrefWaveform::slotSetWaveformOverviewType(int index) {
m_pConfig->set(ConfigKey("[Waveform]", "WaveformOverviewType"), ConfigValue(index));
m_pTypeControl->forceSet(index);
void DlgPrefWaveform::slotSetWaveformOverviewType() {
// Apply immediately
QVariant comboboxData = waveformOverviewComboBox->currentData();
DEBUG_ASSERT(comboboxData.canConvert<WOverview::Type>());
auto type = comboboxData.value<WOverview::Type>();
m_pConfig->setValue(kOverviewTypeCfgKey, type);
m_pTypeControl->forceSet(static_cast<double>(type));
}

void DlgPrefWaveform::slotSetDefaultZoom(int index) {
Expand Down Expand Up @@ -570,6 +594,8 @@ void DlgPrefWaveform::slotClearCachedWaveforms() {
}

void DlgPrefWaveform::slotSetBeatGridAlpha(int alpha) {
// TODO(xxx) For consistency set this in WaveformWidgetFactory like
// the other waveform controls.
m_pConfig->setValue(ConfigKey("[Waveform]", "beatGridAlpha"), alpha);
WaveformWidgetFactory::instance()->setDisplayBeatGridAlpha(alpha);
}
Expand Down
6 changes: 3 additions & 3 deletions src/preferences/dialog/dlgprefwaveform.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "waveform/renderers/allshader/waveformrenderersignalbase.h"
#endif

class ControlObject;
class ControlPushButton;
class Library;

class DlgPrefWaveform : public DlgPreferencePage, public Ui::DlgPrefWaveformDlg {

Check failure on line 16 in src/preferences/dialog/dlgprefwaveform.h

View workflow job for this annotation

GitHub Actions / macOS 12 arm64

call to implicitly-deleted copy constructor of 'DlgPreferencePage'

Check failure on line 16 in src/preferences/dialog/dlgprefwaveform.h

View workflow job for this annotation

GitHub Actions / macOS 12 arm64

call to implicitly-deleted copy constructor of 'std::unique_ptr<ControlPushButton>'

Check failure on line 16 in src/preferences/dialog/dlgprefwaveform.h

View workflow job for this annotation

GitHub Actions / macOS 12 x64

call to implicitly-deleted copy constructor of 'DlgPreferencePage'

Check failure on line 16 in src/preferences/dialog/dlgprefwaveform.h

View workflow job for this annotation

GitHub Actions / macOS 12 x64

call to implicitly-deleted copy constructor of 'std::unique_ptr<ControlPushButton>'

Check failure on line 16 in src/preferences/dialog/dlgprefwaveform.h

View workflow job for this annotation

GitHub Actions / clazy

call to implicitly-deleted copy constructor of 'DlgPreferencePage'

Check failure on line 16 in src/preferences/dialog/dlgprefwaveform.h

View workflow job for this annotation

GitHub Actions / clazy

call to deleted constructor of 'std::unique_ptr<ControlPushButton>'
Expand Down Expand Up @@ -44,7 +44,7 @@ class DlgPrefWaveform : public DlgPreferencePage, public Ui::DlgPrefWaveformDlg
slotSetWaveformOptions(allshader::WaveformRendererSignalBase::Option::HighDetail, checked);
}
#endif
void slotSetWaveformOverviewType(int index);
void slotSetWaveformOverviewType();
void slotSetDefaultZoom(int index);
void slotSetZoomSynchronization(bool checked);
void slotSetVisualGainAll(double gain);
Expand Down Expand Up @@ -73,7 +73,7 @@ class DlgPrefWaveform : public DlgPreferencePage, public Ui::DlgPrefWaveformDlg
void updateWaveformAcceleration(
WaveformWidgetType::Type type, WaveformWidgetBackend backend);

std::unique_ptr<ControlObject> m_pTypeControl;
std::unique_ptr<ControlPushButton> m_pTypeControl;
std::unique_ptr<ControlObject> m_pOverviewMinuteMarkersControl;

Check failure on line 77 in src/preferences/dialog/dlgprefwaveform.h

View workflow job for this annotation

GitHub Actions / macOS 12 arm64

use of undeclared identifier 'ControlObject'; did you mean 'ConfigObject'?

Check failure on line 77 in src/preferences/dialog/dlgprefwaveform.h

View workflow job for this annotation

GitHub Actions / macOS 12 arm64

use of undeclared identifier 'ControlObject'

Check failure on line 77 in src/preferences/dialog/dlgprefwaveform.h

View workflow job for this annotation

GitHub Actions / macOS 12 x64

use of undeclared identifier 'ControlObject'; did you mean 'ConfigObject'?

Check failure on line 77 in src/preferences/dialog/dlgprefwaveform.h

View workflow job for this annotation

GitHub Actions / macOS 12 x64

use of undeclared identifier 'ControlObject'

Check failure on line 77 in src/preferences/dialog/dlgprefwaveform.h

View workflow job for this annotation

GitHub Actions / Ubuntu 22.04

‘ControlObject’ was not declared in this scope; did you mean ‘ConfigObject’?

Check failure on line 77 in src/preferences/dialog/dlgprefwaveform.h

View workflow job for this annotation

GitHub Actions / Ubuntu 22.04

template argument 1 is invalid

Check failure on line 77 in src/preferences/dialog/dlgprefwaveform.h

View workflow job for this annotation

GitHub Actions / Ubuntu 22.04

template argument 2 is invalid

Check failure on line 77 in src/preferences/dialog/dlgprefwaveform.h

View workflow job for this annotation

GitHub Actions / Ubuntu 22.04

‘<expression error>’ in namespace ‘std’ does not name a type

Check failure on line 77 in src/preferences/dialog/dlgprefwaveform.h

View workflow job for this annotation

GitHub Actions / coverage

‘ControlObject’ was not declared in this scope; did you mean ‘ConfigObject’?

Check failure on line 77 in src/preferences/dialog/dlgprefwaveform.h

View workflow job for this annotation

GitHub Actions / coverage

template argument 1 is invalid

Check failure on line 77 in src/preferences/dialog/dlgprefwaveform.h

View workflow job for this annotation

GitHub Actions / coverage

template argument 2 is invalid

Check failure on line 77 in src/preferences/dialog/dlgprefwaveform.h

View workflow job for this annotation

GitHub Actions / coverage

‘<expression error>’ in namespace ‘std’ does not name a type

Check failure on line 77 in src/preferences/dialog/dlgprefwaveform.h

View workflow job for this annotation

GitHub Actions / clazy

use of undeclared identifier 'ControlObject'; did you mean 'ConfigObject'?

Check failure on line 77 in src/preferences/dialog/dlgprefwaveform.h

View workflow job for this annotation

GitHub Actions / clazy

use of undeclared identifier 'ControlObject'

UserSettingsPointer m_pConfig;
Expand Down
Loading

0 comments on commit d9d23dc

Please sign in to comment.