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"
49 class Selection : public sigc::trackable
64 TrackSelection tracks;
65 RegionSelection regions;
67 AutomationSelection lines;
68 PlaylistSelection playlists;
69 RedirectSelection redirects;
70 PointSelection points;
77 Selection& operator= (const Selection& other);
79 sigc::signal<void> RegionsChanged;
80 sigc::signal<void> TracksChanged;
81 sigc::signal<void> TimeChanged;
82 sigc::signal<void> LinesChanged;
83 sigc::signal<void> PlaylistsChanged;
84 sigc::signal<void> RedirectsChanged;
85 sigc::signal<void> PointsChanged;
90 void dump_region_layers();
92 bool selected (TimeAxisView*);
93 bool selected (RegionView*);
95 void set (std::list<Selectable*>&);
96 void add (std::list<Selectable*>&);
97 void toggle (std::list<Selectable*>&);
99 void set (TimeAxisView*);
100 void set (const std::list<TimeAxisView*>&);
101 void set (RegionView*);
102 void set (std::vector<RegionView*>&);
103 long set (TimeAxisView*, nframes_t, nframes_t);
104 void set (ARDOUR::AutomationList*);
105 void set (boost::shared_ptr<ARDOUR::Playlist>);
106 void set (const std::list<boost::shared_ptr<ARDOUR::Playlist> >&);
107 void set (boost::shared_ptr<ARDOUR::Redirect>);
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 (boost::shared_ptr<ARDOUR::Redirect>);
119 void toggle (const std::vector<AutomationSelectable*>&);
121 void add (TimeAxisView*);
122 void add (const std::list<TimeAxisView*>&);
123 void add (RegionView*);
124 void add (std::vector<RegionView*>&);
125 long add (nframes_t, nframes_t);
126 void add (ARDOUR::AutomationList*);
127 void add (boost::shared_ptr<ARDOUR::Playlist>);
128 void add (const std::list<boost::shared_ptr<ARDOUR::Playlist> >&);
129 void add (boost::shared_ptr<ARDOUR::Redirect>);
131 void remove (TimeAxisView*);
132 void remove (const std::list<TimeAxisView*>&);
133 void remove (RegionView*);
134 void remove (uint32_t selection_id);
135 void remove (nframes_t, nframes_t);
136 void remove (ARDOUR::AutomationList*);
137 void remove (boost::shared_ptr<ARDOUR::Playlist>);
138 void remove (const std::list<boost::shared_ptr<ARDOUR::Playlist> >&);
139 void remove (boost::shared_ptr<ARDOUR::Redirect>);
140 void remove (const list<Selectable*>&);
142 void replace (uint32_t time_index, nframes_t start, nframes_t end);
144 void clear_regions();
145 void clear_tracks ();
148 void clear_playlists ();
149 void clear_redirects ();
150 void clear_points ();
152 void foreach_region (void (ARDOUR::Region::*method)(void));
153 template<class A> void foreach_region (void (ARDOUR::Region::*method)(A), A arg);
156 uint32_t next_time_id;
158 void add (std::vector<AutomationSelectable*>&);
161 bool operator==(const Selection& a, const Selection& b);
163 #endif /* __ardour_gtk_selection_h__ */