X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Ftrack_selection.h;h=5f85bcfd5866e73323abe38df7b104aeb3edfa9e;hb=40e2a6b16b47acf1f19a31f5e6d1cd463c45e1b6;hp=38032d6de304aa4a5e039fb8943b4a6802d94b65;hpb=bb9cc45cd22af67ac275a5e73accbe14fee664d8;p=ardour.git diff --git a/gtk2_ardour/track_selection.h b/gtk2_ardour/track_selection.h index 38032d6de3..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,18 +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; -class TrackSelection : public std::list +class TrackSelection : public TrackViewList { public: - TrackSelection () {} + TrackSelection (PublicEditor const * e) : _editor (e) {} + TrackSelection (PublicEditor const *, TrackViewList const &); - TrackSelection (std::list const &); - std::list add (std::list const &); - bool contains (TimeAxisView const *) 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__ */