}
if (pl) {
- pl->clear_history ();
+ pl->clear_changes ();
pl->split_region ((*a)->region(), where);
_session->add_command (new StatefulDiffCommand (pl));
}
distance = next_distance;
}
- r->clear_history ();
+ r->clear_changes ();
r->set_position (r->position() + distance, this);
_session->add_command (new StatefulDiffCommand (r));
}
distance = next_distance;
}
- r->clear_history ();
+ r->clear_changes ();
if (r->position() > distance) {
r->set_position (r->position() - distance, this);
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
boost::shared_ptr<Region> r ((*i)->region());
- r->clear_history ();
+ r->clear_changes ();
r->set_position (r->position() + distance, this);
_session->add_command(new StatefulDiffCommand (r));
}
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
boost::shared_ptr<Region> r ((*i)->region());
- r->clear_history ();
+ r->clear_changes ();
if (r->position() > distance) {
r->set_position (r->position() - distance, this);
case SyncPoint:
rpos = r->sync_position ();
- //r->adjust_to_sync (r->first_frame());
break;
default:
case SyncPoint:
rpos = r->sync_position ();
- // r->adjust_to_sync (r->first_frame());
break;
}
case SyncPoint:
pos = r->sync_position ();
- // r->adjust_to_sync (r->first_frame());
break;
}
snap_to (where);
begin_reversible_command (_("insert dragged region"));
- playlist->clear_history ();
+ playlist->clear_changes ();
playlist->add_region (RegionFactory::create (region), where, 1.0);
_session->add_command(new StatefulDiffCommand (playlist));
commit_reversible_command ();
}
begin_reversible_command (_("insert region"));
- playlist->clear_history ();
+ playlist->clear_changes ();
playlist->add_region ((RegionFactory::create (region)), get_preferred_edit_position(), times);
_session->add_command(new StatefulDiffCommand (playlist));
commit_reversible_command ();
if ((playlist = rtv->playlist()) != 0) {
- playlist->clear_history ();
+ playlist->clear_changes ();
/* XXX need to consider musical time selections here at some point */
/* pick up changes to existing regions */
- vector<StatefulDiffCommand*> cmds;
+ vector<Command*> cmds;
playlist->rdiff (cmds);
- for (vector<StatefulDiffCommand*>::iterator j = cmds.begin(); j != cmds.end(); ++j) {
- _session->add_command (*j);
- }
+ _session->add_commands (cmds);
/* pick up changes to the playlist itself (adds/removes)
*/
the_end = min (end, the_end);
cnt = the_end - the_start + 1;
- region->clear_history ();
+ region->clear_changes ();
region->trim_to (the_start, cnt, this);
_session->add_command (new StatefulDiffCommand (region));
}
return;
}
- pl->clear_history ();
+ pl->clear_changes ();
pl->add_region (RegionFactory::create (region), region->last_frame(), times);
_session->add_command (new StatefulDiffCommand (pl));
}
continue;
}
- playlist->clear_history ();
+ playlist->clear_changes ();
playlist->add_region (RegionFactory::create (region), start, times);
_session->add_command (new StatefulDiffCommand (playlist));
}
in_command = true;
}
- region->clear_history ();
+ region->clear_changes ();
region->set_sync_position (where);
_session->add_command(new StatefulDiffCommand (region));
}
begin_reversible_command (_("remove sync"));
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
- (*i)->region()->clear_history ();
+ (*i)->region()->clear_changes ();
(*i)->region()->clear_sync_position ();
_session->add_command(new StatefulDiffCommand ((*i)->region()));
}
begin_reversible_command (_("naturalize"));
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
- (*i)->region()->clear_history ();
+ (*i)->region()->clear_changes ();
(*i)->region()->move_to_natural_position (this);
_session->add_command (new StatefulDiffCommand ((*i)->region()));
}
/* move first one specially */
- r->clear_history ();
+ r->clear_changes ();
r->set_position (pos, this);
_session->add_command(new StatefulDiffCommand (r));
boost::shared_ptr<Region> region ((*i)->region());
- region->clear_history ();
+ region->clear_changes ();
if (dir > 0) {
region->set_position (region->position() + distance, this);
void
Editor::align_region_internal (boost::shared_ptr<Region> region, RegionPoint point, nframes64_t position)
{
- region->clear_history ();
+ region->clear_changes ();
switch (point) {
case SyncPoint:
for (list<RegionView*>::const_iterator i = rs.by_layer().begin(); i != rs.by_layer().end(); ++i) {
if (!(*i)->region()->locked()) {
- (*i)->region()->clear_history ();
+ (*i)->region()->clear_changes ();
if (front) {
(*i)->region()->trim_front (where, this);
start = session_frame_to_track_frame (loc.start(), speed);
end = session_frame_to_track_frame (loc.end(), speed);
- rv->region()->clear_history ();
+ rv->region()->clear_changes ();
rv->region()->trim_to (start, (end - start), this);
_session->add_command(new StatefulDiffCommand (rv->region()));
}
speed = tav->track()->speed();
}
- rv->region()->clear_history ();
+ rv->region()->clear_changes ();
rv->region()->trim_end (session_frame_to_track_frame(where, speed), this);
_session->add_command(new StatefulDiffCommand (rv->region()));
}
speed = tav->track()->speed();
}
- rv->region()->clear_history ();
+ rv->region()->clear_changes ();
rv->region()->trim_front (session_frame_to_track_frame(where, speed), this);
_session->add_command(new StatefulDiffCommand (rv->region()));
}
boost::shared_ptr<Region> region = arv->region();
boost::shared_ptr<Playlist> playlist (region->playlist());
- region->clear_history ();
+ region->clear_changes ();
if(forward){
InterThreadInfo itt;
- playlist->clear_history ();
- playlist->clear_owned_history ();
+ playlist->clear_changes ();
+ playlist->clear_owned_changes ();
boost::shared_ptr<Region> r = rtv->track()->bounce_range (start, start+cnt, itt, enable_processing);
playlist->add_region (r, start);
}
- vector<StatefulDiffCommand*> cmds;
+ vector<Command*> cmds;
playlist->rdiff (cmds);
- for (vector<StatefulDiffCommand*>::iterator j = cmds.begin(); j != cmds.end(); ++j) {
- _session->add_command (*j);
- }
+ _session->add_commands (cmds);
_session->add_command (new StatefulDiffCommand (playlist));
}
boost::shared_ptr<Playlist> playlist = clicked_routeview->playlist();
begin_reversible_command (_("remove region"));
- playlist->clear_history ();
+ playlist->clear_changes ();
playlist->remove_region (clicked_regionview->region());
_session->add_command(new StatefulDiffCommand (playlist));
commit_reversible_command ();
if (i == playlists.end()) {
- playlist->clear_history ();
+ playlist->clear_changes ();
playlist->freeze ();
playlists.push_back (playlist);
}
if (fl == freezelist.end()) {
- pl->clear_history();
+ pl->clear_changes();
pl->freeze ();
freezelist.insert (pl);
}
foo.push_back ((*i).pl);
}
-
if (!foo.empty()) {
cut_buffer->set (foo);
}
+
+ if (pmap.empty()) {
+ _last_cut_copy_source_track = 0;
+ } else {
+ _last_cut_copy_source_track = pmap.front().tv;
+ }
for (FreezeList::iterator pl = freezelist.begin(); pl != freezelist.end(); ++pl) {
(*pl)->thaw ();
/* get everything in the correct order */
if (!selection->tracks.empty()) {
+ /* there are some selected tracks, so paste to them */
sort_track_selection ();
ts = selection->tracks;
- } else if (entered_track) {
- ts.push_back (entered_track);
+ } else if (_last_cut_copy_source_track) {
+ /* otherwise paste to the track that the cut/copy came from;
+ see discussion in mants #3333.
+ */
+ ts.push_back (_last_cut_copy_source_track);
}
for (nth = 0, i = ts.begin(); i != ts.end(); ++i, ++nth) {
sigc::connection c = rtv->view()->RegionViewAdded.connect (sigc::mem_fun(*this, &Editor::collect_new_region_view));
playlist = (*i)->region()->playlist();
- playlist->clear_history ();
+ playlist->clear_changes ();
playlist->duplicate (r, end_frame + (r->first_frame() - start_frame), times);
_session->add_command(new StatefulDiffCommand (playlist));
if ((playlist = (*i)->playlist()) == 0) {
continue;
}
- playlist->clear_history ();
+ playlist->clear_changes ();
playlist->duplicate (*ri, selection->time[clicked_selection].end, times);
_session->add_command (new StatefulDiffCommand (playlist));
Editor::clear_playlist (boost::shared_ptr<Playlist> playlist)
{
begin_reversible_command (_("clear playlist"));
- playlist->clear_history ();
+ playlist->clear_changes ();
playlist->clear ();
_session->add_command (new StatefulDiffCommand (playlist));
commit_reversible_command ();
continue;
}
- playlist->clear_history ();
- playlist->clear_owned_history ();
+ playlist->clear_changes ();
+ playlist->clear_owned_changes ();
playlist->nudge_after (start, distance, forwards);
- vector<StatefulDiffCommand*> cmds;
+ vector<Command*> cmds;
playlist->rdiff (cmds);
-
- for (vector<StatefulDiffCommand*>::iterator c = cmds.begin(); c != cmds.end(); ++c) {
- _session->add_command (*c);
- }
+ _session->add_commands (cmds);
_session->add_command (new StatefulDiffCommand (playlist));
}
if (!arv) {
continue;
}
- arv->region()->clear_history ();
+ arv->region()->clear_changes ();
double const amp = normalize_across_all->get_active() ? maxamp : arv->audio_region()->maximum_amplitude ();
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*r);
if (!arv)
continue;
- arv->region()->clear_history ();
+ arv->region()->clear_changes ();
arv->audio_region()->set_scale_amplitude (1.0f);
_session->add_command (new StatefulDiffCommand (arv->region()));
}
continue;
}
- arv->region()->clear_history ();
+ arv->region()->clear_changes ();
double fraction = gain_to_slider_position (arv->audio_region()->scale_amplitude ());
boost::shared_ptr<Playlist> playlist = mrv->region()->playlist();
boost::shared_ptr<MidiRegion> newregion = mrv->midi_region()->clone ();
- playlist->clear_history ();
+ playlist->clear_changes ();
playlist->replace_region (mrv->region(), newregion, mrv->region()->position());
_session->add_command(new StatefulDiffCommand (playlist));
}
if (arv->audio_region()->apply (filter) == 0) {
- playlist->clear_history ();
+ playlist->clear_changes ();
if (filter.results.empty ()) {
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i);
if (arv) {
- arv->region()->clear_history ();
+ arv->region()->clear_changes ();
arv->set_envelope_visible (!arv->envelope_visible());
_session->add_command (new StatefulDiffCommand (arv->region()));
}
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i);
if (arv) {
- arv->region()->clear_history ();
+ arv->region()->clear_changes ();
arv->audio_region()->set_envelope_active (!arv->audio_region()->envelope_active());
_session->add_command (new StatefulDiffCommand (arv->region()));
}
_session->begin_reversible_command (_("region lock"));
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
- (*i)->region()->clear_history ();
+ (*i)->region()->clear_changes ();
(*i)->region()->set_locked (!(*i)->region()->locked());
_session->add_command (new StatefulDiffCommand ((*i)->region()));
}
_session->begin_reversible_command (_("region lock style"));
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
- (*i)->region()->clear_history ();
+ (*i)->region()->clear_changes ();
PositionLockStyle const ns = (*i)->region()->position_lock_style() == AudioTime ? MusicTime : AudioTime;
(*i)->region()->set_position_lock_style (ns);
_session->add_command (new StatefulDiffCommand ((*i)->region()));
_session->begin_reversible_command (_("region mute"));
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
- (*i)->region()->clear_history ();
+ (*i)->region()->clear_changes ();
(*i)->region()->set_muted (!(*i)->region()->muted());
_session->add_command (new StatefulDiffCommand ((*i)->region()));
}
_session->begin_reversible_command (_("region opacity"));
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
- (*i)->region()->clear_history ();
+ (*i)->region()->clear_changes ();
(*i)->region()->set_opaque (!(*i)->region()->opaque());
_session->add_command (new StatefulDiffCommand ((*i)->region()));
}
have_switch = true;
}
- region->clear_history ();
+ region->clear_changes ();
if (in) {
region->set_fade_in_active (!yn);
boost::shared_ptr<AudioRegion> ar (tmp->audio_region());
- ar->clear_history ();
+ ar->clear_changes ();
ar->set_fade_in_active (yn);
_session->add_command (new StatefulDiffCommand (ar));
}
boost::shared_ptr<AudioRegion> ar (tmp->audio_region());
- ar->clear_history ();
+ ar->clear_changes ();
ar->set_fade_out_active (yn);
_session->add_command(new StatefulDiffCommand (ar));
}
AnalysisFeatureList::const_iterator x;
- pl->clear_history ();
+ pl->clear_changes ();
x = positions.begin();
if (nbusses) {
prompt = string_compose (_("Do you really want to remove %1 %2 and %3 %4?\n"
"(You may also lose the playlists associated with the %2)\n\n"
- "This action cannot be undone!"),
+ "This action cannot be undone, and the session file will be overwritten!"),
ntracks, trackstr, nbusses, busstr);
} else {
prompt = string_compose (_("Do you really want to remove %1 %2?\n"
"(You may also lose the playlists associated with the %2)\n\n"
- "This action cannot be undone!"),
+ "This action cannot be undone, and the session file will be overwritten!"),
ntracks, trackstr);
}
} else if (nbusses) {
- prompt = string_compose (_("Do you really want to remove %1 %2?"),
+ prompt = string_compose (_("Do you really want to remove %1 %2?\n\n"
+ "This action cannot be undon, and the session file will be overwritten"),
nbusses, busstr);
}
if (pl) {
- pl->clear_history ();
- pl->clear_owned_history ();
+ pl->clear_changes ();
+ pl->clear_owned_changes ();
if (opt == SplitIntersected) {
pl->split (pos);
pl->shift (pos, frames, (opt == MoveIntersected), ignore_music_glue);
- vector<StatefulDiffCommand*> cmds;
-
+ vector<Command*> cmds;
pl->rdiff (cmds);
-
- for (vector<StatefulDiffCommand*>::iterator c = cmds.begin(); c != cmds.end(); ++c) {
- _session->add_command (*c);
- }
-
+ _session->add_commands (cmds);
+
_session->add_command (new StatefulDiffCommand (pl));
commit = true;
}