}
} else {
view_to_model_y(fraction);
- if (((ARDOUR::Parameter)alist->parameter()).is_integer())
+ if (EventTypeMap::instance().is_integer(alist->parameter())) {
snprintf (buf, sizeof (buf), "%d", (int)fraction);
- else
+ } else {
snprintf (buf, sizeof (buf), "%.2f", fraction);
+ }
}
return buf;
uint8_t parameter_midi_type(const Evoral::Parameter& param) const;
uint32_t midi_event_type(uint8_t status) const;
+ bool is_integer(const Evoral::Parameter& param) const;
+
static EventTypeMap& instance() { return event_type_map; }
private:
std::string symbol() const;
- inline bool is_integer() const {
- return (_type >= MidiCCAutomation && _type <= MidiChannelPressureAutomation);
- }
-
inline operator Parameter() { return (Parameter)*this; }
};
}
}
+bool
+EventTypeMap::is_integer(const Evoral::Parameter& param) const
+{
+ return ( param.type() >= MidiCCAutomation
+ && param.type() <= MidiChannelPressureAutomation);
+}
+
} // namespace ARDOUR
/** The type ID for a MIDI event with the given status byte
*/
virtual uint32_t midi_event_type(uint8_t status) const = 0;
+
+ /** Return true iff parameter should be locked to integer boundaries */
+ bool is_integer(const Evoral::Parameter& param) const;
};
} // namespace Evoral