From d9d54f422807983d689777451d02ea0ea88be299 Mon Sep 17 00:00:00 2001 From: ronso0 Date: Fri, 2 Feb 2024 14:37:40 +0100 Subject: [PATCH] WIP add TODO and temp stuff --- src/library/dlgtrackinfomulti.cpp | 41 +++++++++++++++++++++++++++++++ src/library/dlgtrackinfomulti.h | 7 ++++++ 2 files changed, 48 insertions(+) diff --git a/src/library/dlgtrackinfomulti.cpp b/src/library/dlgtrackinfomulti.cpp index c267e8eceb5c..2b6d17b3dd8f 100644 --- a/src/library/dlgtrackinfomulti.cpp +++ b/src/library/dlgtrackinfomulti.cpp @@ -437,6 +437,16 @@ void DlgTrackInfoMulti::updateTrackMetadataFields() { } else { txtDuration->setText(mixxx::Duration::formatTime(durations.first())); } + + // Key + + // ReplayGain? + + // Nice to have: display 'date added' range + // txtDateAdded->setText( + // mixxx::displayLocalDateTime( + // mixxx::localDateTimeFromUtc( + // m_trackRecord.getDateAdded()))); } void DlgTrackInfoMulti::saveTracks() { @@ -496,6 +506,12 @@ void DlgTrackInfoMulti::saveTracks() { pTrack->replaceRecord(std::move(rec)); } + // If the user is editing the key and hits enter to close the dialog, + // the editingFinished signal will not fire in time. Therefore, invoke the + // connectedhandlers manually to capture any changes. + // If the key was unchanged or invalid the change will be ignored/rejected. + // static_cast(updateKeyText()); // discard result + connectTracksChanged(); // Repopulate the dialog and update the UI @@ -732,3 +748,28 @@ void DlgTrackInfoMulti::slotReloadCoverArt() { } updateCoverArtFromTracks(); } + +// mixxx::UpdateResult DlgTrackInfoMulti::updateKeyText() { +// const auto keyText = txtKey->text().trimmed(); +// const auto updateResult = +// m_trackRecord.updateGlobalKeyNormalizeText( +// keyText, +// mixxx::track::io::key::USER); +// if (updateResult == mixxx::UpdateResult::Rejected) { +// // Restore the current key text +// displayKeyText(); +// } +// return updateResult; +// } + +// void DlgTrackInfoMulti::displayKeyText() { +// const QString keyText = m_trackRecord.getMetadata().getTrackInfo().getKeyText(); +// txtKey->setText(keyText); +// } + +// void DlgTrackInfoMulti::slotKeyTextChanged() { +// if (updateKeyText() != mixxx::UpdateResult::Unchanged) { +// // Ensure that the text field always reflects the actual value +// displayKeyText(); +// } +// } diff --git a/src/library/dlgtrackinfomulti.h b/src/library/dlgtrackinfomulti.h index 159049ab3fcf..23ef56b36068 100644 --- a/src/library/dlgtrackinfomulti.h +++ b/src/library/dlgtrackinfomulti.h @@ -41,6 +41,8 @@ class DlgTrackInfoMulti : public QDialog, public Ui::DlgTrackInfoMulti { /// the dialog from all tracks. This discards pending changes. void slotTrackChanged(TrackId trackId); + // void focusField(const QString& property); + void slotColorButtonClicked(); void slotColorPicked(const mixxx::RgbColor::optional_t& newColor); @@ -53,6 +55,7 @@ class DlgTrackInfoMulti : public QDialog, public Ui::DlgTrackInfoMulti { void slotCoverInfoSelected(const CoverInfoRelative& coverInfo); void slotReloadCoverArt(); + // void slotKeyTextChanged(); private: void init(); @@ -70,6 +73,8 @@ class DlgTrackInfoMulti : public QDialog, public Ui::DlgTrackInfoMulti { void updateCoverArtFromTracks(); void trackColorDialogSetColorStyleButton(const mixxx::RgbColor::optional_t& color, bool variousColors = false); + // mixxx::UpdateResult updateKeyText(); + // void displayKeyText(); TrackPointer getTrackFromSetById(TrackId trackId) { DEBUG_ASSERT(!m_pLoadedTracks.isEmpty()); @@ -85,6 +90,8 @@ class DlgTrackInfoMulti : public QDialog, public Ui::DlgTrackInfoMulti { QHash m_pLoadedTracks; QList m_trackRecords; + // QHash m_propertyWidgets; + parented_ptr m_pWCoverArtMenu; parented_ptr m_pWCoverArtLabel; parented_ptr m_pWStarRating;