diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-10-07 18:31:02 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-10-07 18:31:02 +0200 |
commit | 39d6a781bbd9073aba30db15f57d8ce3c3e3ab92 (patch) | |
tree | 4c32c175927c40c902f03a54b352cc36143ca8b1 | |
parent | 18d2216f12fa500d91c00449006b674ad0463cf5 (diff) | |
download | dabmux-39d6a781bbd9073aba30db15f57d8ce3c3e3ab92.tar.gz dabmux-39d6a781bbd9073aba30db15f57d8ce3c3e3ab92.tar.bz2 dabmux-39d6a781bbd9073aba30db15f57d8ce3c3e3ab92.zip |
Print to log when a setting is changed through RC
-rw-r--r-- | src/RemoteControl.cpp | 15 | ||||
-rw-r--r-- | src/RemoteControl.h | 8 |
2 files changed, 18 insertions, 5 deletions
diff --git a/src/RemoteControl.cpp b/src/RemoteControl.cpp index 12ab84e..9ee1f24 100644 --- a/src/RemoteControl.cpp +++ b/src/RemoteControl.cpp @@ -55,7 +55,9 @@ std::list<std::string> RemoteControllable::get_supported_parameters() const { return parameterlist; } -RemoteControllable* RemoteControllers::get_controllable_(const std::string& name) { +RemoteControllable* RemoteControllers::get_controllable_( + const std::string& name) +{ auto rc = std::find_if(controllables.begin(), controllables.end(), [&](RemoteControllable* r) { return r->get_rc_name() == name; }); @@ -67,6 +69,17 @@ RemoteControllable* RemoteControllers::get_controllable_(const std::string& name } } +void RemoteControllers::set_param( + const std::string& name, + const std::string& param, + const std::string& value) +{ + etiLog.level(info) << "RC: Setting " << name << " " << param + << " to " << value; + RemoteControllable* controllable = get_controllable_(name); + return controllable->set_parameter(param, value); +} + // This runs in a separate thread, because // it would take too long to be done in the main loop // thread. diff --git a/src/RemoteControl.h b/src/RemoteControl.h index c682826..1a81b42 100644 --- a/src/RemoteControl.h +++ b/src/RemoteControl.h @@ -176,10 +176,10 @@ class RemoteControllers { return controllable->get_parameter(param); } - void set_param(const std::string& name, const std::string& param, const std::string& value) { - RemoteControllable* controllable = get_controllable_(name); - return controllable->set_parameter(param, value); - } + void set_param( + const std::string& name, + const std::string& param, + const std::string& value); std::list<RemoteControllable*> controllables; |