fixed slides not being cleared in SongEditor, still have crashes

This commit is contained in:
Chris Cochrun 2022-09-07 05:38:08 -05:00
parent ae2791eb61
commit da1fb49c64
3 changed files with 16 additions and 6 deletions

View file

@ -4,8 +4,6 @@
:END:
* Inbox
** DONE Need to make =getLyricList= give back the verses with empty lines as separate slides :core:
[[file:~/dev/church-presenter/src/songsqlmodel.cpp:://TODO make sure to split empty line in verse into two slides]]
** TODO VideoSQL Model and SQLite system needs fixing
[[file:src/videosqlmodel.cpp::if (!query.exec("CREATE TABLE IF NOT EXISTS 'videos' ("]]
@ -13,9 +11,13 @@
[[file:~/dev/church-presenter/src/qml/presenter/SongEditor.qml::Presenter.SlideEditor {]]
- [X] Initial ListView with text coming from =getLyricList=
- [ ] Depending on this [[*Need to make getLyricList give back the verses with empty lines as separate slides][Need to make getLyricList give back the verses with empty lines as separate slides]]
- [X] Depending on this [[*Need to make getLyricList give back the verses with empty lines as separate slides][Need to make getLyricList give back the verses with empty lines as separate slides]]
- [ ] Need to perhaps address the MPV crashing problem for a smoother experience.
Essentially, mpv objects cause a seg fault when we remove them from the qml graph scene and are somehow re-referencing them. Using =reuseItems=, I can prevent the seg fault but then we are storing a lot of things in memory and will definitely cause slowdowns on older hardware.
Essentially, mpv objects cause a seg fault when we remove them from the qml graph scene and are somehow re-referencing them. Using =reuseItems=, I can prevent the seg fault but then we are storing a lot of things in memory and will definitely cause slowdowns on older hardware. So far I haven't seen too many problems with the =reuseItems= piece yet.
Apparently, I still have crashing
- [X] There is also a small hiccup in switching between songs. I appears as if songs that don't have any slides will have ghost slides from the previously selected song.
** WAIT Make toolbar functional for =songeditor= [3/4] [75%] :core:
[[file:~/dev/church-presenter/src/qml/presenter/SongEditor.qml::Controls.ToolBar {]]
@ -71,6 +73,8 @@ This thread helped a lot
** DONE Fix bug in not removing old slides in the SongEditor when switching songs from the Library :bug:
** DONE Need to make =getLyricList= give back the verses with empty lines as separate slides :core:
[[file:~/dev/church-presenter/src/songsqlmodel.cpp:://TODO make sure to split empty line in verse into two slides]]
** DONE bug in changing slides with the arrows :core:
[[file:~/dev/church-presenter/src/qml/presenter/Presentation.qml::function changeSlide() {]]

View file

@ -21,6 +21,7 @@ Item {
property bool playingVideo: false
property ListModel songs: songModel
property ListView songSlides: slideList
property var firstItem
@ -160,4 +161,5 @@ Item {
print(slideList.currentItem);
}
}
}

View file

@ -278,6 +278,7 @@ Item {
}
function changeSong(index) {
clearSlides();
const s = songsqlmodel.getSong(index);
song = s;
songLyrics = s.lyrics;
@ -420,9 +421,12 @@ Item {
}
function changeSlideText(id) {
const verses = songsqlmodel.getLyricList(id);
/* print("Here are the verses: " + verses); */
slideEditor.songs.clear()
const verses = songsqlmodel.getLyricList(id);
verses.forEach(slideEditor.appendVerse);
}
function clearSlides() {
slideEditor.songs.clear()
}
}