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