FINDING THINGS
**********************************************************************/
+boost::shared_ptr<RegionList>
+Playlist::region_list() {
+ RegionReadLock rlock (this);
+ boost::shared_ptr<RegionList> rlist (new RegionList (regions.rlist ()));
+ return rlist;
+}
+
boost::shared_ptr<RegionList>
Playlist::regions_at (framepos_t frame)
{
for (RegionList::iterator i = rlist->begin(); i != rlist->end(); ) {
RegionList::iterator tmp = i;
+
++tmp;
if ((*i)->muted()) {
boost::shared_ptr<Region> r = (*i);
frameoffset_t distance;
+ const framepos_t first_frame = r->first_frame();
+ const framepos_t last_frame = r->last_frame();
- if (r->first_frame() > frame) {
+ if (first_frame > frame) {
- distance = r->first_frame() - frame;
+ distance = first_frame - frame;
if (distance < closest) {
- ret = r->first_frame();
+ ret = first_frame;
closest = distance;
}
}
- if (r->last_frame () > frame) {
+ if (last_frame > frame) {
- distance = r->last_frame () - frame;
+ distance = last_frame - frame;
if (distance < closest) {
- ret = r->last_frame ();
+ ret = last_frame;
closest = distance;
}
}
boost::shared_ptr<Region> r = (*i);
frameoffset_t distance;
+ const framepos_t first_frame = r->first_frame();
+ const framepos_t last_frame = r->last_frame();
- if (r->last_frame() < frame) {
+ if (last_frame < frame) {
- distance = frame - r->last_frame();
+ distance = frame - last_frame;
if (distance < closest) {
- ret = r->last_frame();
+ ret = last_frame;
closest = distance;
}
}
- if (r->first_frame() < frame) {
+ if (first_frame < frame) {
- distance = frame - r->first_frame();
+ distance = frame - first_frame;
if (distance < closest) {
- ret = r->first_frame();
+ ret = first_frame;
closest = distance;
}
}
}
thaw ();
+ notify_contents_changed();
}
void
// (2) get all the original regions
- const RegionList& rl (pl->region_list().rlist());
+ const RegionList& rl (pl->region_list_property().rlist());
RegionFactory::CompoundAssociations& cassocs (RegionFactory::compound_associations());
frameoffset_t move_offset = 0;