diff options
author | Robin Gareus <robin@gareus.org> | 2018-08-02 21:02:31 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2018-08-02 21:36:34 +0200 |
commit | cf39ebc966c3518411bebe85e499237b0c750817 (patch) | |
tree | 040c04edcd13235b482b67df50551cc1a2b832f4 /libs/ardour | |
parent | 50569eab784f23b0aba8b39963c7d100e8b56518 (diff) |
Add method to conveniently retrieve a sorted routelist
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/ardour/session.h | 2 | ||||
-rw-r--r-- | libs/ardour/luabindings.cc | 2 | ||||
-rw-r--r-- | libs/ardour/session.cc | 10 |
3 files changed, 14 insertions, 0 deletions
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 40cf8578cc..c4c7458670 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -284,6 +284,8 @@ public: boost::shared_ptr<RTTaskList> rt_tasklist () { return _rt_tasklist; } + RouteList get_routelist (bool mixer_order = false) const; + CoreSelection& selection () { return *_selection; } /* because the set of Stripables consists of objects managed diff --git a/libs/ardour/luabindings.cc b/libs/ardour/luabindings.cc index 7866dcb271..d82fb38bc6 100644 --- a/libs/ardour/luabindings.cc +++ b/libs/ardour/luabindings.cc @@ -2234,6 +2234,8 @@ LuaBindings::common (lua_State* L) .addFunction ("get_routes", &Session::get_routes) .addFunction ("get_tracks", &Session::get_tracks) .addFunction ("get_stripables", (StripableList (Session::*)() const)&Session::get_stripables) + .addFunction ("get_routelist", &Session::get_routelist) + .addFunction ("name", &Session::name) .addFunction ("path", &Session::path) .addFunction ("record_status", &Session::record_status) diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 789c313ae6..8b3ad8af95 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -4313,6 +4313,16 @@ Session::get_stripables () const return rv; } +RouteList +Session::get_routelist (bool mixer_order) const +{ + boost::shared_ptr<RouteList> r = routes.reader (); + RouteList rv; + rv.insert (rv.end(), r->begin(), r->end()); + rv.sort (Stripable::Sorter (mixer_order)); + return rv; +} + boost::shared_ptr<RouteList> Session::get_routes_with_internal_returns() const { |