From 6018f1df3d76ee914d9543f36abb13ebab62eab3 Mon Sep 17 00:00:00 2001 From: jules Date: Tue, 5 Nov 2013 11:10:31 +0000 Subject: [PATCH] Added a SystemStats::getDeviceDescription() method. --- modules/juce_core/native/juce_android_SystemStats.cpp | 5 +++++ modules/juce_core/native/juce_linux_SystemStats.cpp | 5 +++++ modules/juce_core/native/juce_mac_SystemStats.mm | 9 +++++++++ modules/juce_core/native/juce_win32_SystemStats.cpp | 5 +++++ modules/juce_core/system/juce_SystemStats.h | 9 +++++++-- 5 files changed, 31 insertions(+), 2 deletions(-) diff --git a/modules/juce_core/native/juce_android_SystemStats.cpp b/modules/juce_core/native/juce_android_SystemStats.cpp index ae68b47537..472f08bc5a 100644 --- a/modules/juce_core/native/juce_android_SystemStats.cpp +++ b/modules/juce_core/native/juce_android_SystemStats.cpp @@ -192,6 +192,11 @@ String SystemStats::getOperatingSystemName() return "Android " + AndroidStatsHelpers::getSystemProperty ("os.version"); } +String SystemStats::getDeviceDescription() +{ + return String::empty; +} + bool SystemStats::isOperatingSystem64Bit() { #if JUCE_64BIT diff --git a/modules/juce_core/native/juce_linux_SystemStats.cpp b/modules/juce_core/native/juce_linux_SystemStats.cpp index 1062b6593f..91cecbdcb2 100644 --- a/modules/juce_core/native/juce_linux_SystemStats.cpp +++ b/modules/juce_core/native/juce_linux_SystemStats.cpp @@ -42,6 +42,11 @@ String SystemStats::getOperatingSystemName() return "Linux"; } +String SystemStats::getDeviceDescription() +{ + return String::empty; +} + bool SystemStats::isOperatingSystem64Bit() { #if JUCE_64BIT diff --git a/modules/juce_core/native/juce_mac_SystemStats.mm b/modules/juce_core/native/juce_mac_SystemStats.mm index e4bd18aa1a..ecccb2daa9 100644 --- a/modules/juce_core/native/juce_mac_SystemStats.mm +++ b/modules/juce_core/native/juce_mac_SystemStats.mm @@ -143,6 +143,15 @@ String SystemStats::getOperatingSystemName() #endif } +String SystemStats::getDeviceDescription() +{ + #if JUCE_IOS + return nsStringToJuce ([[UIDevice currentDevice] model]); + #else + return String::empty; + #endif +} + bool SystemStats::isOperatingSystem64Bit() { #if JUCE_IOS diff --git a/modules/juce_core/native/juce_win32_SystemStats.cpp b/modules/juce_core/native/juce_win32_SystemStats.cpp index 7855b397ee..0098b46fe5 100644 --- a/modules/juce_core/native/juce_win32_SystemStats.cpp +++ b/modules/juce_core/native/juce_win32_SystemStats.cpp @@ -197,6 +197,11 @@ String SystemStats::getOperatingSystemName() return name; } +String SystemStats::getDeviceDescription() +{ + return String::empty; +} + bool SystemStats::isOperatingSystem64Bit() { #if JUCE_64BIT diff --git a/modules/juce_core/system/juce_SystemStats.h b/modules/juce_core/system/juce_SystemStats.h index dd40674d0c..2a8b267e41 100644 --- a/modules/juce_core/system/juce_SystemStats.h +++ b/modules/juce_core/system/juce_SystemStats.h @@ -83,8 +83,7 @@ public: */ static String getOperatingSystemName(); - /** Returns true if the OS is 64-bit, or false for a 32-bit OS. - */ + /** Returns true if the OS is 64-bit, or false for a 32-bit OS. */ static bool isOperatingSystem64Bit(); /** Returns an environment variable. @@ -122,6 +121,12 @@ public: */ static String getDisplayLanguage(); + /** This will attempt to return some kind of string describing the device. + If no description is available, it'll just return an empty string. You may + want to use this for things like determining the type of phone/iPad, etc. + */ + static String getDeviceDescription(); + //============================================================================== // CPU and memory information..