2 Copyright (C) 2002 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include <sigc++/bind.h>
22 #include "pbd/error.h"
24 #include "ardour/playlist.h"
25 #include "ardour/processor.h"
26 #include "ardour/route.h"
28 #include "route_processor_selection.h"
33 using namespace ARDOUR;
37 RouteRedirectSelection&
38 RouteRedirectSelection::operator= (const RouteRedirectSelection& other)
41 processors = other.processors;
42 routes = other.routes;
48 operator== (const RouteRedirectSelection& a, const RouteRedirectSelection& b)
50 // XXX MUST TEST PROCESSORS SOMEHOW
51 return a.routes == b.routes;
55 RouteRedirectSelection::clear ()
62 RouteRedirectSelection::clear_processors ()
69 RouteRedirectSelection::clear_routes ()
76 RouteRedirectSelection::add (XMLNode* node)
78 // XXX check for duplicate
79 processors.add (node);
84 RouteRedirectSelection::set (XMLNode* node)
87 processors.set (node);
92 RouteRedirectSelection::add (boost::shared_ptr<Route> r)
94 if (find (routes.begin(), routes.end(), r) == routes.end()) {
97 // XXX SHAREDPTR FIXME
98 // void (RouteRedirectSelection::*pmf)(Route*) = &RouteRedirectSelection::remove;
99 // r->GoingAway.connect (bind (mem_fun(*this, pmf), r));
106 RouteRedirectSelection::remove (boost::shared_ptr<Route> r)
108 list<boost::shared_ptr<Route> >::iterator i;
109 if ((i = find (routes.begin(), routes.end(), r)) != routes.end()) {
116 RouteRedirectSelection::set (boost::shared_ptr<Route> r)
123 RouteRedirectSelection::selected (boost::shared_ptr<Route> r)
125 return find (routes.begin(), routes.end(), r) != routes.end();
129 RouteRedirectSelection::empty ()
131 return processors.empty () && routes.empty ();