1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-07 03:22:33 +01:00
This commit is contained in:
kelteseth 2018-11-17 11:54:59 +01:00
parent baa162d862
commit 855c70273b
12 changed files with 71 additions and 30 deletions

View File

@ -119,9 +119,7 @@
<file>settings.json</file>
<file>translations/ScreenPlay_de.qm</file>
<file>translations/ScreenPlay_en.qm</file>
<file>qml/Create/Wizards/CreateWallpaper/Page_0.qml</file>
<file>qml/Create/Wizards/CreateWallpaper/Page_1.qml</file>
<file>qml/Create/Wizards/CreateWallpaper/Page_2.qml</file>
<file>qml/Create/Wizards/CreateWallpaper/NextButton.qml</file>
<file>qml/Screen/Screen.qml</file>
</qresource>
</RCC>

View File

@ -1,4 +1,3 @@
#include <QThread>
#include <QDebug>
#include <QDir>
#include <QFontDatabase>
@ -10,6 +9,7 @@
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QQmlEngine>
#include <QThread>
#include <QQuickView>
#include <QScreen>
@ -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);

View File

@ -85,7 +85,7 @@ Item {
FileDialog {
id: fileDialogOpenFile
nameFilters: ["Video files (*.mp4)"]
// nameFilters: ["Video files (*.mp4)"]
onAccepted: {
videoFileSelected(fileDialogOpenFile.currentFile)
}

View File

@ -127,6 +127,25 @@ Item {
running: true
}
AnimatedImage {
id: imgPreview
asynchronous: true
playing: true
visible: false
anchors.fill: parent
}
Text {
id: txtConvertNumber
color: "white"
text: qsTr("")
font.pixelSize: 21
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
bottomMargin: 40
}
}
Text {
id: txtConvert
color: "white"
@ -135,7 +154,7 @@ Item {
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
bottomMargin: 30
bottomMargin: 20
}
}
@ -152,20 +171,17 @@ Item {
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 + "%"
}
}
}
AnimatedImage {
id: imgPreview
asynchronous: true
playing: true
visible: false
anchors.fill: parent
}
}
}
Item {
@ -193,7 +209,6 @@ Item {
onTextChanged: {
if (textField.text.length >= 3) {
canNext = true
} else {
canNext = false
}

View File

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

View File

@ -93,10 +93,8 @@ 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 {
id: rp

View File

@ -46,6 +46,7 @@ Rectangle {
navInstalled.state = "inactive"
navSettings.state = "inactive"
navCommunity.state = "inactive"
navScreen.state = "inactive"
navCreate.state = "inactive"
} else if (name === "Installed") {
navWorkshop.state = "inactive"
@ -53,24 +54,35 @@ Rectangle {
navSettings.state = "inactive"
navCommunity.state = "inactive"
navCreate.state = "inactive"
navScreen.state = "inactive"
} else if (name === "Settings") {
navWorkshop.state = "inactive"
navInstalled.state = "inactive"
navSettings.state = "active"
navCommunity.state = "inactive"
navCreate.state = "inactive"
navScreen.state = "inactive"
} else if (name === "Create") {
navWorkshop.state = "inactive"
navInstalled.state = "inactive"
navSettings.state = "inactive"
navCreate.state = "active"
navCommunity.state = "inactive"
navScreen.state = "inactive"
} else if (name === "Community") {
navWorkshop.state = "inactive"
navInstalled.state = "inactive"
navSettings.state = "inactive"
navCommunity.state = "active"
navCreate.state = "inactive"
navScreen.state = "inactive"
}else if (name === "Screen") {
navWorkshop.state = "inactive"
navInstalled.state = "inactive"
navSettings.state = "inactive"
navCommunity.state = "inactive"
navCreate.state = "inactive"
navScreen.state = "active"
}
}
@ -104,6 +116,14 @@ Rectangle {
onPageClicked: navigation.onPageChanged(name)
}
NavigationItem {
id: navScreen
state: "inactive"
name: "Screen"
iconSource: "qrc:/assets/icons/icon_monitor.svg"
onPageClicked: navigation.onPageChanged(name)
}
NavigationItem {
id: navCommunity
state: "inactive"

View File

@ -67,6 +67,7 @@ Item {
text: settingsHeader.text
font.pixelSize: 18
color: "white"
verticalAlignment: Text.AlignTop
renderType: Text.NativeRendering
font.family: "Roboto"
anchors{

View File

@ -335,6 +335,16 @@ bool Create::createWallpaperVideo()
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);
@ -344,9 +354,10 @@ bool Create::createWallpaperVideo()
if (!ok)
return;
qDebug() << currentFrame << m_createWallpaperData.length << m_createWallpaperData.framerate;
float progress = currentFrame / (m_createWallpaperData.length * m_createWallpaperData.framerate);
qDebug() << progress ;
this->setProgress(progress);
}
this->processOutput(tmpOut);

View File

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

View File

@ -1,4 +1,4 @@
QT += quick qml quickcontrols2 core charts widgets gui
QT += quick qml quickcontrols2 core widgets gui
CONFIG += c++17
CONFIG += qtquickcompiler
# The following define makes your compiler emit warnings if you use

View File

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