From a7ec68e4f05b42866c447b701fe412f99e784e4f Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Fri, 5 Apr 2019 13:10:26 -0400 Subject: [PATCH] Log OS version on launch --- include/system.hpp | 1 + src/engine/ParamQuantity.cpp | 2 +- src/main.cpp | 1 + src/plugin.cpp | 1 - src/system.cpp | 16 ++++++++++++++++ 5 files changed, 19 insertions(+), 2 deletions(-) diff --git a/include/system.hpp b/include/system.hpp index 2d2ba152..b83b9c43 100644 --- a/include/system.hpp +++ b/include/system.hpp @@ -42,6 +42,7 @@ void openFolder(const std::string &path); The launched process will continue running if the current process is closed. */ void runProcessAsync(const std::string &path); +std::string getOperatingSystemInfo(); } // namespace system diff --git a/src/engine/ParamQuantity.cpp b/src/engine/ParamQuantity.cpp index 4247d5a2..2cf4ca74 100644 --- a/src/engine/ParamQuantity.cpp +++ b/src/engine/ParamQuantity.cpp @@ -35,7 +35,7 @@ void ParamQuantity::setValue(float value) { float ParamQuantity::getValue() { if (!module) return 0.f; - return getParam()->getValue(); + return APP->engine->getParam(module, paramId); } float ParamQuantity::getMinValue() { diff --git a/src/main.cpp b/src/main.cpp index 5dc12ac7..8c2603da 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -100,6 +100,7 @@ int main(int argc, char *argv[]) { // Log environment INFO("%s v%s", app::APP_NAME, app::APP_VERSION); + INFO("%s", system::getOperatingSystemInfo().c_str()); if (settings::devMode) INFO("Development mode"); INFO("System directory: %s", asset::systemDir.c_str()); diff --git a/src/plugin.cpp b/src/plugin.cpp index 158539d2..815871d0 100644 --- a/src/plugin.cpp +++ b/src/plugin.cpp @@ -150,7 +150,6 @@ static bool loadPlugin(std::string path) { for (Model *model : plugin->models) { std::string presetDir = asset::plugin(plugin, "presets/" + model->slug); for (const std::string &presetPath : system::listEntries(presetDir)) { - DEBUG("%s", presetPath.c_str()); model->presetPaths.push_back(presetPath); } } diff --git a/src/system.cpp b/src/system.cpp index 2fc64074..5d6f8ccc 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -10,6 +10,7 @@ #include #include // for backtrace and backtrace_symbols #include // for execl + #include #endif #if defined ARCH_WIN @@ -190,5 +191,20 @@ void runProcessAsync(const std::string &path) { } +std::string getOperatingSystemInfo() { +#if defined ARCH_LIN || defined ARCH_MAC + struct utsname u; + uname(&u); + return string::f("%s %s %s %s", u.sysname, u.release, u.version, u.machine); +#elif defined ARCH_WIN + OSVERSIONINFOEX info; + ZeroMemory(&info, sizeof(info)); + info.dwOSVersionInfoSize = sizeof(info); + GetVersionEx(&info); + return string::f("Windows %u.%u", info.dwMajorVersion, info.dwMinorVersion); +#endif +} + + } // namespace system } // namespace rack