libardour: add Locations::ripple()
This commit is contained in:
parent
ac1fd6d448
commit
9766132a53
@ -205,6 +205,8 @@ public:
|
||||
bool clear_xrun_markers ();
|
||||
bool clear_ranges ();
|
||||
|
||||
void ripple (samplepos_t at, samplecnt_t distance, bool include_locked, bool notify);
|
||||
|
||||
XMLNode& get_state (void);
|
||||
int set_state (const XMLNode&, int version);
|
||||
Location *get_location_by_id(PBD::ID);
|
||||
|
@ -1612,3 +1612,38 @@ Locations::range_starts_at(samplepos_t pos, samplecnt_t slop, bool incl) const
|
||||
|
||||
return closest;
|
||||
}
|
||||
|
||||
void
|
||||
Locations::ripple (samplepos_t at, samplecnt_t distance, bool include_locked, bool notify)
|
||||
{
|
||||
Glib::Threads::RWLock::WriterLock lm (_lock);
|
||||
|
||||
for (LocationList::iterator i = locations.begin(); i != locations.end(); ) {
|
||||
|
||||
if (!include_locked && (*i)->locked()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
bool locked = (*i)->locked();
|
||||
|
||||
if (locked) {
|
||||
(*i)->unlock ();
|
||||
}
|
||||
|
||||
if ((*i)->start() >= at) {
|
||||
(*i)->set_start ((*i)->start() - distance);
|
||||
|
||||
if (!(*i)->is_mark()) {
|
||||
(*i)->set_end ((*i)->end() - distance);
|
||||
}
|
||||
}
|
||||
|
||||
if (locked) {
|
||||
(*i)->locked();
|
||||
}
|
||||
}
|
||||
|
||||
if (notify) {
|
||||
changed(); /* EMIT SIGNAL */
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user