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.
This commit is contained in:
Robin Gareus
2016-10-10 16:57:20 +02:00
parent 8d710a5f8a
commit 4f8fdf0af7
2 changed files with 7 additions and 0 deletions

View File

@@ -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;

View File

@@ -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 ()
{