13
0

Add API to define related controls

This is intended to show connected controls that share
automaton state, notably pannables
This commit is contained in:
Robin Gareus 2024-01-19 01:56:28 +01:00
parent 276adf292e
commit 32eb9b0520
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
3 changed files with 25 additions and 0 deletions

View File

@ -124,6 +124,14 @@ public:
AutomationControlList grouped_controls () const;
void add_visually_linked_control (std::shared_ptr<AutomationControl> ctrl) {
_visually_linked_ctrls.push_back (ctrl);
}
WeakAutomationControlList visually_linked_controls () const {
return _visually_linked_ctrls;
}
protected:
std::shared_ptr<ControlGroup> _group;
std::shared_ptr<ControlGroup> _pushed_group;
@ -150,6 +158,8 @@ protected:
void session_going_away ();
WeakAutomationControlList _visually_linked_ctrls;
private:
/* I am unclear on why we have to make ControlGroup a friend in order
to get access to the ::set_group() method when it is already

View File

@ -74,6 +74,13 @@ Pannable::Pannable (Session& s, Temporal::TimeDomainProvider const & tdp)
pan_width_control->Changed.connect_same_thread (*this, boost::bind (&Pannable::value_changed, this));
pan_frontback_control->Changed.connect_same_thread (*this, boost::bind (&Pannable::value_changed, this));
pan_lfe_control->Changed.connect_same_thread (*this, boost::bind (&Pannable::value_changed, this));
pan_azimuth_control->add_visually_linked_control (pan_width_control);
pan_azimuth_control->add_visually_linked_control (pan_elevation_control);
pan_width_control->add_visually_linked_control (pan_azimuth_control);
pan_width_control->add_visually_linked_control (pan_elevation_control);
pan_elevation_control->add_visually_linked_control (pan_azimuth_control);
pan_elevation_control->add_visually_linked_control (pan_width_control);
}
Pannable::~Pannable ()

View File

@ -94,6 +94,14 @@ SurroundPannable::SurroundPannable (Session& s, uint32_t chn, Temporal::TimeDoma
pan_pos_z->Changed.connect_same_thread (*this, boost::bind (&SurroundPannable::value_changed, this));
pan_size->Changed.connect_same_thread (*this, boost::bind (&SurroundPannable::value_changed, this));
pan_snap->Changed.connect_same_thread (*this, boost::bind (&SurroundPannable::value_changed, this));
/* all controls are visible together */
pan_pos_x->add_visually_linked_control (pan_pos_y);
pan_pos_x->add_visually_linked_control (pan_pos_z);
pan_pos_y->add_visually_linked_control (pan_pos_x);
pan_pos_y->add_visually_linked_control (pan_pos_z);
pan_pos_z->add_visually_linked_control (pan_pos_x);
pan_pos_z->add_visually_linked_control (pan_pos_y);
}
SurroundPannable::~SurroundPannable ()