diff --git a/TODO.org b/TODO.org index 6a25957..ec91644 100644 --- a/TODO.org +++ b/TODO.org @@ -12,13 +12,18 @@ - [X] Initial ListView with text coming from =getLyricList= - [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. +- [X] 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. So far I haven't seen too many problems with the =reuseItems= piece yet. Apparently, I still have crashing + Setting a really high =cacheBuffer= in the ListView seems to have fixed the crashing, but will result in higher memory use. As of right now we are using 1.1Gb total, so I may think of a better solution later, but for now, that'll have to work. + - [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. +- [ ] Another issue I discovered was that when switching to a song with videoBackgrounds, the mpv object doesn't ALWAYS load the first frame of the slide. Can I let the video play a tiny bit longer to make sure frames ALWAYS get loaded? + ** WAIT Make toolbar functional for =songeditor= [3/4] [75%] :core: [[file:~/dev/church-presenter/src/qml/presenter/SongEditor.qml::Controls.ToolBar {]] diff --git a/src/qml/presenter/Slide.qml b/src/qml/presenter/Slide.qml index 02a3bb2..da859c9 100644 --- a/src/qml/presenter/Slide.qml +++ b/src/qml/presenter/Slide.qml @@ -93,7 +93,7 @@ Item { Timer { id: pauseTimer - interval: 200 + interval: 300 onTriggered: mpv.pause() } diff --git a/src/qml/presenter/SlideEditor.qml b/src/qml/presenter/SlideEditor.qml index bb42742..f475f06 100644 --- a/src/qml/presenter/SlideEditor.qml +++ b/src/qml/presenter/SlideEditor.qml @@ -58,26 +58,28 @@ Item { anchors.rightMargin: 20 model: songModel clip: true - cacheBuffer: 900 + cacheBuffer: 1900 reuseItems: true spacing: Kirigami.Units.gridUnit - /* flickDeceleration: 4000 */ - /* boundsMovement: Flickable.StopAtBounds */ synchronousDrag: true - delegate: Presenter.Slide { - id: representation - editMode: true - imageSource: root.imageBackground - videoSource: root.videoBackground - hTextAlignment: root.hTextAlignment - vTextAlignment: root.vTextAlignment - chosenFont: font - textSize: fontSize - preview: true - text: verse - implicitWidth: slideList.width - implicitHeight: width * 9 / 16 - itemType: "song" + delegate: Loader { + width: slideList.width + height: width * 9 / 16 + Presenter.Slide { + id: representation + editMode: true + imageSource: root.imageBackground + videoSource: root.videoBackground + hTextAlignment: root.hTextAlignment + vTextAlignment: root.vTextAlignment + chosenFont: font + textSize: fontSize + preview: true + text: verse + implicitWidth: slideList.width + implicitHeight: width * 9 / 16 + itemType: "song" + } } Kirigami.WheelHandler { @@ -155,9 +157,10 @@ Item { } function loadVideo() { + showPassiveNotification("I'm loading the videos"); for (var i = 0; i < slideList.count; ++i) { slideList.currentIndex = i; - slideList.currentItem.loadVideo(); + slideList.currentItem.representation.loadVideo(); print(slideList.currentItem); } } diff --git a/src/qml/presenter/SongEditor.qml b/src/qml/presenter/SongEditor.qml index 8f1fc5c..c6afc19 100644 --- a/src/qml/presenter/SongEditor.qml +++ b/src/qml/presenter/SongEditor.qml @@ -424,6 +424,7 @@ Item { /* print("Here are the verses: " + verses); */ const verses = songsqlmodel.getLyricList(id); verses.forEach(slideEditor.appendVerse); + /* slideEditor.loadVideo(); */ } function clearSlides() {