summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-10-14 11:12:50 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-10-14 11:12:50 -0400
commitd9058499afa3fc84a6746f290c4b87501a4dcb4b (patch)
tree8d2149818d082f488ed7ce7932fccc1c5a516958 /libs
parenta244075fb31868a9108202763dbd304ddc853a75 (diff)
add a back-pointer to the owner of a Processor
Use SessionObject* rather than Route so that per-region plugins will be possible in the future.
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/processor.h4
-rw-r--r--libs/ardour/processor.cc12
-rw-r--r--libs/ardour/route.cc4
3 files changed, 20 insertions, 0 deletions
diff --git a/libs/ardour/ardour/processor.h b/libs/ardour/ardour/processor.h
index 772ae3520d..18f13dbc78 100644
--- a/libs/ardour/ardour/processor.h
+++ b/libs/ardour/ardour/processor.h
@@ -113,6 +113,9 @@ class Processor : public SessionObject, public Automatable, public Latent
void set_ui (void*);
void* get_ui () const { return _ui_pointer; }
+ void set_owner (SessionObject*);
+ SessionObject* owner() const;
+
protected:
virtual int set_state_2X (const XMLNode&, int version);
@@ -125,6 +128,7 @@ protected:
bool _display_to_user;
bool _pre_fader; ///< true if this processor is currently placed before the Amp, otherwise false
void* _ui_pointer;
+ SessionObject* _owner;
};
} // namespace ARDOUR
diff --git a/libs/ardour/processor.cc b/libs/ardour/processor.cc
index 3f8fdf509d..f9590bee11 100644
--- a/libs/ardour/processor.cc
+++ b/libs/ardour/processor.cc
@@ -269,3 +269,15 @@ Processor::set_ui (void* p)
{
_ui_pointer = p;
}
+
+void
+Processor::set_owner (SessionObject* o)
+{
+ _owner = o;
+}
+
+SessionObject*
+Processor::owner() const
+{
+ return _owner;
+}
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index d0b2260c3d..f6af17b1b8 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -149,6 +149,7 @@ Route::init ()
*/
_meter.reset (new PeakMeter (_session, _name));
+ _meter->set_owner (this);
_meter->set_display_to_user (false);
_meter->activate ();
@@ -1011,6 +1012,7 @@ Route::add_processor (boost::shared_ptr<Processor> processor, boost::shared_ptr<
}
_processors.insert (loc, processor);
+ processor->set_owner (this);
// Set up processor list channels. This will set processor->[input|output]_streams(),
// configure redirect ports properly, etc.
@@ -1161,6 +1163,7 @@ Route::add_processors (const ProcessorList& others, boost::shared_ptr<Processor>
}
_processors.insert (loc, *i);
+ (*i)->set_owner (this);
if ((*i)->active()) {
(*i)->activate ();
@@ -2616,6 +2619,7 @@ Route::set_processor_state (const XMLNode& node)
for (ProcessorList::const_iterator i = _processors.begin(); i != _processors.end(); ++i) {
+ (*i)->set_owner (this);
(*i)->ActiveChanged.connect_same_thread (*this, boost::bind (&Session::update_latency_compensation, &_session, false));
boost::shared_ptr<PluginInsert> pi;