change ControlProtocolManager protocol mutex into a RW lock.
[ardour.git] / libs / ardour / lua_api.cc
index c32a9e9338744e6c7953ddb0df5a5c8ddcf25447..0e82276b1e6e7582de244c4de4467c25e078b5b6 100644 (file)
@@ -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 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;
+}