Ardour  9.0-pre0-582-g084a23a80d
region_selection.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005 Taybin Rutkin <taybin@taybin.com>
3  * Copyright (C) 2006-2014 David Robillard <d@drobilla.net>
4  * Copyright (C) 2006-2017 Paul Davis <paul@linuxaudiosystems.com>
5  * Copyright (C) 2007-2011 Carl Hetherington <carl@carlh.net>
6  * Copyright (C) 2016-2017 Robin Gareus <robin@gareus.org>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with this program; if not, write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22 
23 #pragma once
24 
25 #include <set>
26 #include <list>
27 
28 #include "pbd/signals.h"
29 #include "ardour/types.h"
30 
31 namespace ARDOUR {
32  class Playlist;
33 }
34 
35 class RegionView;
36 class TimeAxisView;
37 
40 class RegionSelection : public std::list<RegionView*>
41 {
42 public:
45 
47 
48  bool add (RegionView*);
49  bool remove (RegionView*);
50  bool remove (std::vector<RegionView*>);
52 
53  bool contains (RegionView*) const;
54  bool contains (std::shared_ptr<ARDOUR::Region>) const;
55  bool involves (const TimeAxisView&) const;
56 
57  void clear_all();
58 
61 
62  const std::list<RegionView *>& by_layer() const { return _bylayer; }
63  void by_position (std::list<RegionView*>&) const;
64  void by_track (std::list<RegionView*>&) const;
65 
66  size_t n_midi_regions() const;
67 
69  std::list<PBD::ID> pending;
70 
72 
73 private:
75 
76  std::list<RegionView *> _bylayer;
77 };
78 
bool contains(std::shared_ptr< ARDOUR::Region >) const
Temporal::timepos_t end_time() const
Temporal::timepos_t start_time() const
bool remove(RegionView *)
ARDOUR::PlaylistSet playlists() const
void by_position(std::list< RegionView * > &) const
void add_to_layer(RegionView *)
const std::list< RegionView * > & by_layer() const
std::list< PBD::ID > pending
ARDOUR::RegionList regionlist() const
std::list< RegionView * > _bylayer
list of regions sorted by layer
void sort_by_position_and_track()
size_t n_midi_regions() const
void by_track(std::list< RegionView * > &) const
bool involves(const TimeAxisView &) const
bool add(RegionView *)
bool remove(std::vector< RegionView * >)
bool contains(RegionView *) const
RegionSelection(const RegionSelection &)
RegionSelection & operator=(const RegionSelection &)
std::list< std::shared_ptr< Region > > RegionList
std::set< std::shared_ptr< Playlist > > PlaylistSet