diff options
author | Hans Baier <hansfbaier@googlemail.com> | 2008-05-13 18:40:10 +0000 |
---|---|---|
committer | Hans Baier <hansfbaier@googlemail.com> | 2008-05-13 18:40:10 +0000 |
commit | a65044d097105a1b9915ead5e51054bb7947771e (patch) | |
tree | 4e54e6f28fe51ef5e6ada5afde8687486a8ca2ab /gtk2_ardour | |
parent | a25be81b5df6d68449f0775a847f83ab5b30df7f (diff) |
* formatting
* fixed corruption bugs due to allocation hell of MidiModel::const_iterator::_event: Changed it into boost::shared_ptr
* fixed MidiModel::const_iterator bugs:
-First note on lost, if an automation event comes first
-corrupt MidiEvent compared to automation event if there are no notes in the region
* (hopefully) fixed possible race condition
* fixed range check in MidiDiskstream::set_state for channel mask
* treating notes with duration 0 more gently in MidiRegionView (warning instead of assertion)
git-svn-id: svn://localhost/ardour2/branches/3.0@3345 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/midi_region_view.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 18ab4ef74f..b70e1c7b08 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -481,10 +481,8 @@ MidiRegionView::redisplay_model() for (AutomationList::const_iterator event = control->second->list()->begin(); event != control->second->list()->end(); ++event) { - boost::shared_ptr<MIDI::Event> midi_event(new MIDI::Event()); MidiControlIterator iter(control->second->list(), (*event)->when, (*event)->value); - _model->control_to_midi_event(*midi_event, iter); - add_pgm_change(midi_event); + add_pgm_change(_model->control_to_midi_event(iter)); } break; } @@ -767,9 +765,12 @@ MidiRegionView::add_note(const boost::shared_ptr<Note> note) ev_rect->property_y2() = y1 + floor(midi_stream_view()->note_height()); if (note->duration() == 0) { - assert(_active_notes); - assert(note->note() < 128); - _active_notes[note->note()] = ev_rect; + cerr << "MidiModel: WARNING: Discovered note with duration 0 and pitch" << note->note() + << " at time " << note->time() << endl; + if (_active_notes) { + assert(note->note() < 128); + _active_notes[note->note()] = ev_rect; + } /* outline all but right edge */ ev_rect->property_outline_what() = (guint32) (0x1 & 0x4 & 0x8); } else { |