osc: provide human readable reading for gain.
authorLen Ovens <len@ovenwerks.net>
Sat, 6 Aug 2016 02:08:43 +0000 (19:08 -0700)
committerLen Ovens <len@ovenwerks.net>
Sat, 6 Aug 2016 02:08:43 +0000 (19:08 -0700)
libs/surfaces/osc/osc_select_observer.cc
libs/surfaces/osc/osc_select_observer.h

index d40a599ecea47ea6825ed1cba87f0a6f7a6f6fb0..bcea1c078b75328df07f7fb4bdd7762fcdca0779 100644 (file)
@@ -336,6 +336,14 @@ OSCSelectObserver::tick ()
                _last_meter = now_meter;
 
        }
+       if (feedback[1]) {
+               if (gain_timeout) {
+                       if (gain_timeout == 1) {
+                               text_message ("/select/name", _strip->name());
+                       }
+                       gain_timeout--;
+               }
+       }
        if (feedback[13]) {
                for (uint32_t i = 0; i < send_timeout.size(); i++) {
                        if (send_timeout[i]) {
@@ -476,6 +484,8 @@ OSCSelectObserver::gain_message (string path, boost::shared_ptr<Controllable> co
 
        if (gainmode) {
                lo_message_add_float (msg, gain_to_slider_position (controllable->get_value()));
+               text_message ("/select/name", to_string (accurate_coefficient_to_dB (controllable->get_value())));
+               gain_timeout = 8;
        } else {
                if (controllable->get_value() < 1e-15) {
                        lo_message_add_float (msg, -200);
index ba179e7979d4f683c812ffab29d84ac3b0a6ffd8..d3abc20c808c880b35058465bf7797476fa99846 100644 (file)
@@ -54,6 +54,7 @@ class OSCSelectObserver
        uint32_t gainmode;
        std::bitset<32> feedback;
        std::vector<int> send_timeout;
+       uint32_t gain_timeout;
        float _last_meter;
        uint32_t nsends;