Ardour  9.0-pre0-582-g084a23a80d
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 #pragma once
20 
21 #include <set>
22 
23 
24 
25 #include "pbd/signals.h"
26 
27 #include "temporal/beats.h"
28 #include "evoral/Sequence.h"
29 
30 #include "ardour/types.h"
31 
32 namespace ARDOUR {
33 
34 struct MidiCursor {
36  MidiCursor(const MidiCursor&) = delete;
37  MidiCursor& operator=(const MidiCursor&) = delete;
38 
39  void connect(PBD::Signal<void(bool)>& invalidated) {
41  invalidated.connect_same_thread (connections, std::bind(&MidiCursor::invalidate, this, _1));
42  }
43 
44 
45  void invalidate(bool preserve_notes) {
46  iter.invalidate (preserve_notes);
47  /* maintain time domain while resetting to zero */
49  }
50 
55 };
56 
57 }
58 
std::set< WeakNotePtr, std::owner_less< WeakNotePtr > > WeakActiveNotes
Definition: Sequence.h:92
Temporal::TimeDomain time_domain() const
Definition: timeline.h:86
Temporal::timepos_t timepos_t
MidiCursor(const MidiCursor &)=delete
void connect(PBD::Signal< void(bool)> &invalidated)
Definition: midi_cursor.h:39
PBD::ScopedConnectionList connections
Definition: midi_cursor.h:54
void invalidate(bool preserve_notes)
Definition: midi_cursor.h:45
Evoral::Sequence< Temporal::Beats >::const_iterator iter
Definition: midi_cursor.h:51
MidiCursor & operator=(const MidiCursor &)=delete
Evoral::Sequence< Temporal::Beats >::WeakActiveNotes active_notes
Definition: midi_cursor.h:52
timepos_t last_read_end
Definition: midi_cursor.h:53