From 61cade6d59118288e90a405e0f4fbc24d0108814 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 10 Dec 2009 03:25:32 +0000 Subject: drastic, deep and wide changes to make RouteGroup use boost::shared_ptr and boost::shared_ptr to better fit into emerging framework for "RT operations" ; torben's changes to MTC slaving code (sorry for bundling) git-svn-id: svn://localhost/ardour2/branches/3.0@6334 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/ardour/route_group.h | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'libs/ardour/ardour/route_group.h') diff --git a/libs/ardour/ardour/route_group.h b/libs/ardour/ardour/route_group.h index 0f71093377..996e8fee2f 100644 --- a/libs/ardour/ardour/route_group.h +++ b/libs/ardour/ardour/route_group.h @@ -25,6 +25,7 @@ #include #include #include + #include "pbd/stateful.h" #include "ardour/types.h" @@ -53,6 +54,7 @@ public: }; RouteGroup (Session& s, const std::string &n, Flag f = Flag(0), Property p = Property(0)); + ~RouteGroup (); const std::string& name() { return _name; } void set_name (std::string str); @@ -60,13 +62,12 @@ public: bool is_active () const { return _flags & Active; } bool is_relative () const { return _flags & Relative; } bool is_hidden () const { return _flags & Hidden; } - bool empty() const {return routes.empty();} + bool empty() const {return routes->empty();} + size_t size() const { return routes->size();} gain_t get_max_factor(gain_t factor); gain_t get_min_factor(gain_t factor); - int size() { return routes.size();} - void set_active (bool yn, void *src); void set_relative (bool yn, void *src); void set_hidden (bool yn, void *src); @@ -86,24 +87,23 @@ public: } } - int add (Route *); - - int remove (Route *); + int add (boost::shared_ptr); + int remove (boost::shared_ptr); void apply (void (Route::*func)(void *), void *src) { - for (std::list::iterator i = routes.begin(); i != routes.end(); i++) { - ((*i)->*func)(src); + for (RouteList::iterator i = routes->begin(); i != routes->end(); i++) { + ((*i).get()->*func)(src); } } template void apply (void (Route::*func)(T, void *), T val, void *src) { - for (std::list::iterator i = routes.begin(); i != routes.end(); i++) { - ((*i)->*func)(val, src); + for (RouteList::iterator i = routes->begin(); i != routes->end(); i++) { + ((*i).get()->*func)(val, src); } } template void foreach_route (T *obj, void (T::*func)(Route&)) { - for (std::list::iterator i = routes.begin(); i != routes.end(); i++) { + for (RouteList::iterator i = routes->begin(); i != routes->end(); i++) { (obj->*func)(**i); } } @@ -114,17 +114,18 @@ public: /* fills at_set with all members of the group that are AudioTracks */ - void audio_track_group (std::set& at_set); + void audio_track_group (std::set >& at_set); void clear () { - routes.clear (); + routes->clear (); changed(); } void make_subgroup (); void destroy_subgroup (); - const std::list& route_list() { return routes; } + boost::shared_ptr route_list() { return routes; } + boost::shared_ptr route_list (Property forProperty); sigc::signal changed; sigc::signal FlagsChanged; @@ -135,13 +136,13 @@ public: private: Session& _session; - std::list routes; + boost::shared_ptr routes; boost::shared_ptr subgroup_bus; std::string _name; Flag _flags; Property _properties; - void remove_when_going_away (Route*); + void remove_when_going_away (boost::weak_ptr); int set_state_2X (const XMLNode&, int); }; -- cgit v1.2.3