lyrics system update

This commit is contained in:
Chris Cochrun 2022-03-25 10:06:32 -05:00
parent 7c1ff53074
commit 9bd6adb2f3
2 changed files with 16 additions and 5 deletions

View file

@ -59,7 +59,6 @@ Controls.Page {
Item {
id: mainPageArea
Controls.SplitView.fillWidth: true
/* Controls.SplitView.preferredWidth: 500 */
Controls.SplitView.minimumWidth: 100
Presenter.Presentation {

View file

@ -154,22 +154,34 @@ QStringList SongSqlModel::getLyricList(const int &row) {
int endIndex;
QString line;
QString verse;
qDebug() << vorder.contains("C1");
qDebug() << vorder.indexOf("C1");
foreach (QString vstr, vorder) {
foreach (line, rawLyrics) {
if (line.startsWith(vstr.at(0)) && line.endsWith(vstr.at(1))) {
qDebug() << 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;
// qDebug() << line;
// qDebug() << startIndex;
}
if (line.trimmed() == "Verse 1") {
endIndex = rawLyrics.indexOf(line);
qDebug() << endIndex;
// qDebug() << endIndex;
break;
}
if (rawLyrics.indexOf(line) == startIndex - 1) {
continue;
}
verse.append(line + "\n");
qDebug() << verse;
// qDebug() << verse;
}
lyrics.append(verse);