starting to build

This commit is contained in:
Chris Cochrun 2024-09-11 09:30:42 -05:00
parent 61aef5c48f
commit 7b82202c51
6 changed files with 75 additions and 77 deletions

View file

@ -14,8 +14,8 @@ target_sources(lumina
# cpp/imagesqlmodel.cpp cpp/imagesqlmodel.h
# cpp/filemanager.cpp cpp/filemanager.h
# cpp/presentationsqlmodel.cpp cpp/presentationsqlmodel.h
cpp/mpv/mpvitem.h cpp/mpv/mpvitem.cpp
cpp/mpv/mpvproperties.h
# cpp/mpv/mpvitem.h cpp/mpv/mpvitem.cpp
# cpp/mpv/mpvproperties.h
)
target_compile_options (lumina PUBLIC -fexceptions)

View file

@ -23,7 +23,7 @@
#include <QQuickStyle>
#include <QSurfaceFormat>
#include <QtGui/QOpenGLFramebufferObject>
// #include <QtGui/QOpenGLFramebufferObject>
#include <QtQuick/QQuickWindow>
#include <QtQuick/QQuickView>
@ -38,8 +38,8 @@
#include <qsqlquery.h>
#include <qstringliteral.h>
#include "cpp/mpv/mpvitem.h"
#include "cpp/mpv/mpvproperties.h"
// #include "cpp/mpv/mpvitem.h"
// #include "cpp/mpv/mpvproperties.h"
// #include "cpp/serviceitemmodel.h"
// #include "cpp/slidemodel.h"
// #include "cpp/songsqlmodel.h"
@ -221,8 +221,8 @@ int main(int argc, char *argv[])
// apparently mpv needs this class set
// let's register mpv as well
std::setlocale(LC_NUMERIC, "C");
qmlRegisterType<MpvItem>("mpv", 1, 0, "MpvItem");
qmlRegisterSingletonInstance("org.presenter", 1, 0, "MpvProperties", MpvProperties::self());
// qmlRegisterType<MpvItem>("mpv", 1, 0, "MpvItem");
// qmlRegisterSingletonInstance("org.presenter", 1, 0, "MpvProperties", MpvProperties::self());
//register our models
// qmlRegisterType<SongProxyModel>("org.presenter", 1, 0, "SongProxyModel");

View file

@ -1,10 +1,10 @@
import QtQuick 2.15
import QtQuick.Dialogs 1.3
import QtQuick.Controls 2.15 as Controls
import Qt.labs.platform 1.1 as Labs
import QtQuick.Window 2.15
import QtQuick.Layouts 1.15
import QtMultimedia 5.15
import QtQuick
/* import QtQuick.Dialogs */
import QtQuick.Controls as Controls
import Qt.labs.platform as Labs
import QtQuick.Window
import QtQuick.Layouts
import QtMultimedia
/* import QtAudioEngine 1.15 */
import org.kde.kirigami 2.13 as Kirigami
import "./presenter" as Presenter
@ -198,11 +198,11 @@ Kirigami.ApplicationWindow {
anchors.fill: parent
}
FileDialog {
Labs.FileDialog {
id: saveFileDialog
title: "Save"
folder: shortcuts.home
/* fileMode: FileDialog.SaveFile */
/* fileMode: Labs.FileDialog.SaveFile */
defaultSuffix: ".pres"
selectExisting: false
onAccepted: {
@ -218,11 +218,11 @@ Kirigami.ApplicationWindow {
id: fileHelper
}
FileDialog {
Labs.FileDialog {
id: loadFileDialog
title: "Load"
folder: shortcuts.home
/* fileMode: FileDialog.SaveFile */
/* fileMode: Labs.FileDialog.SaveFile */
defaultSuffix: ".pres"
selectExisting: true
onAccepted: {
@ -233,11 +233,11 @@ Kirigami.ApplicationWindow {
}
}
FileDialog {
Labs.FileDialog {
id: soundFileDialog
title: "Pick a Sound Effect"
folder: shortcuts.home
/* fileMode: FileDialog.SaveFile */
/* fileMode: Labs.FileDialog.SaveFile */
selectExisting: true
onAccepted: {
soundEffect = loadFileDialog.fileUrl;

View file

@ -1,7 +1,7 @@
import QtQuick 2.15
import QtQuick.Controls 2.15 as Controls
import QtQuick.Layouts 1.15
import QtMultimedia 5.15
import QtMultimedia
/* import QtAudioEngine 1.15 */
import QtWebEngine 1.10
import QtGraphicalEffects 1.15
@ -53,27 +53,14 @@ Item {
anchors.fill: parent
color: "black"
MpvObject {
id: mpv
Video {
id: video
/* objectName: "mpv" */
anchors.fill: parent
useHwdec: true
enableAudio: !preview
/* useHwdec: true */
muted: preview
Component.onCompleted: mpvLoadingTimer.start()
onFileLoaded: {
/* showPassiveNotification(videoSource + " has been loaded"); */
if (itemType == "song") {
mpv.setProperty("loop", "inf");
} else if (vidLoop) {
mpv.setProperty("loop", "inf");
} else {
mpv.setProperty("loop", "no");
}
/* showPassiveNotification(mpv.getProperty("loop")); */
mpv.setProperty("sid", "no");
}
/* onIsPlayingChanged: showPassiveNotification(mpv.getProperty("pause")) */
loops: itemType == "song" ? MediaPlayer.Infinite : vidLoop ? MediaPlayer.Infinite : 1
MouseArea {
id: playArea
@ -84,32 +71,32 @@ Item {
}
}
Timer {
id: mpvLoadingTimer
interval: 500
onTriggered: {
/* showPassiveNotification("YIPPEEE!") */
mpv.stop();
if (vidStartTime > 0 && vidStartTime < vidEndTime) {
/* mpv.seek(vidStartTime); */
let start = "+" + vidStartTime;
let end = "+" + vidEndTime;
mpv.setProperty("start", start);
mpv.setProperty("end", end);
Utils.dbg("Setting position to: " + mpv.position);
} else {
mpv.setProperty("start", "none");
mpv.setProperty("end", "none");
}
mpv.loadFile(videoSource.toString());
Utils.dbg("Setting position to: " + vidStartTime + " and end is " + vidEndTime);
if (editMode) {
console.log("WHY AREN'T YOU PASUING!");
pauseTimer.restart();
}
blackTimer.restart();
}
}
/* Timer { */
/* id: mpvLoadingTimer */
/* interval: 500 */
/* onTriggered: { */
/* /\* showPassiveNotification("YIPPEEE!") *\/ */
/* mpv.stop(); */
/* if (vidStartTime > 0 && vidStartTime < vidEndTime) { */
/* /\* mpv.seek(vidStartTime); *\/ */
/* let start = "+" + vidStartTime; */
/* let end = "+" + vidEndTime; */
/* mpv.setProperty("start", start); */
/* mpv.setProperty("end", end); */
/* Utils.dbg("Setting position to: " + mpv.position); */
/* } else { */
/* mpv.setProperty("start", "none"); */
/* mpv.setProperty("end", "none"); */
/* } */
/* mpv.loadFile(videoSource.toString()); */
/* Utils.dbg("Setting position to: " + vidStartTime + " and end is " + vidEndTime); */
/* if (editMode) { */
/* console.log("WHY AREN'T YOU PASUING!"); */
/* pauseTimer.restart(); */
/* } */
/* blackTimer.restart(); */
/* } */
/* } */
Timer {
id: pauseTimer
@ -132,13 +119,15 @@ Item {
visible: false
}
MpvObject {
MediaPlayer {
id: audio
useHwdec: true
enableAudio: true
audioOutput: AudioOutput {}
/* useHwdec: true */
/* enableAudio: true */
// embeded mpv allows to set commandline propertys using the options/<name>
// syntax. This could be abstracted later, but for now this works.
Component.onCompleted: audio.setProperty("options/audio-display", "no");
/* Component.onCompleted: audio.setProperty("options/audio-display", "no"); */
}
Image {