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__
24 #include <sigc++/signal_system.h>
26 #include "time_selection.h"
27 #include "region_selection.h"
28 #include "track_selection.h"
29 #include "automation_selection.h"
30 #include "playlist_selection.h"
31 #include "redirect_selection.h"
32 #include "point_selection.h"
35 class AudioRegionView;
38 class Selection : public SigC::Object
46 TrackSelection tracks;
47 AudioRegionSelection audio_regions;
49 AutomationSelection lines;
50 PlaylistSelection playlists;
51 RedirectSelection redirects;
52 PointSelection points;
59 Selection& operator= (const Selection& other);
61 SigC::Signal0<void> RegionsChanged;
62 SigC::Signal0<void> TracksChanged;
63 SigC::Signal0<void> TimeChanged;
64 SigC::Signal0<void> LinesChanged;
65 SigC::Signal0<void> PlaylistsChanged;
66 SigC::Signal0<void> RedirectsChanged;
67 SigC::Signal0<void> PointsChanged;
72 void dump_region_layers();
74 bool selected (TimeAxisView*);
75 bool selected (AudioRegionView*);
77 void set (list<Selectable*>&);
78 void add (list<Selectable*>&);
80 void set (TimeAxisView*);
81 void set (const list<TimeAxisView*>&);
82 void set (AudioRegionView*);
83 void set (std::vector<AudioRegionView*>&);
84 long set (TimeAxisView*, jack_nframes_t, jack_nframes_t);
85 void set (ARDOUR::AutomationList*);
86 void set (ARDOUR::Playlist*);
87 void set (const list<ARDOUR::Playlist*>&);
88 void set (ARDOUR::Redirect*);
89 void set (AutomationSelectable*);
91 void add (TimeAxisView*);
92 void add (const list<TimeAxisView*>&);
93 void add (AudioRegionView*);
94 void add (std::vector<AudioRegionView*>&);
95 long add (jack_nframes_t, jack_nframes_t);
96 void add (ARDOUR::AutomationList*);
97 void add (ARDOUR::Playlist*);
98 void add (const list<ARDOUR::Playlist*>&);
99 void add (ARDOUR::Redirect*);
101 void remove (TimeAxisView*);
102 void remove (const list<TimeAxisView*>&);
103 void remove (AudioRegionView*);
104 void remove (uint32_t selection_id);
105 void remove (jack_nframes_t, jack_nframes_t);
106 void remove (ARDOUR::AutomationList*);
107 void remove (ARDOUR::Playlist*);
108 void remove (const list<ARDOUR::Playlist*>&);
109 void remove (ARDOUR::Redirect*);
111 void replace (uint32_t time_index, jack_nframes_t start, jack_nframes_t end);
113 void clear_audio_regions();
114 void clear_tracks ();
117 void clear_playlists ();
118 void clear_redirects ();
119 void clear_points ();
121 void foreach_audio_region (void (ARDOUR::AudioRegion::*method)(void));
122 void foreach_audio_region (void (ARDOUR::Region::*method)(void));
123 template<class A> void foreach_audio_region (void (ARDOUR::AudioRegion::*method)(A), A arg);
124 template<class A> void foreach_audio_region (void (ARDOUR::Region::*method)(A), A arg);
127 uint32_t next_time_id;
129 void add (vector<AutomationSelectable*>&);
132 bool operator==(const Selection& a, const Selection& b);
134 #endif /* __ardour_gtk_selection_h__ */