Updated config.guess file
[ardour.git] / gtk2_ardour / selection.h
1 /*
2     Copyright (C) 2000-2003 Paul Davis 
3
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.
8
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.
13
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.
17
18     $Id$
19 */
20
21 #ifndef __ardour_gtk_selection_h__
22 #define __ardour_gtk_selection_h__
23
24 #include <vector>
25
26 #include <sigc++/signal.h>
27
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"
35
36 class TimeAxisView;
37 class AudioRegionView;
38 class Selectable;
39
40 namespace ARDOUR {
41         class Region;
42         class AudioRegion;
43         class Playlist;
44         class Redirect;
45         class AutomationList;
46 }
47
48 class Selection : public sigc::trackable 
49 {
50   public:
51         enum SelectionType {
52                 Object = 0x1,
53                 Range = 0x2
54         };
55
56         enum Operation {
57                 Set,
58                 Toggle,
59                 Extend
60         };
61
62         TrackSelection       tracks;
63         AudioRegionSelection audio_regions;
64         TimeSelection        time;
65         AutomationSelection  lines;
66         PlaylistSelection    playlists;
67         RedirectSelection    redirects;
68         PointSelection       points;
69
70         Selection() {
71                 next_time_id = 0;
72                 clear();
73         }
74
75         Selection& operator= (const Selection& other);
76
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;
84
85         void clear ();
86         bool empty();
87
88         void dump_region_layers();
89
90         bool selected (TimeAxisView*);
91         bool selected (AudioRegionView*);
92
93         void set (list<Selectable*>&);
94         void add (list<Selectable*>&);
95         
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*);
106
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*);
116
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*);
126         
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*);
136
137         void replace (uint32_t time_index, jack_nframes_t start, jack_nframes_t end);
138         
139         void clear_audio_regions();
140         void clear_tracks ();
141         void clear_time();
142         void clear_lines ();
143         void clear_playlists ();
144         void clear_redirects ();
145         void clear_points ();
146
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);
151
152   private:
153         uint32_t next_time_id;
154
155         void add (std::vector<AutomationSelectable*>&);
156 };
157
158 bool operator==(const Selection& a, const Selection& b);
159
160 #endif /* __ardour_gtk_selection_h__ */