47 return v > 0 ?
_(
"on") :
_(
"off");
54 #ifdef PLATFORM_WINDOWS
56 snprintf(buf,
sizeof(buf),
"-inf dB");
64 snprintf (buf,
sizeof (buf),
"%d%%", (
int) floor (100.0 * v));
66 snprintf(buf,
sizeof(buf), desc.
print_fmt.c_str(), v);
68 snprintf(buf,
sizeof(buf),
"%d", (
int)v);
70 snprintf(buf,
sizeof(buf),
"%.1f", v);
72 snprintf(buf,
sizeof(buf),
"%.2f", v);
74 snprintf(buf,
sizeof(buf),
"%.3f", v);
78 return std::string(buf) +
" dB";
93 std::string
const & str,
110 if (str ==
_(
"on") || str ==
_(
"yes") || str ==
"1") {
112 }
else if (str ==
_(
"off") || str ==
_(
"no") || str ==
"0") {
137 legal = (sscanf (str.c_str(),
"%f", &f) == 1);
147 f = std::max (std::min (f, max_dB), min_dB);
153 legal = (sscanf (str.c_str(),
"%d", &tmp) == 1);
157 legal = (sscanf (str.c_str(),
"%g", &tmp) == 1);
static float dB_to_coefficient(float dB)
static float accurate_coefficient_to_dB(float coeff)
std::string value_as_string(const ARDOUR::ParameterDescriptor &desc, double v)
double string_as_value(const ARDOUR::ParameterDescriptor &desc, std::string const &str, bool &legal)
std::string print_fmt
format string for pretty printing
static uint8_t midi_note_num(const std::string &name)
std::shared_ptr< ScalePoints > scale_points
@ MIDI_NOTE
MIDI note number.
static std::string midi_note_name(uint8_t, bool translate=true)
float upper
Maximum value (in Hz, for frequencies)
float lower
Minimum value (in Hz, for frequencies)
bool toggled
True iff parameter is boolean.