Browse Source

Log OS version on launch

tags/v1.0.0
Andrew Belt 5 years ago
parent
commit
a7ec68e4f0
5 changed files with 19 additions and 2 deletions
  1. +1
    -0
      include/system.hpp
  2. +1
    -1
      src/engine/ParamQuantity.cpp
  3. +1
    -0
      src/main.cpp
  4. +0
    -1
      src/plugin.cpp
  5. +16
    -0
      src/system.cpp

+ 1
- 0
include/system.hpp View File

@@ -42,6 +42,7 @@ void openFolder(const std::string &path);
The launched process will continue running if the current process is closed. The launched process will continue running if the current process is closed.
*/ */
void runProcessAsync(const std::string &path); void runProcessAsync(const std::string &path);
std::string getOperatingSystemInfo();




} // namespace system } // namespace system


+ 1
- 1
src/engine/ParamQuantity.cpp View File

@@ -35,7 +35,7 @@ void ParamQuantity::setValue(float value) {
float ParamQuantity::getValue() { float ParamQuantity::getValue() {
if (!module) if (!module)
return 0.f; return 0.f;
return getParam()->getValue();
return APP->engine->getParam(module, paramId);
} }


float ParamQuantity::getMinValue() { float ParamQuantity::getMinValue() {


+ 1
- 0
src/main.cpp View File

@@ -100,6 +100,7 @@ int main(int argc, char *argv[]) {


// Log environment // Log environment
INFO("%s v%s", app::APP_NAME, app::APP_VERSION); INFO("%s v%s", app::APP_NAME, app::APP_VERSION);
INFO("%s", system::getOperatingSystemInfo().c_str());
if (settings::devMode) if (settings::devMode)
INFO("Development mode"); INFO("Development mode");
INFO("System directory: %s", asset::systemDir.c_str()); INFO("System directory: %s", asset::systemDir.c_str());


+ 0
- 1
src/plugin.cpp View File

@@ -150,7 +150,6 @@ static bool loadPlugin(std::string path) {
for (Model *model : plugin->models) { for (Model *model : plugin->models) {
std::string presetDir = asset::plugin(plugin, "presets/" + model->slug); std::string presetDir = asset::plugin(plugin, "presets/" + model->slug);
for (const std::string &presetPath : system::listEntries(presetDir)) { for (const std::string &presetPath : system::listEntries(presetDir)) {
DEBUG("%s", presetPath.c_str());
model->presetPaths.push_back(presetPath); model->presetPaths.push_back(presetPath);
} }
} }


+ 16
- 0
src/system.cpp View File

@@ -10,6 +10,7 @@
#include <sched.h> #include <sched.h>
#include <execinfo.h> // for backtrace and backtrace_symbols #include <execinfo.h> // for backtrace and backtrace_symbols
#include <unistd.h> // for execl #include <unistd.h> // for execl
#include <sys/utsname.h>
#endif #endif


#if defined ARCH_WIN #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 system
} // namespace rack } // namespace rack

Loading…
Cancel
Save