summaryrefslogtreecommitdiffstats
path: root/src/track
diff options
context:
space:
mode:
authorJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-05-22 11:02:45 +0200
committerGitHub <noreply@github.com>2020-05-22 11:02:45 +0200
commit2091896785e359eec3dc3c42381519ab01397e58 (patch)
tree60a4a94c6068c59f4f6e001f6fa4da797b52d5a1 /src/track
parent4a0daeb0ec2349150319875edf6b6b80f0322c9d (diff)
parent4384fbca45f704c776f3bfd576de492a1863ea49 (diff)
Merge pull request #2809 from uklotzde/lp1879656_track_title_info
lp1879656 Track info (pt. 2): Show file name for tracks without artist&title
Diffstat (limited to 'src/track')
-rw-r--r--src/track/track.cpp9
-rw-r--r--src/track/track.h7
2 files changed, 14 insertions, 2 deletions
diff --git a/src/track/track.cpp b/src/track/track.cpp
index 1547a42985..d05cfb1bf9 100644
--- a/src/track/track.cpp
+++ b/src/track/track.cpp
@@ -57,6 +57,13 @@ inline mixxx::Bpm getActualBpm(
} // anonymous namespace
+// Don't change this string without an entry in the CHANGELOG!
+// Otherwise 3rd party software that picks up the currently
+// playing track from the main window and relies on this
+// formatting would stop working.
+//static
+const QString Track::kArtistTitleSeparator = QStringLiteral(" - ");
+
Track::Track(
TrackFile fileInfo,
SecurityTokenPointer pSecurityToken,
@@ -369,7 +376,7 @@ QString Track::getInfo() const {
}
} else {
return m_record.getMetadata().getTrackInfo().getArtist() +
- QStringLiteral(" - ") +
+ kArtistTitleSeparator +
m_record.getMetadata().getTrackInfo().getTitle();
}
}
diff --git a/src/track/track.h b/src/track/track.h
index 75524ee438..8d4f8e33a5 100644
--- a/src/track/track.h
+++ b/src/track/track.h
@@ -235,7 +235,12 @@ class Track : public QObject {
// Set URL for track
void setURL(const QString& url);
- /// Formatted string with artist and title.
+ /// Separator between artist and title string that is
+ /// used for composing the track info.
+ static const QString kArtistTitleSeparator;
+
+ /// Formatted string with artist and title, separated by
+ /// kArtistTitleSeparator.
QString getInfo() const;
/// The filename if BOTH artist AND title are empty, e.g. for tracks without