2009-12-13 14:09:52 -05:00
|
|
|
/*
|
|
|
|
Copyright (C) 2000-2009 Paul Davis
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2009-06-21 15:59:56 -04:00
|
|
|
#include <algorithm>
|
2016-07-06 13:37:30 -04:00
|
|
|
|
2009-12-13 14:09:52 -05:00
|
|
|
#include "ardour/route_group.h"
|
2016-07-06 13:37:30 -04:00
|
|
|
#include "control_protocol/control_protocol.h"
|
|
|
|
|
2009-06-21 15:59:56 -04:00
|
|
|
#include "track_selection.h"
|
2009-12-13 14:09:52 -05:00
|
|
|
#include "time_axis_view.h"
|
|
|
|
#include "public_editor.h"
|
2009-06-21 15:59:56 -04:00
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
2009-12-13 14:09:52 -05:00
|
|
|
TrackSelection::TrackSelection (PublicEditor const * e, TrackViewList const &t)
|
|
|
|
: TrackViewList (t)
|
|
|
|
, _editor (e)
|
2009-07-01 19:20:18 -04:00
|
|
|
{
|
2010-09-07 17:26:37 -04:00
|
|
|
}
|
2009-07-01 19:20:18 -04:00
|
|
|
|
2010-09-07 17:26:37 -04:00
|
|
|
TrackSelection::~TrackSelection ()
|
|
|
|
{
|
2009-07-01 19:20:18 -04:00
|
|
|
}
|
|
|
|
|
2009-12-13 14:09:52 -05:00
|
|
|
TrackViewList
|
|
|
|
TrackSelection::add (TrackViewList const & t)
|
2009-06-21 15:59:56 -04:00
|
|
|
{
|
2009-12-13 14:09:52 -05:00
|
|
|
TrackViewList added = TrackViewList::add (t);
|
2009-06-21 15:59:56 -04:00
|
|
|
|
|
|
|
for (TrackSelection::const_iterator i = t.begin(); i != t.end(); ++i) {
|
2009-12-13 14:09:52 -05:00
|
|
|
|
|
|
|
/* select anything in the same select-enabled route group */
|
|
|
|
ARDOUR::RouteGroup* rg = (*i)->route_group ();
|
2010-02-18 08:59:49 -05:00
|
|
|
if (rg && rg->is_active() && rg->is_select ()) {
|
2009-12-13 14:09:52 -05:00
|
|
|
TrackViewList tr = _editor->axis_views_from_routes (rg->route_list ());
|
|
|
|
for (TrackViewList::iterator j = tr.begin(); j != tr.end(); ++j) {
|
|
|
|
if (!contains (*j)) {
|
|
|
|
added.push_back (*j);
|
|
|
|
push_back (*j);
|
|
|
|
}
|
|
|
|
}
|
2009-06-21 15:59:56 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return added;
|
|
|
|
}
|