2014-02-12 19:34:14 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Simple x264 Launcher
|
2021-12-08 00:03:40 +01:00
|
|
|
// Copyright (C) 2004-2021 LoRd_MuldeR <MuldeR2@GMX.de>
|
2014-02-12 19:34:14 +01:00
|
|
|
//
|
|
|
|
// 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
|
|
|
|
// the Free Software Foundation; either version 2 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License along
|
|
|
|
// with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
//
|
|
|
|
// http://www.gnu.org/licenses/gpl-2.0.txt
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
2014-02-14 00:01:00 +01:00
|
|
|
|
|
|
|
#include <QMutex>
|
|
|
|
#include <QMutexLocker>
|
2014-02-12 19:34:14 +01:00
|
|
|
#include <QString>
|
2015-02-28 17:12:35 +01:00
|
|
|
#include <QFlags>
|
2014-02-12 19:34:14 +01:00
|
|
|
|
2014-02-14 23:13:16 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2015-02-28 17:12:35 +01:00
|
|
|
#define SYSINFO_MAKE_FLAG(NAME) \
|
2014-02-14 23:13:16 +01:00
|
|
|
protected: \
|
2015-02-28 17:12:35 +01:00
|
|
|
QFlags<NAME##_t> m_flag##NAME; \
|
2014-02-14 23:13:16 +01:00
|
|
|
public: \
|
2015-02-28 17:12:35 +01:00
|
|
|
inline void set##NAME(const NAME##_t &flag, const bool &enable) \
|
2014-02-14 23:13:16 +01:00
|
|
|
{ \
|
|
|
|
QMutexLocker lock(&m_mutex); \
|
2015-02-28 17:12:35 +01:00
|
|
|
if(enable) m_flag##NAME |= flag; else m_flag##NAME &= (~flag); \
|
2014-02-14 23:13:16 +01:00
|
|
|
} \
|
2015-02-28 17:12:35 +01:00
|
|
|
inline bool get##NAME(const NAME##_t &flag) const \
|
2014-02-14 23:13:16 +01:00
|
|
|
{ \
|
|
|
|
QMutexLocker lock(&m_mutex); \
|
2015-02-28 17:12:35 +01:00
|
|
|
return m_flag##NAME.testFlag(flag); \
|
|
|
|
} \
|
|
|
|
inline bool has##NAME(void) const \
|
|
|
|
{ \
|
|
|
|
QMutexLocker lock(&m_mutex); \
|
|
|
|
return !!m_flag##NAME; \
|
2015-03-01 22:00:05 +01:00
|
|
|
} \
|
|
|
|
inline void clear##NAME(void) \
|
|
|
|
{ \
|
|
|
|
QMutexLocker lock(&m_mutex); \
|
|
|
|
m_flag##NAME &= 0; \
|
2014-02-14 23:13:16 +01:00
|
|
|
}
|
2014-02-12 19:34:14 +01:00
|
|
|
|
|
|
|
#define SYSINFO_MAKE_PATH(NAME) \
|
2014-02-14 23:13:16 +01:00
|
|
|
protected: \
|
|
|
|
QString m_path##NAME; \
|
|
|
|
public: \
|
|
|
|
inline void set##NAME##Path(const QString &path) \
|
|
|
|
{ \
|
|
|
|
QMutexLocker lock(&m_mutex); \
|
|
|
|
m_path##NAME = path; \
|
|
|
|
} \
|
|
|
|
inline const QString get##NAME##Path(void) const \
|
|
|
|
{ \
|
|
|
|
QMutexLocker lock(&m_mutex); \
|
|
|
|
const QString path = m_path##NAME; \
|
|
|
|
return path; \
|
2015-03-01 22:00:05 +01:00
|
|
|
} \
|
|
|
|
inline void clear##NAME##Path(void) \
|
|
|
|
{ \
|
|
|
|
QMutexLocker lock(&m_mutex); \
|
|
|
|
m_path##NAME.clear(); \
|
2014-02-14 23:13:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2014-02-12 19:34:14 +01:00
|
|
|
|
|
|
|
class SysinfoModel
|
|
|
|
{
|
|
|
|
public:
|
2015-02-28 17:12:35 +01:00
|
|
|
SysinfoModel(void) {}
|
2014-02-14 23:13:16 +01:00
|
|
|
|
2015-02-28 17:12:35 +01:00
|
|
|
typedef enum _CPUFeatures_t
|
|
|
|
{
|
|
|
|
CPUFeatures_MMX = 0x1,
|
|
|
|
CPUFeatures_SSE = 0x2,
|
|
|
|
CPUFeatures_X64 = 0x4,
|
|
|
|
}
|
|
|
|
CPUFeatures_t;
|
|
|
|
|
|
|
|
typedef enum _Avisynth_t
|
|
|
|
{
|
|
|
|
Avisynth_X86 = 0x1,
|
|
|
|
Avisynth_X64 = 0x2,
|
|
|
|
}
|
|
|
|
Avisynth_t;
|
|
|
|
|
|
|
|
typedef enum _VapourSynth_t
|
|
|
|
{
|
|
|
|
VapourSynth_X86 = 0x1,
|
|
|
|
VapourSynth_X64 = 0x2,
|
|
|
|
}
|
|
|
|
VapourSynth_t;
|
|
|
|
|
|
|
|
SYSINFO_MAKE_FLAG(CPUFeatures)
|
|
|
|
SYSINFO_MAKE_FLAG(Avisynth)
|
|
|
|
SYSINFO_MAKE_FLAG(VapourSynth)
|
|
|
|
|
2016-10-02 16:18:01 +02:00
|
|
|
SYSINFO_MAKE_PATH(AVS)
|
2019-07-22 14:19:18 +02:00
|
|
|
SYSINFO_MAKE_PATH(VPS32)
|
|
|
|
SYSINFO_MAKE_PATH(VPS64)
|
2014-02-12 19:34:14 +01:00
|
|
|
SYSINFO_MAKE_PATH(App)
|
|
|
|
|
|
|
|
protected:
|
2014-02-14 23:13:16 +01:00
|
|
|
mutable QMutex m_mutex;
|
2014-02-12 19:34:14 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#undef SYSINFO_MAKE_FLAG
|
|
|
|
#undef SYSINFO_MAKE_PATH
|