2 Copyright (C) 2000-2003 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 #ifndef __ardour_gtk_selection_templates_h__
22 #define __ardour_gtk_selection_templates_h__
24 /* these inlines require knowledge of Region and Route classes,
25 and so they are in a separate header file from selection.h to
26 avoid multiplying dependencies.
29 #include <ardour/region.h>
30 #include <ardour/audioregion.h>
32 #include "selection.h"
35 Selection::foreach_audio_region (void (ARDOUR::AudioRegion::*method)(void)) {
36 for (AudioRegionSelection::iterator i = audio_regions.begin(); i != audio_regions.end(); ++i) {
37 ((*i)->region.*(method))();
42 Selection::foreach_audio_region (void (ARDOUR::Region::*method)(void)) {
43 for (AudioRegionSelection::iterator i = audio_regions.begin(); i != audio_regions.end(); ++i) {
44 ((*i)->region.*(method))();
48 template<class A> inline void
49 Selection::foreach_audio_region (void (ARDOUR::AudioRegion::*method)(A), A arg) {
50 for (AudioRegionSelection::iterator i = audio_regions.begin(); i != audio_regions.end(); ++i) {
51 ((*i)->region.*(method))(arg);
55 template<class A> inline void
56 Selection::foreach_audio_region (void (ARDOUR::Region::*method)(A), A arg) {
57 for (AudioRegionSelection::iterator i = audio_regions.begin(); i != audio_regions.end(); ++i) {
58 ((*i)->region.*(method))(arg);
64 template<class A> inline void
65 Selection::foreach_route (void (ARDOUR::Route::*method)(A), A arg) {
66 for (list<ARDOUR::Route*>::iterator i = routes.begin(); i != routes.end(); ++i) {
67 ((*i)->region.*(method))(arg);
71 template<class A1, class A2> inline void
72 Selection::foreach_route (void (ARDOUR::Route::*method)(A1,A2), A1 arg1, A2 arg2) {
73 for (list<ARDOUR::Route*>::iterator i = routes.begin(); i != routes.end(); ++i) {
74 ((*i)->region.*(method))(arg1, arg2);
80 #endif /* __ardour_gtk_selection_templates_h__ */