, _type(other->_type)
, _orig_track_id (other->_orig_track_id)
{
- RegionLock rlock2 (const_cast<Playlist*> (other.get()));
+ RegionReadLock rlock2 (const_cast<Playlist*> (other.get()));
framepos_t end = start + cnt - 1;
void
Playlist::copy_regions (RegionList& newlist) const
{
- RegionLock rlock (const_cast<Playlist *> (this));
+ RegionReadLock rlock (const_cast<Playlist *> (this));
for (RegionList::const_iterator i = regions.begin(); i != regions.end(); ++i) {
newlist.push_back (RegionFactory::RegionFactory::create (*i, true));
DEBUG_TRACE (DEBUG::Destruction, string_compose ("Playlist %1 destructor\n", _name));
{
- RegionLock rl (this);
+ RegionReadLock rl (this);
for (set<boost::shared_ptr<Region> >::iterator i = all_regions.begin(); i != all_regions.end(); ++i) {
(*i)->set_playlist (boost::shared_ptr<Playlist>());
void
Playlist::add_region (boost::shared_ptr<Region> region, framepos_t position, float times, bool auto_partition)
{
- RegionLock rlock (this);
+ RegionWriteLock rlock (this);
times = fabs (times);
int itimes = (int) floor (times);
void
Playlist::set_region_ownership ()
{
- RegionLock rl (this);
+ RegionWriteLock rl (this);
RegionList::iterator i;
boost::weak_ptr<Playlist> pl (shared_from_this());
void
Playlist::replace_region (boost::shared_ptr<Region> old, boost::shared_ptr<Region> newr, framepos_t pos)
{
- RegionLock rlock (this);
+ RegionWriteLock rlock (this);
bool old_sp = _splicing;
_splicing = true;
void
Playlist::remove_region (boost::shared_ptr<Region> region)
{
- RegionLock rlock (this);
+ RegionWriteLock rlock (this);
remove_region_internal (region);
}
RegionList new_regions;
{
- RegionLock rlock (this);
+ RegionWriteLock rlock (this);
boost::shared_ptr<Region> region;
boost::shared_ptr<Region> current;
times = fabs (times);
{
- RegionLock rl1 (this);
- RegionLock rl2 (other.get());
+ RegionWriteLock rl1 (this);
+ RegionReadLock rl2 (other.get());
int itimes = (int) floor (times);
framepos_t pos = position;
{
times = fabs (times);
- RegionLock rl (this);
+ RegionWriteLock rl (this);
int itimes = (int) floor (times);
framepos_t pos = position + 1;
void
Playlist::shift (framepos_t at, frameoffset_t distance, bool move_intersected, bool ignore_music_glue)
{
- RegionLock rlock (this);
+ RegionWriteLock rlock (this);
RegionList copy (regions.rlist());
RegionList fixup;
void
Playlist::split (framepos_t at)
{
- RegionLock rlock (this);
+ RegionWriteLock rlock (this);
RegionList copy (regions.rlist());
/* use a copy since this operation can modify the region list
void
Playlist::split_region (boost::shared_ptr<Region> region, framepos_t playlist_position)
{
- RegionLock rl (this);
+ RegionWriteLock rl (this);
_split_region (region, playlist_position);
}
Playlist::splice_locked (framepos_t at, framecnt_t distance, boost::shared_ptr<Region> exclude)
{
{
- RegionLock rl (this);
+ RegionWriteLock rl (this);
core_splice (at, distance, exclude);
}
}
void
Playlist::drop_regions ()
{
- RegionLock rl (this);
+ RegionWriteLock rl (this);
regions.clear ();
all_regions.clear ();
}
void
Playlist::sync_all_regions_with_regions ()
{
- RegionLock rl (this);
+ RegionWriteLock rl (this);
all_regions.clear ();
Playlist::clear (bool with_signals)
{
{
- RegionLock rl (this);
+ RegionWriteLock rl (this);
region_state_changed_connections.drop_connections ();
boost::shared_ptr<RegionList>
Playlist::regions_at (framepos_t frame)
{
- RegionLock rlock (this);
+ RegionReadLock rlock (this);
return find_regions_at (frame);
}
uint32_t
Playlist::count_regions_at (framepos_t frame) const
{
- RegionLock rlock (const_cast<Playlist*>(this));
+ RegionReadLock rlock (const_cast<Playlist*>(this));
uint32_t cnt = 0;
for (RegionList::const_iterator i = regions.begin(); i != regions.end(); ++i) {
Playlist::top_region_at (framepos_t frame)
{
- RegionLock rlock (this);
+ RegionReadLock rlock (this);
boost::shared_ptr<RegionList> rlist = find_regions_at (frame);
boost::shared_ptr<Region> region;
Playlist::top_unmuted_region_at (framepos_t frame)
{
- RegionLock rlock (this);
+ RegionReadLock rlock (this);
boost::shared_ptr<RegionList> rlist = find_regions_at (frame);
for (RegionList::iterator i = rlist->begin(); i != rlist->end(); ) {
boost::shared_ptr<RegionList>
Playlist::regions_with_start_within (Evoral::Range<framepos_t> range)
{
- RegionLock rlock (this);
+ RegionReadLock rlock (this);
boost::shared_ptr<RegionList> rlist (new RegionList);
for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
boost::shared_ptr<RegionList>
Playlist::regions_with_end_within (Evoral::Range<framepos_t> range)
{
- RegionLock rlock (this);
+ RegionReadLock rlock (this);
boost::shared_ptr<RegionList> rlist (new RegionList);
for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
boost::shared_ptr<RegionList>
Playlist::regions_touched (framepos_t start, framepos_t end)
{
- RegionLock rlock (this);
+ RegionReadLock rlock (this);
return regions_touched_locked (start, end);
}
framepos_t
Playlist::find_next_transient (framepos_t from, int dir)
{
- RegionLock rlock (this);
+ RegionReadLock rlock (this);
AnalysisFeatureList points;
AnalysisFeatureList these_points;
boost::shared_ptr<Region>
Playlist::find_next_region (framepos_t frame, RegionPoint point, int dir)
{
- RegionLock rlock (this);
+ RegionReadLock rlock (this);
boost::shared_ptr<Region> ret;
framepos_t closest = max_framepos;
framepos_t
Playlist::find_next_region_boundary (framepos_t frame, int dir)
{
- RegionLock rlock (this);
+ RegionReadLock rlock (this);
framepos_t closest = max_framepos;
framepos_t ret = -1;
void
Playlist::rdiff (vector<Command*>& cmds) const
{
- RegionLock rlock (const_cast<Playlist *> (this));
+ RegionReadLock rlock (const_cast<Playlist *> (this));
Stateful::rdiff (cmds);
}
void
Playlist::clear_owned_changes ()
{
- RegionLock rlock (this);
+ RegionReadLock rlock (this);
Stateful::clear_owned_changes ();
}
}
{
- RegionLock rlock (this);
+ RegionWriteLock rlock (this);
add_region_internal (region, region->position());
}
node->add_property (X_("frozen"), _frozen ? "yes" : "no");
if (full_state) {
- RegionLock rlock (this, false);
+ RegionReadLock rlock (this);
snprintf (buf, sizeof (buf), "%u", _combine_ops);
node->add_property ("combine-ops", buf);
bool
Playlist::empty() const
{
- RegionLock rlock (const_cast<Playlist *>(this), false);
+ RegionReadLock rlock (const_cast<Playlist *>(this));
return regions.empty();
}
uint32_t
Playlist::n_regions() const
{
- RegionLock rlock (const_cast<Playlist *>(this), false);
+ RegionReadLock rlock (const_cast<Playlist *>(this));
return regions.size();
}
pair<framepos_t, framepos_t>
Playlist::get_extent () const
{
- RegionLock rlock (const_cast<Playlist *>(this), false);
+ RegionReadLock rlock (const_cast<Playlist *>(this));
return _get_extent ();
}
layer_t
Playlist::top_layer() const
{
- RegionLock rlock (const_cast<Playlist *> (this));
+ RegionReadLock rlock (const_cast<Playlist *> (this));
layer_t top = 0;
for (RegionList::const_iterator i = regions.begin(); i != regions.end(); ++i) {
_nudging = true;
{
- RegionLock rlock (const_cast<Playlist *> (this));
+ RegionWriteLock rlock (const_cast<Playlist *> (this));
for (i = regions.begin(); i != regions.end(); ++i) {
bool
Playlist::uses_source (boost::shared_ptr<const Source> src) const
{
- RegionLock rlock (const_cast<Playlist*> (this));
+ RegionReadLock rlock (const_cast<Playlist*> (this));
for (set<boost::shared_ptr<Region> >::iterator r = all_regions.begin(); r != all_regions.end(); ++r) {
if ((*r)->uses_source (src)) {
boost::shared_ptr<Region>
Playlist::find_region (const ID& id) const
{
- RegionLock rlock (const_cast<Playlist*> (this));
+ RegionReadLock rlock (const_cast<Playlist*> (this));
/* searches all regions currently in use by the playlist */
uint32_t
Playlist::region_use_count (boost::shared_ptr<Region> r) const
{
- RegionLock rlock (const_cast<Playlist*> (this));
+ RegionReadLock rlock (const_cast<Playlist*> (this));
uint32_t cnt = 0;
for (RegionList::const_iterator i = regions.begin(); i != regions.end(); ++i) {
_shuffling = true;
{
- RegionLock rlock (const_cast<Playlist*> (this));
+ RegionWriteLock rlock (const_cast<Playlist*> (this));
if (dir > 0) {
bool
Playlist::region_is_shuffle_constrained (boost::shared_ptr<Region>)
{
- RegionLock rlock (const_cast<Playlist*> (this));
+ RegionReadLock rlock (const_cast<Playlist*> (this));
if (regions.size() > 1) {
return true;
void
Playlist::update_after_tempo_map_change ()
{
- RegionLock rlock (const_cast<Playlist*> (this));
+ RegionWriteLock rlock (const_cast<Playlist*> (this));
RegionList copy (regions.rlist());
freeze ();
void
Playlist::foreach_region (boost::function<void(boost::shared_ptr<Region>)> s)
{
- RegionLock rl (this, false);
+ RegionWriteLock rl (this, false);
for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
s (*i);
}
bool
Playlist::has_region_at (framepos_t const p) const
{
- RegionLock (const_cast<Playlist *> (this));
+ RegionReadLock (const_cast<Playlist *> (this));
RegionList::const_iterator i = regions.begin ();
while (i != regions.end() && !(*i)->covers (p)) {
void
Playlist::remove_region_by_source (boost::shared_ptr<Source> s)
{
- RegionLock rl (this);
+ RegionWriteLock rl (this);
RegionList::iterator i = regions.begin();
while (i != regions.end()) {
framepos_t
Playlist::find_next_top_layer_position (framepos_t t) const
{
- RegionLock rlock (const_cast<Playlist *> (this));
+ RegionReadLock rlock (const_cast<Playlist *> (this));
layer_t const top = top_layer ();
uint32_t
Playlist::max_source_level () const
{
- RegionLock rlock (const_cast<Playlist *> (this));
+ RegionReadLock rlock (const_cast<Playlist *> (this));
uint32_t lvl = 0;
for (RegionList::const_iterator i = regions.begin(); i != regions.end(); ++i) {