2023-09-17 18:14:09 -05:00
|
|
|
#include <QGuiApplication>
|
|
|
|
#include <QQmlApplicationEngine>
|
2023-10-29 13:42:40 -05:00
|
|
|
#include <QMediaInfo.h>
|
|
|
|
#include <QHandbrake.h>
|
2023-12-25 12:02:14 -06:00
|
|
|
#include "qmoviedb.h"
|
2023-10-07 09:01:19 -05:00
|
|
|
|
|
|
|
#include <QFile>
|
2023-10-28 16:17:30 -05:00
|
|
|
#include <QQmlContext>
|
2023-12-25 12:02:14 -06:00
|
|
|
#include <QSettings>
|
2023-09-17 18:14:09 -05:00
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
QGuiApplication app(argc, argv);
|
2023-12-25 12:02:14 -06:00
|
|
|
QCoreApplication::setOrganizationName("abissen");
|
|
|
|
QCoreApplication::setApplicationName("DoViGUI");
|
|
|
|
QSettings settings;
|
|
|
|
|
2023-09-17 18:14:09 -05:00
|
|
|
|
2023-10-29 13:42:40 -05:00
|
|
|
QMediaInfo mInfo(&app);
|
2023-10-07 09:01:19 -05:00
|
|
|
|
2023-12-25 12:02:14 -06:00
|
|
|
if (QString::compare(settings.value("MovieDB API Key").toString(), "", Qt::CaseInsensitive) == 0) {
|
|
|
|
qWarning() << "Set MovieDB API key in settings file.";
|
|
|
|
settings.setValue("MovieDB API Key", "");
|
|
|
|
}
|
|
|
|
QMovieDB movieDB(settings.value("MovieDB API Key").toString());
|
|
|
|
|
2024-01-07 13:05:30 -06:00
|
|
|
//movieDB.searchMovieTitle("10 cloverfield lane"); //Single Result Example
|
|
|
|
movieDB.searchMovieTitle("The Shawshank Redemption"); //Multi-result
|
2023-12-25 12:02:14 -06:00
|
|
|
|
2023-10-29 13:42:40 -05:00
|
|
|
// //Check if HDR/DolbyVision
|
|
|
|
// enum QMediaInfo::HDR_Type hdrType = mInfo.getHDRType(__T("Cosmos.mkv"));
|
|
|
|
// if (hdrType >= 0) {
|
|
|
|
// qInfo() << hdrType;
|
|
|
|
// } else {
|
|
|
|
// qWarning() << "Could not open file.";
|
|
|
|
// }
|
|
|
|
|
|
|
|
QHandbrake handbrake;
|
|
|
|
if (handbrake.setPath("J:\\Video\\VideoTools\\HandBrakeCLI.exe") ==1 ) {
|
|
|
|
qInfo() << "Success";
|
|
|
|
//handbrake.startEncode();
|
|
|
|
}
|
2023-12-23 05:29:36 -06:00
|
|
|
else if (handbrake.setPath("/usr/bin/HandBrakeCLI")) {
|
|
|
|
qInfo() << "Succes Linux";
|
|
|
|
}
|
2023-10-29 13:42:40 -05:00
|
|
|
else {
|
|
|
|
qInfo() << "fail";
|
2023-10-07 09:01:19 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-09-17 18:14:09 -05:00
|
|
|
QQmlApplicationEngine engine;
|
2023-10-28 16:17:30 -05:00
|
|
|
engine.rootContext()->setContextProperty("mediaInfo", &mInfo);
|
2023-10-29 13:42:40 -05:00
|
|
|
engine.rootContext()->setContextProperty("handbrake", &handbrake);
|
2023-10-28 16:17:30 -05:00
|
|
|
|
2023-09-17 18:14:09 -05:00
|
|
|
const QUrl url(u"qrc:/DoViGUI/Main.qml"_qs);
|
|
|
|
QObject::connect(&engine, &QQmlApplicationEngine::objectCreationFailed,
|
|
|
|
&app, []() { QCoreApplication::exit(-1); },
|
|
|
|
Qt::QueuedConnection);
|
|
|
|
engine.load(url);
|
|
|
|
|
|
|
|
return app.exec();
|
|
|
|
}
|