OSDN Git Service

Added option to delete jobs from the list + also added option to browse the output...
[x264-launcher/x264-launcher.git] / src / global.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Simple x264 Launcher
3 // Copyright (C) 2004-2012 LoRd_MuldeR <MuldeR2@GMX.de>
4 //
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.
9 //
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.
14 //
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.
18 //
19 // http://www.gnu.org/licenses/gpl-2.0.txt
20 ///////////////////////////////////////////////////////////////////////////////
21
22 #include "targetver.h"
23
24 //C++ includes
25 #include <stdio.h>
26 #include <string.h>
27 #include <iostream>
28 #include <time.h>
29
30 //Win32 includes
31 #define WIN32_LEAN_AND_MEAN
32 #include <Windows.h>
33
34 //Debug build
35 #if defined(_DEBUG) && defined(QT_DEBUG) && !defined(NDEBUG) && !defined(QT_NO_DEBUG)
36         #define X264_DEBUG (1)
37 #else
38         #define X264_DEBUG (0)
39 #endif
40
41 //Memory leack checker
42 #if X264_DEBUG
43 #define X264_MEMORY_CHECK(CMD) \
44 { \
45         SIZE_T _privateBytesBefore = x264_dbg_private_bytes(); \
46         CMD; \
47         SIZE_T _privateBytesLeak = (x264_dbg_private_bytes() - _privateBytesBefore) / 1024; \
48         if(_privateBytesLeak > 10) { \
49                 qWarning("Memory leak: Lost %u KiloBytes.", _privateBytesLeak); \
50         } \
51 }
52 #else
53 #define X264_MEMORY_CHECK(CMD) CMD
54 #endif
55
56 //Helper macros
57 #define QWCHAR(STR) reinterpret_cast<const wchar_t*>(STR.utf16())
58 #define X264_BOOL(X) ((X) ? "1" : "0")
59 #define X264_DELETE(PTR) if(PTR) { delete PTR; PTR = NULL; }
60 #define X264_DELETE_ARRAY(PTR) if(PTR) { delete [] PTR; PTR = NULL; }
61
62 //Declarations
63 class QString;
64 class QStringList;
65 class QDate;
66 class QTime;
67 class QIcon;
68 class QWidget;
69 class LockedFile;
70 enum QtMsgType;
71
72 //Types definitions
73 typedef struct
74 {
75         int family;
76         int model;
77         int stepping;
78         int count;
79         bool x64;
80         bool mmx;
81         bool sse;
82         bool sse2;
83         bool sse3;
84         bool ssse3;
85         char vendor[0x40];
86         char brand[0x40];
87         bool intel;
88 }
89 x264_cpu_t;
90
91 //Functions
92 LONG WINAPI x264_exception_handler(__in struct _EXCEPTION_POINTERS *ExceptionInfo);
93 void x264_invalid_param_handler(const wchar_t*, const wchar_t*, const wchar_t*, unsigned int, uintptr_t);
94 void x264_message_handler(QtMsgType type, const char *msg);
95 unsigned int x264_version_major(void);
96 unsigned int x264_version_minor(void);
97 const QDate &x264_version_date(void);
98 bool x264_is_prerelease(void);
99 const char *x264_version_time(void);
100 const char *x264_version_compiler(void);
101 const char *x264_version_arch(void);
102 void x264_init_console(int argc, char* argv[]);
103 bool x264_init_qt(int argc, char* argv[]);
104 x264_cpu_t x264_detect_cpu_features(int argc, char **argv);
105 SIZE_T x264_dbg_private_bytes(void);
106 void x264_finalization(void);