summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/midi_model.h
diff options
context:
space:
mode:
authorHans Baier <hansfbaier@googlemail.com>2008-05-13 18:40:10 +0000
committerHans Baier <hansfbaier@googlemail.com>2008-05-13 18:40:10 +0000
commita65044d097105a1b9915ead5e51054bb7947771e (patch)
tree4e54e6f28fe51ef5e6ada5afde8687486a8ca2ab /libs/ardour/ardour/midi_model.h
parenta25be81b5df6d68449f0775a847f83ab5b30df7f (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 'libs/ardour/ardour/midi_model.h')
-rw-r--r--libs/ardour/ardour/midi_model.h11
1 files changed, 6 insertions, 5 deletions
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<MIDI::Event> operator->() const { return _event; }
+ const boost::shared_ptr<MIDI::Event> 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<MIDI::Event> _event;
typedef std::priority_queue<
boost::shared_ptr<Note>, std::deque< boost::shared_ptr<Note> >,
@@ -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<MIDI::Event> control_to_midi_event(const MidiControlIterator& iter) const;
private:
friend class DeltaCommand;