X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Ftrack_selection.h;h=8c7aac45c4776b1c01bf5ba1167dacab8e082f55;hb=ea5d75a05b76c8e61e2261521339e385d81094d0;hp=53f59e67cf98393a1e6ce18b288beb5bdc5dfa28;hpb=87726495c30f90554b5204b5385d17274a8fe93e;p=ardour.git diff --git a/gtk2_ardour/track_selection.h b/gtk2_ardour/track_selection.h index 53f59e67cf..8c7aac45c4 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,83 @@ #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 list {}; +class TrackSelection : public TrackViewList +{ +public: + TrackSelection (PublicEditor const * e) : _editor (e) {} + TrackSelection (PublicEditor const *, TrackViewList const &); + + virtual ~TrackSelection (); + + 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(); ) { + iterator tmp = i; + ++tmp; + + RouteUI* t = dynamic_cast (*i); + if (t) { + f (t); + } + i = tmp; + } + } + + template + void foreach_route_time_axis (Function f) { + for (iterator i = begin(); i != end(); ) { + iterator tmp = i; + ++tmp; + RouteTimeAxisView* t = dynamic_cast (*i); + if (t) { + f (t); + } + i = tmp; + } + } + + template + void foreach_audio_time_axis (Function f) { + for (iterator i = begin(); i != end(); ) { + iterator tmp = i; + ++tmp; + AudioTimeAxisView* t = dynamic_cast (*i); + if (t) { + f (t); + } + i = tmp; + } + } + + template + void foreach_midi_time_axis (Function f) { + for (iterator i = begin(); i != end(); ) { + iterator tmp = i; + ++tmp; + MidiTimeAxisView* t = dynamic_cast (*i); + if (t) { + f (t); + } + i = tmp; + } + } + +private: + PublicEditor const * _editor; +}; #endif /* __ardour_gtk_track_selection_h__ */