+ int set_state (const XMLNode&);
+ XMLNode& get_state ();
+
+ void add(const boost::shared_ptr<Note> note);
+ void remove(const boost::shared_ptr<Note> note);
+
+ private:
+ XMLNode &marshal_note(const boost::shared_ptr<Note> note);
+ boost::shared_ptr<Note> unmarshal_note(XMLNode *xml_note);
+
+ boost::shared_ptr<MidiModel> _model;
+ const std::string _name;
+
+ typedef std::list< boost::shared_ptr<Note> > NoteList;
+
+ NoteList _added_notes;
+ NoteList _removed_notes;
+ };
+
+ MidiModel::DeltaCommand* new_delta_command(const std::string name="midi edit");
+ void apply_command(Command* cmd);
+
+ bool edited() const { return _edited; }
+ void set_edited(bool yn) { _edited = yn; }
+ bool write_to(boost::shared_ptr<MidiSource> source);
+
+ // MidiModel doesn't use the normal AutomationList serialisation code
+ // since controller data is stored in the .mid
+ XMLNode& get_state();
+ int set_state(const XMLNode&) { return 0; }
+
+ sigc::signal<void> ContentsChanged;
+
+ /** Read iterator */
+ class const_iterator {
+ public:
+ const_iterator(const MidiModel& model, double t);
+ ~const_iterator();