triggerbox: change entire UI side to avoid using TriggerPtr

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.
This commit is contained in:
Paul Davis 2021-12-24 14:13:36 -07:00
parent 401411d5c3
commit c18823c0e0
16 changed files with 109 additions and 99 deletions

View file

@ -37,7 +37,7 @@ public:
TriggerPropertiesBox () {}
~TriggerPropertiesBox () {}
virtual void set_trigger (ARDOUR::TriggerPtr) = 0;
virtual void set_trigger (ARDOUR::TriggerReference) = 0;
};
class AudioTriggerPropertiesBox : public TriggerPropertiesBox
@ -46,7 +46,7 @@ public:
AudioTriggerPropertiesBox ();
~AudioTriggerPropertiesBox ();
void set_trigger (ARDOUR::TriggerPtr);
void set_trigger (ARDOUR::TriggerReference);
void set_session (ARDOUR::Session*);
@ -58,7 +58,7 @@ protected:
Gtk::Label _header_label;
private:
boost::shared_ptr<ARDOUR::AudioTrigger> _trigger;
ARDOUR::TriggerReference tref;
Gtk::Table _table;
Gtk::Label _abpm_label;