Ardour  8.12
midi_cursor.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Paul Davis <paul@linuxaudiosystems.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef __ardour_midi_cursor_h__
20 #define __ardour_midi_cursor_h__
21 
22 #include <set>
23 
24 
25 
26 #include "pbd/signals.h"
27 
28 #include "temporal/beats.h"
29 #include "evoral/Sequence.h"
30 
31 #include "ardour/types.h"
32 
33 namespace ARDOUR {
34 
35 struct MidiCursor : public boost::noncopyable {
37 
38  void connect(PBD::Signal1<void, bool>& invalidated) {
40  invalidated.connect_same_thread (connections, boost::bind(&MidiCursor::invalidate, this, _1));
41  }
42 
43 
44  void invalidate(bool preserve_notes) {
45  iter.invalidate (preserve_notes);
46  /* maintain time domain while resetting to zero */
48  }
49 
54 };
55 
56 }
57 
58 #endif /* __ardour_midi_cursor_h__ */
std::set< WeakNotePtr, std::owner_less< WeakNotePtr > > WeakActiveNotes
Definition: Sequence.h:92
Temporal::TimeDomain time_domain() const
Definition: timeline.h:87
Temporal::timepos_t timepos_t
PBD::ScopedConnectionList connections
Definition: midi_cursor.h:53
void invalidate(bool preserve_notes)
Definition: midi_cursor.h:44
Evoral::Sequence< Temporal::Beats >::const_iterator iter
Definition: midi_cursor.h:50
void connect(PBD::Signal1< void, bool > &invalidated)
Definition: midi_cursor.h:38
Evoral::Sequence< Temporal::Beats >::WeakActiveNotes active_notes
Definition: midi_cursor.h:51
timepos_t last_read_end
Definition: midi_cursor.h:52