+
+ //now compare our list with the current selection, and add or remove as necessary
+ //( NOTE: most mouse moves don't change the selection so we can't just SET it for every mouse move; it gets clunky )
+ TrackViewList tracks_to_add;
+ TrackViewList tracks_to_remove;
+ for (TrackViewList::const_iterator i = grouped_add.begin(); i != grouped_add.end(); ++i)
+ if ( !_editor->selection->tracks.contains ( *i ) )
+ tracks_to_add.push_back ( *i );
+ for (TrackViewList::const_iterator i = _editor->selection->tracks.begin(); i != _editor->selection->tracks.end(); ++i)
+ if ( !grouped_add.contains ( *i ) )
+ tracks_to_remove.push_back ( *i );
+ _editor->selection->add(tracks_to_add);
+ _editor->selection->remove(tracks_to_remove);
+