1 ///////////////////////////////////////////////////////////////////////////////
2 // Simple x264 Launcher
3 // Copyright (C) 2004-2016 LoRd_MuldeR <MuldeR2@GMX.de>
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License along
16 // with this program; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 // http://www.gnu.org/licenses/gpl-2.0.txt
20 ///////////////////////////////////////////////////////////////////////////////
25 #include <QMutexLocker>
29 ///////////////////////////////////////////////////////////////////////////////
31 #define SYSINFO_MAKE_FLAG(NAME) \
33 QFlags<NAME##_t> m_flag##NAME; \
35 inline void set##NAME(const NAME##_t &flag, const bool &enable) \
37 QMutexLocker lock(&m_mutex); \
38 if(enable) m_flag##NAME |= flag; else m_flag##NAME &= (~flag); \
40 inline bool get##NAME(const NAME##_t &flag) const \
42 QMutexLocker lock(&m_mutex); \
43 return m_flag##NAME.testFlag(flag); \
45 inline bool has##NAME(void) const \
47 QMutexLocker lock(&m_mutex); \
48 return !!m_flag##NAME; \
50 inline void clear##NAME(void) \
52 QMutexLocker lock(&m_mutex); \
56 #define SYSINFO_MAKE_PATH(NAME) \
58 QString m_path##NAME; \
60 inline void set##NAME##Path(const QString &path) \
62 QMutexLocker lock(&m_mutex); \
63 m_path##NAME = path; \
65 inline const QString get##NAME##Path(void) const \
67 QMutexLocker lock(&m_mutex); \
68 const QString path = m_path##NAME; \
71 inline void clear##NAME##Path(void) \
73 QMutexLocker lock(&m_mutex); \
74 m_path##NAME.clear(); \
77 ///////////////////////////////////////////////////////////////////////////////
84 typedef enum _CPUFeatures_t
86 CPUFeatures_MMX
= 0x1,
87 CPUFeatures_SSE
= 0x2,
88 CPUFeatures_X64
= 0x4,
92 typedef enum _Avisynth_t
99 typedef enum _VapourSynth_t
101 VapourSynth_X86
= 0x1,
102 VapourSynth_X64
= 0x2,
106 SYSINFO_MAKE_FLAG(CPUFeatures
)
107 SYSINFO_MAKE_FLAG(Avisynth
)
108 SYSINFO_MAKE_FLAG(VapourSynth
)
110 SYSINFO_MAKE_PATH(AVS
)
111 SYSINFO_MAKE_PATH(VPS
)
112 SYSINFO_MAKE_PATH(App
)
115 mutable QMutex m_mutex
;
118 #undef SYSINFO_MAKE_FLAG
119 #undef SYSINFO_MAKE_PATH