OSDN Git Service

Bump program version + updated changelog.
[x264-launcher/x264-launcher.git] / src / thread_avisynth.h
index 54d3421..5e4045f 100644 (file)
@@ -1,6 +1,6 @@
 ///////////////////////////////////////////////////////////////////////////////
 // Simple x264 Launcher
-// Copyright (C) 2004-2012 LoRd_MuldeR <MuldeR2@GMX.de>
+// Copyright (C) 2004-2017 LoRd_MuldeR <MuldeR2@GMX.de>
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
 #include <QMutex>
 
 class QLibrary;
+class SysinfoModel;
+class QFile;
 
 class AvisynthCheckThread : public QThread
 {
        Q_OBJECT
 
 public:
-       AvisynthCheckThread(void);
-       ~AvisynthCheckThread(void);
+       static bool detect(SysinfoModel *sysinfo);
 
-       static int detect(volatile double *version);
-       static void unload(void);
+protected:
+       AvisynthCheckThread(const SysinfoModel *const sysinfo);
+       ~AvisynthCheckThread(void);
 
-       bool getSuccess(void) { return m_success; }
+       int getSuccess(void) { return m_success; }
        bool getException(void) { return m_exception; }
-       double getVersion(void) { return m_version; }
+       QString getPath(void) { return m_basePath; }
+
+       typedef enum _AvisynthFlags
+       {
+               AVISYNTH_X86 = 0x1,
+               AVISYNTH_X64 = 0x2
+       }
+       AvisynthFlags;
 
 private slots:
        void start(Priority priority = InheritPriority) { QThread::start(priority); }
 
 private:
        volatile bool m_exception;
-       volatile bool m_success;
-       volatile double m_version;
+       int m_success;
+       QString m_basePath;
+       const SysinfoModel *const m_sysinfo;
 
        static QMutex m_avsLock;
-       static QLibrary *m_avsLib;
-       
+       static QScopedPointer<QFile> m_avsDllPath[2];
+
        //Entry point
        virtual void run(void);
 
        //Functions
-       static bool detectAvisynthVersion1(volatile double *version_number, volatile bool *exception);
-       static bool detectAvisynthVersion2(volatile double *version_number, volatile bool *exception);
-       static bool detectAvisynthVersion3(volatile double *version_number);
+       static void detectAvisynthVersion1(int &success, QString &basePath, const SysinfoModel *const sysinfo, volatile bool *exception);
+       static void detectAvisynthVersion2(int &success, QString &basePath, const SysinfoModel *const sysinfo, volatile bool *exception);
+       static void detectAvisynthVersion3(int &success, QString &basePath, const SysinfoModel *const sysinfo);
+
+       //Internal functions
+       static bool checkAvisynth(QString &basePath, const SysinfoModel *const sysinfo, QFile *&path, const bool &x64);
 };