boost::dynamic_pointer_cast<AudioRegion>(RegionFactory::create (sources, plist, false)));
assert(region);
- region->set_position (_trackview.session()->transport_frame(), this);
+ region->set_position (_trackview.session()->transport_frame());
rec_regions.push_back (make_pair(region, (RegionView*) 0));
}
if (nlen != region->length()) {
region->suspend_property_changes ();
- region->set_position (_trackview.track()->get_capture_start_frame(n), this);
- region->set_length (nlen, this);
+ region->set_position (_trackview.track()->get_capture_start_frame(n));
+ region->set_length (nlen);
region->resume_property_changes ();
if (origlen == 1) {
if (region->source_length(0) >= region->start() + nlen) {
region->suspend_property_changes ();
- region->set_position (_trackview.track()->get_capture_start_frame(n), this);
- region->set_length (nlen, this);
+ region->set_position (_trackview.track()->get_capture_start_frame(n));
+ region->set_length (nlen);
region->resume_property_changes ();
if (origlen == 1) {
const boost::shared_ptr<const Region> original = rv->region();
boost::shared_ptr<Region> region_copy = RegionFactory::create (original, true);
- region_copy->set_position (original->position(), this);
+ region_copy->set_position (original->position());
RegionView* nrv;
if (arv) {
playlist->clear_changes ();
}
- rv->region()->set_position (where, (void*) this);
+ rv->region()->set_position (where);
_editor->session()->add_command (new StatefulDiffCommand (rv->region()));
}
if (_region) {
framepos_t const f = adjusted_current_frame (event);
if (f < grab_frame()) {
- _region->set_position (f, this);
+ _region->set_position (f);
}
/* Don't use a zero-length region, and subtract 1 frame from the snapped length
*/
framecnt_t const len = abs (f - grab_frame () - 1);
- _region->set_length (len < 1 ? 1 : len, this);
+ _region->set_length (len < 1 ? 1 : len);
}
}
}
if (!(*i)->region()->locked()) {
(*i)->region()->clear_changes ();
- (*i)->region()->trim_front (new_bound, this);
+ (*i)->region()->trim_front (new_bound);
_session->add_command(new StatefulDiffCommand ((*i)->region()));
}
}
} else {
if (!rv->region()->locked()) {
rv->region()->clear_changes ();
- rv->region()->trim_front (new_bound, this);
+ rv->region()->trim_front (new_bound);
_session->add_command(new StatefulDiffCommand (rv->region()));
}
}
{
if (!(*i)->region()->locked()) {
(*i)->region()->clear_changes();
- (*i)->region()->trim_end (new_bound, this);
+ (*i)->region()->trim_end (new_bound);
_session->add_command(new StatefulDiffCommand ((*i)->region()));
}
}
if (!rv->region()->locked()) {
rv->region()->clear_changes ();
- rv->region()->trim_end (new_bound, this);
+ rv->region()->trim_end (new_bound);
_session->add_command (new StatefulDiffCommand (rv->region()));
}
}
}
r->clear_changes ();
- r->set_position (r->position() + distance, this);
+ r->set_position (r->position() + distance);
_session->add_command (new StatefulDiffCommand (r));
}
r->clear_changes ();
if (r->position() > distance) {
- r->set_position (r->position() - distance, this);
+ r->set_position (r->position() - distance);
} else {
- r->set_position (0, this);
+ r->set_position (0);
}
_session->add_command (new StatefulDiffCommand (r));
}
boost::shared_ptr<Region> r ((*i)->region());
r->clear_changes ();
- r->set_position (r->position() + distance, this);
+ r->set_position (r->position() + distance);
_session->add_command(new StatefulDiffCommand (r));
}
r->clear_changes ();
if (r->position() > distance) {
- r->set_position (r->position() - distance, this);
+ r->set_position (r->position() - distance);
} else {
- r->set_position (0, this);
+ r->set_position (0);
}
_session->add_command(new StatefulDiffCommand (r));
}
cnt = the_end - the_start + 1;
region->clear_changes ();
- region->trim_to (the_start, cnt, this);
+ region->trim_to (the_start, cnt);
_session->add_command (new StatefulDiffCommand (region));
}
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
(*i)->region()->clear_changes ();
- (*i)->region()->move_to_natural_position (this);
+ (*i)->region()->move_to_natural_position ();
_session->add_command (new StatefulDiffCommand ((*i)->region()));
}
/* move first one specially */
r->clear_changes ();
- r->set_position (pos, this);
+ r->set_position (pos);
_session->add_command(new StatefulDiffCommand (r));
/* move rest by the same amount */
region->clear_changes ();
if (dir > 0) {
- region->set_position (region->position() + distance, this);
+ region->set_position (region->position() + distance);
} else {
- region->set_position (region->position() - distance, this);
+ region->set_position (region->position() - distance);
}
_session->add_command(new StatefulDiffCommand (region));
switch (point) {
case SyncPoint:
- region->set_position (region->adjust_to_sync (position), this);
+ region->set_position (region->adjust_to_sync (position));
break;
case End:
if (position > region->length()) {
- region->set_position (position - region->length(), this);
+ region->set_position (position - region->length());
}
break;
case Start:
- region->set_position (position, this);
+ region->set_position (position);
break;
}
(*i)->region()->clear_changes ();
if (front) {
- (*i)->region()->trim_front (where, this);
+ (*i)->region()->trim_front (where);
} else {
- (*i)->region()->trim_end (where, this);
+ (*i)->region()->trim_end (where);
}
_session->add_command (new StatefulDiffCommand ((*i)->region()));
end = session_frame_to_track_frame (loc.end(), speed);
rv->region()->clear_changes ();
- rv->region()->trim_to (start, (end - start), this);
+ rv->region()->trim_to (start, (end - start));
_session->add_command(new StatefulDiffCommand (rv->region()));
}
continue;
}
- region->trim_end((framepos_t) ( (next_region->first_frame() - 1) * speed), this);
+ region->trim_end((framepos_t) ( (next_region->first_frame() - 1) * speed));
arv->region_changed (PropertyChange (ARDOUR::Properties::length));
}
else {
continue;
}
- region->trim_front((framepos_t) ((next_region->last_frame() + 1) * speed), this);
+ region->trim_front((framepos_t) ((next_region->last_frame() + 1) * speed));
arv->region_changed (ARDOUR::bounds_change);
}
framepos_t start_frame = (*r)->region()->first_frame ();
snap_to (start_frame);
- (*r)->region()->set_position (start_frame, this);
+ (*r)->region()->set_position (start_frame);
}
while (used_playlists.size() > 0) {
continue;
}
- (*r)->region()->trim_front( (position - pull_back_frames), this );
- last_region->trim_end( (position - pull_back_frames + crossfade_len), this );
+ (*r)->region()->trim_front( (position - pull_back_frames));
+ last_region->trim_end( (position - pull_back_frames + crossfade_len));
last_region = (*r)->region();
framepos_t region_end = _region->position() + _region->length() - 1;
if (end_frame > region_end) {
- _region->set_length (end_frame - _region->position(), this);
+ _region->set_length (end_frame - _region->position());
}
MidiTimeAxisView* const mtv = dynamic_cast<MidiTimeAxisView*>(&trackview);
DEBUG_TRACE (DEBUG::CutNPaste, string_compose ("Paste extended region from %1 to %2\n", region_end, end_frame));
_region->clear_changes ();
- _region->set_length (end_frame, this);
+ _region->set_length (end_frame);
trackview.session()->add_command (new StatefulDiffCommand (_region));
}
(RegionFactory::create (sources, plist, false)));
assert(region);
- region->set_start (_trackview.track()->current_capture_start() - _trackview.track()->get_capture_start_frame (0), this);
- region->set_position (_trackview.track()->current_capture_start(), this);
+ region->set_start (_trackview.track()->current_capture_start() - _trackview.track()->get_capture_start_frame (0));
+ region->set_position (_trackview.track()->current_capture_start());
RegionView* rv = add_region_view_internal (region, false);
MidiRegionView* mrv = dynamic_cast<MidiRegionView*> (rv);
mrv->begin_write ();
/* Update the region being recorded to reflect where we currently are */
boost::shared_ptr<ARDOUR::Region> region = rec_regions.back().first;
- region->set_length (_trackview.track()->current_capture_end () - _trackview.track()->current_capture_start(), this);
+ region->set_length (_trackview.track()->current_capture_end () - _trackview.track()->current_capture_start());
MidiRegionView* mrv = dynamic_cast<MidiRegionView*> (rec_regions.back().second);
mrv->extend_active_notes ();
if (pl) {
_region->clear_changes ();
- _region->set_position (position_clock.current_time(), this);
+ _region->set_position (position_clock.current_time());
_session->add_command(new StatefulDiffCommand (_region));
}
if (pl) {
_region->clear_changes ();
- _region->trim_end (end_clock.current_time(), this);
+ _region->trim_end (end_clock.current_time());
_session->add_command(new StatefulDiffCommand (_region));
}
if (pl) {
_region->clear_changes ();
- _region->trim_end (_region->position() + frames - 1, this);
+ _region->trim_end (_region->position() + frames - 1);
_session->add_command(new StatefulDiffCommand (_region));
}
framepos_t const pre_trim_first_frame = _region->first_frame();
- _region->trim_front ((framepos_t) (new_bound * speed), this);
+ _region->trim_front ((framepos_t) (new_bound * speed));
if (no_overlap) {
// Get the next region on the left of this region and shrink/expand it.
// Only trim region on the left if the first frame has gone beyond the left region's last frame.
if (region_left != 0 && (region_left->last_frame() > _region->first_frame() || regions_touching)) {
- region_left->trim_end (_region->first_frame() - 1, this);
+ region_left->trim_end (_region->first_frame() - 1);
}
}
framepos_t const pre_trim_last_frame = _region->last_frame();
- _region->trim_end ((framepos_t) (new_bound * speed), this);
+ _region->trim_end ((framepos_t) (new_bound * speed));
if (no_overlap) {
// Get the next region on the right of this region and shrink/expand it.
// Only trim region on the right if the last frame has gone beyond the right region's first frame.
if (region_right != 0 && (region_right->first_frame() < _region->last_frame() || regions_touching)) {
- region_right->trim_front (_region->last_frame() + 1, this);
+ region_right->trim_front (_region->last_frame() + 1);
}
region_changed (ARDOUR::bounds_change);
}
}
- _region->trim_start ((framepos_t) (new_bound * speed), this);
+ _region->trim_start ((framepos_t) (new_bound * speed));
region_changed (PropertyChange (ARDOUR::Properties::start));
}
void refresh_dependents (boost::shared_ptr<Region> region);
void check_dependents (boost::shared_ptr<Region> region, bool norefresh);
void remove_dependents (boost::shared_ptr<Region> region);
- void copy_dependents (const std::vector<TwoRegions>&, boost::shared_ptr<Playlist>);
+ void copy_dependents (const std::vector<TwoRegions>&, Playlist*) const;
void pre_combine (std::vector<boost::shared_ptr<Region> >&);
void post_combine (std::vector<boost::shared_ptr<Region> >&, boost::shared_ptr<Region>);
void _split_region (boost::shared_ptr<Region>, framepos_t position);
typedef std::pair<boost::shared_ptr<Region>, boost::shared_ptr<Region> > TwoRegions;
- virtual void copy_dependents (const std::vector<TwoRegions>&, boost::shared_ptr<Playlist>) { }
+ virtual void copy_dependents (const std::vector<TwoRegions>&, Playlist*) const { }
struct RegionInfo {
boost::shared_ptr<Region> region;
/* EDITING OPERATIONS */
- void set_length (framecnt_t, void *src);
- void set_start (framepos_t, void *src);
- void set_position (framepos_t, void *src);
- void set_position_on_top (framepos_t, void *src);
+ void set_length (framecnt_t);
+ void set_start (framepos_t);
+ void set_position (framepos_t);
+ void set_position_on_top (framepos_t);
void special_set_position (framepos_t);
void update_position_after_tempo_map_change ();
- void nudge_position (frameoffset_t, void *src);
+ void nudge_position (frameoffset_t);
bool at_natural_position () const;
- void move_to_natural_position (void *src);
+ void move_to_natural_position ();
- void trim_start (framepos_t new_position, void *src);
- void trim_front (framepos_t new_position, void *src);
- void trim_end (framepos_t new_position, void *src);
- void trim_to (framepos_t position, framecnt_t length, void *src);
+ void trim_start (framepos_t new_position);
+ void trim_front (framepos_t new_position);
+ void trim_end (framepos_t new_position);
+ void trim_to (framepos_t position, framecnt_t length);
- void cut_front (framepos_t new_position, void *src);
- void cut_end (framepos_t new_position, void *src);
+ void cut_front (framepos_t new_position);
+ void cut_end (framepos_t new_position);
void set_layer (layer_t l); /* ONLY Playlist can call this */
void raise ();
void send_change (const PBD::PropertyChange&);
void mid_thaw (const PBD::PropertyChange&);
- void trim_to_internal (framepos_t position, framecnt_t length, void *src);
+ void trim_to_internal (framepos_t position, framecnt_t length);
virtual void set_position_internal (framepos_t pos, bool allow_bbt_recompute);
virtual void set_length_internal (framepos_t pos);
- void modify_front (framepos_t new_position, bool reset_fade, void* src);
- void modify_end (framepos_t new_position, bool reset_fade, void* src);
+ void modify_front (framepos_t new_position, bool reset_fade);
+ void modify_end (framepos_t new_position, bool reset_fade);
void maybe_uncopy ();
void first_edit ();
/* be sure to stretch the region out to the maximum length */
- region->set_length (max_framepos - region->position(), this);
+ region->set_length (max_framepos - region->position());
uint32_t n;
ChannelList::iterator chan;
};
void
-AudioPlaylist::copy_dependents (const vector<TwoRegions>& old_and_new, boost::shared_ptr<Playlist> other)
+AudioPlaylist::copy_dependents (const vector<TwoRegions>& old_and_new, Playlist* other) const
{
- boost::shared_ptr<AudioPlaylist> other_audio = boost::dynamic_pointer_cast<AudioPlaylist>(other);
+ AudioPlaylist* other_audio = dynamic_cast<AudioPlaylist*>(other);
if (!other_audio) {
return;
for (vector<TwoRegions>::const_iterator on = old_and_new.begin(); on != old_and_new.end(); ++on) {
- for (Crossfades::iterator i = _crossfades.begin(); i != _crossfades.end(); ++i) {
+ for (Crossfades::const_iterator i = _crossfades.begin(); i != _crossfades.end(); ++i) {
if ((*i)->in() == on->first) {
* of the fade-in region
*/
- new_xfade->set_position (ci->second.new_in->position(), this);
+ new_xfade->set_position (ci->second.new_in->position());
other_audio->add_crossfade (new_xfade);
}
}
if (afs && afs->destructive()) {
// set_start (source()->natural_position(), this);
- set_position (source()->natural_position(), this);
+ set_position (source()->natural_position());
}
}
/* copy it */
boost::shared_ptr<AudioRegion> the_region (boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (region)));
- the_region->set_position (0, this);
+ the_region->set_position (0);
_diskstream->playlist()->drop_regions ();
_diskstream->playlist()->add_region (the_region, 0, 1);
const int ret = finish (region, nsrcs, new_name);
- results[0]->set_length((framecnt_t) floor (r->length() * _request.time_fraction), NULL);
+ results[0]->set_length((framecnt_t) floor (r->length() * _request.time_fraction));
return ret;
}
region->set_playlist (boost::weak_ptr<Playlist>(foo));
}
- region->set_position (position, this);
+ region->set_position (position);
timestamp_layer_op (region);
current->suspend_property_changes ();
thawlist.push_back (current);
- current->cut_end (pos2 - 1, this);
+ current->cut_end (pos2 - 1);
} else if (overlap == OverlapEnd) {
current->suspend_property_changes ();
thawlist.push_back (current);
- current->cut_end (pos2 - 1, this);
+ current->cut_end (pos2 - 1);
} else if (overlap == OverlapStart) {
current->suspend_property_changes ();
thawlist.push_back (current);
- current->trim_front (pos3, this);
+ current->trim_front (pos3);
} else if (overlap == OverlapExternal) {
/* split: no split required.
continue;
}
- (*r)->set_position ((*r)->position() + distance, this);
+ (*r)->set_position ((*r)->position() + distance);
}
for (RegionList::iterator r = fixup.begin(); r != fixup.end(); ++r) {
new_pos = max_framepos - (*i)->length();
}
- (*i)->set_position (new_pos, this);
+ (*i)->set_position (new_pos);
}
}
}
}
- (*i)->set_position (new_pos, this);
+ (*i)->set_position (new_pos);
moved = true;
}
}
new_pos = region->position() + (*next)->length();
}
- (*next)->set_position (region->position(), this);
- region->set_position (new_pos, this);
+ (*next)->set_position (region->position());
+ region->set_position (new_pos);
/* avoid a full sort */
new_pos = (*prev)->position() + region->length();
}
- region->set_position ((*prev)->position(), this);
- (*prev)->set_position (new_pos, this);
+ region->set_position ((*prev)->position());
+ (*prev)->set_position (new_pos);
/* avoid a full sort */
/* add any dependent regions to the new playlist */
- copy_dependents (old_and_new_regions, pl);
+ copy_dependents (old_and_new_regions, pl.get());
/* now create a new PlaylistSource for each channel in the new playlist */
/* the pure copy constructor resets position() to zero,
so fix that up.
*/
- original->set_position (pos, this);
+ original->set_position (pos);
}
/* check to see how the original region (in the
/* overlap is just a small piece inside the
* original so trim both ends
*/
- original->trim_to (adjusted_start, adjusted_end - adjusted_start, this);
+ original->trim_to (adjusted_start, adjusted_end - adjusted_start);
modified_region = true;
break;
/* overlap starts within but covers end,
so trim the front of the region
*/
- original->trim_front (adjusted_start, this);
+ original->trim_front (adjusted_start);
modified_region = true;
break;
/* overlap covers start but ends within, so
* trim the end of the region.
*/
- original->trim_end (adjusted_end, this);
+ original->trim_end (adjusted_end);
modified_region = true;
break;
}
if (move_offset) {
/* fix the position to match any movement of the compound region.
*/
- original->set_position (original->position() + move_offset, this);
+ original->set_position (original->position() + move_offset);
modified_region = true;
}
stretch,
shift);
(*x)->set_master_sources (region->master_sources());
- (*x)->set_length( (*x)->length() * stretch, this);
+ (*x)->set_length( (*x)->length() * stretch);
}
/* stretch region gain envelope */
}
void
-Region::set_length (framecnt_t len, void */*src*/)
+Region::set_length (framecnt_t len)
{
//cerr << "Region::set_length() len = " << len << endl;
if (locked()) {
}
void
-Region::move_to_natural_position (void *src)
+Region::move_to_natural_position ()
{
boost::shared_ptr<Playlist> pl (playlist());
boost::shared_ptr<Region> whole_file_region = get_parent();
if (whole_file_region) {
- set_position (whole_file_region->position() + _start, src);
+ set_position (whole_file_region->position() + _start);
}
}
}
void
-Region::set_position (framepos_t pos, void* /*src*/)
+Region::set_position (framepos_t pos)
{
if (!can_move()) {
return;
}
void
-Region::set_position_on_top (framepos_t pos, void* /*src*/)
+Region::set_position_on_top (framepos_t pos)
{
if (locked()) {
return;
}
void
-Region::nudge_position (frameoffset_t n, void* /*src*/)
+Region::nudge_position (frameoffset_t n)
{
if (locked()) {
return;
}
void
-Region::set_start (framepos_t pos, void* /*src*/)
+Region::set_start (framepos_t pos)
{
if (locked() || position_locked()) {
return;
}
void
-Region::trim_start (framepos_t new_position, void */*src*/)
+Region::trim_start (framepos_t new_position)
{
if (locked() || position_locked()) {
return;
}
void
-Region::trim_front (framepos_t new_position, void *src)
+Region::trim_front (framepos_t new_position)
{
- modify_front (new_position, false, src);
+ modify_front (new_position, false);
}
void
-Region::cut_front (framepos_t new_position, void *src)
+Region::cut_front (framepos_t new_position)
{
- modify_front (new_position, true, src);
+ modify_front (new_position, true);
}
void
-Region::cut_end (framepos_t new_endpoint, void *src)
+Region::cut_end (framepos_t new_endpoint)
{
- modify_end (new_endpoint, true, src);
+ modify_end (new_endpoint, true);
}
void
-Region::modify_front (framepos_t new_position, bool reset_fade, void *src)
+Region::modify_front (framepos_t new_position, bool reset_fade)
{
if (locked()) {
return;
delta = _position - new_position;
}
- trim_to_internal (new_position, newlen, src);
+ trim_to_internal (new_position, newlen);
if (reset_fade) {
_right_of_split = true;
}
void
-Region::modify_end (framepos_t new_endpoint, bool reset_fade, void* /*src*/)
+Region::modify_end (framepos_t new_endpoint, bool reset_fade)
{
if (locked()) {
return;
}
if (new_endpoint > _position) {
- trim_to_internal (_position, new_endpoint - _position +1, this);
+ trim_to_internal (_position, new_endpoint - _position +1);
if (reset_fade) {
_left_of_split = true;
}
*/
void
-Region::trim_end (framepos_t new_endpoint, void* src)
+Region::trim_end (framepos_t new_endpoint)
{
- modify_end (new_endpoint, false, src);
+ modify_end (new_endpoint, false);
}
void
-Region::trim_to (framepos_t position, framecnt_t length, void *src)
+Region::trim_to (framepos_t position, framecnt_t length)
{
if (locked()) {
return;
}
- trim_to_internal (position, length, src);
+ trim_to_internal (position, length);
if (!property_changes_suspended()) {
recompute_at_start ();
}
void
-Region::trim_to_internal (framepos_t position, framecnt_t length, void */*src*/)
+Region::trim_to_internal (framepos_t position, framecnt_t length)
{
framepos_t new_start;