Skip to content

Commit 9412f3c

Browse files
authored
Merge pull request #96 from UltraStar-Deluxe/instrumental-vocals
Full Support for INSTRUMENTALS and VOCALS
2 parents 8239c78 + a9cb295 commit 9412f3c

30 files changed

Lines changed: 3026 additions & 2497 deletions

setup/win64/UltraStar-Manager.nsi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ Section "Application" SecCopyUI
168168
File "plugins\config\rename\030-renameSongTxt.xml"
169169
File "plugins\config\rename\035-renameSongTxtSpecial.xml"
170170
File "plugins\config\rename\040-renameSongAudio.xml"
171+
File "plugins\config\rename\041-renameSongInstrumental.xml"
172+
File "plugins\config\rename\042-renameSongVocals.xml"
171173
File "plugins\config\rename\050-renameSongCover.xml"
172174
File "plugins\config\rename\060-renameSongBackground.xml"
173175
File "plugins\config\rename\070-renameSongVideo.xml"
@@ -320,6 +322,8 @@ Section "Uninstall"
320322
Delete "$INSTDIR\plugins\config\rename\035-renameSongTxtSpecial.xml"
321323
Delete "$INSTDIR\plugins\config\rename\040-renameSongAudio.xml"
322324
Delete "$INSTDIR\plugins\config\rename\040-renameSongMp3.xml"
325+
Delete "$INSTDIR\plugins\config\rename\041-renameSongInstrumental.xml"
326+
Delete "$INSTDIR\plugins\config\rename\042-renameSongVocals.xml"
323327
Delete "$INSTDIR\plugins\config\rename\050-renameSongCover.xml"
324328
Delete "$INSTDIR\plugins\config\rename\060-renameSongBackground.xml"
325329
Delete "$INSTDIR\plugins\config\rename\070-renameSongVideo.xml"

src/QUMainWindow.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,22 @@ void QUMainWindow::editSongSetFileLink(QTreeWidgetItem *item, int column) {
748748
logSrv->add(QString(tr("Audio file changed from \"%1\" to: \"%2\".")).arg(song->audio(), songItem->text(FOLDER_COLUMN)), QU::Information);
749749
song->setAudioInfo(songItem->text(FOLDER_COLUMN));
750750
song->save();
751-
} else if( songItem->icon(COVER_COLUMN).isNull()
751+
}
752+
else if( songItem->icon(INSTRUMENTAL_COLUMN).isNull()
753+
&& QUSongSupport::allowedAudioFiles().contains(fileScheme, Qt::CaseInsensitive)
754+
&& column == INSTRUMENTAL_COLUMN ) {
755+
logSrv->add(QString(tr("Instrumental file changed from \"%1\" to: \"%2\".")).arg(song->instrumental(), songItem->text(FOLDER_COLUMN)), QU::Information);
756+
song->setInfo(INSTRUMENTAL_TAG, songItem->text(FOLDER_COLUMN));
757+
song->save();
758+
}
759+
else if( songItem->icon(VOCALS_COLUMN).isNull()
760+
&& QUSongSupport::allowedAudioFiles().contains(fileScheme, Qt::CaseInsensitive)
761+
&& column == VOCALS_COLUMN ) {
762+
logSrv->add(QString(tr("Vocals file changed from \"%1\" to: \"%2\".")).arg(song->vocals(), songItem->text(FOLDER_COLUMN)), QU::Information);
763+
song->setInfo(VOCALS_TAG, songItem->text(FOLDER_COLUMN));
764+
song->save();
765+
}
766+
else if( songItem->icon(COVER_COLUMN).isNull()
752767
&& QUSongSupport::allowedImageFiles().contains(fileScheme, Qt::CaseInsensitive)
753768
&& column == COVER_COLUMN ) {
754769
logSrv->add(QString(tr("Cover changed from \"%1\" to: \"%2\".")).arg(song->cover(), songItem->text(FOLDER_COLUMN)), QU::Information);

src/UltraStar-Manager.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CONFIG += c++11 app_bundle
1+
CONFIG += c++17 app_bundle
22
TEMPLATE = app
33
UI_DIR = ui
44

src/plugins/rename/QURenameTask.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ void QURenameTask::startOn(QUSongInterface *song) {
103103
else if (QString::compare(this->_target, "path", Qt::CaseInsensitive) == 0) song->moveAllFiles(schema);
104104
else if (QString::compare(this->_target, "txt", Qt::CaseInsensitive) == 0) song->renameSongTxt(schema);
105105
else if (QString::compare(this->_target, "audio", Qt::CaseInsensitive) == 0) song->renameSongAudio(schema);
106+
else if (QString::compare(this->_target, "instrumental", Qt::CaseInsensitive) == 0) song->renameSongInstrumental(schema);
107+
else if (QString::compare(this->_target, "vocals", Qt::CaseInsensitive) == 0) song->renameSongVocals(schema);
106108
else if (QString::compare(this->_target, "cover", Qt::CaseInsensitive) == 0) song->renameSongCover(schema);
107109
else if (QString::compare(this->_target, "background", Qt::CaseInsensitive) == 0) song->renameSongBackground(schema);
108110
else if (QString::compare(this->_target, "video", Qt::CaseInsensitive) == 0) song->renameSongVideo(schema);
@@ -122,7 +124,7 @@ int QURenameTask::configure(QWidget *parent) {
122124
* \returns a list of all possible targets used by rename tasks.
123125
*/
124126
QStringList QURenameTask::availableTargets() {
125-
return QString("dir path txt audio cover background video").split(" ");
127+
return QString("dir path txt audio instrumental vocals cover background video").split(" ");
126128
}
127129

128130
QStringList QURenameTask::availableSources() {
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<task>
2+
<general type="rename" >
3+
<icon resource=":/types/instrumental.png" />
4+
<description><![CDATA[Rename instrumental file to "Artist - Title [INSTR].*"]]></description>
5+
<tooltip/>
6+
</general>
7+
<rename target="instrumental" schema="%1 - %2 [INSTR].%3" >
8+
<data source="artist" />
9+
<data source="title" />
10+
<data keepSuffix="true" />
11+
</rename>
12+
</task>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<task>
2+
<general type="rename" >
3+
<icon resource=":/types/vocals.png" />
4+
<description><![CDATA[Rename vocals file to "Artist - Title [VOC].*"]]></description>
5+
<tooltip/>
6+
</general>
7+
<rename target="vocals" schema="%1 - %2 [VOC].%3" >
8+
<data source="artist" />
9+
<data source="title" />
10+
<data keepSuffix="true" />
11+
</rename>
12+
</task>

src/plugins/rename/getTaskText.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
# python
22

3+
from __future__ import absolute_import
4+
from __future__ import print_function
35
import glob
46
import re
57

6-
finder = re.compile("<!\[CDATA\[(.*?)\]\]>")
7-
outfile = file(r"language.h", "w")
8+
finder = re.compile(r"<!\[CDATA\[(.*?)\]\]>")
9+
outfile = open(r"language.h", "w")
810

911
i = 1
10-
11-
for filename in glob.glob(r"config\*.xml"):
12-
xml = file(filename).read()
12+
13+
for filename in glob.glob(r"config/*.xml"):
14+
xml = open(filename).read()
1315
for text in finder.findall(xml):
14-
print >> outfile, "#define TASKTEXT%i QObject::tr(\"%s\")" % (i, text.replace('"', r'\"'))
16+
print("#define TASKTEXT%i QObject::tr(\"%s\")" % (i, text.replace('"', r'\"')), file=outfile)
1517
i+=1
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# python
2+
3+
import glob
4+
import re
5+
6+
finder = re.compile("<!\[CDATA\[(.*?)\]\]>")
7+
outfile = file(r"language.h", "w")
8+
9+
i = 1
10+
11+
for filename in glob.glob(r"config\*.xml"):
12+
xml = file(filename).read()
13+
for text in finder.findall(xml):
14+
print >> outfile, "#define TASKTEXT%i QObject::tr(\"%s\")" % (i, text.replace('"', r'\"'))
15+
i+=1

src/plugins/rename/language.h

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
1-
#define TASKTEXT1 QObject::tr("Change path to \"Artist - Title\" (default)")
2-
#define TASKTEXT2 QObject::tr("All songs will be in the UltraStar song folder with a custom subdirectory for each one.")
3-
#define TASKTEXT3 QObject::tr("Change path to \"Genre/Artist - Title\"")
4-
#define TASKTEXT4 QObject::tr("Songs will be organized in subdirectories by their genres.")
5-
#define TASKTEXT5 QObject::tr("Change path to \"Edition/Artist - Title\"")
6-
#define TASKTEXT6 QObject::tr("Songs will be organized in subdirectories by their edition.")
7-
#define TASKTEXT7 QObject::tr("Change path to \"Artist/Artist - Title\"")
8-
#define TASKTEXT8 QObject::tr("Songs will be organized in subdirectories by their artist.")
9-
#define TASKTEXT9 QObject::tr("Change path to \"Language/Artist - Title\"")
10-
#define TASKTEXT10 QObject::tr("Songs will be organized in subdirectories by their language.")
11-
#define TASKTEXT11 QObject::tr("Change path to \"Artist/Album/Artist - Title\"")
12-
#define TASKTEXT12 QObject::tr("Songs will be organized in subdirectories by their artist and album.<br><b>You need the custom tag #ALBUM for this task.</b>")
13-
#define TASKTEXT13 QObject::tr("Rename directory to \"Artist - Title\"")
14-
#define TASKTEXT14 QObject::tr("Rename directory to \"Artist - Title [VIDEO] [SC]\" if checked or video present, keep other folder tags")
15-
#define TASKTEXT15 QObject::tr("Looks for <b>[SC]</b> in the <b>#EDITION</b> tag to find out whether it is checked or not.<br><br>Other folder tags like <b>[KARAOKE]</b> will be appended to the end if present.")
16-
#define TASKTEXT16 QObject::tr("Rename songtext file to \"Artist - Title.*\"")
17-
#define TASKTEXT17 QObject::tr("Rename songtext file to \"Artist - Title.*\" and use \"txd\" extension for duets")
18-
#define TASKTEXT18 QObject::tr("Rename audio file to \"Artist - Title.*\"")
19-
#define TASKTEXT19 QObject::tr("Rename cover to \"Artist - Title [CO].*\"")
20-
#define TASKTEXT20 QObject::tr("Rename the cover file to a proper schema.<br>File endings will be preserved.")
21-
#define TASKTEXT21 QObject::tr("Rename background to \"Artist - Title [BG].*\"")
22-
#define TASKTEXT22 QObject::tr("Rename video to \"Artist - Title.*\"")
23-
#define TASKTEXT23 QObject::tr("Rename video to \"Artist - Title [VD#*].*\" considering #VIDEOGAP value")
24-
#define TASKTEXT24 QObject::tr("Uses <b>#VIDEOGAP:0</b> if tag not present.")
1+
#define TASKTEXT1 QObject::tr("Change path to \"Artist/Album/Artist - Title\"")
2+
#define TASKTEXT2 QObject::tr("Songs will be organized in subdirectories by their artist and album.<br><b>You need the custom tag #ALBUM for this task.</b>")
3+
#define TASKTEXT3 QObject::tr("Change path to \"Language/Artist - Title\"")
4+
#define TASKTEXT4 QObject::tr("Songs will be organized in subdirectories by their language.")
5+
#define TASKTEXT5 QObject::tr("Change path to \"Artist - Title\" (default)")
6+
#define TASKTEXT6 QObject::tr("All songs will be in the UltraStar song folder with a custom subdirectory for each one.")
7+
#define TASKTEXT7 QObject::tr("Change path to \"Edition/Artist - Title\"")
8+
#define TASKTEXT8 QObject::tr("Songs will be organized in subdirectories by their edition.")
9+
#define TASKTEXT9 QObject::tr("Rename video to \"Artist - Title.*\"")
10+
#define TASKTEXT10 QObject::tr("Change path to \"Artist/Artist - Title\"")
11+
#define TASKTEXT11 QObject::tr("Songs will be organized in subdirectories by their artist.")
12+
#define TASKTEXT12 QObject::tr("Rename background to \"Artist - Title [BG].*\"")
13+
#define TASKTEXT13 QObject::tr("Rename audio file to \"Artist - Title.*\"")
14+
#define TASKTEXT14 QObject::tr("Rename directory to \"Artist - Title [VIDEO] [SC]\" if checked or video present, keep other folder tags")
15+
#define TASKTEXT15 QObject::tr("Looks for <b>[SC]</b> in the <b>#EDITION</b> tag to find out whether it is checked or not.<br><br>Other folder tags like <b>[KARAOKE]</b> will be appended to the end if present.")
16+
#define TASKTEXT16 QObject::tr("Rename directory to \"Artist - Title\"")
17+
#define TASKTEXT17 QObject::tr("Rename vocals file to \"Artist - Title [VOC].*\"")
18+
#define TASKTEXT18 QObject::tr("Rename instrumental file to \"Artist - Title [INSTR].*\"")
19+
#define TASKTEXT19 QObject::tr("Rename video to \"Artist - Title [VD#*].*\" considering #VIDEOGAP value")
20+
#define TASKTEXT20 QObject::tr("Uses <b>#VIDEOGAP:0</b> if tag not present.")
21+
#define TASKTEXT21 QObject::tr("Rename songtext file to \"Artist - Title.*\"")
22+
#define TASKTEXT22 QObject::tr("Rename cover to \"Artist - Title [CO].*\"")
23+
#define TASKTEXT23 QObject::tr("Rename the cover file to a proper schema.<br>File endings will be preserved.")
24+
#define TASKTEXT24 QObject::tr("Change path to \"Genre/Artist - Title\"")
25+
#define TASKTEXT25 QObject::tr("Songs will be organized in subdirectories by their genres.")
26+
#define TASKTEXT26 QObject::tr("Rename songtext file to \"Artist - Title.txt\" and add \" (duet)\" to title for duets")

src/plugins/rename/rename.de.ts

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,67 +4,77 @@
44
<context>
55
<name>QObject</name>
66
<message>
7-
<location filename="language.h" line="1"/>
7+
<location filename="language.h" line="5"/>
88
<source>Change path to &quot;Artist - Title&quot; (default)</source>
99
<translation>Verschiebe Song nach &quot;Interpret - Titel&quot; (Standard)</translation>
1010
</message>
1111
<message>
12-
<location filename="language.h" line="2"/>
12+
<location filename="language.h" line="6"/>
1313
<source>All songs will be in the UltraStar song folder with a custom subdirectory for each one.</source>
1414
<translation>Alle Songs landen im UltraStar-Songordner und erhalten ein eigenes Verzeichnis.</translation>
1515
</message>
1616
<message>
17-
<location filename="language.h" line="3"/>
17+
<location filename="language.h" line="18"/>
18+
<source>Rename instrumental file to &quot;Artist - Title [INSTR].*&quot;</source>
19+
<translation type="unfinished"></translation>
20+
</message>
21+
<message>
22+
<location filename="language.h" line="24"/>
1823
<source>Change path to &quot;Genre/Artist - Title&quot;</source>
1924
<translation>Verschiebe Song nach &quot;Genre/Interpret - Titel&quot;</translation>
2025
</message>
2126
<message>
22-
<location filename="language.h" line="4"/>
27+
<location filename="language.h" line="25"/>
2328
<source>Songs will be organized in subdirectories by their genres.</source>
2429
<translation>Songs werden in Unterverzeichnissen nach ihren Genres organisiert.</translation>
2530
</message>
2631
<message>
27-
<location filename="language.h" line="5"/>
32+
<location filename="language.h" line="26"/>
33+
<source>Rename songtext file to &quot;Artist - Title.txt&quot; and add &quot; (duet)&quot; to title for duets</source>
34+
<translation type="unfinished"></translation>
35+
</message>
36+
<message>
37+
<location filename="language.h" line="7"/>
2838
<source>Change path to &quot;Edition/Artist - Title&quot;</source>
2939
<translation>Verschiebe Song nach &quot;Edition/Interpret - Titel&quot;</translation>
3040
</message>
3141
<message>
32-
<location filename="language.h" line="6"/>
42+
<location filename="language.h" line="8"/>
3343
<source>Songs will be organized in subdirectories by their edition.</source>
3444
<translation>Songs werden in Unterverzeichnissen nach ihren Editionen organisiert.</translation>
3545
</message>
3646
<message>
37-
<location filename="language.h" line="7"/>
47+
<location filename="language.h" line="10"/>
3848
<source>Change path to &quot;Artist/Artist - Title&quot;</source>
3949
<translation>Verschiebe Song nach &quot;Artist/Interpret - Titel&quot;</translation>
4050
</message>
4151
<message>
42-
<location filename="language.h" line="8"/>
52+
<location filename="language.h" line="11"/>
4353
<source>Songs will be organized in subdirectories by their artist.</source>
4454
<translation>Songs werden in Unterverzeichnissen nach ihren Interpreten organisiert.</translation>
4555
</message>
4656
<message>
47-
<location filename="language.h" line="9"/>
57+
<location filename="language.h" line="3"/>
4858
<source>Change path to &quot;Language/Artist - Title&quot;</source>
4959
<translation>Verschiebe Song nach &quot;Sprache/Interpret - Titel&quot;</translation>
5060
</message>
5161
<message>
52-
<location filename="language.h" line="10"/>
62+
<location filename="language.h" line="4"/>
5363
<source>Songs will be organized in subdirectories by their language.</source>
5464
<translation>Songs werden in Unterverzeichnissen nach ihren Sprachen organisiert.</translation>
5565
</message>
5666
<message>
57-
<location filename="language.h" line="11"/>
67+
<location filename="language.h" line="1"/>
5868
<source>Change path to &quot;Artist/Album/Artist - Title&quot;</source>
5969
<translation>Verschiebe Song nach &quot;Interpret/Album/Interpret - Titel&quot;</translation>
6070
</message>
6171
<message>
62-
<location filename="language.h" line="12"/>
72+
<location filename="language.h" line="2"/>
6373
<source>Songs will be organized in subdirectories by their artist and album.&lt;br&gt;&lt;b&gt;You need the custom tag #ALBUM for this task.&lt;/b&gt;</source>
6474
<translation>Songs werden in Unterverzeichnissen nach ihren Interpreten und Alben organisiert.&lt;br&gt;&lt;b&gt;Der benutzerdefinierte Tag #ALBUM wird benötigt.&lt;/b&gt;</translation>
6575
</message>
6676
<message>
67-
<location filename="language.h" line="13"/>
77+
<location filename="language.h" line="16"/>
6878
<source>Rename directory to &quot;Artist - Title&quot;</source>
6979
<translation>Benenne Ordner um nach &quot;Interpret - Titel&quot;</translation>
7080
</message>
@@ -81,51 +91,51 @@
8191
<translation>Sucht nach &lt;b&gt;[SC]&lt;/b&gt; im &lt;b&gt;#EDITION&lt;/b&gt;-Tag, um herauszufinden, ob ein Song &quot;checked&quot; ist oder nicht.&lt;br&gt;&lt;br&gt;Andere Ordner-Tags wie &lt;b&gt;[KARAOKE]&lt;/b&gt; bleiben erhalten und werden an den Ordnernamen angehängt.</translation>
8292
</message>
8393
<message>
84-
<location filename="language.h" line="16"/>
94+
<location filename="language.h" line="21"/>
8595
<source>Rename songtext file to &quot;Artist - Title.*&quot;</source>
8696
<oldsource>Rename songtext file to &quot;Artist - Title.txt&quot;</oldsource>
8797
<translation>Benenne Song-Datei um nach &quot;Interpret - Titel.*&quot;</translation>
8898
</message>
8999
<message>
90100
<location filename="language.h" line="17"/>
91-
<source>Rename songtext file to &quot;Artist - Title.*&quot; and use &quot;txd&quot; extension for duets</source>
92-
<oldsource>Rename songtext file to &quot;Artist - Title.*&quot; and use &quot;txd&quot; extension for duets.</oldsource>
93-
<translation>Benenne Song-Datei um nach &quot;Interpret - Titel.*&quot; und verwende &quot;txd&quot; als Erweiterung für Duette</translation>
101+
<source>Rename vocals file to &quot;Artist - Title [VOC].*&quot;</source>
102+
<oldsource>Rename songtext file to &quot;Artist - Title.*&quot; and use &quot;txd&quot; extension for duets</oldsource>
103+
<translation type="unfinished">Benenne Song-Datei um nach &quot;Interpret - Titel.*&quot; und verwende &quot;txd&quot; als Erweiterung für Duette</translation>
94104
</message>
95105
<message>
96-
<location filename="language.h" line="18"/>
106+
<location filename="language.h" line="13"/>
97107
<source>Rename audio file to &quot;Artist - Title.*&quot;</source>
98108
<oldsource>Change duet songtext file to &quot;Artist - Title.txd&quot;</oldsource>
99109
<translation>Benenne Audio-Datei um nach &quot;Interpret - Titel.*&quot;</translation>
100110
</message>
101111
<message>
102-
<location filename="language.h" line="19"/>
112+
<location filename="language.h" line="22"/>
103113
<source>Rename cover to &quot;Artist - Title [CO].*&quot;</source>
104114
<translation>Benenne Cover um nach &quot;Interpret - Titel [CO].*&quot;</translation>
105115
</message>
106116
<message>
107-
<location filename="language.h" line="20"/>
117+
<location filename="language.h" line="23"/>
108118
<source>Rename the cover file to a proper schema.&lt;br&gt;File endings will be preserved.</source>
109119
<translation>Benenne die Bilddatei für das Cover nach einem bestimmten Schema um.&lt;br&gt;Dateiendungen werden beibehalten.</translation>
110120
</message>
111121
<message>
112-
<location filename="language.h" line="21"/>
122+
<location filename="language.h" line="12"/>
113123
<source>Rename background to &quot;Artist - Title [BG].*&quot;</source>
114124
<translation>Benenne Hintergrund um nach &quot;Interpret - Titel [BG].*&quot;</translation>
115125
</message>
116126
<message>
117-
<location filename="language.h" line="22"/>
127+
<location filename="language.h" line="9"/>
118128
<source>Rename video to &quot;Artist - Title.*&quot;</source>
119129
<translation>Benenne Video um nach &quot;Interpret - Titel.*&quot;</translation>
120130
</message>
121131
<message>
122-
<location filename="language.h" line="23"/>
132+
<location filename="language.h" line="19"/>
123133
<source>Rename video to &quot;Artist - Title [VD#*].*&quot; considering #VIDEOGAP value</source>
124134
<oldsource>Rename video to &quot;Artist - Title [VD#*].*&quot; consider VIDEOGAP</oldsource>
125135
<translation>Benenne Video um nach &quot;Interpret - Titel [VD#*].*&quot; unter Beachtung des #VIDEOGAP-Werts</translation>
126136
</message>
127137
<message>
128-
<location filename="language.h" line="24"/>
138+
<location filename="language.h" line="20"/>
129139
<source>Uses &lt;b&gt;#VIDEOGAP:0&lt;/b&gt; if tag not present.</source>
130140
<translation>Wählt &lt;b&gt;#VIDEOGAP:0&lt;/b&gt; wenn dieser Tag fehlt.</translation>
131141
</message>
@@ -191,7 +201,7 @@
191201
<translation type="obsolete">Wählt &lt;b&gt;#VIDEOGAP:0&lt;/b&gt; wenn dieser Tag fehlt.</translation>
192202
</message>
193203
<message>
194-
<location filename="QURenameTask.cpp" line="110"/>
204+
<location filename="QURenameTask.cpp" line="112"/>
195205
<source>Invalid target: %1</source>
196206
<translation>Ungültiges Ziel: %1</translation>
197207
</message>

0 commit comments

Comments
 (0)