summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/midi_model.h
diff options
context:
space:
mode:
authorHans Baier <hansfbaier@googlemail.com>2008-04-11 15:49:52 +0000
committerHans Baier <hansfbaier@googlemail.com>2008-04-11 15:49:52 +0000
commitaae8262a363b3d7b85b5baa3b2d0ffb07e604b73 (patch)
treef482717d2f895f3d9fb3b3f7faa5a4648c3b58d0 /libs/ardour/ardour/midi_model.h
parentcb413146428ce5db5e281d70f2b3b7df27c1aaab (diff)
* persistent undo for MIDI edits works now
* fixed bug: dragging of notes beyond left region bounds made it disappear (unsigned int wrap around) git-svn-id: svn://localhost/ardour2/branches/3.0@3249 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/midi_model.h')
-rw-r--r--libs/ardour/ardour/midi_model.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/libs/ardour/ardour/midi_model.h b/libs/ardour/ardour/midi_model.h
index 3ba0fc1279..b6cdac1864 100644
--- a/libs/ardour/ardour/midi_model.h
+++ b/libs/ardour/ardour/midi_model.h
@@ -55,7 +55,7 @@ typedef std::pair<boost::shared_ptr<const AutomationList>, std::pair<double,doub
*/
class MidiModel : public boost::noncopyable, public Automatable {
public:
- MidiModel(MidiSource& s, size_t size=0);
+ MidiModel(MidiSource *s, size_t size=0);
// This is crap.
void write_lock();
@@ -108,9 +108,8 @@ public:
class DeltaCommand : public Command
{
public:
- DeltaCommand (MidiModel& m, const std::string& name)
- : Command(name), _model(m), _name(name) {}
- DeltaCommand (MidiModel&, const XMLNode& node);
+ DeltaCommand (boost::shared_ptr<MidiModel> m, const std::string& name);
+ DeltaCommand (boost::shared_ptr<MidiModel>, const XMLNode& node);
const std::string& name() const { return _name; }
@@ -127,7 +126,7 @@ public:
XMLNode &marshal_note(const boost::shared_ptr<Note> note);
boost::shared_ptr<Note> unmarshal_note(XMLNode *xml_note);
- MidiModel& _model;
+ boost::shared_ptr<MidiModel> _model;
const std::string _name;
typedef std::list< boost::shared_ptr<Note> > NoteList;
@@ -189,7 +188,8 @@ public:
const_iterator begin() const { return const_iterator(*this, 0); }
const const_iterator& end() const { return _end_iter; }
- const MidiSource& midi_source() const { return _midi_source; }
+ const MidiSource *midi_source() const { return _midi_source; }
+ void set_midi_source(MidiSource *source) { _midi_source = source; }
private:
friend class DeltaCommand;
@@ -227,7 +227,8 @@ private:
LaterNoteEndComparator>
ActiveNotes;
- MidiSource& _midi_source;
+ // We cannot use a boost::shared_ptr here to avoid a retain cycle
+ MidiSource *_midi_source;
};
} /* namespace ARDOUR */