ardour
region_selection.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2006 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 
19 #ifndef __ardour_gtk_region_selection_h__
20 #define __ardour_gtk_region_selection_h__
21 
22 #include <set>
23 #include <list>
24 
25 #include "pbd/signals.h"
26 #include "ardour/types.h"
27 
28 namespace ARDOUR {
29  class Playlist;
30 }
31 
32 class RegionView;
33 class TimeAxisView;
34 
37 class RegionSelection : public std::list<RegionView*>
38 {
39  public:
42 
44 
45  bool add (RegionView*);
46  bool remove (RegionView*);
48 
49  bool contains (RegionView*) const;
50  bool involves (const TimeAxisView&) const;
51 
52  void clear_all();
53 
54  framepos_t start () const;
55 
56  /* "end" collides with list<>::end */
57 
58  framepos_t end_frame () const;
59 
60  const std::list<RegionView *>& by_layer() const { return _bylayer; }
61  void by_position (std::list<RegionView*>&) const;
62  void by_track (std::list<RegionView*>&) const;
63 
64  size_t n_midi_regions() const;
65 
66  std::set<boost::shared_ptr<ARDOUR::Playlist> > playlists () const;
67  std::list<PBD::ID> pending;
68 
69  private:
70  void remove_it (RegionView*);
71 
72  void add_to_layer (RegionView *);
73 
74  std::list<RegionView *> _bylayer;
76 };
77 
78 #endif /* __ardour_gtk_region_selection_h__ */
bool add(RegionView *)
std::list< PBD::ID > pending
void by_track(std::list< RegionView * > &) const
void sort_by_position_and_track()
framepos_t end_frame() const
void remove_it(RegionView *)
size_t n_midi_regions() const
void by_position(std::list< RegionView * > &) const
bool contains(RegionView *) const
const std::list< RegionView * > & by_layer() const
RegionSelection & operator=(const RegionSelection &)
Definition: amp.h:29
bool involves(const TimeAxisView &) const
std::set< boost::shared_ptr< ARDOUR::Playlist > > playlists() const
std::list< RegionView * > _bylayer
list of regions sorted by layer
framepos_t start() const
int64_t framepos_t
PBD::ScopedConnection death_connection
void add_to_layer(RegionView *)