Add method to conveniently retrieve a sorted routelist

This commit is contained in:
Robin Gareus 2018-08-02 21:02:31 +02:00
parent 50569eab78
commit cf39ebc966
3 changed files with 14 additions and 0 deletions

View File

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

View File

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

View File

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