MCU: make EQ subview show actual values, not just decimal between 0 and 1
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
#include <climits>
|
||||
#include <regex>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -711,6 +712,16 @@ Strip::handle_button (Button& button, ButtonState bs)
|
||||
}
|
||||
}
|
||||
|
||||
std::string
|
||||
Strip::remove_units (std::string s) {
|
||||
s = std::regex_replace (s, std::regex(" kHz$"), "k");
|
||||
s = std::regex_replace (s, std::regex(" Hz$"), "");
|
||||
s = std::regex_replace (s, std::regex(" dB$"), "");
|
||||
s = std::regex_replace (s, std::regex(" ms$"), "");
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
std::string
|
||||
Strip::format_parameter_for_display(
|
||||
ARDOUR::ParameterDescriptor const& desc,
|
||||
|
||||
@@ -92,6 +92,8 @@ public:
|
||||
MidiByteArray display (uint32_t lcd_number, uint32_t line_number, const std::string&);
|
||||
MidiByteArray blank_display (uint32_t lcd_number, uint32_t line_number);
|
||||
|
||||
static std::string remove_units (std::string s);
|
||||
|
||||
static std::string format_parameter_for_display(
|
||||
ARDOUR::ParameterDescriptor const& desc,
|
||||
float val,
|
||||
|
||||
@@ -410,7 +410,7 @@ void EQSubview::notify_change (std::weak_ptr<ARDOUR::AutomationControl> pc, uint
|
||||
std::shared_ptr<AutomationControl> control = pc.lock ();
|
||||
if (control) {
|
||||
float val = control->get_value();
|
||||
do_parameter_display(pending_display[1], control->desc(), val, strip, true);
|
||||
pending_display[1] = Strip::remove_units(control->get_user_string());
|
||||
/* update pot/encoder */
|
||||
strip->surface()->write (vpot->set (control->internal_to_interface (val), true, Pot::wrap));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user