Getting some functionality in switching slides

This commit is contained in:
Chris Cochrun 2022-03-11 07:04:23 -06:00
parent 1fa5aa8a0a
commit cc8f447166
7 changed files with 72 additions and 4 deletions

View file

@ -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"))))

View file

@ -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

View file

@ -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

View file

@ -120,6 +120,7 @@ Item {
displayComponent: Component {
Kirigami.SearchField {
id: searchField
height: parent.height
width: parent.width - 40
onAccepted: showPassiveNotification(searchField.text, 3000)
}

View file

@ -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)

View file

@ -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 {

View file

@ -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()
}
}