diff options
author | Robin Gareus <robin@gareus.org> | 2017-03-18 18:37:19 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-03-18 19:07:03 +0100 |
commit | 6ceade76b32fe5e63901ae926b7198870c1b79a4 (patch) | |
tree | d13007edd6298ab8530d51c2175faf3caf5f2f13 /libs/ardour/lua_api.cc | |
parent | 940707e327014f30791d75be00ccbd33b0a0555d (diff) |
Lua bindings to access MIDI region/source note-events
Diffstat (limited to 'libs/ardour/lua_api.cc')
-rw-r--r-- | libs/ardour/lua_api.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/ardour/lua_api.cc b/libs/ardour/lua_api.cc index c32a9e9338..8499e5c7ff 100644 --- a/libs/ardour/lua_api.cc +++ b/libs/ardour/lua_api.cc @@ -820,3 +820,17 @@ LuaAPI::new_noteptr (uint8_t chan, Evoral::Beats beat_time, Evoral::Beats length { return boost::shared_ptr<Evoral::Note<Evoral::Beats> > (new Evoral::Note<Evoral::Beats>(chan, beat_time, length, note, velocity)); } + +std::list<boost::shared_ptr<Evoral::Note<Evoral::Beats> > > +LuaAPI::note_list (boost::shared_ptr<MidiModel> mm) +{ + typedef typename boost::shared_ptr<Evoral::Note<Evoral::Beats> > NotePtr; + + std::list<NotePtr> note_ptr_list; + + const MidiModel::Notes& notes = mm->notes(); + for (MidiModel::Notes::const_iterator i = notes.begin(); i != notes.end(); ++i) { + note_ptr_list.push_back (*i); + } + return note_ptr_list; +} |