mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
Change handling of Midi note selection to eliminate signal emission/delays.
Each MidiRegionView(MRV) is connected to the Selection::ClearMidiNoteSelection signal that is used to notify the all MRV instances to clear their note selection. The MRV class also has a private static SelectionCleared signal that is used to signal other MRV instances when their selection has been cleared. When the Selection::ClearMidiNoteSelection signal is emitted it causes each MRV to also emit the SelectionCleared signal. So the emission takes quadratic time. With 1500 MRV instances emission takes about 2.2 seconds on my machine, and some operations like track selection cause it to be emitted 3 times(another issue). The Selection class in the Editor knows which MRV instances have note selections, as it is notified by MidiRegionView whenever the selection count becomes zero or becomes non-zero. Clearing the Note selection should then just be O(N) and direct calls can be used rather than signals. This change removes both the signals and uses the existing references between Selection and MRV class to control note selection. There should be no behavioural changes in Midi note selection with this change.
This commit is contained in:
parent
b93a9e2601
commit
084af96bf4
5 changed files with 73 additions and 117 deletions
|
|
@ -221,8 +221,6 @@ class Selection : public sigc::trackable, public PBD::ScopedConnectionList
|
|||
XMLNode& get_state () const;
|
||||
int set_state (XMLNode const &, int);
|
||||
|
||||
PBD::Signal0<void> ClearMidiNoteSelection;
|
||||
|
||||
std::list<std::pair<PBD::ID const, std::list<boost::shared_ptr<Evoral::Note<Evoral::Beats> > > > > pending_midi_note_selection;
|
||||
|
||||
private:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue