summaryrefslogtreecommitdiff
path: root/gtk2_ardour/track_selection.cc
blob: d9c7f02e19b00ceabff2539a0666113ce24a0fac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <algorithm>
#include "track_selection.h"

using namespace std;

TrackSelection::TrackSelection (list<TimeAxisView*> const &t)
	: list<TimeAxisView*> (t)
{

}

list<TimeAxisView*>
TrackSelection::add (list<TimeAxisView*> const & t)
{
	list<TimeAxisView*> added;

	for (TrackSelection::const_iterator i = t.begin(); i != t.end(); ++i) {
		if (!contains (*i)) {
			added.push_back (*i);
			push_back (*i);
		}
	}

	return added;
}

bool
TrackSelection::contains (TimeAxisView const * t) const
{
	return find (begin(), end(), t) != end();
}