diff --git a/.dir-locals.el b/.dir-locals.el index 38e15e5..2fba23d 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -1,4 +1,5 @@ ;;; 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/")))) +((nil . ((projectile-project-compilation-cmd . "cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -B build/ . && make --dir build/") + (projectile-project-run-cmd . "./build/bin/presenter")))) diff --git a/src/qml/main.qml b/src/qml/main.qml index 7eceb9c..b71536f 100644 --- a/src/qml/main.qml +++ b/src/qml/main.qml @@ -1,6 +1,7 @@ import QtQuick 2.13 import QtQuick.Dialogs 1.0 -import QtQuick.Controls 2.0 as Controls +import QtQuick.Controls 2.15 as Controls +import Qt.labs.platform 1.1 as Labs import QtQuick.Window 2.13 import QtQuick.Layouts 1.2 import QtMultimedia 5.15 @@ -21,6 +22,29 @@ Kirigami.ApplicationWindow { pageStack.initialPage: mainPage header: Presenter.Header {} + /* Loader { */ + /* Labs.MenuBar { */ + /* Labs.Menu { */ + /* title: qsTr("File") */ + /* Labs.MenuItem { text: qsTr("New...") } */ + /* Labs.MenuItem { text: qsTr("Open...") } */ + /* Labs.MenuItem { text: qsTr("Save") } */ + /* Labs.MenuItem { text: qsTr("Save As...") } */ + /* Labs.MenuSeparator { } */ + /* Labs.MenuItem { text: qsTr("Quit") } */ + /* } */ + /* Labs.Menu { */ + /* title: qsTr("Edit") */ + /* Labs.MenuItem { text: qsTr("Cut") } */ + /* Labs.MenuItem { text: qsTr("Copy") } */ + /* Labs.MenuItem { text: qsTr("Paste") } */ + /* } */ + /* Labs.Menu { */ + /* title: qsTr("Help") */ + /* Labs.MenuItem { text: qsTr("About") } */ + /* } */ + /* } */ + /* } */ width: 1800 height: 900 diff --git a/src/qml/presenter/Header.qml b/src/qml/presenter/Header.qml index e940c64..892ce06 100644 --- a/src/qml/presenter/Header.qml +++ b/src/qml/presenter/Header.qml @@ -37,7 +37,7 @@ Kirigami.ActionToolBar { Kirigami.Action { icon.name: "view-presentation" - text: "Go Live" + text: presenting ? "Presenting" : "Go Live" onTriggered: { print("Window is loading") presenting = true diff --git a/src/qml/presenter/Library.qml b/src/qml/presenter/Library.qml index 36f251e..8704957 100644 --- a/src/qml/presenter/Library.qml +++ b/src/qml/presenter/Library.qml @@ -120,6 +120,7 @@ Item { displayComponent: Component { Kirigami.SearchField { id: searchField + height: parent.height width: parent.width - 40 onAccepted: showPassiveNotification(searchField.text, 3000) } diff --git a/src/qml/presenter/MainWindow.qml b/src/qml/presenter/MainWindow.qml index a5f0f0c..c64159e 100644 --- a/src/qml/presenter/MainWindow.qml +++ b/src/qml/presenter/MainWindow.qml @@ -155,7 +155,8 @@ Controls.Page { /* showPassiveNotification("used to be: " + presentation.text); */ presentation.text = text; /* showPassiveNotification("next"); */ - presentationSlide.text = text; + if (slideItem) + slideItem.text = text; /* showPassiveNotification("last"); */ } @@ -166,13 +167,31 @@ Controls.Page { if (type == "image") { presentation.vidbackground = ""; presentation.imagebackground = background; + if (slideItem) { + slideItem.videoSource = ""; + slideItem.stopVideo(); + slideItem.imageSource = background; + } } else { presentation.imagebackground = ""; presentation.vidbackground = background; presentation.loadVideo() + if (slideItem) { + slideItem.imageSource = ""; + slideItem.videoSource = background; + slideItem.loadVideo() + } } } + function changeSlideNext() { + showPassiveNotification("next slide please") + } + + function changeSlidePrevious() { + showPassiveNotification("previous slide please") + } + function editSwitch(edit) { if (edit) mainPageArea.push(songEditorComp, Controls.StackView.Immediate) diff --git a/src/qml/presenter/Presentation.qml b/src/qml/presenter/Presentation.qml index 2e59aa6..1c46a59 100644 --- a/src/qml/presenter/Presentation.qml +++ b/src/qml/presenter/Presentation.qml @@ -66,6 +66,11 @@ Item { Layout.preferredWidth: 100 Layout.preferredHeight: 200 Layout.alignment: Qt.AlignRight + MouseArea { + anchors.fill: parent + onPressed: changeSlidePrevious() + cursorShape: Qt.PointingHandCursor + } } Presenter.Slide { @@ -77,6 +82,7 @@ Item { text: root.text imageSource: imagebackground videoSource: vidbackground + preview: true } Kirigami.Icon { @@ -84,6 +90,11 @@ Item { Layout.preferredWidth: 100 Layout.preferredHeight: 200 Layout.alignment: Qt.AlignLeft + MouseArea { + anchors.fill: parent + onPressed: changeSlideNext() + cursorShape: Qt.PointingHandCursor + } } Item { diff --git a/src/qml/presenter/Slide.qml b/src/qml/presenter/Slide.qml index 117df65..4677948 100644 --- a/src/qml/presenter/Slide.qml +++ b/src/qml/presenter/Slide.qml @@ -23,8 +23,14 @@ Item { property string text: "This is demo text" property color backgroundColor + //these properties are for giving video info to parents + property int mpvPosition: mpv.position + property int mpvDuration: mpv.duration + property var mpvLoop: mpv.getProperty("loop") + // These properties help to determine the state of the slide property string itemType + property bool preview: false Rectangle { id: basePrColor @@ -36,6 +42,7 @@ Item { objectName: "mpv" anchors.fill: parent useHwdec: true + enableAudio: !preview Component.onCompleted: mpvLoadingTimer.start() onFileLoaded: { print(videoSource + " has been loaded"); @@ -49,6 +56,7 @@ Item { anchors.fill: parent enabled: editMode onPressed: mpv.loadFile(videoSource.toString()); + cursorShape: preview ? Qt.ArrowCursor : Qt.BlankCursor } Controls.ProgressBar { @@ -113,4 +121,8 @@ Item { function loadVideo() { mpvLoadingTimer.restart() } + + function stopVideo() { + mpv.stop() + } }