OpenShot Audio Library | OpenShotAudio: juce_SystemStats.h Source File

OpenShot Audio Library | OpenShotAudio 0.4.0

Loading...
Searching...
No Matches
juce_SystemStats.h
1/*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 The code included in this file is provided under the terms of the ISC license
11 http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 To use, copy, modify, and/or distribute this software for any purpose with or
13 without fee is hereby granted provided that the above copyright notice and
14 this permission notice appear in all copies.
15
16 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 DISCLAIMED.
19
20 ==============================================================================
21*/
22
23namespace juce
24{
25
26//==============================================================================
32 class JUCE_API SystemStats final
33{
34public:
35 //==============================================================================
39 static String getJUCEVersion();
40
41 //==============================================================================
43 enum OperatingSystemType
44 {
45 UnknownOS = 0,
46
47 MacOSX = 0x0100,
49 Windows = 0x0200,
51 Linux = 0x0400,
52 Android = 0x0800,
53 iOS = 0x1000,
54 WASM = 0x2000,
55
56 MacOSX_10_7 = MacOSX | 7,
57 MacOSX_10_8 = MacOSX | 8,
58 MacOSX_10_9 = MacOSX | 9,
59 MacOSX_10_10 = MacOSX | 10,
60 MacOSX_10_11 = MacOSX | 11,
61 MacOSX_10_12 = MacOSX | 12,
62 MacOSX_10_13 = MacOSX | 13,
63 MacOSX_10_14 = MacOSX | 14,
64 MacOSX_10_15 = MacOSX | 15,
65 MacOS_11 = MacOSX | 16,
66 MacOS_12 = MacOSX | 17,
67 MacOS_13 = MacOSX | 18,
68 MacOS_14 = MacOSX | 19,
69
70 Win2000 = Windows | 1,
71 WinXP = Windows | 2,
72 WinVista = Windows | 3,
73 Windows7 = Windows | 4,
74 Windows8_0 = Windows | 5,
75 Windows8_1 = Windows | 6,
76 Windows10 = Windows | 7,
77 Windows11 = Windows | 8
78 };
79
85 static OperatingSystemType getOperatingSystemType();
86
92 static String getOperatingSystemName();
93
95 static bool isOperatingSystem64Bit();
96
100 static String getEnvironmentVariable (const String& name, const String& defaultValue);
101
102 //==============================================================================
106 static String getLogonName();
107
112 static String getFullUserName();
113
115 static String getComputerName();
116
120 static String getUserLanguage();
121
125 static String getUserRegion();
126
132 static String getDisplayLanguage();
133
138 static String getDeviceDescription();
139
143 static String getDeviceManufacturer();
144
150 [[deprecated ("The identifiers produced by this function are not reliable. Use getUniqueDeviceID() instead.")]]
151 static StringArray getDeviceIdentifiers();
152
165 static String getUniqueDeviceID();
166
168 enum class MachineIdFlags
169 {
170 macAddresses = 1 << 0,
171 fileSystemId = 1 << 1,
172 legacyUniqueId = 1 << 2,
173 uniqueId = 1 << 3,
174 };
175
190 static StringArray getMachineIdentifiers (MachineIdFlags flags);
191
192 //==============================================================================
193 // CPU and memory information..
194
196 static int getNumCpus() noexcept;
197
199 static int getNumPhysicalCpus() noexcept;
200
205 static int getCpuSpeedInMegahertz();
206
210 static String getCpuVendor();
211
215 static String getCpuModel();
216
217 static bool hasMMX() noexcept;
218 static bool has3DNow() noexcept;
219 static bool hasFMA3() noexcept;
220 static bool hasFMA4() noexcept;
221 static bool hasSSE() noexcept;
222 static bool hasSSE2() noexcept;
223 static bool hasSSE3() noexcept;
224 static bool hasSSSE3() noexcept;
225 static bool hasSSE41() noexcept;
226 static bool hasSSE42() noexcept;
227 static bool hasAVX() noexcept;
228 static bool hasAVX2() noexcept;
229 static bool hasAVX512F() noexcept;
230 static bool hasAVX512BW() noexcept;
231 static bool hasAVX512CD() noexcept;
232 static bool hasAVX512DQ() noexcept;
233 static bool hasAVX512ER() noexcept;
234 static bool hasAVX512IFMA() noexcept;
235 static bool hasAVX512PF() noexcept;
236 static bool hasAVX512VBMI() noexcept;
237 static bool hasAVX512VL() noexcept;
238 static bool hasAVX512VPOPCNTDQ() noexcept;
239 static bool hasNeon() noexcept;
241 //==============================================================================
246 static int getMemorySizeInMegabytes();
247
251 static int getPageSize();
252
253 //==============================================================================
258 static String getStackBacktrace();
259
263 using CrashHandlerFunction = void (*) (void*);
264
271 static void setApplicationCrashHandler (CrashHandlerFunction);
272
276 static bool isRunningInAppExtensionSandbox() noexcept;
277
278 #if JUCE_MAC
279 static bool isAppSandboxEnabled();
280 #endif
281
282 //==============================================================================
283 #ifndef DOXYGEN
284 [[deprecated ("This method was spelt wrong! Please change your code to use getCpuSpeedInMegahertz instead.")]]
285 static int getCpuSpeedInMegaherz() { return getCpuSpeedInMegahertz(); }
286 #endif
287
288private:
289 SystemStats() = delete; // uses only static methods
290 JUCE_DECLARE_NON_COPYABLE (SystemStats)
291};
292
293JUCE_DECLARE_SCOPED_ENUM_BITWISE_OPERATORS (SystemStats::MachineIdFlags)
294
295} // namespace juce
juce::StringArray
Definition juce_StringArray.h:35
juce::String
Definition juce_String.h:53
juce::SystemStats
Definition juce_SystemStats.h:33
juce::SystemStats::getOperatingSystemName
static String getOperatingSystemName()
juce::SystemStats::getUserRegion
static String getUserRegion()
juce::SystemStats::getFullUserName
static String getFullUserName()
juce::SystemStats::getLogonName
static String getLogonName()
juce::SystemStats::getOperatingSystemType
static OperatingSystemType getOperatingSystemType()
juce::SystemStats::getDeviceManufacturer
static String getDeviceManufacturer()
juce::SystemStats::isOperatingSystem64Bit
static bool isOperatingSystem64Bit()
juce::SystemStats::getDisplayLanguage
static String getDisplayLanguage()
juce::SystemStats::CrashHandlerFunction
void(*)(void *) CrashHandlerFunction
Definition juce_SystemStats.h:263
juce::SystemStats::getUniqueDeviceID
static String getUniqueDeviceID()
juce::SystemStats::MachineIdFlags
MachineIdFlags
Definition juce_SystemStats.h:169
juce::SystemStats::getEnvironmentVariable
static String getEnvironmentVariable(const String &name, const String &defaultValue)
juce::SystemStats::OperatingSystemType
OperatingSystemType
Definition juce_SystemStats.h:44
juce::SystemStats::getComputerName
static String getComputerName()
juce::SystemStats::getDeviceDescription
static String getDeviceDescription()
juce::SystemStats::getUserLanguage
static String getUserLanguage()