diff options
author | Hans Baier <hansfbaier@googlemail.com> | 2008-05-12 11:42:41 +0000 |
---|---|---|
committer | Hans Baier <hansfbaier@googlemail.com> | 2008-05-12 11:42:41 +0000 |
commit | 277bfa35d5265be18733e59ed0148d304e23748b (patch) | |
tree | 36ffba517c7edee2b30558dffaed59d448740535 /libs/ardour/midi_model.cc | |
parent | d46724515238fdb57f5d21c450883f7cc8897a56 (diff) |
* Quick Fix: assertion converted into warning in MidiModel::write_to
git-svn-id: svn://localhost/ardour2/branches/3.0@3337 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/midi_model.cc')
-rw-r--r-- | libs/ardour/midi_model.cc | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/libs/ardour/midi_model.cc b/libs/ardour/midi_model.cc index 168516fcc4..a85d00f49e 100644 --- a/libs/ardour/midi_model.cc +++ b/libs/ardour/midi_model.cc @@ -879,8 +879,8 @@ XMLNode& MidiModel::DeltaCommand::get_state() struct EventTimeComparator { typedef const MIDI::Event* value_type; - inline bool operator()(const MIDI::Event* a, const MIDI::Event* b) const { - return a->time() >= b->time(); + inline bool operator()(const MIDI::Event& a, const MIDI::Event& b) const { + return a.time() >= b.time(); } }; @@ -893,14 +893,34 @@ struct EventTimeComparator { */ bool MidiModel::write_to(boost::shared_ptr<MidiSource> source) { + /* + EventTimeComparator comp; + typedef std::priority_queue< + const MIDI::Event*, + std::deque<MIDI::Event>, + EventTimeComparator> MidiEvents; + + MidiEvents events(comp); + */ + read_lock(); const NoteMode old_note_mode = _note_mode; _note_mode = Sustained; for (const_iterator i = begin(); i != end(); ++i) { + //events.push(*i); source->append_event_unlocked(Frames, *i); } + + /* + // TODO: As of now, this is still necessary, because there are some events appended whose + // times are earlier than the preceding events + while(!events.empty()) { + source->append_event_unlocked(Frames, events.top()); + events.pop(); + } + */ _note_mode = old_note_mode; |