diff --git a/ScreenPlay/main.qml b/ScreenPlay/main.qml index 6a8e0a43..95115f72 100644 --- a/ScreenPlay/main.qml +++ b/ScreenPlay/main.qml @@ -46,6 +46,7 @@ ApplicationWindow { sidebar.state = "inactive" } } + Connections { target: screenPlaySettings onSetMainWindowVisible: { @@ -112,11 +113,11 @@ ApplicationWindow { if (miMuteAll.isMuted) { isMuted = false miMuteAll.text = qsTr("Mute all") - screenPlaySettings.setMuteAll(false) + screenPlay.setWallpaperValue(0, "volume", "1") } else { isMuted = true miMuteAll.text = qsTr("Unmute all") - screenPlaySettings.setMuteAll(true) + screenPlay.setWallpaperValue(0, "volume", "0") } } } @@ -128,11 +129,11 @@ ApplicationWindow { if (miStopAll.isPlaying) { isPlaying = false miStopAll.text = qsTr("Pause all") - screenPlaySettings.setPlayAll(true) + screenPlay.setWallpaperValue(0, "isPlaying", "false") } else { isPlaying = true miStopAll.text = qsTr("Play all") - screenPlaySettings.setPlayAll(false) + screenPlay.setWallpaperValue(0, "isPlaying", "true") } } } @@ -181,17 +182,6 @@ ApplicationWindow { } } - // Loader { - // id: pageLoaderCommunity - // visible: false - // asynchronous: true - // anchors { - // top: nav.bottom - // right: parent.right - // bottom: parent.bottom - // left: parent.left - // } - // } Loader { id: pageLoaderWorkshop visible: false @@ -233,7 +223,7 @@ ApplicationWindow { } else { sidebar.state = "activeWidget" } - }else if (type === "qmlScene") { + } else if (type === "qmlScene") { if (sidebar.activeScreen == screenId && sidebar.state == "activeScene") { sidebar.state = "inactive" diff --git a/ScreenPlay/qml/Installed/Sidebar.qml b/ScreenPlay/qml/Installed/Sidebar.qml index 947b1164..cd16b588 100644 --- a/ScreenPlay/qml/Installed/Sidebar.qml +++ b/ScreenPlay/qml/Installed/Sidebar.qml @@ -183,7 +183,7 @@ Item { Text { id: txtHeadlineMonitor text: qsTr("Select a Monitor to display the content") - height: 20 + height: 50 renderType: Text.NativeRendering horizontalAlignment: Qt.AlignHCenter font.family: "Roboto" @@ -192,7 +192,7 @@ Item { wrapMode: Text.WrapAnywhere anchors { top: headlineWrapper.bottom - topMargin: 20 + margins: 20 right: parent.right left: parent.left } @@ -289,6 +289,7 @@ Item { } Text { + visible: false id: txtComboBoxFillMode text: qsTr("Fill Mode") height: 30 @@ -306,6 +307,7 @@ Item { } ComboBox { + visible: false id: settingsComboBox width: 200 diff --git a/ScreenPlay/src/installedlistmodel.cpp b/ScreenPlay/src/installedlistmodel.cpp index 2b9b1660..86e86856 100644 --- a/ScreenPlay/src/installedlistmodel.cpp +++ b/ScreenPlay/src/installedlistmodel.cpp @@ -123,7 +123,7 @@ void InstalledListModel::loadScreens() if (!obj.contains("type")) { obj.insert("type", "video"); } - if (fileEnding.endsWith(".webm")) + if (fileEnding.endsWith(".webm") || (obj.value("type").toString() == "qmlScene")) emit addInstalledItem(obj, item.baseName()); } } diff --git a/ScreenPlay/src/projectsettingslistmodel.cpp b/ScreenPlay/src/projectsettingslistmodel.cpp index c22b74ee..3513ae2e 100644 --- a/ScreenPlay/src/projectsettingslistmodel.cpp +++ b/ScreenPlay/src/projectsettingslistmodel.cpp @@ -54,7 +54,7 @@ QHash ProjectSettingsListModel::roleNames() const void ProjectSettingsListModel::init(QString file) { - qDebug() << file; + qDebug() << "ProjectSettingsListModel loading: " << file; QFile configTmp; configTmp.setFileName(file); QJsonDocument configJsonDocument; diff --git a/ScreenPlay/src/screenplay.cpp b/ScreenPlay/src/screenplay.cpp index 2337b0f1..6f62d1a7 100644 --- a/ScreenPlay/src/screenplay.cpp +++ b/ScreenPlay/src/screenplay.cpp @@ -106,6 +106,8 @@ QVector ScreenPlay::getMonitorByAppID(QString appID) return m_screenPlayWallpaperList.at(i).data()->screenNumber(); } } + + return QVector(); } Settings* ScreenPlay::settings() const diff --git a/ScreenPlay/src/sdkconnector.cpp b/ScreenPlay/src/sdkconnector.cpp index 4eafbb41..e1fd1c2b 100644 --- a/ScreenPlay/src/sdkconnector.cpp +++ b/ScreenPlay/src/sdkconnector.cpp @@ -9,12 +9,16 @@ SDKConnector::SDKConnector(QObject* parent) m_server = QSharedPointer(new QLocalServer(this)); connect(m_server.data(), &QLocalServer::newConnection, this, &SDKConnector::newConnection); - if (!m_server.data()->listen("ScreenPlay")) { //TODO } } +void SDKConnector::readyRead() +{ + +} + void SDKConnector::newConnection() { m_clients.append(QSharedPointer(new SDKConnection(m_server.data()->nextPendingConnection()))); @@ -77,11 +81,6 @@ void SDKConnector::setSceneValue(QString appID, QString key, QString value) } -void SDKConnection::setSocket(QLocalSocket* socket) -{ - m_socket = socket; -} - QLocalSocket* SDKConnection::socket() const { return m_socket; diff --git a/ScreenPlay/src/sdkconnector.h b/ScreenPlay/src/sdkconnector.h index fc675e8c..382b06e8 100644 --- a/ScreenPlay/src/sdkconnector.h +++ b/ScreenPlay/src/sdkconnector.h @@ -26,6 +26,7 @@ public: signals: public slots: + void readyRead(); void newConnection(); void closeAllWallpapers(); void closeWallpapersAt(int at); @@ -56,7 +57,6 @@ public: qDebug() << "destroying SDKConnection Object"; } - void setSocket(QLocalSocket* socket); QString appID() const { diff --git a/ScreenPlay/src/settings.h b/ScreenPlay/src/settings.h index 869e008b..160aac81 100644 --- a/ScreenPlay/src/settings.h +++ b/ScreenPlay/src/settings.h @@ -29,7 +29,7 @@ #include "profilelistmodel.h" #include "projectsettingslistmodel.h" #include "sdkconnector.h" -#include "steam/steam_api.h" +#include "../ThirdParty/steam/steam_api.h" #ifdef Q_OS_WIN #include #endif diff --git a/ScreenPlay/src/steamworkshop.cpp b/ScreenPlay/src/steamworkshop.cpp index e95d6eb4..3d8abb7b 100644 --- a/ScreenPlay/src/steamworkshop.cpp +++ b/ScreenPlay/src/steamworkshop.cpp @@ -1,5 +1,8 @@ #include "steamworkshop.h" +#include "stdlib.h" +#include "cstring" + SteamWorkshop::SteamWorkshop(QObject* parent) : QObject(parent) { @@ -97,6 +100,7 @@ void SteamWorkshop::submitWorkshopItem(QString title, QString description, QStri if (!jsonObject.contains("workshopid")) { jsonObject.insert("workshopid", publishedFileId); } + projectConfig.close(); // Reopen to empty the file via Truncate projectConfig.open(QIODevice::ReadWrite | QIODevice::Truncate); @@ -109,17 +113,21 @@ void SteamWorkshop::submitWorkshopItem(QString title, QString description, QStri SteamUGC()->SetItemUpdateLanguage(m_UGCUpdateHandle, QByteArray(language.toLatin1()).data()); SteamUGC()->SetItemContent(m_UGCUpdateHandle, QByteArray(absoluteContentPath.toLatin1()).data()); SteamUGC()->SetItemPreview(m_UGCUpdateHandle, QByteArray(preview.toLatin1()).data()); - auto tagList = new QScopedPointer(new SteamParamStringArray_t); - - //const char** cchKey[5][2000]; - - //tagList->data()->m_ppStrings = cchKey; - //tagList->data()->m_nNumStrings = 1; - //tagList->data()->m_ppStrings[1][0] = QByteArray("asas").data(); - SteamUGC()->SetItemTags(m_UGCUpdateHandle, tagList->data()); auto visibility = static_cast(remoteStoragePublishedFileVisibility); SteamUGC()->SetItemVisibility(m_UGCUpdateHandle, visibility); + + auto tagList = new QScopedPointer(new SteamParamStringArray_t); + + int numStrings = 2; + tagList->data()->m_nNumStrings = numStrings; + const char *a[2]; + a[0] = "Videos"; + a[1] = "Scenes"; + + tagList->data()->m_ppStrings = a; + SteamUGC()->SetItemTags(m_UGCUpdateHandle, tagList->data()); + SteamUGC()->SubmitItemUpdate(m_UGCUpdateHandle, nullptr); emit remoteWorkshopCreationStatusChanged(RemoteWorkshopCreationStatus::Started); @@ -152,7 +160,6 @@ bool SteamWorkshop::contentFolderExist(QString folder) } } - void SteamWorkshop::subscribeItem(unsigned int id) { SteamUGC()->SubscribeItem(static_cast(id)); @@ -178,7 +185,7 @@ void SteamWorkshop::onWorkshopSearched(SteamUGCQueryCompleted_t* pCallback, bool if (bIOFailure) return; - //QtConcurrent::run([this, pCallback]() { }); + QtConcurrent::run([this, &pCallback]() { }); SteamUGCDetails_t details; const int urlLength = 200; @@ -194,10 +201,11 @@ void SteamWorkshop::onWorkshopSearched(SteamUGCQueryCompleted_t* pCallback, bool char* pchValue[cchValueSize]; uint32 results = pCallback->m_unTotalMatchingResults; + qDebug() << "ok " << results; for (uint32 i = 0; i < results; i++) { if (SteamUGC()->GetQueryUGCResult(pCallback->m_handle, i, &details)) { - //qDebug() << "ok " << pCallback; + if (SteamUGC()->GetQueryUGCPreviewURL(pCallback->m_handle, i, url, static_cast(urlLength))) { QByteArray urlData(url); @@ -223,7 +231,9 @@ void SteamWorkshop::onWorkshopSearched(SteamUGCQueryCompleted_t* pCallback, bool qDebug() << "Loading error!"; } } + SteamUGC()->ReleaseQueryUGCRequest(pCallback->m_handle); + } void SteamWorkshop::onWorkshopItemInstalled(ItemInstalled_t* itemInstalled) diff --git a/ScreenPlay/src/steamworkshop.h b/ScreenPlay/src/steamworkshop.h index 75edb61e..dd13e03b 100644 --- a/ScreenPlay/src/steamworkshop.h +++ b/ScreenPlay/src/steamworkshop.h @@ -1,7 +1,7 @@ #pragma once #include "settings.h" -#include "steam/steam_api.h" +#include "../ThirdParty/steam/steam_api.h" #include "steamworkshoplistmodel.h" #include #include diff --git a/ScreenPlay/src/steamworkshoplistmodel.cpp b/ScreenPlay/src/steamworkshoplistmodel.cpp index 895b6dd0..57d27e87 100644 --- a/ScreenPlay/src/steamworkshoplistmodel.cpp +++ b/ScreenPlay/src/steamworkshoplistmodel.cpp @@ -3,7 +3,6 @@ SteamWorkshopListModel::SteamWorkshopListModel(QObject* parent) : QAbstractListModel(parent) { - } QHash SteamWorkshopListModel::roleNames() const @@ -46,7 +45,7 @@ QVariant SteamWorkshopListModel::data(const QModelIndex& index, int role) const return QVariant(); int row = index.row(); - if(row < 0 || row >= m_workshopItemList.count()) { + if (row < 0 || row >= m_workshopItemList.count()) { return QVariant(); } @@ -68,13 +67,12 @@ void SteamWorkshopListModel::append(unsigned int id, QString title, QUrl imgUrl, { int row = 0; beginInsertRows(QModelIndex(), row, row); - m_workshopItemList.append(QSharedPointer(new WorkshopItem(id, title, imgUrl , "", numSubscriptions))); + m_workshopItemList.append(QSharedPointer(new WorkshopItem(id, title, imgUrl, "", numSubscriptions))); endInsertRows(); } void SteamWorkshopListModel::addWorkshopItem(WorkshopItem wi) { - } QUrl SteamWorkshopListModel::getBannerUrl() @@ -106,7 +104,6 @@ void SteamWorkshopListModel::setBannerWorkshopItem(unsigned int id, QString titl m_workshopBannerItem.m_title = title; m_workshopBannerItem.m_previewImageUrl = imgUrl; m_workshopBannerItem.m_numSubscriptions = numSubscriptions; - } bool SteamWorkshopListModel::setData(const QModelIndex& index, const QVariant& value, int role) diff --git a/ScreenPlay/src/steamworkshoplistmodel.h b/ScreenPlay/src/steamworkshoplistmodel.h index 74c21b4f..88364493 100644 --- a/ScreenPlay/src/steamworkshoplistmodel.h +++ b/ScreenPlay/src/steamworkshoplistmodel.h @@ -4,6 +4,7 @@ #include #include #include +#include #include "workshopitem.h" diff --git a/ScreenPlaySDK/Screenplaysdk.pri b/ScreenPlaySDK/Screenplaysdk.pri new file mode 100644 index 00000000..ad58cb47 --- /dev/null +++ b/ScreenPlaySDK/Screenplaysdk.pri @@ -0,0 +1,7 @@ +SOURCES += \ + $$PWD/screenplay-sdk_plugin.cpp \ + $$PWD/screenplaysdk.cpp + +HEADERS += \ + $$PWD/screenplay-sdk_plugin.h \ + $$PWD/screenplaysdk.h diff --git a/ScreenPlaySDK/Screenplaysdk.pro b/ScreenPlaySDK/Screenplaysdk.pro index 85f8a263..2be8cfb5 100644 --- a/ScreenPlaySDK/Screenplaysdk.pro +++ b/ScreenPlaySDK/Screenplaysdk.pro @@ -8,12 +8,12 @@ uri = net.aimber.screenplaysdk # Input SOURCES += \ - screenplay-sdk_plugin.cpp \ - screenplaysdk.cpp + $$PWD/screenplay-sdk_plugin.cpp \ + $$PWD/screenplaysdk.cpp HEADERS += \ - screenplay-sdk_plugin.h \ - screenplaysdk.h + $$PWD/screenplay-sdk_plugin.h \ + $$PWD/screenplaysdk.h DISTFILES = qmldir diff --git a/ScreenPlaySDK/screenplaysdk.cpp b/ScreenPlaySDK/screenplaysdk.cpp index 27141978..e0b90f52 100644 --- a/ScreenPlaySDK/screenplaysdk.cpp +++ b/ScreenPlaySDK/screenplaysdk.cpp @@ -1,21 +1,54 @@ #include "screenplaysdk.h" -ScreenPlaySDK::ScreenPlaySDK(QQuickItem *parent): - QQuickItem(parent) -{ - // By default, QQuickItem does not draw anything. If you subclass - // QQuickItem to create a visual item, you will need to uncomment the - // following line and re-implement updatePaintNode() +// USE THIS ONLY FOR redirectMessageOutputToMainWindow +static ScreenPlaySDK* global_sdkPtr = nullptr; - // setFlag(ItemHasContents, true); - m_socket = QSharedPointer(new QLocalSocket()); - m_socket.data()->setServerName("ScreenPlay"); - QObject::connect(m_socket.data(), &QLocalSocket::connected, this, &ScreenPlaySDK::connected); - QObject::connect(m_socket.data(), &QLocalSocket::disconnected, this, &ScreenPlaySDK::disconnected); - QObject::connect(m_socket.data(), &QLocalSocket::bytesWritten, this, &ScreenPlaySDK::bytesWritten); - QObject::connect(m_socket.data(), &QLocalSocket::readyRead, this, &ScreenPlaySDK::readyRead); - QObject::connect(m_socket.data(), QOverload::of(&QLocalSocket::error), this, &ScreenPlaySDK::error); - m_socket.data()->connectToServer(); +void redirectMessageOutputToMainWindow(QtMsgType type, const QMessageLogContext& context, const QString& msg) +{ + if (global_sdkPtr == nullptr) + return; + + QByteArray localMsg = msg.toLocal8Bit(); + QByteArray file = "File: " + QByteArray(context.file) + ", "; + QByteArray line = "in line " + QByteArray::number(context.line) + ", "; + //QByteArray function = "function " + QByteArray(context.function) + ", Message: "; + + localMsg = file + line + localMsg; + + switch (type) { + case QtDebugMsg: + localMsg = "Debug " /*+ QByteArray::fromStdString(global_sdkPtr->contentType().toStdString()) + " "*/ + localMsg; + global_sdkPtr->redirectMessage(localMsg); + break; + case QtInfoMsg: + //fprintf(stderr, "Info: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function); + break; + case QtWarningMsg: + //fprintf(stderr, "Warning: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function); + break; + case QtCriticalMsg: + //fprintf(stderr, "Critical: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function); + break; + case QtFatalMsg: + //(stderr, "Fatal: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function); + break; + } +} + +ScreenPlaySDK::ScreenPlaySDK(QQuickItem* parent) + : QQuickItem(parent) +{ + global_sdkPtr = this; + m_socket.setServerName("ScreenPlay"); + connect(&m_socket, &QLocalSocket::connected, this, &ScreenPlaySDK::connected); + connect(&m_socket, &QLocalSocket::disconnected, this, &ScreenPlaySDK::disconnected); + connect(&m_socket, &QLocalSocket::bytesWritten, this, &ScreenPlaySDK::bytesWritten); + connect(&m_socket, &QLocalSocket::readyRead, this, &ScreenPlaySDK::readyRead); + connect(&m_socket, QOverload::of(&QLocalSocket::error), this, &ScreenPlaySDK::error); + m_socket.connectToServer(); + + // Redirect all messages from this to ScreenPlay + qInstallMessageHandler(redirectMessageOutputToMainWindow); } ScreenPlaySDK::~ScreenPlaySDK() @@ -36,14 +69,13 @@ void ScreenPlaySDK::disconnected() void ScreenPlaySDK::bytesWritten(qint64 bytes) { - } void ScreenPlaySDK::readyRead() { - QString tmp = m_socket.data()->readAll(); + QString tmp = m_socket.readAll(); QJsonParseError err; - auto doc = QJsonDocument::fromJson(QByteArray::fromStdString(tmp.toStdString()),&err); + auto doc = QJsonDocument::fromJson(QByteArray::fromStdString(tmp.toStdString()), &err); if (!(err.error == QJsonParseError::NoError)) { emit incommingMessageError(err.errorString()); @@ -59,9 +91,15 @@ void ScreenPlaySDK::readyRead() void ScreenPlaySDK::error(QLocalSocket::LocalSocketError socketError) { - emit sdkSocketError("Error"); - - if(socketError == QLocalSocket::LocalSocketError::ConnectionRefusedError){ - //QCoreApplication::quit(); + if (socketError == QLocalSocket::LocalSocketError::ConnectionRefusedError) { + QCoreApplication::quit(); + } +} + +void ScreenPlaySDK::redirectMessage(QByteArray& msg) +{ + if (isConnected()) { + m_socket.write(msg); + m_socket.waitForBytesWritten(); } } diff --git a/ScreenPlaySDK/screenplaysdk.h b/ScreenPlaySDK/screenplaysdk.h index 6358a382..c23423c3 100644 --- a/ScreenPlaySDK/screenplaysdk.h +++ b/ScreenPlaySDK/screenplaysdk.h @@ -7,10 +7,12 @@ #include #include #include +#include #include #include #include #include +#include class ScreenPlaySDK : public QQuickItem { Q_OBJECT @@ -39,12 +41,14 @@ public: return m_appID; } + public slots: void connected(); void disconnected(); void bytesWritten(qint64 bytes); void readyRead(); void error(QLocalSocket::LocalSocketError socketError); + void redirectMessage(QByteArray &msg); void setContentType(QString contentType) { @@ -54,9 +58,9 @@ public slots: m_contentType = contentType; if (isConnected()) { - m_socket.data()->write(QByteArray(m_contentType.toLatin1())); - m_socket.data()->flush(); - m_socket.data()->waitForBytesWritten(); + m_socket.write(QByteArray(m_contentType.toLatin1())); + m_socket.flush(); + m_socket.waitForBytesWritten(); } emit contentTypeChanged(m_contentType); } @@ -78,25 +82,28 @@ public slots: m_appID = appID; emit appIDChanged(m_appID); - m_socket.data()->write(QByteArray(appID.toUtf8())); - m_socket.data()->waitForBytesWritten(); + m_socket.write(QByteArray(appID.toUtf8())); + m_socket.waitForBytesWritten(); } +private: + //qint64 writeData(const char *data, qint64 c) override; + signals: void incommingMessage(QString key, QString value); void incommingMessageError(QString msg); void sdkConnected(); void sdkDisconnected(); - void sdkSocketError(QString type); void contentTypeChanged(QString contentType); void isConnectedChanged(bool isConnected); void appIDChanged(QString appID); + void newRedirectMessage(QByteArray &msg); private: - QSharedPointer m_socket; + QLocalSocket m_socket; QString m_contentType = "undefined"; bool m_isConnected = false; diff --git a/ScreenPlayWindow/SPWResources.qrc b/ScreenPlayWindow/SPWResources.qrc index ce695aea..5f6483ac 100644 --- a/ScreenPlayWindow/SPWResources.qrc +++ b/ScreenPlayWindow/SPWResources.qrc @@ -1,6 +1,5 @@ main.qml - ScreenVideo.qml diff --git a/ScreenPlayWindow/SPWmain.cpp b/ScreenPlayWindow/SPWmain.cpp index 9eaf605a..9ca8a409 100644 --- a/ScreenPlayWindow/SPWmain.cpp +++ b/ScreenPlayWindow/SPWmain.cpp @@ -1,29 +1,37 @@ +#include "../ScreenPlaySDK/screenplaysdk.h" #include "src/SPWmainwindow.h" #include +#include #include int main(int argc, char* argv[]) { + QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QApplication a(argc, argv); + ScreenPlaySDK sdk; + // 6 parameter + 1 OS working directory default paramter QStringList argumentList = a.arguments(); - if (argumentList.length() != 7) { return -3; } - bool ok = false; - int monitor = argumentList.at(1).toInt(&ok); + bool canParseMonitorNumber = false; + int monitor = argumentList.at(1).toInt(&canParseMonitorNumber); - if (!ok) { + if (!canParseMonitorNumber) { return -4; } - // Args: which monitor, path to project, wallpaper secret to identify the connected socket - //MainWindow w(monitor, argumentList.at(2), argumentList.at(3), argumentList.at(4), argumentList.at(5), argumentList.at(6)); - //MainWindow w(0,"D:/672870/827148653","","","",""); + // 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","","","",""); + qDebug() << "Starting: " << 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)); + QObject::connect(&sdk, &ScreenPlaySDK::sdkDisconnected, &w, &MainWindow::destroyThis); + return a.exec(); } diff --git a/ScreenPlayWindow/ScreenPlayWindow.pro b/ScreenPlayWindow/ScreenPlayWindow.pro index 8b15c843..3cd7b11c 100644 --- a/ScreenPlayWindow/ScreenPlayWindow.pro +++ b/ScreenPlayWindow/ScreenPlayWindow.pro @@ -1,7 +1,7 @@ TEMPLATE = app QT += qml quick quickcontrols2 widgets core CONFIG += c++17 -#CONFIG += qtquickcompiler +CONFIG += qtquickcompiler msvc: LIBS += -luser32 TARGETPATH = ScreenPlayWindow @@ -18,15 +18,19 @@ RESOURCES += \ INCLUDEPATH += \ $$PWD/../../ThirdParty/ \ - $$PWD/../../src/\ + $$PWD/../../src/ \ +include(../ScreenPlaySDK/Screenplaysdk.pri) +LIBS += -lScreenplaysdk CONFIG(debug, debug|release) { install_it.path = $${OUT_PWD}/debug/ + QMAKE_LIBDIR += $$OUT_PWD/../ScreenPlaySDK/debug } else { install_it.path = $${OUT_PWD}/release/ + QMAKE_LIBDIR += $$OUT_PWD/../ScreenPlaySDK/release } - +QMAKE_LIBDIR += $$OUT_PWD/../ScreenPlaySDK install_it.files += index.html \ @@ -52,3 +56,5 @@ DEFINES += QT_DEPRECATED_WARNINGS qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS += target + + diff --git a/ScreenPlayWindow/ScreenVideo.qml b/ScreenPlayWindow/ScreenVideo.qml deleted file mode 100644 index 356f2be3..00000000 --- a/ScreenPlayWindow/ScreenVideo.qml +++ /dev/null @@ -1,93 +0,0 @@ -import QtQuick 2.9 -import QtAV 1.7 - -Rectangle { - id: screenVideoPlayer - color: "black" - anchors.fill: parent - - property string videoPath - property string decoder: "DXVA" //["CUDA", "VAAPI", "D3D11", "DXVA", "FFmpeg"] - property string fillMode - onFillModeChanged: { - if(fillMode === "Stretch"){ - videoOut.fillMode = VideoOutput.Stretch - } else if(fillMode === "PreserveAspectFit"){ - videoOut.fillMode = VideoOutput.PreserveAspectFit - } else if(fillMode === "PreserveAspectCrop"){ - videoOut.fillMode = VideoOutput.PreserveAspectCrop - } - } - - property bool loops: true - property real volume: 0 - - onVideoPathChanged: { - player.source = Qt.resolvedUrl("file:///" + videoPath) - player.play() - } - - property bool isPlaying: true - - VideoOutput2 { - id: videoOut - anchors.fill: parent - source: player - opengl: true - fillMode: VideoOutput.Stretch - } - - MediaPlayer { - id: player - videoCodecPriority: screenVideoPlayer.decoder - loops: MediaPlayer.Infinite - volume: screenVideoPlayer.volume - onPlaybackStateChanged: { - if (player.playbackState === MediaPlayer.PlayingState) { - state = "playing" - mainwindow.init() - } - } - } - - states: [ - State { - name: "playing" - PropertyChanges { - target: player - volume: screenVideoPlayer.volume - } - }, - State { - name: "destroy" - PropertyChanges { - target: player - volume: 0 - } - } - ] - transitions: [ - Transition { - from: "*" - to: "playing" - reversible: true - - NumberAnimation { - target: player - property: "volume" - duration: 1000 - } - }, - Transition { - from: "playing" - to: "destroy" - reversible: true - - NumberAnimation { - target: player - property: "volume" - duration: 200 - } - } - ] -} diff --git a/ScreenPlayWindow/index.html b/ScreenPlayWindow/index.html index 1113fd22..dc605d98 100644 --- a/ScreenPlayWindow/index.html +++ b/ScreenPlayWindow/index.html @@ -17,7 +17,7 @@ -