diff options
author | Tim Mayberry <mojofunk@gmail.com> | 2015-10-14 20:37:07 +1000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-10-17 22:15:07 -0400 |
commit | e7b8e98db26bc2b9ee2587f388de2dbbf7ca5837 (patch) | |
tree | 227714e6850ccbabd534d46aff1530f9b83bcbb2 /gtk2_ardour/note_base.cc | |
parent | 827c23bef3a8ccc102895f55b7632074241f9684 (diff) |
Replace static PBD::Signal in NoteBase with direct call to MidiRegionView
NoteBaseDeleted signal is static so each MidiRegionView(MRV) gets notified
about the deletion of each NodeBase instance even if it is contained in another
MRV
The NoteBase and MRV classes are currently coupled anyway, so this change uses
the reference to the MRV parent to directly call the parent when the NoteBase
is deleted. This is all in the GUI thread so I'm not sure why a PBD::Signal was
being used?
If the MRV class is the only reference holder to the NoteBase class
then I'm not sure if a callback is needed, perhaps the MRV should just remove
the note from the selection before deleting it but I'm not that familiar with
the code.
Signal emission/calls static NoteBaseDeleted signal vs direct with 10540
NoteBase instances.
static:
After Load Session: 6360638
After Unload Session: 12221026(5860388)
direct:
After load Session: 10540
After unload Session: 21080
Session Load/Unload time in master, debug/release with ~10000 Notes(seconds)
Load Debug: 32, 26
Unload Debug: 83
Load Release 32, 20, 42
Unload Release 26, 25
Session Load/Unload time with direct call debug/release(seconds)
Load Debug: 21.7, 18.1
Unload Debug: 69.4, 71
Load Release: 22.6, 13.4, 17.7
Unload Release: 24, 23.5
This is not a large Session, 1500 regions, 10000 notes so there is probably
some other funky stuff going on that needs fixing.
Diffstat (limited to 'gtk2_ardour/note_base.cc')
-rw-r--r-- | gtk2_ardour/note_base.cc | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/gtk2_ardour/note_base.cc b/gtk2_ardour/note_base.cc index 228a6dead7..feee7e7d7c 100644 --- a/gtk2_ardour/note_base.cc +++ b/gtk2_ardour/note_base.cc @@ -36,8 +36,6 @@ using namespace Gtkmm2ext; using ARDOUR::MidiModel; using namespace ArdourCanvas; -PBD::Signal1<void,NoteBase*> NoteBase::NoteBaseDeleted; - /// dividing the hue circle in 16 parts, hand adjusted for equal look, courtesy Thorsten Wilms const uint32_t NoteBase::midi_channel_colors[16] = { 0xd32d2dff, 0xd36b2dff, 0xd3972dff, 0xd3d12dff, @@ -62,7 +60,7 @@ NoteBase::NoteBase(MidiRegionView& region, bool with_events, const boost::shared NoteBase::~NoteBase() { - NoteBaseDeleted (this); + _region.note_deleted (this); delete _text; } |