mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 16:24:57 +01:00
Remove ARDOUR::Parameter::is_integer.
git-svn-id: svn://localhost/ardour2/branches/3.0@3837 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
80608f7594
commit
03f188cc8b
5 changed files with 15 additions and 6 deletions
|
|
@ -614,10 +614,11 @@ AutomationLine::get_verbose_cursor_string (double fraction)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
view_to_model_y(fraction);
|
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);
|
snprintf (buf, sizeof (buf), "%d", (int)fraction);
|
||||||
else
|
} else {
|
||||||
snprintf (buf, sizeof (buf), "%.2f", fraction);
|
snprintf (buf, sizeof (buf), "%.2f", fraction);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@ public:
|
||||||
uint8_t parameter_midi_type(const Evoral::Parameter& param) const;
|
uint8_t parameter_midi_type(const Evoral::Parameter& param) const;
|
||||||
uint32_t midi_event_type(uint8_t status) 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; }
|
static EventTypeMap& instance() { return event_type_map; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -93,10 +93,6 @@ public:
|
||||||
|
|
||||||
std::string symbol() const;
|
std::string symbol() const;
|
||||||
|
|
||||||
inline bool is_integer() const {
|
|
||||||
return (_type >= MidiCCAutomation && _type <= MidiChannelPressureAutomation);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline operator Parameter() { return (Parameter)*this; }
|
inline operator Parameter() { return (Parameter)*this; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,5 +57,12 @@ EventTypeMap::midi_event_type(uint8_t status) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
EventTypeMap::is_integer(const Evoral::Parameter& param) const
|
||||||
|
{
|
||||||
|
return ( param.type() >= MidiCCAutomation
|
||||||
|
&& param.type() <= MidiChannelPressureAutomation);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace ARDOUR
|
} // namespace ARDOUR
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,9 @@ public:
|
||||||
/** The type ID for a MIDI event with the given status byte
|
/** The type ID for a MIDI event with the given status byte
|
||||||
*/
|
*/
|
||||||
virtual uint32_t midi_event_type(uint8_t status) const = 0;
|
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
|
} // namespace Evoral
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue