2007-04-26 16:54:31 -04:00
|
|
|
/*
|
2019-08-02 17:26:43 -04:00
|
|
|
* Copyright (C) 2007-2017 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
* Copyright (C) 2009-2011 Carl Hetherington <carl@carlh.net>
|
|
|
|
* Copyright (C) 2009-2011 David Robillard <d@drobilla.net>
|
|
|
|
*
|
|
|
|
* 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.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
2007-04-26 16:54:31 -04:00
|
|
|
|
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
|
|
|
|
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) {
|
2014-06-30 11:02:23 -04:00
|
|
|
for (iterator i = begin(); i != end(); ) {
|
|
|
|
iterator tmp = i;
|
|
|
|
++tmp;
|
|
|
|
|
2011-02-22 20:03:51 -05:00
|
|
|
RouteUI* t = dynamic_cast<RouteUI*> (*i);
|
2011-03-07 08:04:46 -05:00
|
|
|
if (t) {
|
|
|
|
f (t);
|
|
|
|
}
|
2014-06-30 11:02:23 -04:00
|
|
|
i = tmp;
|
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) {
|
2014-06-30 11:02:23 -04:00
|
|
|
for (iterator i = begin(); i != end(); ) {
|
|
|
|
iterator tmp = i;
|
|
|
|
++tmp;
|
2011-02-22 21:08:57 -05:00
|
|
|
RouteTimeAxisView* t = dynamic_cast<RouteTimeAxisView*> (*i);
|
2011-03-07 08:04:46 -05:00
|
|
|
if (t) {
|
|
|
|
f (t);
|
|
|
|
}
|
2014-06-30 11:02:23 -04:00
|
|
|
i = tmp;
|
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) {
|
2014-06-30 11:02:23 -04:00
|
|
|
for (iterator i = begin(); i != end(); ) {
|
|
|
|
iterator tmp = i;
|
|
|
|
++tmp;
|
2011-02-22 21:08:46 -05:00
|
|
|
AudioTimeAxisView* t = dynamic_cast<AudioTimeAxisView*> (*i);
|
2011-03-07 08:04:46 -05:00
|
|
|
if (t) {
|
|
|
|
f (t);
|
|
|
|
}
|
2014-06-30 11:02:23 -04:00
|
|
|
i = tmp;
|
2011-03-07 08:04:46 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
template <typename Function>
|
|
|
|
void foreach_midi_time_axis (Function f) {
|
2014-06-30 11:02:23 -04:00
|
|
|
for (iterator i = begin(); i != end(); ) {
|
|
|
|
iterator tmp = i;
|
|
|
|
++tmp;
|
2011-03-07 08:04:46 -05:00
|
|
|
MidiTimeAxisView* t = dynamic_cast<MidiTimeAxisView*> (*i);
|
|
|
|
if (t) {
|
|
|
|
f (t);
|
|
|
|
}
|
2014-06-30 11:02:23 -04:00
|
|
|
i = tmp;
|
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__ */
|