From 6858411d21e2fa3f2163fdbcafcd92648997c6e4 Mon Sep 17 00:00:00 2001 From: Georg Krause Date: Sun, 16 Jun 2019 22:09:17 +0200 Subject: [PATCH] Also check /usr/share/loopp for default controller maps --- src/diskreader.cxx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/diskreader.cxx b/src/diskreader.cxx index ca51861..c6961fa 100644 --- a/src/diskreader.cxx +++ b/src/diskreader.cxx @@ -84,9 +84,21 @@ int DiskReader::loadPreferences() cJSON* ctlr = cJSON_GetArrayItem( ctlrs, i ); if( ctlr && strcmp(ctlr->valuestring, "") != 0 ) { LOOPP_NOTE("Loading controller %s", ctlr->valuestring); - stringstream s; - s << getenv("HOME") << "/.config/soundship/loopp/controllers/" << ctlr->valuestring; - gui->addMidiControllerToSetup( s.str() ); + + // TODO This is a really dirty hack. This way its possible to load + // default controllers also from user installed mappings. But it will also + // generate a lot of Error messages. This needs some refactoring to be done properly. + stringstream s_home; + s_home << getenv ( "HOME" ) + << "/.config/soundship/loopp/controllers/" + << ctlr->valuestring; + gui->addMidiControllerToSetup ( + s_home.str () ); + stringstream s_share; + s_share << "/usr/share/loopp/" + << ctlr->valuestring; + gui->addMidiControllerToSetup ( + s_share.str () ); } } } else {