diff --git a/.dir-locals.el b/.dir-locals.el index 2a03574..38e15e5 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -1,6 +1,4 @@ ;;; Directory Local Variables ;;; For more information see (info "(emacs) Directory Variables") -;;; Directory Local Variables -;;; For more information see (info "(emacs) Directory Variables") ((nil . ((compile-command . "cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -B build/ . && make --dir build/")))) diff --git a/src/qml/presenter/LeftDock.qml b/src/qml/presenter/LeftDock.qml index 50f0365..acc1d1b 100644 --- a/src/qml/presenter/LeftDock.qml +++ b/src/qml/presenter/LeftDock.qml @@ -107,6 +107,7 @@ ColumnLayout { onClicked: { serviceItemList.currentIndex = index; showPassiveNotification(serviceItemList.currentIndex); + changeSlideBackground(background, backgroundType); changeSlideText(text); } } @@ -142,15 +143,22 @@ ColumnLayout { name: "10,000 Reason" type: "song" text: "YIP YIP!" + backgroundType: "image" + background: "file:/home/chris/nextcloud/tfc/openlp/CMG - Nature King 21.jpg" } ListElement { name: "Marvelous Light" type: "song" - text: "YIP YIP!" + text: "HALLELUJAH!" + backgroundType: "video" + background: "file:/home/chris/nextcloud/tfc/openlp/Fire Embers_Loop.mp4" } ListElement { - name: "10,000 Reason" - type: "song" + name: "Test" + type: "video" + text: "" + backgroundType: "video" + background: "file:/home/chris/nextcloud/tfc/openlp/videos/test.mp4" } ListElement { name: "Marvelous Light" diff --git a/src/qml/presenter/MainWindow.qml b/src/qml/presenter/MainWindow.qml index 72a10f5..a5f0f0c 100644 --- a/src/qml/presenter/MainWindow.qml +++ b/src/qml/presenter/MainWindow.qml @@ -62,8 +62,8 @@ Controls.Page { id: mainPageArea Controls.SplitView.fillHeight: true Controls.SplitView.fillWidth: true - Controls.SplitView.preferredWidth: 700 - Controls.SplitView.minimumWidth: 500 + Controls.SplitView.preferredWidth: 500 + Controls.SplitView.minimumWidth: 200 initialItem: Presenter.Presentation { id: presentation } } @@ -152,11 +152,25 @@ Controls.Page { } function changeSlideText(text) { - showPassiveNotification("used to be: " + presentation.text); + /* showPassiveNotification("used to be: " + presentation.text); */ presentation.text = text; - showPassiveNotification("next"); + /* showPassiveNotification("next"); */ presentationSlide.text = text; - showPassiveNotification("last"); + /* showPassiveNotification("last"); */ + } + + function changeSlideBackground(background, type) { + showPassiveNotification("starting background change.."); + showPassiveNotification(background); + showPassiveNotification(type); + if (type == "image") { + presentation.vidbackground = ""; + presentation.imagebackground = background; + } else { + presentation.imagebackground = ""; + presentation.vidbackground = background; + presentation.loadVideo() + } } function editSwitch(edit) { diff --git a/src/qml/presenter/Presentation.qml b/src/qml/presenter/Presentation.qml index ef879a6..2e59aa6 100644 --- a/src/qml/presenter/Presentation.qml +++ b/src/qml/presenter/Presentation.qml @@ -10,7 +10,9 @@ import "./" as Presenter Item { id: root - property string text: "GOOD" + property string text + property url imagebackground + property url vidbackground GridLayout { anchors.fill: parent @@ -61,22 +63,25 @@ Item { Kirigami.Icon { source: "arrow-left" - Layout.preferredWidth: 200 + Layout.preferredWidth: 100 Layout.preferredHeight: 200 Layout.alignment: Qt.AlignRight } Presenter.Slide { + id: previewSlide Layout.preferredWidth: 900 Layout.preferredHeight: width / 16 * 9 Layout.alignment: Qt.AlignCenter textSize: width / 15 text: root.text + imageSource: imagebackground + videoSource: vidbackground } Kirigami.Icon { source: "arrow-right" - Layout.preferredWidth: 200 + Layout.preferredWidth: 100 Layout.preferredHeight: 200 Layout.alignment: Qt.AlignLeft } @@ -89,4 +94,8 @@ Item { } } + + function loadVideo() { + previewSlide.loadVideo(); + } } diff --git a/src/qml/presenter/Slide.qml b/src/qml/presenter/Slide.qml index b2ddd76..117df65 100644 --- a/src/qml/presenter/Slide.qml +++ b/src/qml/presenter/Slide.qml @@ -39,7 +39,8 @@ Item { Component.onCompleted: mpvLoadingTimer.start() onFileLoaded: { print(videoSource + " has been loaded"); - mpv.setProperty("loop", "inf"); + if (itemType == "song") + mpv.setProperty("loop", "inf"); print(mpv.getProperty("loop")); } @@ -108,4 +109,8 @@ Item { function changeText(text) { lyrics.text = text } + + function loadVideo() { + mpvLoadingTimer.restart() + } }