diff --git a/Common/ProtocolBuffer/google/protobuf/bin/libprotobuf.lib b/Common/ProtocolBuffer/google/protobuf/bin/libprotobuf.lib new file mode 100644 index 00000000..1d92e9fb Binary files /dev/null and b/Common/ProtocolBuffer/google/protobuf/bin/libprotobuf.lib differ diff --git a/Common/ProtocolBuffer/google/protobuf/bin/libprotobufd.dll b/Common/ProtocolBuffer/google/protobuf/bin/libprotobufd.dll new file mode 100644 index 00000000..b91fe0bd --- /dev/null +++ b/Common/ProtocolBuffer/google/protobuf/bin/libprotobufd.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c96cd9bfc6ccbee21eaf465f3936a3610baf32a8f6fd9b1f148f529efbebd64 +size 9250304 diff --git a/Common/ProtocolBuffer/google/protobuf/bin/libprotobufd.lib b/Common/ProtocolBuffer/google/protobuf/bin/libprotobufd.lib new file mode 100644 index 00000000..f8aad209 Binary files /dev/null and b/Common/ProtocolBuffer/google/protobuf/bin/libprotobufd.lib differ diff --git a/ProtocolBuffers/ProtocolBuffers.pro b/ProtocolBuffers/ProtocolBuffers.pro deleted file mode 100644 index e69de29b..00000000 diff --git a/ScreenPlay/main.cpp b/ScreenPlay/main.cpp index 87d740ae..6a456308 100644 --- a/ScreenPlay/main.cpp +++ b/ScreenPlay/main.cpp @@ -1,4 +1,3 @@ -#include #include #include #include @@ -10,6 +9,7 @@ #include #include #include +#include #include #include @@ -26,6 +26,7 @@ #endif //#include "ThirdParty/qt-google-analytics/ganalytics.h" +#include "ThirdParty/steam/steam_api.h" #include "src/create.h" #include "src/installedlistfilter.h" #include "src/installedlistmodel.h" @@ -36,11 +37,9 @@ #include "src/sdkconnector.h" #include "src/settings.h" #include "src/startuperror.h" -#include "ThirdParty/steam/steam_api.h" #include "src/steamworkshop.h" #include "src/steamworkshoplistmodel.h" - int main(int argc, char* argv[]) { @@ -50,7 +49,6 @@ int main(int argc, char* argv[]) app.setQuitOnLastWindowClosed(false); qSetMessagePattern("%{if-category}%{category}: %{endif}%{message}\n Loc: [%{file}:%{line}]"); - QTranslator trsl; trsl.load(":/translations/ScreenPlay_de.qm"); app.installTranslator(&trsl); diff --git a/ScreenPlay/qml/Create/CreateWallpaper.qml b/ScreenPlay/qml/Create/CreateWallpaper.qml index 7a15f95b..96cdca53 100644 --- a/ScreenPlay/qml/Create/CreateWallpaper.qml +++ b/ScreenPlay/qml/Create/CreateWallpaper.qml @@ -85,6 +85,7 @@ Item { FileDialog { id: fileDialogOpenFile + // nameFilters: ["Video files (*.mp4)"] onAccepted: { videoFileSelected(fileDialogOpenFile.currentFile) } diff --git a/ScreenPlay/qml/Create/Wizards/CreateWallpaper/CreateWallpaperWizard.qml b/ScreenPlay/qml/Create/Wizards/CreateWallpaper/CreateWallpaperWizard.qml index f5b71d8f..b89e5bba 100644 --- a/ScreenPlay/qml/Create/Wizards/CreateWallpaper/CreateWallpaperWizard.qml +++ b/ScreenPlay/qml/Create/Wizards/CreateWallpaper/CreateWallpaperWizard.qml @@ -19,7 +19,6 @@ Item { utility.setNavigationActive(false) } - //Blocks some MouseArea from create page MouseArea { anchors.fill: parent @@ -137,6 +136,18 @@ Item { running: true } + Text { + id: txtConvertNumber + color: "white" + text: qsTr("") + font.pixelSize: 21 + anchors { + horizontalCenter: parent.horizontalCenter + bottom: parent.bottom + bottomMargin: 40 + } + } + Text { id: txtConvert color: "white" @@ -145,7 +156,7 @@ Item { anchors { horizontalCenter: parent.horizontalCenter bottom: parent.bottom - bottomMargin: 30 + bottomMargin: 20 } } @@ -162,368 +173,398 @@ Item { imgPreview.source = "file:///" + screenPlayCreate.workingDir + "/preview.png" imgPreview.visible = true - } if (state === Create.State.ConvertingPreviewGifFinished) { imgPreview.source = "file:///" + screenPlayCreate.workingDir + "/preview.gif" imgPreview.visible = true + txtConvert.text = qsTr("Converting Video") + } + } + onProgressChanged: { + var percentage = Math.floor(progress * 100) + if (percentage > 100) + percentage = 100 + txtConvertNumber.text = percentage + "%" + } + } + } + Item { + id: wrapperRight + width: parent.width * .5 + anchors { + top: txtHeadline.bottom + topMargin: 30 + bottom: parent.bottom + right: parent.right + } + + Column { + id: column + spacing: 20 + anchors.fill: parent + anchors.margins: 30 + anchors.topMargin: 0 + + TextField { + id: textField + placeholderText: qsTr("Name") + anchors.right: parent.right + anchors.left: parent.left + onTextChanged: { + if (textField.text.length >= 3) { + canNext = true + } else { + canNext = false + } + } + } + + TextField { + id: textField1 + placeholderText: qsTr("Description") + anchors.right: parent.right + anchors.left: parent.left + } + + TextField { + id: textField2 + placeholderText: qsTr("Youtube URL") + anchors.right: parent.right + anchors.left: parent.left + } + + TextField { + id: textField3 + placeholderText: qsTr("Tags") + anchors.right: parent.right + anchors.left: parent.left + } + } + + Row { + id: column1 + height: 100 + width: childrenRect.width + spacing: 10 + anchors { + horizontalCenter: parent.horizontalCenter + bottom: parent.bottom + } + + Button { + id: btnExit + text: qsTr("Abort") + Material.background: Material.Gray + Material.foreground: "white" + onClicked: { + screenPlayCreate.abort() + utility.setNavigationActive(true) + utility.setNavigation("Create") + } + } + + NextButton { + id: btnFinish + onClicked: { + if (btnFinish.state === "enabled" && canNext) { + screenPlayCreate.createWallpaperProjectFile( + textField.text, textField1.text) + } } } } - + Connections { + target: screenPlayCreate + onCreateWallpaperStateChanged: { + if (state === Create.State.ConvertingVideoFinished) { + btnFinish.state = "enabled" + } + } + } } - } Item { - id: wrapperRight - width: parent.width * .5 - anchors { - top: txtHeadline.bottom - topMargin: 30 - bottom: parent.bottom - right: parent.right + id: wrapperError + anchors.fill: parent + opacity: 0 + + Text { + id: txtErrorHeadline + text: qsTr("An error occurred!") + anchors { + top: parent.top + topMargin: 30 + horizontalCenter: parent.horizontalCenter + } + height: 40 + font.family: "Segoe UI, Roboto" + font.weight: Font.Light + color: Material.color(Material.Red) + renderType: Text.NativeRendering + font.pixelSize: 32 } - Column { - id: column - spacing: 20 - anchors.fill: parent - anchors.margins: 30 - anchors.topMargin: 0 + Rectangle { + id: rectangle1 + color: "#eeeeee" + radius: 3 + anchors { + top: txtErrorHeadline.bottom + right: parent.right + bottom: btnBack.top + left: parent.left + margins: 30 + bottomMargin: 10 + } - TextField { - id: textField - placeholderText: qsTr("Name") - anchors.right: parent.right - anchors.left: parent.left - onTextChanged: { - if (textField.text.length >= 3 ) { - canNext = true - - } else { - canNext = false + Flickable { + anchors.fill: parent + clip: true + contentHeight: txtFFMPEGDebug.paintedHeight + ScrollBar.vertical: ScrollBar { + snapMode: ScrollBar.SnapOnRelease + policy: ScrollBar.AlwaysOn + } + Text { + id: txtFFMPEGDebug + anchors { + top: parent.top + right: parent.right + left: parent.left + margins: 20 + } + wrapMode: Text.WordWrap + color: "#626262" + renderType: Text.NativeRendering + height: txtFFMPEGDebug.paintedHeight + } + Connections { + target: screenPlayCreate + onProcessOutput: { + txtFFMPEGDebug.text = text } } } - - TextField { - id: textField1 - placeholderText: qsTr("Description") - anchors.right: parent.right - anchors.left: parent.left - } - - TextField { - id: textField2 - placeholderText: qsTr("Youtube URL") - anchors.right: parent.right - anchors.left: parent.left - } - - TextField { - id: textField3 - placeholderText: qsTr("Tags") - anchors.right: parent.right - anchors.left: parent.left - } } - - Row { - id: column1 - height: 100 - width:childrenRect.width - spacing: 10 + Button { + id: btnBack + text: qsTr("Back to create and send an error report!") + Material.background: Material.Orange + Material.foreground: "white" anchors { horizontalCenter: parent.horizontalCenter bottom: parent.bottom + margins: 10 } + onClicked: { + utility.setNavigationActive(true) + utility.setNavigation("Create") + } + } + } - Button { - id: btnExit - text: qsTr("Abort") - Material.background: Material.Gray - Material.foreground: "white" - onClicked: { - screenPlayCreate.abort() - utility.setNavigationActive(true) - utility.setNavigation("Create") + Item { + id: wrapperSuccess + anchors.fill: parent + opacity: 0 + + Text { + id: txtSuccessHeadline + text: qsTr("An error occurred!") + anchors { + top: parent.top + topMargin: 30 + horizontalCenter: parent.horizontalCenter + } + height: 40 + font.family: "Segoe UI, Roboto" + font.weight: Font.Light + color: Material.color(Material.Orange) + renderType: Text.NativeRendering + font.pixelSize: 32 + } + + Button { + id: btnSuccessBack + text: qsTr("Back to create!") + Material.background: Material.Orange + Material.foreground: "white" + anchors { + horizontalCenter: parent.horizontalCenter + bottom: parent.bottom + margins: 10 + } + onClicked: { + utility.setNavigationActive(true) + utility.setNavigation("Create") + } + } + } + + MouseArea { + anchors { + top: parent.top + right: parent.right + margins: 5 + } + width: 32 + height: width + cursorShape: Qt.PointingHandCursor + onClicked: { + createNew.state = "out" + timerBack.start() + } + + Image { + id: imgClose + source: "qrc:/assets/icons/font-awsome/close.svg" + width: 16 + height: 16 + anchors.centerIn: parent + sourceSize: Qt.size(width, width) + } + ColorOverlay { + id: iconColorOverlay + anchors.fill: imgClose + source: imgClose + color: "gray" + } + Timer { + id: timerBack + interval: 800 + onTriggered: { + screenPlayCreate.abort() + utility.setNavigationActive(true) + utility.setNavigation("Create") + } + } + } + } + + states: [ + State { + name: "out" + PropertyChanges { + target: wrapper + anchors.topMargin: 800 + opacity: 0 + } + PropertyChanges { + target: effect + opacity: 0 + } + PropertyChanges { + target: wrapperError + opacity: 0 + } + }, + State { + name: "in" + PropertyChanges { + target: wrapper + anchors.topMargin: 40 + opacity: 1 + } + PropertyChanges { + target: effect + opacity: .4 + } + PropertyChanges { + target: wrapperError + opacity: 0 + } + }, + State { + name: "error" + PropertyChanges { + target: wrapper + anchors.topMargin: 40 + opacity: 1 + } + PropertyChanges { + target: effect + opacity: .4 + } + PropertyChanges { + target: wrapperContent + opacity: 0 + z: 0 + } + PropertyChanges { + target: wrapperError + opacity: 1 + } + }, + State { + name: "success" + PropertyChanges { + target: wrapper + anchors.topMargin: 40 + opacity: 1 + } + PropertyChanges { + target: effect + opacity: .4 + } + PropertyChanges { + target: wrapperContent + opacity: 0 + z: 0 + } + PropertyChanges { + target: wrapperError + opacity: 1 + } + } + ] + transitions: [ + Transition { + from: "out" + to: "in" + SequentialAnimation { + + PauseAnimation { + duration: 400 + } + ParallelAnimation { + + PropertyAnimation { + target: wrapper + duration: 600 + property: "anchors.topMargin" + easing.type: Easing.InOutQuad } - } + PropertyAnimation { + target: wrapper + duration: 600 + property: "opacity" + easing.type: Easing.InOutQuad + } + SequentialAnimation { - NextButton { - id: btnFinish - onClicked: { - if (btnFinish.state === "enabled" && canNext) { - screenPlayCreate.createWallpaperProjectFile( - textField.text, textField1.text) + PauseAnimation { + duration: 1000 + } + PropertyAnimation { + target: effect + duration: 300 + property: "opacity" + easing.type: Easing.InOutQuad } } } - } + }, + Transition { + from: "in" + to: "out" - Connections { - target: screenPlayCreate - onCreateWallpaperStateChanged: { - if (state === Create.State.ConvertingVideoFinished) { - btnFinish.state = "enabled" - } - } - } - - } - } - - Item { - id: wrapperError - anchors.fill: parent - opacity: 0 - - Text { - id: txtErrorHeadline - text: qsTr("An error occurred!") - anchors { - top: parent.top - topMargin: 30 - horizontalCenter: parent.horizontalCenter - } - height: 40 - font.family: "Segoe UI, Roboto" - font.weight: Font.Light - color: Material.color(Material.Red) - renderType: Text.NativeRendering - font.pixelSize: 32 - } - - Rectangle { - id: rectangle1 - color: "#eeeeee" - radius: 3 - anchors { - top: txtErrorHeadline.bottom - right: parent.right - bottom: btnBack.top - left: parent.left - margins: 30 - bottomMargin: 10 - } - - Flickable { - anchors.fill: parent - clip: true - contentHeight: txtFFMPEGDebug.paintedHeight - ScrollBar.vertical: ScrollBar { - snapMode: ScrollBar.SnapOnRelease - policy: ScrollBar.AlwaysOn - } - Text { - id: txtFFMPEGDebug - anchors { - top: parent.top - right: parent.right - left: parent.left - margins: 20 - } - wrapMode: Text.WordWrap - color: "#626262" - renderType: Text.NativeRendering - height: txtFFMPEGDebug.paintedHeight - } - Connections { - target: screenPlayCreate - onProcessOutput: { - txtFFMPEGDebug.text = text - } - } - } - } - - Button { - id: btnBack - text: qsTr("Back to create and send an error report!") - Material.background: Material.Orange - Material.foreground: "white" - anchors { - horizontalCenter: parent.horizontalCenter - bottom: parent.bottom - margins: 10 - } - onClicked: { - utility.setNavigationActive(true) - utility.setNavigation("Create") - } - } - } - - Item { - id: wrapperSuccess - anchors.fill: parent - opacity: 0 - - Text { - id: txtSuccessHeadline - text: qsTr("An error occurred!") - anchors { - top: parent.top - topMargin: 30 - horizontalCenter: parent.horizontalCenter - } - height: 40 - font.family: "Segoe UI, Roboto" - font.weight: Font.Light - color: Material.color(Material.Orange) - renderType: Text.NativeRendering - font.pixelSize: 32 - } - - Button { - id: btnSuccessBack - text: qsTr("Back to create!") - Material.background: Material.Orange - Material.foreground: "white" - anchors { - horizontalCenter: parent.horizontalCenter - bottom: parent.bottom - margins: 10 - } - onClicked: { - utility.setNavigationActive(true) - utility.setNavigation("Create") - } - } - } - - MouseArea { - anchors { - top: parent.top - right: parent.right - margins: 5 - } - width: 32 - height: width - cursorShape: Qt.PointingHandCursor - onClicked: { - createNew.state = "out" - timerBack.start() - } - - Image { - id: imgClose - source: "qrc:/assets/icons/font-awsome/close.svg" - width: 16 - height: 16 - anchors.centerIn: parent - sourceSize: Qt.size(width, width) - } - ColorOverlay { - id: iconColorOverlay - anchors.fill: imgClose - source: imgClose - color: "gray" - } - Timer { - id: timerBack - interval: 800 - onTriggered:{ - screenPlayCreate.abort() - utility.setNavigationActive(true) - utility.setNavigation("Create") - } - } - } - } - - states: [ - State { - name: "out" - PropertyChanges { - target: wrapper - anchors.topMargin: 800 - opacity: 0 - } - PropertyChanges { - target: effect - opacity: 0 - } - PropertyChanges { - target: wrapperError - opacity: 0 - } - }, - State { - name: "in" - PropertyChanges { - target: wrapper - anchors.topMargin: 40 - opacity: 1 - } - PropertyChanges { - target: effect - opacity: .4 - } - PropertyChanges { - target: wrapperError - opacity: 0 - } - }, - State { - name: "error" - PropertyChanges { - target: wrapper - anchors.topMargin: 40 - opacity: 1 - } - PropertyChanges { - target: effect - opacity: .4 - } - PropertyChanges { - target: wrapperContent - opacity: 0 - z: 0 - } - PropertyChanges { - target: wrapperError - opacity: 1 - } - }, - State { - name: "success" - PropertyChanges { - target: wrapper - anchors.topMargin: 40 - opacity: 1 - } - PropertyChanges { - target: effect - opacity: .4 - } - PropertyChanges { - target: wrapperContent - opacity: 0 - z: 0 - } - PropertyChanges { - target: wrapperError - opacity: 1 - } - } - ] - transitions: [ - Transition { - from: "out" - to: "in" - SequentialAnimation { - - PauseAnimation { - duration: 400 - } ParallelAnimation { PropertyAnimation { @@ -541,7 +582,7 @@ Item { SequentialAnimation { PauseAnimation { - duration: 1000 + duration: 500 } PropertyAnimation { target: effect @@ -551,82 +592,49 @@ Item { } } } - } - }, - Transition { - from: "in" - to: "out" - - ParallelAnimation { - - PropertyAnimation { - target: wrapper - duration: 600 - property: "anchors.topMargin" - easing.type: Easing.InOutQuad - } - PropertyAnimation { - target: wrapper - duration: 600 - property: "opacity" - easing.type: Easing.InOutQuad - } + }, + Transition { + from: "in" + to: "error" SequentialAnimation { - + PropertyAnimation { + target: wrapperContent + duration: 600 + property: "opacity" + easing.type: Easing.InOutQuad + } PauseAnimation { - duration: 500 + duration: 50 } PropertyAnimation { - target: effect - duration: 300 + target: wrapperError + duration: 200 + property: "opacity" + easing.type: Easing.InOutQuad + } + } + }, + Transition { + from: "in" + to: "success" + SequentialAnimation { + PropertyAnimation { + target: wrapperContent + duration: 600 + property: "opacity" + easing.type: Easing.InOutQuad + } + PauseAnimation { + duration: 50 + } + PropertyAnimation { + target: wrapperSuccess + duration: 200 property: "opacity" easing.type: Easing.InOutQuad } } } - }, - Transition { - from: "in" - to: "error" - SequentialAnimation { - PropertyAnimation { - target: wrapperContent - duration: 600 - property: "opacity" - easing.type: Easing.InOutQuad - } - PauseAnimation { - duration: 50 - } - PropertyAnimation { - target: wrapperError - duration: 200 - property: "opacity" - easing.type: Easing.InOutQuad - } - } - }, - Transition { - from: "in" - to: "success" - SequentialAnimation { - PropertyAnimation { - target: wrapperContent - duration: 600 - property: "opacity" - easing.type: Easing.InOutQuad - } - PauseAnimation { - duration: 50 - } - PropertyAnimation { - target: wrapperSuccess - duration: 200 - property: "opacity" - easing.type: Easing.InOutQuad - } - } - } - ] + ] + } } - diff --git a/ScreenPlay/qml/Installed/Installed.qml b/ScreenPlay/qml/Installed/Installed.qml index 692f64b7..8693ff62 100644 --- a/ScreenPlay/qml/Installed/Installed.qml +++ b/ScreenPlay/qml/Installed/Installed.qml @@ -117,7 +117,6 @@ Item { //Pull to refresh if (contentY <= -180 && !refresh && !isDragging) { - tracker.sendEvent("ui_event", "pulltorefresh", "refresh") installedListModel.reset() installedListModel.loadScreens() } diff --git a/ScreenPlay/qml/Installed/Sidebar.qml b/ScreenPlay/qml/Installed/Sidebar.qml index 357006cd..2fb7b64e 100644 --- a/ScreenPlay/qml/Installed/Sidebar.qml +++ b/ScreenPlay/qml/Installed/Sidebar.qml @@ -225,8 +225,8 @@ Item { height: 100 width: 400 anchors { - top: monitorSelectionWrapper.bottom - topMargin: 30 + bottom: btnSetWallpaper.top + bottomMargin: 20 right: parent.right rightMargin: 30 leftMargin: 30 diff --git a/ScreenPlay/qml/MonitorSelection.qml b/ScreenPlay/qml/MonitorSelection.qml index 333f881c..fff51047 100644 --- a/ScreenPlay/qml/MonitorSelection.qml +++ b/ScreenPlay/qml/MonitorSelection.qml @@ -93,9 +93,7 @@ Rectangle { rp.itemAt(i).x = rp.itemAt(i).x * monitorWidthRationDelta rp.itemAt(i).y = rp.itemAt(i).y * monitorHeightRationDelta } - for(var i = 0; i < rp.count; i++){ - } } Repeater { diff --git a/ScreenPlay/qml/Settings/SettingsHeader.qml b/ScreenPlay/qml/Settings/SettingsHeader.qml index 2f2acd2a..799fe31e 100644 --- a/ScreenPlay/qml/Settings/SettingsHeader.qml +++ b/ScreenPlay/qml/Settings/SettingsHeader.qml @@ -67,6 +67,7 @@ Item { text: settingsHeader.text font.pixelSize: 18 color: "white" + verticalAlignment: Text.AlignTop renderType: Text.NativeRendering font.family: "Roboto" anchors{ diff --git a/ScreenPlay/src/create.cpp b/ScreenPlay/src/create.cpp index 6f6f481f..144c8217 100644 --- a/ScreenPlay/src/create.cpp +++ b/ScreenPlay/src/create.cpp @@ -324,9 +324,67 @@ bool Create::createWallpaperVideoPreview() bool Create::createWallpaperVideo() { - emit createWallpaperStateChanged(Create::State::ConvertingVideo); + + /* + * + * Extract audio + * + */ + + emit createWallpaperStateChanged(Create::State::ConvertingAudio); QStringList args; + args.clear(); + args.append("-y"); + args.append("-stats"); + args.append("-i"); + args.append(m_createWallpaperData.videoPath); + args.append("-f"); + args.append("mp3"); + args.append("-ab"); + args.append("192000"); + args.append("-vn"); + args.append(m_createWallpaperData.exportPath + "/audio.mp3"); + + QScopedPointer proConvertImage(new QProcess()); + proConvertImage.data()->setArguments(args); + qDebug() << "Start extracting video to audio"; +#ifdef Q_OS_WIN + proConvertImage.data()->setProgram(QApplication::applicationDirPath() + "/ffmpeg.exe"); +#endif +#ifdef Q_OS_MACOS + pro.data()->setProgram(QApplication::applicationDirPath() + "/ffmpeg"); +#endif + + connect(this, &Create::abortCreateWallpaper, proConvertImage.data(), &QProcess::kill); + proConvertImage.data()->start(QIODevice::ReadOnly); + while (!proConvertImage.data()->waitForFinished(100)) //Wake up every 100ms and check if we must exit + { + QCoreApplication::processEvents(); + } + + QString tmpErrImg = proConvertImage.data()->readAllStandardError(); + if (!tmpErrImg.isEmpty()) { + QFile previewImg(m_createWallpaperData.exportPath + "/preview.png"); + if (!previewImg.exists() && !(previewImg.size() > 0)) { + emit createWallpaperStateChanged(Create::State::ConvertingAudioError); + return false; + } + } + + this->processOutput(proConvertImage.data()->readAll()); + proConvertImage.data()->close(); + emit createWallpaperStateChanged(Create::State::ConvertingAudioFinished); + + /* + * + * Create video + * + */ + + emit createWallpaperStateChanged(Create::State::ConvertingVideo); + + args.clear(); args.append("-hide_banner"); args.append("-y"); args.append("-stats"); @@ -359,8 +417,25 @@ bool Create::createWallpaperVideo() #endif qDebug() << "Start converting video"; - connect(proConvertVideo.data(), &QProcess::readyReadStandardOutput, this, [&]() { - QString tmpOut = proConvertVideo.data()->readAllStandardOutput(); + connect(proConvertVideo.data(), &QProcess::readyRead, this, [&]() { + // Somehow readyRead gets seldom called in the end with an + // not valid QProcess pointer.... + if (proConvertVideo.isNull()) { + qDebug() << "EROR NULL"; + return; + } + + if (!proConvertVideo.data()->isOpen()) { + qDebug() << "ERROR NOT OPEN"; + return; + } + + if (!proConvertVideo.data()->isReadable()) { + qDebug() << "ERROR CANNOT READ LINE"; + return; + } + + QString tmpOut = proConvertVideo.data()->readAll(); qDebug() << tmpOut << m_createWallpaperData.length; auto tmpList = tmpOut.split(QRegExp("\\s+"), QString::SkipEmptyParts); if (tmpList.length() > 2) { @@ -369,13 +444,15 @@ bool Create::createWallpaperVideo() if (!ok) return; + qDebug() << currentFrame << m_createWallpaperData.length << m_createWallpaperData.framerate; - float progress = currentFrame / m_createWallpaperData.length; - + float progress = currentFrame / (m_createWallpaperData.length * m_createWallpaperData.framerate); + qDebug() << progress; this->setProgress(progress); } this->processOutput(tmpOut); - }); + }, + Qt::QueuedConnection); connect(this, &Create::abortCreateWallpaper, proConvertVideo.data(), &QProcess::kill); proConvertVideo.data()->start(QIODevice::ReadOnly); diff --git a/ScreenPlay/src/create.h b/ScreenPlay/src/create.h index 6edd9a7f..81708725 100644 --- a/ScreenPlay/src/create.h +++ b/ScreenPlay/src/create.h @@ -55,10 +55,13 @@ public: ConvertingPreviewImageError, ConvertingPreviewVideo, ConvertingPreviewVideoFinished, - ConvertingPreviewVideoError, + ConvertingPreviewVideoError, //10 ConvertingPreviewGif, ConvertingPreviewGifFinished, ConvertingPreviewGifError, + ConvertingAudio, + ConvertingAudioFinished, + ConvertingAudioError, ConvertingVideo, ConvertingVideoFinished, ConvertingVideoError, diff --git a/ScreenPlay/src/installedlistmodel.cpp b/ScreenPlay/src/installedlistmodel.cpp index 715b687a..9957d039 100644 --- a/ScreenPlay/src/installedlistmodel.cpp +++ b/ScreenPlay/src/installedlistmodel.cpp @@ -129,7 +129,7 @@ void InstalledListModel::loadScreens() if (fileEnding.endsWith(".webm") || (obj.value("type").toString() == "qmlScene") || fileEnding.endsWith(".html")) emit addInstalledItem(obj, item.baseName()); - if(obj.value("type") == "qmlWidget") + if(obj.value("type") == "qmlWidget" || obj.value("type") == "standalonewidget") emit addInstalledItem(obj, item.baseName()); } diff --git a/ScreenPlayWindow/SPWmain.cpp b/ScreenPlayWindow/SPWmain.cpp index dda4c5c1..753d5779 100644 --- a/ScreenPlayWindow/SPWmain.cpp +++ b/ScreenPlayWindow/SPWmain.cpp @@ -29,7 +29,7 @@ int main(int argc, char* argv[]) // Args: which monitor, (2) path to project, (3)wallpaper secret to identify the connected socket, (4) decoder, (5) volume, (6) fillmode // See screenplay.h @ScreenPlayWallpaper constructor how the args get created - // MainWindow w(0,"D:/672870/827148653","","","",""); + //MainWindow w(0,"D:/672870/_tmp_135011","","","",""); sdk.setAppID(argumentList.at(3)); qDebug() << "Starting MainWindow: " << argumentList.at(2) << argumentList.at(3) << argumentList.at(4) << argumentList.at(5) << argumentList.at(6); MainWindow w(monitor, argumentList.at(2), argumentList.at(3), argumentList.at(4), argumentList.at(5), argumentList.at(6));