From 4f8fdf0af7272cfcf62f40229db35b86fe9a32e0 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 10 Oct 2016 16:57:20 +0200 Subject: [PATCH] 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. --- libs/ardour/ardour/route.h | 2 ++ libs/ardour/route.cc | 5 +++++ 2 files changed, 7 insertions(+) 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 weakroute (); + int save_as_template (const std::string& path, const std::string& name); PBD::Signal1 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::weakroute () { + return boost::weak_ptr (shared_from_this ()); +} + int Route::init () {