Update app to support linux.
This commit is contained in:
parent
081e541b5c
commit
dc43da0e0e
@ -76,9 +76,10 @@ Window {
|
|||||||
id: videoFileDialog
|
id: videoFileDialog
|
||||||
fileMode: FileDialog.OpenFile
|
fileMode: FileDialog.OpenFile
|
||||||
nameFilters: ["Video files (*.mkv *.mp4)", "All files (*)"]
|
nameFilters: ["Video files (*.mkv *.mp4)", "All files (*)"]
|
||||||
onAccepted: { const reg = /^file:\/\/\// //Remove "file:/// at start of URL
|
onAccepted: {
|
||||||
var fileName = videoFileDialog.selectedFile.toString().replace(reg, "")
|
//Remove "file:/// at start of URL
|
||||||
txtVideoFile.text = fileName
|
var fileName = mediaInfo.fixFileName(videoFileDialog.selectedFile.toString());
|
||||||
|
txtVideoFile.text = fileName;
|
||||||
|
|
||||||
switch (mediaInfo.getHDRType(fileName)) {
|
switch (mediaInfo.getHDRType(fileName)) {
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -3,11 +3,9 @@
|
|||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QMediaInfo::QMediaInfo(QObject *parent){}
|
QMediaInfo::QMediaInfo(QObject *parent){}
|
||||||
|
|
||||||
enum QMediaInfo::HDR_Type QMediaInfo::getHDRType(const MediaInfoDLL::String fileName) {
|
enum QMediaInfo::HDR_Type QMediaInfo::getHDRType(MediaInfoDLL::String fileName) {
|
||||||
if (Open(fileName)) {
|
if (Open(fileName)) {
|
||||||
MediaInfoDLL::String HDRtext = Get(MediaInfoDLL::Stream_Video, 0, __T("HDR_Format"), MediaInfoDLL::Info_Text, MediaInfoDLL::Info_Name);
|
MediaInfoDLL::String HDRtext = Get(MediaInfoDLL::Stream_Video, 0, __T("HDR_Format"), MediaInfoDLL::Info_Text, MediaInfoDLL::Info_Name);
|
||||||
Close();
|
Close();
|
||||||
@ -24,5 +22,17 @@ enum QMediaInfo::HDR_Type QMediaInfo::getHDRType(const MediaInfoDLL::String file
|
|||||||
}
|
}
|
||||||
|
|
||||||
enum QMediaInfo::HDR_Type QMediaInfo::getHDRType(const QString fileName) {
|
enum QMediaInfo::HDR_Type QMediaInfo::getHDRType(const QString fileName) {
|
||||||
|
#ifdef linux
|
||||||
|
return getHDRType(fileName.toStdString());
|
||||||
|
#else
|
||||||
return getHDRType(fileName.toStdWString());
|
return getHDRType(fileName.toStdWString());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
QString QMediaInfo::fixFileName(QString fileName) {
|
||||||
|
#ifdef linux
|
||||||
|
return fileName.remove(0, 7);
|
||||||
|
#else
|
||||||
|
return fileName.remove(0, 8);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -11,10 +11,11 @@ class QMediaInfo : public QObject, public MediaInfoDLL::MediaInfo {
|
|||||||
public:
|
public:
|
||||||
QMediaInfo(QObject* parent = nullptr);
|
QMediaInfo(QObject* parent = nullptr);
|
||||||
enum HDR_Type{ERR = -1, SDR = 0, HDR = 1, DOVI = 2};
|
enum HDR_Type{ERR = -1, SDR = 0, HDR = 1, DOVI = 2};
|
||||||
Q_ENUM(HDR_Type)
|
|
||||||
|
|
||||||
enum HDR_Type getHDRType(const MediaInfoDLL::String fileName);
|
enum HDR_Type getHDRType(const MediaInfoDLL::String fileName);
|
||||||
|
|
||||||
|
Q_ENUM(HDR_Type)
|
||||||
Q_INVOKABLE enum HDR_Type getHDRType(QString fileName);
|
Q_INVOKABLE enum HDR_Type getHDRType(QString fileName);
|
||||||
|
Q_INVOKABLE QString fixFileName(QString fileName);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -26,6 +26,9 @@ int main(int argc, char *argv[])
|
|||||||
qInfo() << "Success";
|
qInfo() << "Success";
|
||||||
//handbrake.startEncode();
|
//handbrake.startEncode();
|
||||||
}
|
}
|
||||||
|
else if (handbrake.setPath("/usr/bin/HandBrakeCLI")) {
|
||||||
|
qInfo() << "Succes Linux";
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
qInfo() << "fail";
|
qInfo() << "fail";
|
||||||
}
|
}
|
||||||
|
BIN
MediaInfo.dll
Normal file
BIN
MediaInfo.dll
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user