From a65044d097105a1b9915ead5e51054bb7947771e Mon Sep 17 00:00:00 2001 From: Hans Baier Date: Tue, 13 May 2008 18:40:10 +0000 Subject: * 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 --- libs/ardour/ardour/midi_model.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'libs/ardour/ardour/midi_model.h') diff --git a/libs/ardour/ardour/midi_model.h b/libs/ardour/ardour/midi_model.h index 3d49123b94..98e159002a 100644 --- a/libs/ardour/ardour/midi_model.h +++ b/libs/ardour/ardour/midi_model.h @@ -165,8 +165,9 @@ public: inline bool locked() const { return _locked; } - const MIDI::Event& operator*() const { return _event; } - const MIDI::Event* operator->() const { return &_event; } + const MIDI::Event& operator*() const { return *_event; } + const boost::shared_ptr operator->() const { return _event; } + const boost::shared_ptr get_event_pointer() { return _event; } const const_iterator& operator++(); // prefix only bool operator==(const const_iterator& other) const; @@ -177,8 +178,8 @@ public: private: friend class MidiModel; - const MidiModel* _model; - MIDI::Event _event; + const MidiModel* _model; + boost::shared_ptr _event; typedef std::priority_queue< boost::shared_ptr, std::deque< boost::shared_ptr >, @@ -199,7 +200,7 @@ public: const MidiSource* midi_source() const { return _midi_source; } void set_midi_source(MidiSource* source) { _midi_source = source; } - bool control_to_midi_event(MIDI::Event& ev, const MidiControlIterator& iter) const; + boost::shared_ptr control_to_midi_event(const MidiControlIterator& iter) const; private: friend class DeltaCommand; -- cgit v1.2.3