2 Copyright (C) 2000-2003 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #ifndef __ardour_gtk_selection_h__
22 #define __ardour_gtk_selection_h__
26 #include <sigc++/signal.h>
28 #include "time_selection.h"
29 #include "region_selection.h"
30 #include "track_selection.h"
31 #include "automation_selection.h"
32 #include "playlist_selection.h"
33 #include "redirect_selection.h"
34 #include "point_selection.h"
37 class AudioRegionView;
48 class Selection : public sigc::trackable
62 TrackSelection tracks;
63 AudioRegionSelection audio_regions;
65 AutomationSelection lines;
66 PlaylistSelection playlists;
67 RedirectSelection redirects;
68 PointSelection points;
75 Selection& operator= (const Selection& other);
77 sigc::signal<void> RegionsChanged;
78 sigc::signal<void> TracksChanged;
79 sigc::signal<void> TimeChanged;
80 sigc::signal<void> LinesChanged;
81 sigc::signal<void> PlaylistsChanged;
82 sigc::signal<void> RedirectsChanged;
83 sigc::signal<void> PointsChanged;
88 void dump_region_layers();
90 bool selected (TimeAxisView*);
91 bool selected (AudioRegionView*);
93 void set (list<Selectable*>&);
94 void add (list<Selectable*>&);
96 void set (TimeAxisView*);
97 void set (const list<TimeAxisView*>&);
98 void set (AudioRegionView*);
99 void set (std::vector<AudioRegionView*>&);
100 long set (TimeAxisView*, jack_nframes_t, jack_nframes_t);
101 void set (ARDOUR::AutomationList*);
102 void set (ARDOUR::Playlist*);
103 void set (const list<ARDOUR::Playlist*>&);
104 void set (ARDOUR::Redirect*);
105 void set (AutomationSelectable*);
107 void toggle (TimeAxisView*);
108 void toggle (const list<TimeAxisView*>&);
109 void toggle (AudioRegionView*);
110 void toggle (std::vector<AudioRegionView*>&);
111 long toggle (jack_nframes_t, jack_nframes_t);
112 void toggle (ARDOUR::AutomationList*);
113 void toggle (ARDOUR::Playlist*);
114 void toggle (const list<ARDOUR::Playlist*>&);
115 void toggle (ARDOUR::Redirect*);
117 void add (TimeAxisView*);
118 void add (const list<TimeAxisView*>&);
119 void add (AudioRegionView*);
120 void add (std::vector<AudioRegionView*>&);
121 long add (jack_nframes_t, jack_nframes_t);
122 void add (ARDOUR::AutomationList*);
123 void add (ARDOUR::Playlist*);
124 void add (const list<ARDOUR::Playlist*>&);
125 void add (ARDOUR::Redirect*);
127 void remove (TimeAxisView*);
128 void remove (const list<TimeAxisView*>&);
129 void remove (AudioRegionView*);
130 void remove (uint32_t selection_id);
131 void remove (jack_nframes_t, jack_nframes_t);
132 void remove (ARDOUR::AutomationList*);
133 void remove (ARDOUR::Playlist*);
134 void remove (const list<ARDOUR::Playlist*>&);
135 void remove (ARDOUR::Redirect*);
137 void replace (uint32_t time_index, jack_nframes_t start, jack_nframes_t end);
139 void clear_audio_regions();
140 void clear_tracks ();
143 void clear_playlists ();
144 void clear_redirects ();
145 void clear_points ();
147 void foreach_audio_region (void (ARDOUR::AudioRegion::*method)(void));
148 void foreach_audio_region (void (ARDOUR::Region::*method)(void));
149 template<class A> void foreach_audio_region (void (ARDOUR::AudioRegion::*method)(A), A arg);
150 template<class A> void foreach_audio_region (void (ARDOUR::Region::*method)(A), A arg);
153 uint32_t next_time_id;
155 void add (std::vector<AutomationSelectable*>&);
158 bool operator==(const Selection& a, const Selection& b);
160 #endif /* __ardour_gtk_selection_h__ */