2009-06-21 15:59:56 -04:00
|
|
|
#include <algorithm>
|
|
|
|
#include "track_selection.h"
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
2009-07-09 13:58:13 -04:00
|
|
|
TrackSelection::TrackSelection (list<TimeAxisView*> const &t)
|
|
|
|
: list<TimeAxisView*> (t)
|
2009-07-01 19:20:18 -04:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2009-07-09 13:58:13 -04:00
|
|
|
list<TimeAxisView*>
|
|
|
|
TrackSelection::add (list<TimeAxisView*> const & t)
|
2009-06-21 15:59:56 -04:00
|
|
|
{
|
2009-07-09 13:58:13 -04:00
|
|
|
list<TimeAxisView*> added;
|
2009-06-21 15:59:56 -04:00
|
|
|
|
|
|
|
for (TrackSelection::const_iterator i = t.begin(); i != t.end(); ++i) {
|
2009-06-21 21:01:43 -04:00
|
|
|
if (!contains (*i)) {
|
2009-06-21 15:59:56 -04:00
|
|
|
added.push_back (*i);
|
|
|
|
push_back (*i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return added;
|
|
|
|
}
|
2009-06-21 21:01:43 -04:00
|
|
|
|
|
|
|
bool
|
2009-07-09 13:58:13 -04:00
|
|
|
TrackSelection::contains (TimeAxisView const * t) const
|
2009-06-21 21:01:43 -04:00
|
|
|
{
|
|
|
|
return find (begin(), end(), t) != end();
|
|
|
|
}
|