Skip to content

Commit

Permalink
Merge pull request #52 from UltraStar-Deluxe/support_v120_tags
Browse files Browse the repository at this point in the history
Add support for up to #VERSION:1.2.0.
  • Loading branch information
bohning authored Jan 9, 2025
2 parents a662c4b + ac71a54 commit cb28847
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/QUSongSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ QStringList QUSongSupport::availableTags() {
QStringList result;

result << ENCODING_TAG;
result << VERSION_TAG;
result << TITLE_TAG;
result << ARTIST_TAG;
result << LANGUAGE_TAG;
Expand All @@ -23,9 +24,16 @@ QStringList QUSongSupport::availableTags() {
result << CREATOR_TAG;
result << TAGS_TAG;
result << MP3_TAG;
result << AUDIO_TAG;
result << AUDIOURL_TAG;
result << VOCALS_TAG;
result << INSTRUMENTAL_TAG;
result << COVER_TAG;
result << COVERURL_TAG;
result << BACKGROUND_TAG;
result << BACKGROUNDURL_TAG;
result << VIDEO_TAG;
result << VIDEOURL_TAG;
result << VIDEOGAP_TAG;
result << START_TAG;
result << END_TAG;
Expand Down
1 change: 1 addition & 0 deletions src/resources/UltraStar-Manager.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@
<file>writeID3.png</file>
<file>sync.png</file>
<file>tags.png</file>
<file>format_version.png</file>
</qresource>
<qresource prefix="/big">
<file>save_big.png</file>
Expand Down
Binary file added src/resources/format_version.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions src/song/QUSongFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,23 @@ class QUSongFile: public QUSongInterface {
static bool equal(QUSongFile *s1, QUSongFile *s2);

public slots:
QString version() const {return _info.value(VERSION_TAG, QString(N_A));}
QString artist() const {return _info.value(ARTIST_TAG, QString(N_A));}
QString title() const {return _info.value(TITLE_TAG, QString(N_A));}
QString mp3() const {return _info.value(MP3_TAG, QString(N_A));}
QString audio() const {return _info.value(AUDIO_TAG, QString(N_A));}
QString audiourl() const {return _info.value(AUDIOURL_TAG, QString(N_A));}
QString vocals() const {return _info.value(VOCALS_TAG, QString(N_A));}
QString instrumental() const {return _info.value(INSTRUMENTAL_TAG, QString(N_A));}
QString bpm() const {return _info.value(BPM_TAG, QString(N_A));}
QString gap() const {return _info.value(GAP_TAG, QString(N_A));}
QString video() const {return _info.value(VIDEO_TAG, QString(N_A));}
QString videourl() const {return _info.value(VIDEOURL_TAG, QString(N_A));}
QString videogap() const {return _info.value(VIDEOGAP_TAG, QString(N_A));}
QString cover() const {return _info.value(COVER_TAG, QString(N_A));}
QString coverurl() const {return _info.value(COVERURL_TAG, QString(N_A));}
QString background() const {return _info.value(BACKGROUND_TAG, QString(N_A));}
QString backgroundurl() const {return _info.value(BACKGROUNDURL_TAG, QString(N_A));}
QString start() const {return _info.value(START_TAG, QString(N_A));}
QString language() const {return _info.value(LANGUAGE_TAG, QString(N_A));}
QString relative() const {return _info.value(RELATIVE_TAG, QString(N_A));}
Expand Down
8 changes: 8 additions & 0 deletions src/song/QUSongInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class QString;
class QFileInfo;

#define ENCODING_TAG "ENCODING"
#define VERSION_TAG "VERSION"
#define TITLE_TAG "TITLE"
#define ARTIST_TAG "ARTIST"
#define LANGUAGE_TAG "LANGUAGE"
Expand All @@ -19,9 +20,16 @@ class QFileInfo;
#define CREATOR_TAG "CREATOR"
#define TAGS_TAG "TAGS"
#define MP3_TAG "MP3"
#define AUDIO_TAG "AUDIO"
#define AUDIOURL_TAG "AUDIOURL"
#define VOCALS_TAG "VOCALS"
#define INSTRUMENTAL_TAG "INSTRUMENTAL"
#define COVER_TAG "COVER"
#define COVERURL_TAG "COVERURL"
#define BACKGROUND_TAG "BACKGROUND"
#define BACKGROUNDURL_TAG "BACKGROUNDURL"
#define VIDEO_TAG "VIDEO"
#define VIDEOURL_TAG "VIDEOURL"
#define VIDEOGAP_TAG "VIDEOGAP"
#define START_TAG "START"
#define END_TAG "END"
Expand Down
2 changes: 2 additions & 0 deletions src/songdetails/QUDetailItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ void QUDetailItem::reset() {

if(QString::compare(_tag, ENCODING_TAG) == 0) {
_flagsForSingleSong = Qt::NoItemFlags;
} else if(QString::compare(_tag, VERSION_TAG) == 0) {
_flagsForSingleSong = Qt::NoItemFlags;
// } else if(QString::compare(_tag, TITLE_TAG) == 0) {
} else if(QString::compare(_tag, ARTIST_TAG) == 0) {
_flagsForMultipleSongs = Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable;
Expand Down
21 changes: 21 additions & 0 deletions src/songdetails/QUDetailsTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ void QUDetailsTable::initTagColumn() {
unsigned row = 0;
this->initSeparator(tr("Information"), row++);
this->setItem(row++, 0, new QUTagItem(QIcon(":/control/encoding.png"), tr("Encoding")));
this->setItem(row++, 0, new QUTagItem(QIcon(":/types/format_version.png"), tr("Version")));
this->setItem(row++, 0, new QUTagItem(QIcon(":/types/font.png"), tr("Title")));
this->setItem(row++, 0, new QUTagItem(QIcon(":/types/user.png"), tr("Artist")));
this->setItem(row++, 0, new QUTagItem(QIcon(":/types/language.png"), tr("Language")));
Expand All @@ -55,10 +56,19 @@ void QUDetailsTable::initTagColumn() {

this->initSeparator(tr("Files"), row++);
this->setItem(row++, 0, new QUTagItem(QIcon(":/types/music.png"), tr("MP3")));
this->setItem(row++, 0, new QUTagItem(QIcon(":/types/music.png"), tr("Audio")));
this->setItem(row++, 0, new QUTagItem(QIcon(":/types/music.png"), tr("Vocals")));
this->setItem(row++, 0, new QUTagItem(QIcon(":/types/music.png"), tr("Instrumental")));
this->setItem(row++, 0, new QUTagItem(QIcon(":/types/cover.png"), tr("Cover")));
this->setItem(row++, 0, new QUTagItem(QIcon(":/types/background.png"), tr("Background")));
this->setItem(row++, 0, new QUTagItem(QIcon(":/types/video.png"), tr("Video")));

this->initSeparator(tr("URLs"), row++);
this->setItem(row++, 0, new QUTagItem(QIcon(":/types/music.png"), tr("Audio URL")));
this->setItem(row++, 0, new QUTagItem(QIcon(":/types/cover.png"), tr("Cover URL")));
this->setItem(row++, 0, new QUTagItem(QIcon(":/types/background.png"), tr("Background URL")));
this->setItem(row++, 0, new QUTagItem(QIcon(":/types/video.png"), tr("Video URL")));

this->initSeparator(tr("Control"), row++);
this->setItem(row++, 0, new QUTagItem(QIcon(":/types/videogap.png"), tr("Videogap")));
this->setItem(row++, 0, new QUTagItem(QIcon(":/types/start.png"), tr("Start")));
Expand Down Expand Up @@ -92,6 +102,7 @@ void QUDetailsTable::initValueColumn() {
/* separator here - skip a row */
row++;
this->setItem(row++, 1, new QUDetailItem(ENCODING_TAG));
this->setItem(row++, 1, new QUDetailItem(VERSION_TAG));
this->setItem(row++, 1, new QUDetailItem(TITLE_TAG));
this->setItem(row++, 1, new QUDetailItem(ARTIST_TAG));
this->setItem(row++, 1, new QUDetailItem(LANGUAGE_TAG));
Expand All @@ -107,10 +118,20 @@ void QUDetailsTable::initValueColumn() {
/* separator here - skip a row */
row++;
this->setItem(row++, 1, new QUDetailItem(MP3_TAG));
this->setItem(row++, 1, new QUDetailItem(AUDIO_TAG));
this->setItem(row++, 1, new QUDetailItem(VOCALS_TAG));
this->setItem(row++, 1, new QUDetailItem(INSTRUMENTAL_TAG));
this->setItem(row++, 1, new QUDetailItem(COVER_TAG));
this->setItem(row++, 1, new QUDetailItem(BACKGROUND_TAG));
this->setItem(row++, 1, new QUDetailItem(VIDEO_TAG));

/* separator here - skip a row */
row++;
this->setItem(row++, 1, new QUDetailItem(AUDIOURL_TAG));
this->setItem(row++, 1, new QUDetailItem(COVERURL_TAG));
this->setItem(row++, 1, new QUDetailItem(BACKGROUNDURL_TAG));
this->setItem(row++, 1, new QUDetailItem(VIDEOURL_TAG));

/* separator here - skip a row */
row++;
this->setItem(row++, 1, new QUDetailItem(VIDEOGAP_TAG));
Expand Down

0 comments on commit cb28847

Please sign in to comment.