adding keywords to try to base finding place off that
This commit is contained in:
parent
9bd6adb2f3
commit
fe32ccc3bb
1 changed files with 45 additions and 34 deletions
|
@ -145,47 +145,58 @@ QStringList SongSqlModel::getLyricList(const int &row) {
|
||||||
qDebug() << rawLyrics;
|
qDebug() << rawLyrics;
|
||||||
|
|
||||||
QStringList lyrics;
|
QStringList lyrics;
|
||||||
qDebug() << lyrics;
|
// qDebug() << lyrics;
|
||||||
|
|
||||||
QStringList vorder = recordData.value("vorder").toString().split(" ");
|
QStringList vorder = recordData.value("vorder").toString().split(" ");
|
||||||
qDebug() << vorder;
|
qDebug() << vorder;
|
||||||
|
|
||||||
int startIndex;
|
|
||||||
int endIndex;
|
int endIndex;
|
||||||
QString line;
|
QString line;
|
||||||
|
QStringList keywords = {"Verse 1", "Verse 2", "Verse 3", "Verse 4",
|
||||||
|
"Verse 5", "Verse 6", "Verse 7", "Verse 8",
|
||||||
|
"Chorus 1", "Chorus 2", "Chorus 3", "Chorus 4",
|
||||||
|
"Bridge 1", "Bridge 2", "Bridge 3", "Bridge 4",
|
||||||
|
"Intro 1", "Outro 2", "Ending 1", "Other 1"};
|
||||||
|
|
||||||
|
foreach (const QString &vstr, vorder) {
|
||||||
|
int startIndex;
|
||||||
QString verse;
|
QString verse;
|
||||||
qDebug() << vorder.contains("C1");
|
qDebug() << vstr;
|
||||||
qDebug() << vorder.indexOf("C1");
|
|
||||||
foreach (QString vstr, vorder) {
|
|
||||||
foreach (line, rawLyrics) {
|
foreach (line, rawLyrics) {
|
||||||
|
if (keywords.contains(line)) {
|
||||||
if (line.startsWith(vstr.at(0)) && line.endsWith(vstr.at(1))) {
|
if (line.startsWith(vstr.at(0)) && line.endsWith(vstr.at(1))) {
|
||||||
qDebug() << line;
|
qDebug() << vstr << line;
|
||||||
startIndex = rawLyrics.indexOf(line);
|
startIndex = rawLyrics.indexOf(line);
|
||||||
}
|
|
||||||
if (rawLyrics.indexOf(line) > startIndex)
|
|
||||||
verse.append(line + "\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
foreach (line, rawLyrics) {
|
|
||||||
if (line.trimmed() == "Chorus 1") {
|
|
||||||
startIndex = rawLyrics.indexOf(line) + 1;
|
|
||||||
// qDebug() << line;
|
|
||||||
// qDebug() << startIndex;
|
|
||||||
}
|
|
||||||
if (line.trimmed() == "Verse 1") {
|
|
||||||
endIndex = rawLyrics.indexOf(line);
|
|
||||||
// qDebug() << endIndex;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (rawLyrics.indexOf(line) == startIndex - 1) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
verse.append(line + "\n");
|
qDebug() << "Break out";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
qDebug() << line;
|
||||||
|
// verse.append(line + "\n");
|
||||||
// qDebug() << verse;
|
// qDebug() << verse;
|
||||||
}
|
}
|
||||||
|
// lyrics.append(verse);
|
||||||
|
// qDebug() << verse;
|
||||||
|
}
|
||||||
|
// foreach (line, rawLyrics) {
|
||||||
|
// if (line.trimmed() == "Chorus 1") {
|
||||||
|
// startIndex = rawLyrics.indexOf(line) + 1;
|
||||||
|
// // qDebug() << line;
|
||||||
|
// // qDebug() << startIndex;
|
||||||
|
// }
|
||||||
|
// if (line.trimmed() == "Verse 1") {
|
||||||
|
// endIndex = rawLyrics.indexOf(line);
|
||||||
|
// // qDebug() << endIndex;
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// if (rawLyrics.indexOf(line) == startIndex - 1) {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
// verse.append(line + "\n");
|
||||||
|
// // qDebug() << verse;
|
||||||
|
// }
|
||||||
|
|
||||||
lyrics.append(verse);
|
|
||||||
qDebug() << lyrics;
|
|
||||||
|
|
||||||
return lyrics;
|
return lyrics;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue