- /** Read iterator */
- class const_iterator {
- public:
- const_iterator(const MidiModel& model, double t);
- ~const_iterator();
-
- inline bool locked() const { return _locked; }
-
- const MIDI::Event& operator*() const { return _event; }
- const MIDI::Event* operator->() const { return &_event; }
-
- const const_iterator& operator++(); // prefix only
- bool operator==(const const_iterator& other) const;
- bool operator!=(const const_iterator& other) const { return ! operator==(other); }
-
- const_iterator& operator=(const const_iterator& other);
-
- private:
- friend class MidiModel;
-
- const MidiModel* _model;
- MIDI::Event _event;
-
- typedef std::priority_queue<
- boost::shared_ptr<Note>, std::deque< boost::shared_ptr<Note> >,
- LaterNoteEndComparator>
- ActiveNotes;
-
- mutable ActiveNotes _active_notes;
-
- bool _is_end;
- bool _locked;
- Notes::const_iterator _note_iter;
- std::vector<MidiControlIterator> _control_iters;
- std::vector<MidiControlIterator>::iterator _control_iter;
- };
-
- const_iterator begin() const { return const_iterator(*this, 0); }
- const const_iterator& end() const { return _end_iter; }
-
- const MidiSource *midi_source() const;
- void set_midi_source(MidiSource *source);