X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Ftrack_selection.h;h=5f85bcfd5866e73323abe38df7b104aeb3edfa9e;hb=40e2a6b16b47acf1f19a31f5e6d1cd463c45e1b6;hp=57b8469afba9ddd4d879839d0828ecad192cfadf;hpb=3b89d9eaa03406a5e03648f47734211f09b89d62;p=ardour.git diff --git a/gtk2_ardour/track_selection.h b/gtk2_ardour/track_selection.h index 57b8469afb..5f85bcfd58 100644 --- a/gtk2_ardour/track_selection.h +++ b/gtk2_ardour/track_selection.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2007 Paul Davis + Copyright (C) 2000-2009 Paul Davis 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 @@ -20,10 +20,72 @@ #ifndef __ardour_gtk_track_selection_h__ #define __ardour_gtk_track_selection_h__ -#include +#include "track_view_list.h" +#include "route_ui.h" +#include "audio_time_axis.h" +#include "midi_time_axis.h" -class TimeAxisView; +class PublicEditor; -struct TrackSelection : public std::list {}; +class TrackSelection : public TrackViewList +{ +public: + TrackSelection (PublicEditor const * e) : _editor (e) {} + TrackSelection (PublicEditor const *, TrackViewList const &); + + virtual ~TrackSelection (); + + TrackViewList add (TrackViewList const &); + + template + void foreach_time_axis (Function f) { + for (iterator i = begin(); i != end(); ++i) { + f (*i); + } + } + + template + void foreach_route_ui (Function f) { + for (iterator i = begin(); i != end(); ++i) { + RouteUI* t = dynamic_cast (*i); + if (t) { + f (t); + } + } + } + + template + void foreach_route_time_axis (Function f) { + for (iterator i = begin(); i != end(); ++i) { + RouteTimeAxisView* t = dynamic_cast (*i); + if (t) { + f (t); + } + } + } + + template + void foreach_audio_time_axis (Function f) { + for (iterator i = begin(); i != end(); ++i) { + AudioTimeAxisView* t = dynamic_cast (*i); + if (t) { + f (t); + } + } + } + + template + void foreach_midi_time_axis (Function f) { + for (iterator i = begin(); i != end(); ++i) { + MidiTimeAxisView* t = dynamic_cast (*i); + if (t) { + f (t); + } + } + } + +private: + PublicEditor const * _editor; +}; #endif /* __ardour_gtk_track_selection_h__ */