diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-06-02 19:55:37 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-06-02 19:55:37 +0000 |
commit | 460d2d067545309f103089debdd68a553af29450 (patch) | |
tree | 686c61c5ba9aad07f588aeae76a90708810bdc64 /libs/evoral/evoral/Sequence.hpp | |
parent | baacf1c7b44773cc46ac2e11839502c5ae23f8ac (diff) |
add channel+pitch indexing for notes in a Sequence
git-svn-id: svn://localhost/ardour2/branches/3.0@7217 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/evoral/evoral/Sequence.hpp')
-rw-r--r-- | libs/evoral/evoral/Sequence.hpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libs/evoral/evoral/Sequence.hpp b/libs/evoral/evoral/Sequence.hpp index 8acd04fd27..acfe6970e0 100644 --- a/libs/evoral/evoral/Sequence.hpp +++ b/libs/evoral/evoral/Sequence.hpp @@ -137,6 +137,10 @@ public: inline Notes& notes() { return _notes; } inline const Notes& notes() const { return _notes; } + typedef std::multiset<boost::shared_ptr< Note<Time> >, NoteNumberComparator> Pitches; + inline Pitches& pitches(uint8_t chan) { return _pitches[chan&0xf]; } + inline const Pitches& pitches(uint8_t chan) const { return _pitches[chan&0xf]; } + enum NoteOperator { PitchEqual, PitchLessThan, @@ -244,9 +248,13 @@ private: void append_control_unlocked(const Parameter& param, Time time, double value); void append_sysex_unlocked(const MIDIEvent<Time>& ev); + void get_notes_by_pitch (Notes&, NoteOperator, uint8_t val, int chan_mask = 0) const; + void get_notes_by_velocity (Notes&, NoteOperator, uint8_t val, int chan_mask = 0) const; + const TypeMap& _type_map; - Notes _notes; + Notes _notes; // notes indexed by time + Pitches _pitches[16]; // notes indexed by channel+pitch SysExes _sysexes; typedef std::multiset<boost::shared_ptr< Note<Time> >, EarlierNoteComparator> WriteNotes; |