2014-02-12 19:34:14 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Simple x264 Launcher
|
2015-01-31 19:56:04 +01:00
|
|
|
// Copyright (C) 2004-2015 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; \
|
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; \
|
|
|
|
}
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
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)
|
|
|
|
|
2014-02-12 19:34:14 +01:00
|
|
|
SYSINFO_MAKE_PATH(VPS)
|
|
|
|
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
|