2007-04-26 16:54:31 -04:00
|
|
|
/*
|
2009-12-13 14:09:52 -05:00
|
|
|
Copyright (C) 2000-2009 Paul Davis
|
2007-04-26 16:54:31 -04:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
#ifndef __ardour_gtk_track_selection_h__
|
|
|
|
#define __ardour_gtk_track_selection_h__
|
|
|
|
|
2009-12-13 14:09:52 -05:00
|
|
|
#include "track_view_list.h"
|
2011-02-22 20:03:51 -05:00
|
|
|
#include "route_ui.h"
|
2011-02-22 21:08:46 -05:00
|
|
|
#include "audio_time_axis.h"
|
2011-03-07 08:04:46 -05:00
|
|
|
#include "midi_time_axis.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-12-13 14:09:52 -05:00
|
|
|
class PublicEditor;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-12-13 14:09:52 -05:00
|
|
|
class TrackSelection : public TrackViewList
|
2009-06-21 15:59:56 -04:00
|
|
|
{
|
|
|
|
public:
|
2009-12-13 14:09:52 -05:00
|
|
|
TrackSelection (PublicEditor const * e) : _editor (e) {}
|
|
|
|
TrackSelection (PublicEditor const *, TrackViewList const &);
|
2010-09-07 17:26:37 -04:00
|
|
|
|
|
|
|
virtual ~TrackSelection ();
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2009-12-13 14:09:52 -05:00
|
|
|
TrackViewList add (TrackViewList const &);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2011-02-22 20:04:10 -05:00
|
|
|
template <typename Function>
|
|
|
|
void foreach_time_axis (Function f) {
|
|
|
|
for (iterator i = begin(); i != end(); ++i) {
|
|
|
|
f (*i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-02-22 20:03:51 -05:00
|
|
|
template <typename Function>
|
|
|
|
void foreach_route_ui (Function f) {
|
|
|
|
for (iterator i = begin(); i != end(); ++i) {
|
|
|
|
RouteUI* t = dynamic_cast<RouteUI*> (*i);
|
2011-03-07 08:04:46 -05:00
|
|
|
if (t) {
|
|
|
|
f (t);
|
|
|
|
}
|
2011-02-22 20:03:51 -05:00
|
|
|
}
|
|
|
|
}
|
2011-02-22 21:08:46 -05:00
|
|
|
|
2011-02-22 21:08:57 -05:00
|
|
|
template <typename Function>
|
|
|
|
void foreach_route_time_axis (Function f) {
|
|
|
|
for (iterator i = begin(); i != end(); ++i) {
|
|
|
|
RouteTimeAxisView* t = dynamic_cast<RouteTimeAxisView*> (*i);
|
2011-03-07 08:04:46 -05:00
|
|
|
if (t) {
|
|
|
|
f (t);
|
|
|
|
}
|
2011-02-22 21:08:57 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-02-22 21:08:46 -05:00
|
|
|
template <typename Function>
|
|
|
|
void foreach_audio_time_axis (Function f) {
|
|
|
|
for (iterator i = begin(); i != end(); ++i) {
|
|
|
|
AudioTimeAxisView* t = dynamic_cast<AudioTimeAxisView*> (*i);
|
2011-03-07 08:04:46 -05:00
|
|
|
if (t) {
|
|
|
|
f (t);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
template <typename Function>
|
|
|
|
void foreach_midi_time_axis (Function f) {
|
|
|
|
for (iterator i = begin(); i != end(); ++i) {
|
|
|
|
MidiTimeAxisView* t = dynamic_cast<MidiTimeAxisView*> (*i);
|
|
|
|
if (t) {
|
|
|
|
f (t);
|
|
|
|
}
|
2011-02-22 21:08:46 -05:00
|
|
|
}
|
|
|
|
}
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2009-12-13 14:09:52 -05:00
|
|
|
private:
|
|
|
|
PublicEditor const * _editor;
|
2009-06-21 15:59:56 -04:00
|
|
|
};
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
#endif /* __ardour_gtk_track_selection_h__ */
|