added some lyric checks to update the slides in songeditor
This commit is contained in:
parent
f151e5f05e
commit
e1095817b0
3 changed files with 18 additions and 6 deletions
|
@ -56,6 +56,7 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
function appendVerse(verse) {
|
function appendVerse(verse) {
|
||||||
|
print("Let's append some verses")
|
||||||
print(verse);
|
print(verse);
|
||||||
songModel.append({"verse": verse})
|
songModel.append({"verse": verse})
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ Item {
|
||||||
|
|
||||||
property int songIndex
|
property int songIndex
|
||||||
property var song
|
property var song
|
||||||
|
property string songLyrics
|
||||||
|
|
||||||
GridLayout {
|
GridLayout {
|
||||||
id: mainLayout
|
id: mainLayout
|
||||||
|
@ -238,6 +239,8 @@ Item {
|
||||||
repeat: true
|
repeat: true
|
||||||
running: false
|
running: false
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
|
if (lyricsEditor.text === songLyrics)
|
||||||
|
return;
|
||||||
updateLyrics(lyricsEditor.text);
|
updateLyrics(lyricsEditor.text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -277,6 +280,7 @@ Item {
|
||||||
function changeSong(index) {
|
function changeSong(index) {
|
||||||
const s = songsqlmodel.getSong(index);
|
const s = songsqlmodel.getSong(index);
|
||||||
song = s;
|
song = s;
|
||||||
|
songLyrics = s.lyrics;
|
||||||
songIndex = index;
|
songIndex = index;
|
||||||
|
|
||||||
if (song.backgroundType == "image") {
|
if (song.backgroundType == "image") {
|
||||||
|
@ -298,7 +302,9 @@ Item {
|
||||||
|
|
||||||
function updateLyrics(lyrics) {
|
function updateLyrics(lyrics) {
|
||||||
songsqlmodel.updateLyrics(songIndex, lyrics);
|
songsqlmodel.updateLyrics(songIndex, lyrics);
|
||||||
print(lyrics);
|
songLyrics = lyrics;
|
||||||
|
/* print(lyrics); */
|
||||||
|
changeSlideText(song.id - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateTitle(title) {
|
function updateTitle(title) {
|
||||||
|
@ -325,6 +331,11 @@ Item {
|
||||||
songsqlmodel.updateBackground(songIndex, background);
|
songsqlmodel.updateBackground(songIndex, background);
|
||||||
songsqlmodel.updateBackgroundType(songIndex, backgroundType);
|
songsqlmodel.updateBackgroundType(songIndex, backgroundType);
|
||||||
print("changed background");
|
print("changed background");
|
||||||
|
if (backgroundType === "image") {
|
||||||
|
//todo
|
||||||
|
} else {
|
||||||
|
//todo
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -401,7 +412,7 @@ Item {
|
||||||
|
|
||||||
function changeSlideText(id) {
|
function changeSlideText(id) {
|
||||||
const verses = songsqlmodel.getLyricList(id);
|
const verses = songsqlmodel.getLyricList(id);
|
||||||
print("Here are the verses: " + verses);
|
/* print("Here are the verses: " + verses); */
|
||||||
slideEditor.songs.clear()
|
slideEditor.songs.clear()
|
||||||
verses.forEach(slideEditor.appendVerse);
|
verses.forEach(slideEditor.appendVerse);
|
||||||
}
|
}
|
||||||
|
|
|
@ -161,7 +161,7 @@ QStringList SongSqlModel::getLyricList(const int &row) {
|
||||||
QStringList lyrics;
|
QStringList lyrics;
|
||||||
|
|
||||||
QStringList vorder = recordData.value("vorder").toString().split(" ");
|
QStringList vorder = recordData.value("vorder").toString().split(" ");
|
||||||
qDebug() << vorder;
|
// qDebug() << vorder;
|
||||||
|
|
||||||
QStringList keywords = {"Verse 1", "Verse 2", "Verse 3", "Verse 4",
|
QStringList keywords = {"Verse 1", "Verse 2", "Verse 3", "Verse 4",
|
||||||
"Verse 5", "Verse 6", "Verse 7", "Verse 8",
|
"Verse 5", "Verse 6", "Verse 7", "Verse 8",
|
||||||
|
@ -181,7 +181,7 @@ QStringList SongSqlModel::getLyricList(const int &row) {
|
||||||
|
|
||||||
// This first function pulls out each verse into our verses map
|
// This first function pulls out each verse into our verses map
|
||||||
foreach (line, rawLyrics) {
|
foreach (line, rawLyrics) {
|
||||||
qDebug() << line;
|
// qDebug() << line;
|
||||||
if (firstItem) {
|
if (firstItem) {
|
||||||
if (keywords.contains(line)) {
|
if (keywords.contains(line)) {
|
||||||
recordVerse = true;
|
recordVerse = true;
|
||||||
|
@ -203,7 +203,7 @@ QStringList SongSqlModel::getLyricList(const int &row) {
|
||||||
}
|
}
|
||||||
recordVerse = true;
|
recordVerse = true;
|
||||||
}
|
}
|
||||||
qDebug() << verses;
|
// qDebug() << verses;
|
||||||
|
|
||||||
// let's check to see if there is a verse order, if not return the list given
|
// let's check to see if there is a verse order, if not return the list given
|
||||||
if (vorder.first().isEmpty()) {
|
if (vorder.first().isEmpty()) {
|
||||||
|
@ -224,7 +224,7 @@ QStringList SongSqlModel::getLyricList(const int &row) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qDebug() << lyrics;
|
// qDebug() << lyrics;
|
||||||
|
|
||||||
return lyrics;
|
return lyrics;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue