making a more streamlined newSong function
This commit is contained in:
parent
fb3e3e726c
commit
d63b3faec1
1 changed files with 27 additions and 6 deletions
|
@ -11,7 +11,6 @@ Item {
|
||||||
|
|
||||||
property int songIndex
|
property int songIndex
|
||||||
property var song
|
property var song
|
||||||
property string songLyrics
|
|
||||||
|
|
||||||
GridLayout {
|
GridLayout {
|
||||||
id: mainLayout
|
id: mainLayout
|
||||||
|
@ -264,7 +263,7 @@ Item {
|
||||||
repeat: true
|
repeat: true
|
||||||
running: false
|
running: false
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
if (lyricsEditor.text === songLyrics)
|
if (lyricsEditor.text === song.lyrics)
|
||||||
return;
|
return;
|
||||||
updateLyrics(lyricsEditor.text);
|
updateLyrics(lyricsEditor.text);
|
||||||
}
|
}
|
||||||
|
@ -318,12 +317,34 @@ Item {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function newSong(index) {
|
||||||
|
clearSlides();
|
||||||
|
song = songProxyModel.songModel.getSong(index);
|
||||||
|
console.log(song.lyrics);
|
||||||
|
songIndex = index;
|
||||||
|
|
||||||
|
if (song.backgroundType == "image") {
|
||||||
|
slideEditor.videoBackground = "";
|
||||||
|
slideEditor.imageBackground = song.background;
|
||||||
|
} else {
|
||||||
|
slideEditor.imageBackground = "";
|
||||||
|
slideEditor.videoBackground = song.background;
|
||||||
|
/* slideEditor.loadVideo(); */
|
||||||
|
}
|
||||||
|
|
||||||
|
changeSlideHAlignment("Center");
|
||||||
|
changeSlideVAlignment("Center");
|
||||||
|
changeSlideFont("Noto Sans", true);
|
||||||
|
changeSlideFontSize(50, true)
|
||||||
|
changeSlideText(songIndex);
|
||||||
|
console.log(song.title);
|
||||||
|
}
|
||||||
|
|
||||||
function changeSong(index) {
|
function changeSong(index) {
|
||||||
clearSlides();
|
clearSlides();
|
||||||
console.log(index);
|
console.log(index);
|
||||||
const s = songProxyModel.songModel.getSong(index);
|
song = songProxyModel.songModel.getSong(index);
|
||||||
song = s;
|
console.log(song.lyrics);
|
||||||
songLyrics = s.lyrics;
|
|
||||||
songIndex = index;
|
songIndex = index;
|
||||||
|
|
||||||
if (song.backgroundType == "image") {
|
if (song.backgroundType == "image") {
|
||||||
|
@ -340,7 +361,7 @@ Item {
|
||||||
changeSlideFont(song.font, true);
|
changeSlideFont(song.font, true);
|
||||||
changeSlideFontSize(song.fontSize, true)
|
changeSlideFontSize(song.fontSize, true)
|
||||||
changeSlideText(songIndex);
|
changeSlideText(songIndex);
|
||||||
console.log(s.title);
|
console.log(song.title);
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateLyrics(lyrics) {
|
function updateLyrics(lyrics) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue