Get the event list from the midi state
This commit is contained in:
parent
9f8b275712
commit
9263488882
3 changed files with 15 additions and 4 deletions
|
|
@ -139,3 +139,11 @@ void sfz::MidiState::resetAllControllers(int delay) noexcept
|
|||
|
||||
pitchBend = 0;
|
||||
}
|
||||
|
||||
const sfz::EventVector& sfz::MidiState::getEvents(int ccIdx) const noexcept
|
||||
{
|
||||
if (ccIdx < 0 || ccIdx > config::numCCs)
|
||||
return nullEvent;
|
||||
|
||||
return cc[ccIdx];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,10 +141,9 @@ public:
|
|||
return validRange.clamp(value);
|
||||
}
|
||||
|
||||
const EventVector& getEvents(int ccIdx) const noexcept;
|
||||
|
||||
private:
|
||||
template<class T>
|
||||
using MidiNoteArray = std::array<T, 128>;
|
||||
using EventVector = std::vector<MidiEvent>;
|
||||
int activeNotes { 0 };
|
||||
|
||||
/**
|
||||
|
|
@ -168,6 +167,8 @@ private:
|
|||
*
|
||||
*/
|
||||
std::array<EventVector, config::numCCs> cc;
|
||||
|
||||
const EventVector nullEvent {{0, 0.0f}};
|
||||
/**
|
||||
* Pitch bend status
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ namespace sfz
|
|||
{
|
||||
|
||||
using CCNamePair = std::pair<uint16_t, std::string>;
|
||||
|
||||
template<class T>
|
||||
using MidiNoteArray = std::array<T, 128>;
|
||||
template<class ValueType>
|
||||
struct CCValuePair {
|
||||
int cc;
|
||||
|
|
@ -66,6 +67,7 @@ struct MidiEvent {
|
|||
int delay;
|
||||
float value;
|
||||
};
|
||||
using EventVector = std::vector<MidiEvent>;
|
||||
|
||||
struct MidiEventDelayComparator {
|
||||
bool operator()(const MidiEvent& event, const int& delay)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue