From 51f8488089a70fdb40fd7a308f582c820dad25f1 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Wed, 13 Jul 2022 10:44:13 -0500 Subject: [PATCH] follow the SlideObject for more parts --- src/main.cpp | 2 +- src/qml/main.qml | 1 + src/qml/presenter/MainWindow.qml | 12 ++++++------ src/qml/presenter/Presentation.qml | 7 +++---- src/qml/presenter/PresentationWindow.qml | 6 +++--- src/qml/presenter/Slide.qml | 4 ++-- src/slide.cpp | 2 ++ 7 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 0178535..15df9f2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -94,7 +94,7 @@ int main(int argc, char *argv[]) qDebug() << QIcon::themeName(); //Need to instantiate our slide - Slide slide("", "", "", "", "", "", "", 0); + Slide slide("BALHJ!", "", "/home/chris/Pictures/wallpapers/RoyalKing.png", "", "", "", "", 0); // QScopedPointer slide(new Slide("", "", "", "", "", "", "", 0)); // apparently mpv needs this class set diff --git a/src/qml/main.qml b/src/qml/main.qml index b98f97c..caf8b19 100644 --- a/src/qml/main.qml +++ b/src/qml/main.qml @@ -8,6 +8,7 @@ import QtMultimedia 5.15 /* import QtAudioEngine 1.15 */ import org.kde.kirigami 2.13 as Kirigami import "./presenter" as Presenter +import org.presenter 1.0 Kirigami.ApplicationWindow { id: rootApp diff --git a/src/qml/presenter/MainWindow.qml b/src/qml/presenter/MainWindow.qml index 65514f3..8bfab9d 100644 --- a/src/qml/presenter/MainWindow.qml +++ b/src/qml/presenter/MainWindow.qml @@ -122,19 +122,19 @@ Controls.Page { const item = serviceItemModel.getItem(index); print("index grabbed: " + index); - SlideObject.setImageBackground("/home/chris/Pictures/RoyalKing.png"); - print("The slides backgorund is: " + SlideObject.imageBackground); presentation.stopVideo() presentation.itemType = item.type; print("Time to start changing"); if (item.backgroundType === "image") { - presentation.vidbackground = ""; - presentation.imagebackground = item.background; + print("The slides backgorund is: " + SlideObject.imageBackground); + SlideObject.setVideoBackground(""); + SlideObject.setImageBackground(item.background); } else { - presentation.imagebackground = ""; - presentation.vidbackground = item.background; + print("The slides backgorund is: " + SlideObject.videoBackground); + SlideObject.setImageBackground(""); + SlideObject.setVideoBackground(item.background); presentation.loadVideo() } diff --git a/src/qml/presenter/Presentation.qml b/src/qml/presenter/Presentation.qml index 27c839b..643d432 100644 --- a/src/qml/presenter/Presentation.qml +++ b/src/qml/presenter/Presentation.qml @@ -17,7 +17,7 @@ Item { property url imagebackground property url vidbackground - Component.onCompleted: nextSlideAction() + /* Component.onCompleted: nextSlideAction() */ GridLayout { anchors.fill: parent @@ -87,7 +87,8 @@ Item { textSize: width / 15 itemType: root.itemType imageSource: SlideObject.imageBackground - videoSource: vidbackground + videoSource: SlideObject.videoBackground + text: SlideObject.text preview: true } @@ -122,8 +123,6 @@ Item { function nextSlideAction() { print(textIndex); - print("YIPPEE KAYAYYYY!"); - print("YIPPEE KAYAYYYY!"); if (itemType === "song") { if (textIndex === 0) { previewSlide.text = root.text[textIndex]; diff --git a/src/qml/presenter/PresentationWindow.qml b/src/qml/presenter/PresentationWindow.qml index d77762e..3833395 100644 --- a/src/qml/presenter/PresentationWindow.qml +++ b/src/qml/presenter/PresentationWindow.qml @@ -24,9 +24,9 @@ Window { Presenter.Slide { id: presentationSlide anchors.fill: parent - imageSource: imageBackground - videoSource: videoBackground - text: currentText + imageSource: SlideObject.imageBackground + videoSource: SlideObject.videoBackground + text: SlideObject.text Component.onCompleted: slideItem = presentationSlide } diff --git a/src/qml/presenter/Slide.qml b/src/qml/presenter/Slide.qml index f22fe85..834cd58 100644 --- a/src/qml/presenter/Slide.qml +++ b/src/qml/presenter/Slide.qml @@ -17,8 +17,8 @@ Item { // These properties are for the slides visuals property real textSize: 50 property bool dropShadow: false - property url imageSource: imageBackground - property url videoSource: videoBackground + property url imageSource + property url videoSource property string chosenFont: "Quicksand" property string text: "This is demo text" property color backgroundColor diff --git a/src/slide.cpp b/src/slide.cpp index c50929f..3f5087e 100644 --- a/src/slide.cpp +++ b/src/slide.cpp @@ -17,6 +17,7 @@ Slide::Slide(const QString &text, const QString &audio, const QString &imageBack m_horizontalTextAlignment(horizontalTextAlignment),m_font(font),m_fontSize(fontSize) { qDebug() << "Initializing slide with defaults"; + qDebug() << m_imageBackground; } QString Slide::text() const { @@ -90,6 +91,7 @@ void Slide::setVideoBackground(QString videoBackground) if (m_videoBackground == videoBackground) return; + qDebug() << "####changing video background to: " << videoBackground; m_videoBackground = videoBackground; emit videoBackgroundChanged(m_videoBackground); }