summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-10-10 16:57:20 +0200
committerRobin Gareus <robin@gareus.org>2016-10-10 17:34:18 +0200
commit4f8fdf0af7272cfcf62f40229db35b86fe9a32e0 (patch)
treeb2054c231f27f48c642f4cc510f9f74f23cb4431 /libs/ardour
parent8d710a5f8a30ebf32d68b487a2bf20e2c8e534ce (diff)
Allow to get a route reference from SessionObject*
The motivation is to allow a Processor (here Lua) to get a pointer to the owning Route without resorting to iterative lookup.
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/ardour/route.h2
-rw-r--r--libs/ardour/route.cc5
2 files changed, 7 insertions, 0 deletions
diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h
index 6c57263393..ea783cadca 100644
--- a/libs/ardour/ardour/route.h
+++ b/libs/ardour/ardour/route.h
@@ -378,6 +378,8 @@ public:
XMLNode& get_processor_state ();
virtual void set_processor_state (const XMLNode&);
+ boost::weak_ptr<Route> weakroute ();
+
int save_as_template (const std::string& path, const std::string& name);
PBD::Signal1<void,void*> SelectedChanged;
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index 3d34b92d2c..c15877b28b 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -117,6 +117,11 @@ Route::Route (Session& sess, string name, PresentationInfo::Flag flag, DataType
processor_max_streams.reset();
}
+boost::weak_ptr<Route>
+Route::weakroute () {
+ return boost::weak_ptr<Route> (shared_from_this ());
+}
+
int
Route::init ()
{