Skip to content

Commit

Permalink
WIP add TODO and temp stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
ronso0 committed Mar 20, 2024
1 parent 21da6f2 commit a48e002
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
41 changes: 41 additions & 0 deletions src/library/dlgtrackinfomulti.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -505,6 +515,12 @@ void DlgTrackInfoMulti::saveTracks() {
pTrack->replaceRecord(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<void>(updateKeyText()); // discard result

connectTracksChanged();

// Repopulate the dialog and update the UI
Expand Down Expand Up @@ -741,3 +757,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();
// }
// }
7 changes: 7 additions & 0 deletions src/library/dlgtrackinfomulti.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -53,6 +55,7 @@ class DlgTrackInfoMulti : public QDialog, public Ui::DlgTrackInfoMulti {
void slotCoverInfoSelected(const CoverInfoRelative& coverInfo);

void slotReloadCoverArt();
// void slotKeyTextChanged();

private:
void init();
Expand All @@ -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());
Expand All @@ -85,6 +90,8 @@ class DlgTrackInfoMulti : public QDialog, public Ui::DlgTrackInfoMulti {
QHash<TrackId, TrackPointer> m_pLoadedTracks;
QList<mixxx::TrackRecord> m_trackRecords;

// QHash<QString, QWidget*> m_propertyWidgets;

parented_ptr<WCoverArtMenu> m_pWCoverArtMenu;
parented_ptr<WCoverArtLabel> m_pWCoverArtLabel;
parented_ptr<WStarRating> m_pWStarRating;
Expand Down

0 comments on commit a48e002

Please sign in to comment.