13
0

osc: provide human readable reading for gain.

This commit is contained in:
Len Ovens 2016-08-05 19:08:43 -07:00
parent e78a177dbb
commit 032139ac30
2 changed files with 11 additions and 0 deletions

View File

@ -336,6 +336,14 @@ OSCSelectObserver::tick ()
_last_meter = now_meter; _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]) { if (feedback[13]) {
for (uint32_t i = 0; i < send_timeout.size(); i++) { for (uint32_t i = 0; i < send_timeout.size(); i++) {
if (send_timeout[i]) { if (send_timeout[i]) {
@ -476,6 +484,8 @@ OSCSelectObserver::gain_message (string path, boost::shared_ptr<Controllable> co
if (gainmode) { if (gainmode) {
lo_message_add_float (msg, gain_to_slider_position (controllable->get_value())); 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 { } else {
if (controllable->get_value() < 1e-15) { if (controllable->get_value() < 1e-15) {
lo_message_add_float (msg, -200); lo_message_add_float (msg, -200);

View File

@ -54,6 +54,7 @@ class OSCSelectObserver
uint32_t gainmode; uint32_t gainmode;
std::bitset<32> feedback; std::bitset<32> feedback;
std::vector<int> send_timeout; std::vector<int> send_timeout;
uint32_t gain_timeout;
float _last_meter; float _last_meter;
uint32_t nsends; uint32_t nsends;