From 9bd6adb2f30303c22dd1417a17ed51dd1302e3e7 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Fri, 25 Mar 2022 10:06:32 -0500 Subject: [PATCH] lyrics system update --- src/qml/presenter/MainWindow.qml | 1 - src/songsqlmodel.cpp | 20 ++++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/qml/presenter/MainWindow.qml b/src/qml/presenter/MainWindow.qml index 095f7ea..ee95f78 100644 --- a/src/qml/presenter/MainWindow.qml +++ b/src/qml/presenter/MainWindow.qml @@ -59,7 +59,6 @@ Controls.Page { Item { id: mainPageArea Controls.SplitView.fillWidth: true - /* Controls.SplitView.preferredWidth: 500 */ Controls.SplitView.minimumWidth: 100 Presenter.Presentation { diff --git a/src/songsqlmodel.cpp b/src/songsqlmodel.cpp index ac0c750..d055ace 100644 --- a/src/songsqlmodel.cpp +++ b/src/songsqlmodel.cpp @@ -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);