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.
20 #ifndef __ardour_gtk_selection_h__
21 #define __ardour_gtk_selection_h__
24 #include <boost/shared_ptr.hpp>
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 "processor_selection.h"
34 #include "point_selection.h"
48 /// Lists of selected things
50 /** The Selection class holds lists of selected items (tracks, regions, etc. etc.). */
52 class Selection : public sigc::trackable
67 TrackSelection tracks;
68 RegionSelection regions;
70 AutomationSelection lines;
71 PlaylistSelection playlists;
72 PointSelection points;
79 Selection& operator= (const Selection& other);
81 sigc::signal<void> RegionsChanged;
82 sigc::signal<void> TracksChanged;
83 sigc::signal<void> TimeChanged;
84 sigc::signal<void> LinesChanged;
85 sigc::signal<void> PlaylistsChanged;
86 sigc::signal<void> PointsChanged;
91 void dump_region_layers();
93 bool selected (TimeAxisView*);
94 bool selected (RegionView*);
96 void set (std::list<Selectable*>&);
97 void add (std::list<Selectable*>&);
98 void toggle (std::list<Selectable*>&);
100 void set (TimeAxisView*);
101 void set (const std::list<TimeAxisView*>&);
102 void set (RegionView*);
103 void set (std::vector<RegionView*>&);
104 long set (TimeAxisView*, nframes_t, nframes_t);
105 void set (ARDOUR::AutomationList*);
106 void set (boost::shared_ptr<ARDOUR::Playlist>);
107 void set (const std::list<boost::shared_ptr<ARDOUR::Playlist> >&);
108 void set (AutomationSelectable*);
110 void toggle (TimeAxisView*);
111 void toggle (const std::list<TimeAxisView*>&);
112 void toggle (RegionView*);
113 void toggle (std::vector<RegionView*>&);
114 long toggle (nframes_t, nframes_t);
115 void toggle (ARDOUR::AutomationList*);
116 void toggle (boost::shared_ptr<ARDOUR::Playlist>);
117 void toggle (const std::list<boost::shared_ptr<ARDOUR::Playlist> >&);
118 void toggle (const std::vector<AutomationSelectable*>&);
120 void add (TimeAxisView*);
121 void add (const std::list<TimeAxisView*>&);
122 void add (RegionView*);
123 void add (std::vector<RegionView*>&);
124 long add (nframes_t, nframes_t);
125 void add (ARDOUR::AutomationList*);
126 void add (boost::shared_ptr<ARDOUR::Playlist>);
127 void add (const std::list<boost::shared_ptr<ARDOUR::Playlist> >&);
129 void remove (TimeAxisView*);
130 void remove (const std::list<TimeAxisView*>&);
131 void remove (RegionView*);
132 void remove (uint32_t selection_id);
133 void remove (nframes_t, nframes_t);
134 void remove (ARDOUR::AutomationList*);
135 void remove (boost::shared_ptr<ARDOUR::Playlist>);
136 void remove (const std::list<boost::shared_ptr<ARDOUR::Playlist> >&);
137 void remove (const list<Selectable*>&);
139 void replace (uint32_t time_index, nframes_t start, nframes_t end);
141 void clear_regions();
142 void clear_tracks ();
145 void clear_playlists ();
146 void clear_points ();
148 void foreach_region (void (ARDOUR::Region::*method)(void));
149 void foreach_regionview (void (RegionView::*method)(void));
150 template<class A> void foreach_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__ */