diff options
author | David Robillard <d@drobilla.net> | 2014-11-02 01:29:33 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-11-02 02:10:24 -0500 |
commit | 47c4929bc285da6d752e68aa5a32cf73f20b9f22 (patch) | |
tree | 60dfd783c1aff7e70a1772a3344758b41abf6cf8 /libs/ardour/automatable.cc | |
parent | 8a128b33d38172ae525ac798c53bc105bc4e2c64 (diff) |
Display gain and midiNote plugin parameters/properties nicely.
Show fancy values on generic GUI controls, automation lane controls, and automation lane verbose cursor.
Fix text display of midiNote values.
Make bigstep of midiNote parameters 12 (one octave).
Add ARDOUR::value_as_string() as a stateless one-stop-shop for value printing.
Diffstat (limited to 'libs/ardour/automatable.cc')
-rw-r--r-- | libs/ardour/automatable.cc | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/libs/ardour/automatable.cc b/libs/ardour/automatable.cc index 466899ce48..b4d957c8b6 100644 --- a/libs/ardour/automatable.cc +++ b/libs/ardour/automatable.cc @@ -35,6 +35,7 @@ #include "ardour/plugin_insert.h" #include "ardour/session.h" #include "ardour/uri_map.h" +#include "ardour/value_as_string.h" #include "i18n.h" @@ -474,19 +475,5 @@ Automatable::clear_controls () string Automatable::value_as_string (boost::shared_ptr<AutomationControl> ac) const { - std::stringstream s; - - /* this is a the default fallback for this virtual method. Derived Automatables - are free to override this to display the values of their parameters/controls - in different ways. - */ - - // Hack to display CC as integer value, rather than double - if (ac->parameter().type() == MidiCCAutomation) { - s << lrint (ac->get_value()); - } else { - s << std::fixed << std::setprecision(3) << ac->get_value(); - } - - return s.str (); + return ARDOUR::value_as_string(ac->desc(), ac->get_value()); } |