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>
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.
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.
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.
23 #ifndef __ardour_gtk_region_selection_h__
24 #define __ardour_gtk_region_selection_h__
29 #include "pbd/signals.h"
30 #include "ardour/types.h"
39 /** Class to represent list of selected regions.
41 class RegionSelection : public std::list<RegionView*>
45 RegionSelection (const RegionSelection&);
47 RegionSelection& operator= (const RegionSelection&);
49 bool add (RegionView*);
50 bool remove (RegionView*);
51 void sort_by_position_and_track ();
53 bool contains (RegionView*) const;
54 bool contains (boost::shared_ptr<ARDOUR::Region>) const;
55 bool involves (const TimeAxisView&) const;
59 samplepos_t start () const;
61 /* "end" collides with list<>::end */
63 samplepos_t end_sample () const;
65 const std::list<RegionView *>& by_layer() const { return _bylayer; }
66 void by_position (std::list<RegionView*>&) const;
67 void by_track (std::list<RegionView*>&) const;
69 size_t n_midi_regions() const;
71 std::set<boost::shared_ptr<ARDOUR::Playlist> > playlists () const;
72 std::list<PBD::ID> pending;
74 ARDOUR::RegionList regionlist () const;
77 void remove_it (RegionView*);
79 void add_to_layer (RegionView *);
81 std::list<RegionView *> _bylayer; ///< list of regions sorted by layer
82 PBD::ScopedConnection death_connection;
85 #endif /* __ardour_gtk_region_selection_h__ */