C++11 array initialization won't call copy constructor, leading to
an error: array initializer must be an initializer list.
Specifically this affects the copy c'tor: line 93: peaks (other.peaks)
A workaround is to use a vector instead of a fixed size array.
This fixes macOS builds.
Lifetime management of Triggers is unlike anything(?) we've dealt with in
Ardour so far. The parent object (Triggerbox) has a normal lifetime
pattern, but Triggers can come and go in a way that few other objects
do (although Processors and particularly PluginInsert are somewhat similar).
We do not want the GUI to hold references to the actual Triggers, because the
end of life of a Trigger is not really a signal for the GUI element to go
away (the Trigger will be replaced in the slot). Consequently, we do not
want TriggerPtr used as a member variable anywhere in the UI. Instead we use a
TriggerReference which can "lookup" a Trigger on-demand (by box and slot
number). The (G)UI now uses these exclusively.
Work still needed to pick up trigger swap signals from the boxen.
Uses a custom deleter for the shared_ptr<Trigger>'s that we create. Will
likely evolve to use an allocator so that we can use make_shared's
cousin allocate_shared().
We need to be able to construct Metrics after the ruler is constructed
in order to deal with Triggers which are potentially short-lived. We
stored the reference as a pointer anyway, so it's not as much of a change
as it appears.
This avoids creating a new Trigger with the correct state, and instead
sets the state of the current Trigger. Also change order of ::set_state() so
that the othe Trigger properties are set after the region is set. Setting the
region may set defaults that are no longer correct.