13
0

Vapor: sync automation state of multi-channel surround pans

This commit is contained in:
Robin Gareus 2024-01-29 22:23:42 +01:00
parent 2579bb6dd4
commit 11e508cbe6
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
3 changed files with 14 additions and 1 deletions

View File

@ -62,6 +62,7 @@ public:
void setup_visual_links ();
void sync_visual_link_to (std::shared_ptr<SurroundPannable>);
void sync_auto_state_with (std::shared_ptr<SurroundPannable>);
bool touching() const;

View File

@ -130,6 +130,12 @@ SurroundPannable::sync_visual_link_to (std::shared_ptr<SurroundPannable> other)
pan_pos_z->add_visually_linked_control (other->pan_pos_z);
}
void
SurroundPannable::sync_auto_state_with (std::shared_ptr<SurroundPannable> other)
{
other->pan_pos_x->alist()->automation_state_changed.connect_same_thread (*this, boost::bind (&SurroundPannable::control_auto_state_changed, this, _1));
}
void
SurroundPannable::foreach_pan_control (boost::function<void(std::shared_ptr<AutomationControl>)> f) const
{
@ -143,7 +149,7 @@ SurroundPannable::foreach_pan_control (boost::function<void(std::shared_ptr<Auto
void
SurroundPannable::control_auto_state_changed (AutoState new_state)
{
if (_responding_to_control_auto_state_change) {
if (_responding_to_control_auto_state_change || _auto_state == new_state) {
return;
}

View File

@ -228,6 +228,12 @@ SurroundSend::add_pannable ()
add_control (p->pan_size);
add_control (p->pan_snap);
add_control (p->binaural_render_mode);
for (uint32_t i = 0; i < _pannable.size (); ++i) {
_pannable[i]->sync_auto_state_with (p);
p->sync_auto_state_with (_pannable[i]);
}
_pannable.push_back (p);
_change_connections.drop_connections ();