summaryrefslogtreecommitdiff
path: root/gtk2_ardour/selection.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2008-01-15 00:07:35 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2008-01-15 00:07:35 +0000
commit679e7fcffa01c2bb8d3a1e3a50d8a7f838976f99 (patch)
tree8a3c2ada03ab2d8cc65624cc17635ebc663abd88 /gtk2_ardour/selection.cc
parentcc607b9fb9d0f14ec2fe00366da3c7574874d06f (diff)
fix copy-drag SNAFU; fix shuffling playhead when zoom gets so low that rounding errors cause an iterative convergence on the "true" position if zoom-focus = playhead
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2914 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/selection.cc')
-rw-r--r--gtk2_ardour/selection.cc50
1 files changed, 33 insertions, 17 deletions
diff --git a/gtk2_ardour/selection.cc b/gtk2_ardour/selection.cc
index 2d35fa61aa..a647cbcb6e 100644
--- a/gtk2_ardour/selection.cc
+++ b/gtk2_ardour/selection.cc
@@ -329,32 +329,36 @@ Selection::add (TimeAxisView* track)
}
void
-Selection::add (const RegionSelection& rs)
+Selection::add (vector<RegionView*>& v)
{
- if (!rs.empty()) {
- regions.insert (regions.end(), rs.begin(), rs.end());
- RegionsChanged(); /* EMIT SIGNAL */
- }
-}
+ /* XXX This method or the add (const RegionSelection&) needs to go
+ */
-void
-Selection::add (RegionView* r)
-{
- if (find (regions.begin(), regions.end(), r) == regions.end()) {
- regions.add (r);
- if (Config->get_link_region_and_track_selection()) {
- add (&r->get_trackview());
+ bool changed = false;
+
+ for (vector<RegionView*>::iterator i = v.begin(); i != v.end(); ++i) {
+ if (find (regions.begin(), regions.end(), (*i)) == regions.end()) {
+ changed = regions.add ((*i));
+ if (Config->get_link_region_and_track_selection() && changed) {
+ add (&(*i)->get_trackview());
+ }
}
+ }
+
+ if (changed) {
RegionsChanged ();
}
}
void
-Selection::add (vector<RegionView*>& v)
+Selection::add (const RegionSelection& rs)
{
- bool changed = false;
+ /* XXX This method or the add (const vector<RegionView*>&) needs to go
+ */
- for (vector<RegionView*>::iterator i = v.begin(); i != v.end(); ++i) {
+ bool changed = false;
+
+ for (RegionSelection::const_iterator i = rs.begin(); i != rs.end(); ++i) {
if (find (regions.begin(), regions.end(), (*i)) == regions.end()) {
changed = regions.add ((*i));
if (Config->get_link_region_and_track_selection() && changed) {
@@ -362,12 +366,24 @@ Selection::add (vector<RegionView*>& v)
}
}
}
-
+
if (changed) {
RegionsChanged ();
}
}
+void
+Selection::add (RegionView* r)
+{
+ if (find (regions.begin(), regions.end(), r) == regions.end()) {
+ regions.add (r);
+ if (Config->get_link_region_and_track_selection()) {
+ add (&r->get_trackview());
+ }
+ RegionsChanged ();
+ }
+}
+
long
Selection::add (nframes_t start, nframes_t end)
{