mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 03:36:32 +01:00
Revert "WebSockets: properly release strips and plugins when removed"
This reverts commit f007ba6b46.
This commit is contained in:
parent
aa69fe49f5
commit
dfe2270c9f
2 changed files with 13 additions and 76 deletions
|
|
@ -115,20 +115,7 @@ int
|
||||||
ArdourFeedback::stop ()
|
ArdourFeedback::stop ()
|
||||||
{
|
{
|
||||||
_periodic_connection.disconnect ();
|
_periodic_connection.disconnect ();
|
||||||
_transport_connections.drop_connections ();
|
_signal_connections.drop_connections ();
|
||||||
|
|
||||||
for (StripConnectionMap::iterator it = _strip_connections.begin (); it != _strip_connections.end(); ++it) {
|
|
||||||
it->second->drop_connections ();
|
|
||||||
}
|
|
||||||
|
|
||||||
_strip_connections.clear();
|
|
||||||
|
|
||||||
for (PluginConnectionMap::iterator it = _plugin_connections.begin (); it != _plugin_connections.end(); ++it) {
|
|
||||||
it->second->drop_connections ();
|
|
||||||
}
|
|
||||||
|
|
||||||
_plugin_connections.clear();
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -195,11 +182,11 @@ void
|
||||||
ArdourFeedback::observe_transport ()
|
ArdourFeedback::observe_transport ()
|
||||||
{
|
{
|
||||||
ARDOUR::Session& sess = session ();
|
ARDOUR::Session& sess = session ();
|
||||||
sess.TransportStateChange.connect (_transport_connections, MISSING_INVALIDATOR,
|
sess.TransportStateChange.connect (_signal_connections, MISSING_INVALIDATOR,
|
||||||
boost::bind<void> (TransportObserver (), this), event_loop ());
|
boost::bind<void> (TransportObserver (), this), event_loop ());
|
||||||
sess.RecordStateChanged.connect (_transport_connections, MISSING_INVALIDATOR,
|
sess.RecordStateChanged.connect (_signal_connections, MISSING_INVALIDATOR,
|
||||||
boost::bind<void> (RecordStateObserver (), this), event_loop ());
|
boost::bind<void> (RecordStateObserver (), this), event_loop ());
|
||||||
sess.tempo_map ().PropertyChanged.connect (_transport_connections, MISSING_INVALIDATOR,
|
sess.tempo_map ().PropertyChanged.connect (_signal_connections, MISSING_INVALIDATOR,
|
||||||
boost::bind<void> (TempoObserver (), this), event_loop ());
|
boost::bind<void> (TempoObserver (), this), event_loop ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -209,23 +196,16 @@ ArdourFeedback::observe_mixer ()
|
||||||
for (uint32_t strip_n = 0; strip_n < mixer ().strip_count (); ++strip_n) {
|
for (uint32_t strip_n = 0; strip_n < mixer ().strip_count (); ++strip_n) {
|
||||||
boost::shared_ptr<Stripable> strip = mixer ().nth_strip (strip_n);
|
boost::shared_ptr<Stripable> strip = mixer ().nth_strip (strip_n);
|
||||||
|
|
||||||
std::unique_ptr<PBD::ScopedConnectionList> connections (new PBD::ScopedConnectionList());
|
strip->gain_control ()->Changed.connect (_signal_connections, MISSING_INVALIDATOR,
|
||||||
|
|
||||||
strip->gain_control ()->Changed.connect (*connections, MISSING_INVALIDATOR,
|
|
||||||
boost::bind<void> (StripGainObserver (), this, strip_n), event_loop ());
|
boost::bind<void> (StripGainObserver (), this, strip_n), event_loop ());
|
||||||
|
|
||||||
if (strip->pan_azimuth_control ()) {
|
if (strip->pan_azimuth_control ()) {
|
||||||
strip->pan_azimuth_control ()->Changed.connect (*connections, MISSING_INVALIDATOR,
|
strip->pan_azimuth_control ()->Changed.connect (_signal_connections, MISSING_INVALIDATOR,
|
||||||
boost::bind<void> (StripPanObserver (), this, strip_n), event_loop ());
|
boost::bind<void> (StripPanObserver (), this, strip_n), event_loop ());
|
||||||
}
|
}
|
||||||
|
|
||||||
strip->mute_control ()->Changed.connect (*connections, MISSING_INVALIDATOR,
|
strip->mute_control ()->Changed.connect (_signal_connections, MISSING_INVALIDATOR,
|
||||||
boost::bind<void> (StripMuteObserver (), this, strip_n), event_loop ());
|
boost::bind<void> (StripMuteObserver (), this, strip_n), event_loop ());
|
||||||
|
|
||||||
strip->DropReferences.connect (*connections, MISSING_INVALIDATOR,
|
|
||||||
boost::bind (&ArdourFeedback::on_drop_strip, this, strip_n), event_loop ());
|
|
||||||
|
|
||||||
_strip_connections[strip_n] = std::move (connections);
|
|
||||||
|
|
||||||
observe_strip_plugins (strip_n, strip);
|
observe_strip_plugins (strip_n, strip);
|
||||||
}
|
}
|
||||||
|
|
@ -240,22 +220,15 @@ ArdourFeedback::observe_strip_plugins (uint32_t strip_n, boost::shared_ptr<ARDOU
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t bypass = insert->plugin ()->designated_bypass_port ();
|
uint32_t bypass = insert->plugin ()->designated_bypass_port ();
|
||||||
Evoral::Parameter param = Evoral::Parameter (PluginAutomation, 0, bypass);
|
Evoral::Parameter param = Evoral::Parameter (PluginAutomation, 0, bypass);
|
||||||
boost::shared_ptr<AutomationControl> control = insert->automation_control (param);
|
boost::shared_ptr<AutomationControl> control = insert->automation_control (param);
|
||||||
std::unique_ptr<PBD::ScopedConnectionList> connections (new PBD::ScopedConnectionList());
|
|
||||||
|
|
||||||
if (control) {
|
if (control) {
|
||||||
control->Changed.connect (*connections, MISSING_INVALIDATOR,
|
control->Changed.connect (_signal_connections, MISSING_INVALIDATOR,
|
||||||
boost::bind<void> (PluginBypassObserver (), this, strip_n, plugin_n), event_loop ());
|
boost::bind<void> (PluginBypassObserver (), this, strip_n, plugin_n), event_loop ());
|
||||||
}
|
}
|
||||||
|
|
||||||
insert->DropReferences.connect (*connections, MISSING_INVALIDATOR,
|
|
||||||
boost::bind (&ArdourFeedback::on_drop_plugin, this, strip_n, plugin_n), event_loop ());
|
|
||||||
|
|
||||||
// assume each strip can hold up to 65535 plugins
|
|
||||||
_plugin_connections[(strip_n << 16) | plugin_n] = std::move (connections);
|
|
||||||
|
|
||||||
observe_strip_plugin_param_values (strip_n, plugin_n, insert);
|
observe_strip_plugin_param_values (strip_n, plugin_n, insert);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -274,35 +247,9 @@ ArdourFeedback::observe_strip_plugin_param_values (uint32_t strip_n,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
PBD::ScopedConnectionList *connections = _plugin_connections[(strip_n << 16) | plugin_n].get();
|
control->Changed.connect (_signal_connections, MISSING_INVALIDATOR,
|
||||||
|
|
||||||
control->Changed.connect (*connections, MISSING_INVALIDATOR,
|
|
||||||
boost::bind<void> (PluginParamValueObserver (), this, strip_n, plugin_n, param_n,
|
boost::bind<void> (PluginParamValueObserver (), this, strip_n, plugin_n, param_n,
|
||||||
boost::weak_ptr<AutomationControl>(control)),
|
boost::weak_ptr<AutomationControl>(control)),
|
||||||
event_loop ());
|
event_loop ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
ArdourFeedback::on_drop_strip (uint32_t strip_n)
|
|
||||||
{
|
|
||||||
for (uint32_t plugin_n = 0;; ++plugin_n) {
|
|
||||||
boost::shared_ptr<PluginInsert> insert = mixer ().strip_plugin_insert (strip_n, plugin_n);
|
|
||||||
if (!insert) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
on_drop_plugin (strip_n, plugin_n);
|
|
||||||
}
|
|
||||||
|
|
||||||
_strip_connections[strip_n]->drop_connections ();
|
|
||||||
_strip_connections.erase (strip_n);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ArdourFeedback::on_drop_plugin (uint32_t strip_n, uint32_t plugin_n)
|
|
||||||
{
|
|
||||||
uint32_t key = (strip_n << 16) | plugin_n;
|
|
||||||
_plugin_connections[key]->drop_connections ();
|
|
||||||
_plugin_connections.erase (key);
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@
|
||||||
#define _ardour_surface_websockets_feedback_h_
|
#define _ardour_surface_websockets_feedback_h_
|
||||||
|
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
#include <boost/unordered_map.hpp>
|
|
||||||
#include <glibmm/main.h>
|
#include <glibmm/main.h>
|
||||||
|
|
||||||
#include "component.h"
|
#include "component.h"
|
||||||
|
|
@ -43,15 +42,9 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Glib::Threads::Mutex _client_state_lock;
|
Glib::Threads::Mutex _client_state_lock;
|
||||||
PBD::ScopedConnectionList _transport_connections;
|
PBD::ScopedConnectionList _signal_connections;
|
||||||
sigc::connection _periodic_connection;
|
sigc::connection _periodic_connection;
|
||||||
|
|
||||||
typedef boost::unordered_map<uint32_t, std::unique_ptr<PBD::ScopedConnectionList>> StripConnectionMap;
|
|
||||||
StripConnectionMap _strip_connections;
|
|
||||||
|
|
||||||
typedef boost::unordered_map<uint32_t, std::unique_ptr<PBD::ScopedConnectionList>> PluginConnectionMap;
|
|
||||||
StripConnectionMap _plugin_connections; // also holds connections to parameters
|
|
||||||
|
|
||||||
bool poll () const;
|
bool poll () const;
|
||||||
|
|
||||||
void observe_transport ();
|
void observe_transport ();
|
||||||
|
|
@ -59,9 +52,6 @@ private:
|
||||||
void observe_strip_plugins (uint32_t, boost::shared_ptr<ARDOUR::Stripable>);
|
void observe_strip_plugins (uint32_t, boost::shared_ptr<ARDOUR::Stripable>);
|
||||||
void observe_strip_plugin_param_values (uint32_t, uint32_t,
|
void observe_strip_plugin_param_values (uint32_t, uint32_t,
|
||||||
boost::shared_ptr<ARDOUR::PluginInsert>);
|
boost::shared_ptr<ARDOUR::PluginInsert>);
|
||||||
|
|
||||||
void on_drop_strip (uint32_t);
|
|
||||||
void on_drop_plugin (uint32_t, uint32_t);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _ardour_surface_websockets_feedback_h_
|
#endif // _ardour_surface_websockets_feedback_h_
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue