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__
25 #include <boost/shared_ptr.hpp>
27 #include <sigc++/signal.h>
29 #include "time_selection.h"
30 #include "region_selection.h"
31 #include "track_selection.h"
32 #include "automation_selection.h"
33 #include "playlist_selection.h"
34 #include "redirect_selection.h"
35 #include "point_selection.h"
38 class AudioRegionView;
49 class Selection : public sigc::trackable
63 TrackSelection tracks;
64 AudioRegionSelection audio_regions;
66 AutomationSelection lines;
67 PlaylistSelection playlists;
68 RedirectSelection redirects;
69 PointSelection points;
76 Selection& operator= (const Selection& other);
78 sigc::signal<void> RegionsChanged;
79 sigc::signal<void> TracksChanged;
80 sigc::signal<void> TimeChanged;
81 sigc::signal<void> LinesChanged;
82 sigc::signal<void> PlaylistsChanged;
83 sigc::signal<void> RedirectsChanged;
84 sigc::signal<void> PointsChanged;
89 void dump_region_layers();
91 bool selected (TimeAxisView*);
92 bool selected (AudioRegionView*);
94 void set (list<Selectable*>&);
95 void add (list<Selectable*>&);
97 void set (TimeAxisView*);
98 void set (const list<TimeAxisView*>&);
99 void set (AudioRegionView*);
100 void set (std::vector<AudioRegionView*>&);
101 long set (TimeAxisView*, jack_nframes_t, jack_nframes_t);
102 void set (ARDOUR::AutomationList*);
103 void set (ARDOUR::Playlist*);
104 void set (const list<ARDOUR::Playlist*>&);
105 void set (boost::shared_ptr<ARDOUR::Redirect>);
106 void set (AutomationSelectable*);
108 void toggle (TimeAxisView*);
109 void toggle (const list<TimeAxisView*>&);
110 void toggle (AudioRegionView*);
111 void toggle (std::vector<AudioRegionView*>&);
112 long toggle (jack_nframes_t, jack_nframes_t);
113 void toggle (ARDOUR::AutomationList*);
114 void toggle (ARDOUR::Playlist*);
115 void toggle (const list<ARDOUR::Playlist*>&);
116 void toggle (boost::shared_ptr<ARDOUR::Redirect>);
118 void add (TimeAxisView*);
119 void add (const list<TimeAxisView*>&);
120 void add (AudioRegionView*);
121 void add (std::vector<AudioRegionView*>&);
122 long add (jack_nframes_t, jack_nframes_t);
123 void add (ARDOUR::AutomationList*);
124 void add (ARDOUR::Playlist*);
125 void add (const list<ARDOUR::Playlist*>&);
126 void add (boost::shared_ptr<ARDOUR::Redirect>);
128 void remove (TimeAxisView*);
129 void remove (const list<TimeAxisView*>&);
130 void remove (AudioRegionView*);
131 void remove (uint32_t selection_id);
132 void remove (jack_nframes_t, jack_nframes_t);
133 void remove (ARDOUR::AutomationList*);
134 void remove (ARDOUR::Playlist*);
135 void remove (const list<ARDOUR::Playlist*>&);
136 void remove (boost::shared_ptr<ARDOUR::Redirect>);
138 void replace (uint32_t time_index, jack_nframes_t start, jack_nframes_t end);
140 void clear_audio_regions();
141 void clear_tracks ();
144 void clear_playlists ();
145 void clear_redirects ();
146 void clear_points ();
148 void foreach_audio_region (void (ARDOUR::AudioRegion::*method)(void));
149 void foreach_audio_region (void (ARDOUR::Region::*method)(void));
150 template<class A> void foreach_audio_region (void (ARDOUR::AudioRegion::*method)(A), A arg);
151 template<class A> void foreach_audio_region (void (ARDOUR::Region::*method)(A), A arg);
154 uint32_t next_time_id;
156 void add (std::vector<AutomationSelectable*>&);
159 bool operator==(const Selection& a, const Selection& b);
161 #endif /* __ardour_gtk_selection_h__ */