1 /*******************************************************************************
2 *                         Goggles Audio Player Library                         *
3 ********************************************************************************
4 *           Copyright (C) 2010-2021 by Sander Jansen. All Rights Reserved      *
5 *                               ---                                            *
6 * This program is free software: you can redistribute it and/or modify         *
7 * it under the terms of the GNU General Public License as published by         *
8 * the Free Software Foundation, either version 3 of the License, or            *
9 * (at your option) any later version.                                          *
10 *                                                                              *
11 * This program is distributed in the hope that it will be useful,              *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of               *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                *
14 * GNU General Public License for more details.                                 *
15 *                                                                              *
16 * You should have received a copy of the GNU General Public License            *
17 * along with this program.  If not, see http://www.gnu.org/licenses.           *
18 ********************************************************************************/
19 #ifndef FOX_H
20 #define FOX_H
21 
22 #include <new>
23 
24 // Basic includes
25 #include <stdio.h>
26 #include <stdlib.h>
27 #include <stdarg.h>
28 #include <math.h>
29 #include <string.h>
30 
31 // FOX defines
32 #include <fxver.h>
33 
34 #define FOXVERSION ((FOX_LEVEL) + (FOX_MINOR*1000) + (FOX_MAJOR*100000))
35 #define FXVERSION(major,minor,release) ((release)+(minor*1000)+(major*100000))
36 
37 #include <fxdefs.h>
38 #include <fxendian.h>
39 #include <fxascii.h>
40 #include <fxunicode.h>
41 
42 // Containers
43 #include <FXAutoPtr.h>
44 #include <FXPtrList.h>
45 #include <FXElement.h>
46 #include <FXArray.h>
47 #include <FXString.h>
48 
49 // Threading
50 #include <FXMutex.h>
51 #include <FXCondition.h>
52 #include <FXAutoThreadStorageKey.h>
53 #include <FXThread.h>
54 #include <FXLFQueue.h>
55 
56 // IO
57 #include <FXIO.h>
58 #include <FXIODevice.h>
59 #include <FXFile.h>
60 #include <FXMemMap.h>
61 
62 // Events
63 #include <FXSize.h>
64 #include <FXRectangle.h>
65 #include <FXEvent.h>
66 
67 // System
68 #include <FXPath.h>
69 #include <FXSystem.h>
70 #include <FXStat.h>
71 #include <FXURL.h>
72 #include <FXDLL.h>
73 
74 // FXObject based classes
75 #include <FXHash.h>
76 #include <FXStream.h>
77 #include <FXObject.h>
78 #include <FXObjectList.h>
79 #include <FXDictionary.h>
80 #include <FXStringDictionary.h>
81 #include <FXSettings.h>
82 #include <FXMessageChannel.h>
83 #include <FXTextCodec.h>
84 
85 #include <FXRex.h>
86 
87 using namespace FX;
88 
89 #ifndef BadHandle
90 #ifdef _WIN32
91 #define BadHandle INVALID_HANDLE_VALUE
92 #else
93 #define BadHandle -1
94 #endif
95 #endif
96 
97 
98 typedef FXArray<FXString> FXStringList;
99 
100 /// Some debugging macros
101 #ifdef DEBUG
102 #define GM_TICKS_START() FXTime end,start = fxgetticks();
103 #define GM_TICKS_END()  end = fxgetticks(); fxmessage("%20s:%15lld ticks.\n",__func__,end-start)
104 #define GM_DEBUG_PRINT(format,...) fxmessage(format , ##__VA_ARGS__)
105 #else
106 #define GM_TICKS_START() ((void)0)
107 #define GM_TICKS_END() ((void)0)
108 #define GM_DEBUG_PRINT(arguments,...) ((void)0)
109 #endif
110 
111 #define NANOSECONDS_PER_SECOND  1000000000LL
112 #define NANOSECONDS_PER_MICROSECOND 1000LL
113 #define NANOSECONDS_PER_MILLISECOND 1000000LL
114 
115 constexpr FXTime operator"" _s(unsigned long long int value)
116 {
117   return value * NANOSECONDS_PER_SECOND;
118 }
119 
120 constexpr FXTime operator"" _ms(unsigned long long int value)
121 {
122   return value * NANOSECONDS_PER_MILLISECOND;
123 }
124 
125 #endif
126 
127