public:
Sequence(const TypeMap& type_map, size_t size=0);
- bool read_locked() { return _read_iter.locked(); }
-
void write_lock();
void write_unlock();
inline const boost::shared_ptr< Note<Time> > note_at(size_t i) { return _notes[i]; }
inline size_t n_notes() const { return _notes.size(); }
- inline bool empty() const { return _notes.size() == 0 && ControlSet::empty(); }
+ inline bool empty() const { return _notes.size() == 0 && ControlSet::controls_empty(); }
inline static bool note_time_comparator(const boost::shared_ptr< const Note<Time> >& a,
const boost::shared_ptr< const Note<Time> >& b) {
return a->time() < b->time();
}
+ struct LaterNoteComparator {
+ typedef const Note<Time>* value_type;
+ inline bool operator()(const boost::shared_ptr< const Note<Time> > a,
+ const boost::shared_ptr< const Note<Time> > b) const {
+ return a->time() > b->time();
+ }
+ };
+
struct LaterNoteEndComparator {
typedef const Note<Time>* value_type;
inline bool operator()(const boost::shared_ptr< const Note<Time> > a,
inline Notes& notes() { return _notes; }
inline const Notes& notes() const { return _notes; }
+ void set_notes (const std::vector<boost::shared_ptr<Note<Time> > >&);
+
typedef std::vector< boost::shared_ptr< Event<Time> > > SysExes;
inline SysExes& sysexes() { return _sysexes; }
inline const SysExes& sysexes() const { return _sysexes; }
inline bool valid() const { return !_is_end && _event; }
inline bool locked() const { return _locked; }
+
+ void invalidate();
const Event<Time>& operator*() const { return *_event; }
const boost::shared_ptr< Event<Time> > operator->() const { return _event; }
const_iterator begin(Time t=0) const { return const_iterator(*this, t); }
const const_iterator& end() const { return _end_iter; }
- void read_seek(Time t) { _read_iter = begin(t); }
- Time read_time() const { return _read_iter.valid() ? _read_iter->time() : 0.0; }
-
bool control_to_midi_event(boost::shared_ptr< Event<Time> >& ev,
const ControlIterator& iter) const;
uint8_t highest_note() const { return _highest_note; }
protected:
- mutable const_iterator _read_iter;
- bool _edited;
+ bool _edited;
private:
friend class const_iterator;