Ardour  9.0-pre0-582-g084a23a80d
track_view_list.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010-2011 David Robillard <d@drobilla.net>
3  * Copyright (C) 2013-2016 Robin Gareus <robin@gareus.org>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #pragma once
21 
22 #include "ardour/types.h" /* XXX is this here because of some Cocoa nonsense ? */
23 
24 #include <list>
25 #include <set>
26 
27 #include "route_ui.h"
28 #include "audio_time_axis.h"
29 #include "midi_time_axis.h"
30 
31 class TimeAxisView;
32 
33 class TrackViewList : public std::list<TimeAxisView*>
34 {
35 public:
37  TrackViewList (std::list<TimeAxisView*> const &);
38 
39  virtual ~TrackViewList ();
40 
41  virtual TrackViewList add (TrackViewList const &);
42  bool contains (TimeAxisView const *) const;
43 
46 
47  template <typename Function>
49  for (iterator i = begin(); i != end(); ++i) {
50  f (*i);
51  }
52  }
53 
54  template <typename Function>
56  for (iterator i = begin(); i != end(); ) {
57  iterator tmp = i;
58  ++tmp;
59 
60  RouteUI* t = dynamic_cast<RouteUI*> (*i);
61  if (t) {
62  f (t);
63  }
64  i = tmp;
65  }
66  }
67 
68  template <typename Function>
70  for (iterator i = begin(); i != end(); ) {
71  iterator tmp = i;
72  ++tmp;
73  StripableTimeAxisView* t = dynamic_cast<StripableTimeAxisView*> (*i);
74  if (t) {
75  f (t);
76  }
77  i = tmp;
78  }
79  }
80 
81  template <typename Function>
83  for (iterator i = begin(); i != end(); ) {
84  iterator tmp = i;
85  ++tmp;
86  RouteTimeAxisView* t = dynamic_cast<RouteTimeAxisView*> (*i);
87  if (t) {
88  f (t);
89  }
90  i = tmp;
91  }
92  }
93 
94  template <typename Function>
96  for (iterator i = begin(); i != end(); ) {
97  iterator tmp = i;
98  ++tmp;
99  AudioTimeAxisView* t = dynamic_cast<AudioTimeAxisView*> (*i);
100  if (t) {
101  f (t);
102  }
103  i = tmp;
104  }
105  }
106 
107  template <typename Function>
109  for (iterator i = begin(); i != end(); ) {
110  iterator tmp = i;
111  ++tmp;
112  MidiTimeAxisView* t = dynamic_cast<MidiTimeAxisView*> (*i);
113  if (t) {
114  f (t);
115  }
116  i = tmp;
117  }
118  }
119 };
120 
121 
void foreach_route_ui(Function f)
void foreach_audio_time_axis(Function f)
virtual TrackViewList add(TrackViewList const &)
void foreach_stripable_time_axis(Function f)
ARDOUR::RouteList routelist() const
void foreach_midi_time_axis(Function f)
TrackViewList filter_to_unique_playlists()
void foreach_route_time_axis(Function f)
TrackViewList(std::list< TimeAxisView * > const &)
bool contains(TimeAxisView const *) const
void foreach_time_axis(Function f)
virtual ~TrackViewList()
Function
Definition: gc.h:190
std::list< std::shared_ptr< Route > > RouteList