Don't dispatch on template for the MidiEventComparator
This commit is contained in:
parent
e2f0ca754e
commit
9f8b275712
2 changed files with 3 additions and 5 deletions
|
|
@ -104,7 +104,7 @@ int sfz::MidiState::getPitchBend() const noexcept
|
||||||
void sfz::MidiState::ccEvent(int delay, int ccNumber, float ccValue) noexcept
|
void sfz::MidiState::ccEvent(int delay, int ccNumber, float ccValue) noexcept
|
||||||
{
|
{
|
||||||
ASSERT(ccValue >= 0.0 && ccValue <= 1.0);
|
ASSERT(ccValue >= 0.0 && ccValue <= 1.0);
|
||||||
const auto insertionPoint = absl::c_upper_bound(cc[ccNumber], delay, MidiEventComparator{});
|
const auto insertionPoint = absl::c_upper_bound(cc[ccNumber], delay, MidiEventDelayComparator{});
|
||||||
cc[ccNumber].insert(insertionPoint, { delay, ccValue });
|
cc[ccNumber].insert(insertionPoint, { delay, ccValue });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,8 +67,7 @@ struct MidiEvent {
|
||||||
float value;
|
float value;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<bool CompareValue = false>
|
struct MidiEventDelayComparator {
|
||||||
struct MidiEventComparator {
|
|
||||||
bool operator()(const MidiEvent& event, const int& delay)
|
bool operator()(const MidiEvent& event, const int& delay)
|
||||||
{
|
{
|
||||||
return (event.delay < delay);
|
return (event.delay < delay);
|
||||||
|
|
@ -85,8 +84,7 @@ struct MidiEventComparator {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
struct MidiEventValueComparator {
|
||||||
struct MidiEventComparator<true> {
|
|
||||||
bool operator()(const MidiEvent& event, const float& value)
|
bool operator()(const MidiEvent& event, const float& value)
|
||||||
{
|
{
|
||||||
return (event.value < value);
|
return (event.value < value);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue