47 return v > 0 ?
_(
"on") :
_(
"off");
60 #ifdef PLATFORM_WINDOWS
62 snprintf(buf,
sizeof(buf),
"-inf dB");
70 snprintf (buf,
sizeof (buf),
"%d%%", (
int) floor (100.0 * v));
72 snprintf (buf,
sizeof (buf),
"%d", (
int) v - 8192);
74 snprintf(buf,
sizeof(buf), desc.
print_fmt.c_str(), v);
76 snprintf(buf,
sizeof(buf),
"%d", (
int)v);
78 snprintf(buf,
sizeof(buf),
"%.1f", v);
80 snprintf(buf,
sizeof(buf),
"%.2f", v);
82 snprintf(buf,
sizeof(buf),
"%.3f", v);
86 return std::string(buf) +
" dB";
101 std::string
const & str,
118 if (str ==
_(
"on") || str ==
_(
"yes") || str ==
"1") {
120 }
else if (str ==
_(
"off") || str ==
_(
"no") || str ==
"0") {
145 legal = (sscanf (str.c_str(),
"%f", &f) == 1);
155 f = std::max (std::min (f, max_dB), min_dB);
161 legal = (sscanf (str.c_str(),
"%d", &tmp) == 1);
164 legal = (sscanf (str.c_str(),
"%d", &tmp) == 1);
168 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)
@ MidiPitchBenderAutomation
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.