From e52d44f9376b96dbb184fe6828760adaee7a3685 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Mon, 4 Apr 2022 06:43:05 -0500 Subject: [PATCH] gave the slide a black to put in front of loading videos --- TODO.org | 10 +++++++ src/assets/black.jpg | Bin 0 -> 2097 bytes src/qml/presenter/MainWindow.qml | 2 ++ src/qml/presenter/Presentation.qml | 20 ++++++++++--- src/qml/presenter/Slide.qml | 28 +++++++++++++++--- src/qml/presenter/SlideEditor.qml | 20 +++++++++++++ src/qml/presenter/SongEditor.qml | 17 +++++++++++ src/resources.qrc | 1 + src/songsqlmodel.cpp | 44 ++++++++++++++++++++++++++--- src/songsqlmodel.h | 6 ++++ 10 files changed, 136 insertions(+), 12 deletions(-) create mode 100644 src/assets/black.jpg diff --git a/TODO.org b/TODO.org index a88d4f4..418883d 100644 --- a/TODO.org +++ b/TODO.org @@ -1,7 +1,15 @@ #+TITLE: Todo List * Inbox +** TODO Build out a slide preview system so we can see each slide in the song or image slideshow +[[file:~/dev/church-presenter/src/qml/presenter/SongEditor.qml::Presenter.SlideEditor {]] ** TODO Make sure the video gets changed in a proper manner to not have left over video showing from previous items [[file:~/dev/church-presenter/src/qml/presenter/Presentation.qml::currentServiceItem++;]] + +- [X] Build a basic system that changes to black first and then switches to the video +- [ ] Build out a loading system that will load the next video if it needs to and then the switch can be instant. + + The second option is the best, but requires a lot more work. I have the first already working so I'll come back to this once I have more of an idea of how to do it. + ** TODO Fix possible bug in arrangingItems in draghandler [[file:~/dev/church-presenter/src/qml/presenter/DragHandle.qml::function arrangeItem() {]] ** TODO [#A] Make Presentation Window follow the presenter component @@ -10,9 +18,11 @@ ** TODO Make toolbar functional for songeditor [[file:~/dev/church-presenter/src/qml/presenter/SongEditor.qml::Controls.ToolBar {]] +- [ ] Will likely need to modify the model to persist the effects stored to the songs ** TODO Finish toolbar [[file:~/dev/church-presenter/src/qml/presenter/Presentation.qml::Controls.ToolBar {]] + ** TODO Find a way to maths the textsize [[file:~/dev/church-presenter/src/qml/presenter/Slide.qml::property real textSize: 50]] diff --git a/src/assets/black.jpg b/src/assets/black.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c5796d1d72bb7ff507b978288abd8e02185644ac GIT binary patch literal 2097 zcmex=vmlS~5GZ+{cM3OTSQy3T+*Dx?J=oCdnMlmoj z-T;XwLD+9V>~t`j31qcMQAm(80|S!?0|SFXIubhxiJhELl*_=tWWvC}ppufCm%_ln z6aitUfY>!4c5Y5-GRQy%2Cxr#Qu9KCLE;Py3^EMv44w?W3;_%Z3`q>744Di$3?&S@ z44Djh3C!tn9|Z17(Oj$VBn2pU=Y5* zz`zv^2{#4?29P|%;_D0yAvFvPK4%#iX3k<@P)lcE;E%!KZw|1(q2Y#C4K)1z-)3-T z_zwcVKm?iiHiI)GnOYIr4lxLFFx+AEWM&j(U=n0x7G(T?gh3RXhrpo)BbfdlVGsf3 zESLa<{(p;shnbOqNq|{^fq`)XL~xWGY9SyGid_M4X@}(W1^;g`a4<45FtRcUgH;G( zSHaB4XwQgO1rtIAPFvXQp|;>u!Dz22EDuX@;Cw28qml/presenter/Presentation.qml qml/presenter/Settings.qml assets/parallel.jpg + assets/black.jpg diff --git a/src/songsqlmodel.cpp b/src/songsqlmodel.cpp index 218fa31..61e7c6c 100644 --- a/src/songsqlmodel.cpp +++ b/src/songsqlmodel.cpp @@ -34,6 +34,7 @@ static void createTable() " 'vorder' TEXT," " 'background' TEXT," " 'backgroundType' TEXT," + " 'textAlignment' TEXT," " PRIMARY KEY(id))")) { qFatal("Failed to query database: %s", qPrintable(query.lastError().text())); @@ -41,11 +42,18 @@ static void createTable() qDebug() << query.lastQuery(); qDebug() << "inserting into songs"; - query.exec("INSERT INTO songs (title, lyrics, author, ccli, audio, vorder, background, backgroundType) VALUES ('10,000 Reasons', '10,000 reasons for my heart to sing', 'Matt Redman', '13470183', '', '', '', '')"); + query.exec( + "INSERT INTO songs (title, lyrics, author, ccli, audio, vorder, " + "background, backgroundType) VALUES ('10,000 Reasons', '10,000 reasons " + "for my heart to sing', 'Matt Redman', '13470183', '', '', '', '', 'center')"); qDebug() << query.lastQuery(); - query.exec("INSERT INTO songs (title, lyrics, author, ccli, audio, vorder, background, backgroundType) VALUES ('River', 'Im going down to the river', 'Jordan Feliz', '13470183', '', '', '', '')"); - query.exec("INSERT INTO songs (title, lyrics, author, ccli, audio, vorder, background, backgroundType) VALUES ('Marvelous Light', 'Into marvelous " - "light Im running', 'Chris Tomlin', '13470183', '', '', '', '')"); + query.exec("INSERT INTO songs (title, lyrics, author, ccli, audio, vorder, " + "background, backgroundType) VALUES ('River', 'Im going down to " + "the river', 'Jordan Feliz', '13470183', '', '', '', '', 'center')"); + query.exec( + "INSERT INTO songs (title, lyrics, author, ccli, audio, vorder, " + "background, backgroundType) VALUES ('Marvelous Light', 'Into marvelous " + "light Im running', 'Chris Tomlin', '13470183', '', '', '', '', 'center')"); query.exec("select * from songs"); qDebug() << query.lastQuery(); @@ -85,6 +93,7 @@ QHash SongSqlModel::roleNames() const names[Qt::UserRole + 6] = "vorder"; names[Qt::UserRole + 7] = "background"; names[Qt::UserRole + 8] = "backgroundType"; + names[Qt::UserRole + 9] = "textAlignment"; return names; } @@ -130,6 +139,7 @@ QVariantList SongSqlModel::getSong(const int &row) { song.append(recordData.value("vorder")); song.append(recordData.value("background")); song.append(recordData.value("backgroundType")); + song.append(recordData.value("textAlignment")); return song; } @@ -394,3 +404,29 @@ void SongSqlModel::updateBackgroundType(const int &row, const QString &backgroun submitAll(); emit backgroundTypeChanged(); } + +QString SongSqlModel::textAlignment() const { + return m_textAlignment; +} + +void SongSqlModel::setTextAlignment(const QString &textAlignment) { + if (textAlignment == m_textAlignment) + return; + + m_textAlignment = textAlignment; + + select(); + emit textAlignmentChanged(); +} + +// This function is for updating the lyrics from outside the delegate +void SongSqlModel::updateTextAlignment(const int &row, const QString &textAlignment) { + qDebug() << "Row is " << row; + QSqlRecord rowdata = record(row); + qDebug() << rowdata; + rowdata.setValue("textAlignment", textAlignment); + setRecord(row, rowdata); + qDebug() << rowdata; + submitAll(); + emit textAlignmentChanged(); +} diff --git a/src/songsqlmodel.h b/src/songsqlmodel.h index 09045c1..b90dd60 100644 --- a/src/songsqlmodel.h +++ b/src/songsqlmodel.h @@ -18,6 +18,7 @@ class SongSqlModel : public QSqlTableModel Q_PROPERTY(QString vorder READ vorder WRITE setVerseOrder NOTIFY vorderChanged) Q_PROPERTY(QString background READ background WRITE setBackground NOTIFY backgroundChanged) Q_PROPERTY(QString backgroundType READ backgroundType WRITE setBackgroundType NOTIFY backgroundTypeChanged) + Q_PROPERTY(QString textAlignment READ textAlignment WRITE setTextAlignment NOTIFY textAlignmentChanged) QML_ELEMENT public: @@ -32,6 +33,7 @@ public: QString vorder() const; QString background() const; QString backgroundType() const; + QString textAlignment() const; void setTitle(const QString &title); void setLyrics(const QString &lyrics); @@ -41,6 +43,7 @@ public: void setVerseOrder(const QString &vorder); void setBackground(const QString &background); void setBackgroundType(const QString &backgroundType); + void setTextAlignment(const QString &background); Q_INVOKABLE void updateTitle(const int &row, const QString &title); Q_INVOKABLE void updateLyrics(const int &row, const QString &lyrics); @@ -50,6 +53,7 @@ public: Q_INVOKABLE void updateVerseOrder(const int &row, const QString &vorder); Q_INVOKABLE void updateBackground(const int &row, const QString &background); Q_INVOKABLE void updateBackgroundType(const int &row, const QString &backgroundType); + Q_INVOKABLE void updateTextAlignment(const int &row, const QString &textAlignment); Q_INVOKABLE void newSong(); Q_INVOKABLE void deleteSong(const int &row); @@ -68,6 +72,7 @@ signals: void vorderChanged(); void backgroundChanged(); void backgroundTypeChanged(); + void textAlignmentChanged(); private: int m_id; @@ -79,6 +84,7 @@ private: QString m_vorder; QString m_background; QString m_backgroundType; + QString m_textAlignment; }; #endif //SONGSQLMODEL_H