forward port automation handling changes from 2.x, upto and including about rev 6981...
[ardour.git] / libs / evoral / evoral / Sequence.hpp
index 1ad456b30274a33654f8f2ea3ad3d37c4dc0d866..6c6c58357f6e5bfc63d224f919453788584a4a68 100644 (file)
@@ -79,6 +79,7 @@ protected:
        };
 
 public:
+
         typedef typename boost::shared_ptr<Evoral::Note<Time> >  NotePtr;
         typedef typename boost::shared_ptr<const Evoral::Note<Time> >  constNotePtr;
 
@@ -97,7 +98,7 @@ public:
        bool writing() const { return _writing; }
        void end_write(bool delete_stuck=false);
 
-       void append(const Event<Time>& ev);
+        void append(const Event<Time>& ev, Evoral::event_id_t evid);
 
        inline size_t n_notes() const { return _notes.size(); }
        inline bool   empty()   const { return _notes.size() == 0 && ControlSet::controls_empty(); }
@@ -184,7 +185,7 @@ public:
        class const_iterator {
        public:
                const_iterator();
-               const_iterator(const Sequence<Time>& seq, Time t, std::set<Evoral::Parameter> const &);
+               const_iterator(const Sequence<Time>& seq, Time t, bool, std::set<Evoral::Parameter> const &);
                ~const_iterator();
 
                inline bool valid() const { return !_is_end && _event; }
@@ -219,10 +220,11 @@ public:
                typename SysExes::const_iterator _sysex_iter;
                ControlIterators                 _control_iters;
                ControlIterators::iterator       _control_iter;
+               bool                             _force_discrete;
        };
 
-       const_iterator begin (Time t=0, std::set<Evoral::Parameter> const & f = std::set<Evoral::Parameter> ()) const {
-               return const_iterator (*this, t, f);
+       const_iterator begin (Time t = 0, bool force_discrete = false, std::set<Evoral::Parameter> const & f = std::set<Evoral::Parameter> ()) const {
+               return const_iterator (*this, t, force_discrete, f);
        }
        const const_iterator& end()           const { return _end_iter; }
 
@@ -266,14 +268,16 @@ private:
         bool overlaps_unlocked (const NotePtr& ev, const NotePtr& ignore_this_note) const;
         bool contains_unlocked (const NotePtr& ev) const;
 
-        void append_note_on_unlocked (NotePtr);
+        void append_note_on_unlocked (NotePtr, Evoral::event_id_t);
         void append_note_off_unlocked(NotePtr);
-       void append_control_unlocked(const Parameter& param, Time time, double value);
-       void append_sysex_unlocked(const MIDIEvent<Time>& ev);
+        void append_control_unlocked(const Parameter& param, Time time, double value, Evoral::event_id_t);
+        void append_sysex_unlocked(const MIDIEvent<Time>& ev, Evoral::event_id_t);
 
         void get_notes_by_pitch (Notes&, NoteOperator, uint8_t val, int chan_mask = 0) const;
         void get_notes_by_velocity (Notes&, NoteOperator, uint8_t val, int chan_mask = 0) const;
 
+       void control_list_marked_dirty ();
+
        const TypeMap& _type_map;
 
         Notes   _notes;       // notes indexed by time
@@ -283,9 +287,6 @@ private:
        typedef std::multiset<NotePtr, EarlierNoteComparator> WriteNotes;
        WriteNotes _write_notes[16];
 
-       typedef std::vector< boost::shared_ptr<const ControlList> > ControlLists;
-       ControlLists _dirty_controls;
-
        const   const_iterator _end_iter;
        bool                   _percussive;