}
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) {
}
}
}
-
+
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)
{
add (ac);
}
+bool
+Selection::selected (Marker* m)
+{
+ return find (markers.begin(), markers.end(), m) != markers.end();
+}
+
bool
Selection::selected (TimeAxisView* tv)
{
MarkersChanged();
}
}
+
+void
+Selection::add (const list<Marker*>& m)
+{
+ markers.insert (markers.end(), m.begin(), m.end());
+ MarkersChanged ();
+}
+
+void
+MarkerSelection::range (nframes64_t& s, nframes64_t& e)
+{
+ s = max_frames;
+ e = 0;
+
+ for (MarkerSelection::iterator i = begin(); i != end(); ++i) {
+
+ if ((*i)->position() < s) {
+ s = (*i)->position();
+ }
+
+ if ((*i)->position() > e) {
+ e = (*i)->position();
+ }
+ }
+
+ s = std::min (s, e);
+ e = std::max (s, e);
+}