mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 08:36:32 +01:00
clear_history -> clear_changes and some comments.
git-svn-id: svn://localhost/ardour2/branches/3.0@7685 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
21855b71d2
commit
f30402d073
22 changed files with 115 additions and 111 deletions
|
|
@ -895,7 +895,7 @@ Editor::finish_bringing_in_material (boost::shared_ptr<Region> region, uint32_t
|
|||
boost::shared_ptr<Playlist> playlist = existing_track->playlist();
|
||||
boost::shared_ptr<Region> copy (RegionFactory::create (region, region->properties()));
|
||||
begin_reversible_command (_("insert file"));
|
||||
playlist->clear_history ();
|
||||
playlist->clear_changes ();
|
||||
playlist->add_region (copy, pos);
|
||||
_session->add_command (new StatefulDiffCommand (playlist));
|
||||
commit_reversible_command ();
|
||||
|
|
|
|||
|
|
@ -1008,7 +1008,7 @@ RegionMoveDrag::finished_no_copy (
|
|||
|
||||
} else {
|
||||
|
||||
rv->region()->clear_history ();
|
||||
rv->region()->clear_changes ();
|
||||
|
||||
/*
|
||||
motion on the same track. plonk the previously reparented region
|
||||
|
|
@ -1095,7 +1095,7 @@ RegionMoveDrag::finished_no_copy (
|
|||
* @param region Region to remove.
|
||||
* @param playlist playlist To remove from.
|
||||
* @param modified_playlists The playlist will be added to this if it is not there already; used to ensure
|
||||
* that clear_history () is only called once per playlist.
|
||||
* that clear_changes () is only called once per playlist.
|
||||
*/
|
||||
void
|
||||
RegionMoveDrag::remove_region_from_playlist (
|
||||
|
|
@ -1107,7 +1107,7 @@ RegionMoveDrag::remove_region_from_playlist (
|
|||
pair<set<boost::shared_ptr<Playlist> >::iterator, bool> r = modified_playlists.insert (playlist);
|
||||
|
||||
if (r.second) {
|
||||
playlist->clear_history ();
|
||||
playlist->clear_changes ();
|
||||
}
|
||||
|
||||
playlist->remove_region (region);
|
||||
|
|
@ -1121,7 +1121,7 @@ RegionMoveDrag::remove_region_from_playlist (
|
|||
* @param dest_layer Destination layer.
|
||||
* @param where Destination position.
|
||||
* @param modified_playlists The playlist will be added to this if it is not there already; used to ensure
|
||||
* that clear_history () is only called once per playlist.
|
||||
* that clear_changes () is only called once per playlist.
|
||||
* @return New RegionView, or 0 if no insert was performed.
|
||||
*/
|
||||
RegionView *
|
||||
|
|
@ -1145,7 +1145,7 @@ RegionMoveDrag::insert_region_into_playlist (
|
|||
/* clear history for the playlist we are about to insert to, provided we haven't already done so */
|
||||
pair<PlaylistSet::iterator, bool> r = modified_playlists.insert (dest_playlist);
|
||||
if (r.second) {
|
||||
dest_playlist->clear_history ();
|
||||
dest_playlist->clear_changes ();
|
||||
}
|
||||
|
||||
dest_playlist->add_region (region, where);
|
||||
|
|
@ -1488,7 +1488,7 @@ RegionInsertDrag::finished (GdkEvent* /*event*/, bool /*movement_occurred*/)
|
|||
boost::shared_ptr<Playlist> playlist = dest_rtv->playlist();
|
||||
|
||||
_editor->begin_reversible_command (_("insert region"));
|
||||
playlist->clear_history ();
|
||||
playlist->clear_changes ();
|
||||
playlist->add_region (_primary->region (), _last_frame_position);
|
||||
_editor->session()->add_command (new StatefulDiffCommand (playlist));
|
||||
_editor->commit_reversible_command ();
|
||||
|
|
@ -1823,7 +1823,7 @@ TrimDrag::motion (GdkEvent* event, bool first_move)
|
|||
RegionView* rv = i->view;
|
||||
rv->fake_set_opaque(false);
|
||||
rv->enable_display (false);
|
||||
rv->region()->clear_history ();
|
||||
rv->region()->clear_changes ();
|
||||
rv->region()->suspend_property_changes ();
|
||||
|
||||
AudioRegionView* const arv = dynamic_cast<AudioRegionView*> (rv);
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ Editor::kbd_mute_unmute_region ()
|
|||
|
||||
for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
|
||||
|
||||
(*i)->region()->playlist()->clear_history ();
|
||||
(*i)->region()->playlist()->clear_changes ();
|
||||
(*i)->region()->set_muted (!(*i)->region()->muted ());
|
||||
_session->add_command (new StatefulDiffCommand ((*i)->region()->playlist()));
|
||||
|
||||
|
|
@ -102,7 +102,7 @@ Editor::kbd_mute_unmute_region ()
|
|||
} else if (entered_regionview) {
|
||||
|
||||
begin_reversible_command (_("mute region"));
|
||||
entered_regionview->region()->playlist()->clear_history ();
|
||||
entered_regionview->region()->playlist()->clear_changes ();
|
||||
entered_regionview->region()->set_muted (!entered_regionview->region()->muted());
|
||||
_session->add_command (new StatefulDiffCommand (entered_regionview->region()->playlist()));
|
||||
commit_reversible_command();
|
||||
|
|
|
|||
|
|
@ -2399,7 +2399,7 @@ Editor::point_trim (GdkEvent* event, nframes64_t new_bound)
|
|||
}
|
||||
|
||||
if (!(*i)->region()->locked()) {
|
||||
(*i)->region()->clear_history ();
|
||||
(*i)->region()->clear_changes ();
|
||||
(*i)->region()->trim_front (new_bound, this);
|
||||
_session->add_command(new StatefulDiffCommand ((*i)->region()));
|
||||
}
|
||||
|
|
@ -2407,7 +2407,7 @@ Editor::point_trim (GdkEvent* event, nframes64_t new_bound)
|
|||
|
||||
} else {
|
||||
if (!rv->region()->locked()) {
|
||||
rv->region()->clear_history ();
|
||||
rv->region()->clear_changes ();
|
||||
rv->region()->trim_front (new_bound, this);
|
||||
_session->add_command(new StatefulDiffCommand (rv->region()));
|
||||
}
|
||||
|
|
@ -2424,7 +2424,7 @@ Editor::point_trim (GdkEvent* event, nframes64_t new_bound)
|
|||
for (list<RegionView*>::const_iterator i = selection->regions.by_layer().begin(); i != selection->regions.by_layer().end(); ++i)
|
||||
{
|
||||
if (!(*i)->region()->locked()) {
|
||||
(*i)->region()->clear_history();
|
||||
(*i)->region()->clear_changes();
|
||||
(*i)->region()->trim_end (new_bound, this);
|
||||
_session->add_command(new StatefulDiffCommand ((*i)->region()));
|
||||
}
|
||||
|
|
@ -2433,7 +2433,7 @@ Editor::point_trim (GdkEvent* event, nframes64_t new_bound)
|
|||
} else {
|
||||
|
||||
if (!rv->region()->locked()) {
|
||||
rv->region()->clear_history ();
|
||||
rv->region()->clear_changes ();
|
||||
rv->region()->trim_end (new_bound, this);
|
||||
_session->add_command (new StatefulDiffCommand (rv->region()));
|
||||
}
|
||||
|
|
@ -2555,7 +2555,7 @@ Editor::mouse_brush_insert_region (RegionView* rv, nframes64_t pos)
|
|||
boost::shared_ptr<Playlist> playlist = rtv->playlist();
|
||||
double speed = rtv->track()->speed();
|
||||
|
||||
playlist->clear_history ();
|
||||
playlist->clear_changes ();
|
||||
boost::shared_ptr<Region> new_region (RegionFactory::create (rv->region()));
|
||||
playlist->add_region (new_region, (nframes64_t) (pos * speed));
|
||||
_session->add_command (new StatefulDiffCommand (playlist));
|
||||
|
|
@ -2661,7 +2661,7 @@ Editor::start_selection_grab (ArdourCanvas::Item* /*item*/, GdkEvent* event)
|
|||
|
||||
boost::shared_ptr<Playlist> playlist = clicked_axisview->playlist();
|
||||
|
||||
playlist->clear_history ();
|
||||
playlist->clear_changes ();
|
||||
clicked_routeview->playlist()->add_region (region, selection->time[clicked_selection].start);
|
||||
_session->add_command(new StatefulDiffCommand (playlist));
|
||||
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ Editor::split_regions_at (nframes64_t where, RegionSelection& regions)
|
|||
}
|
||||
|
||||
if (pl) {
|
||||
pl->clear_history ();
|
||||
pl->clear_changes ();
|
||||
pl->split_region ((*a)->region(), where);
|
||||
_session->add_command (new StatefulDiffCommand (pl));
|
||||
}
|
||||
|
|
@ -324,7 +324,7 @@ Editor::nudge_forward (bool next, bool force_playhead)
|
|||
distance = next_distance;
|
||||
}
|
||||
|
||||
r->clear_history ();
|
||||
r->clear_changes ();
|
||||
r->set_position (r->position() + distance, this);
|
||||
_session->add_command (new StatefulDiffCommand (r));
|
||||
}
|
||||
|
|
@ -404,7 +404,7 @@ Editor::nudge_backward (bool next, bool force_playhead)
|
|||
distance = next_distance;
|
||||
}
|
||||
|
||||
r->clear_history ();
|
||||
r->clear_changes ();
|
||||
|
||||
if (r->position() > distance) {
|
||||
r->set_position (r->position() - distance, this);
|
||||
|
|
@ -492,7 +492,7 @@ Editor::nudge_forward_capture_offset ()
|
|||
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));
|
||||
}
|
||||
|
|
@ -521,7 +521,7 @@ Editor::nudge_backward_capture_offset ()
|
|||
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);
|
||||
|
|
@ -2227,7 +2227,7 @@ Editor::insert_region_list_drag (boost::shared_ptr<Region> region, int x, int y)
|
|||
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 ();
|
||||
|
|
@ -2306,7 +2306,7 @@ Editor::insert_region_list_selection (float times)
|
|||
}
|
||||
|
||||
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 ();
|
||||
|
|
@ -2788,7 +2788,7 @@ Editor::separate_regions_between (const TimeSelection& ts)
|
|||
|
||||
if ((playlist = rtv->playlist()) != 0) {
|
||||
|
||||
playlist->clear_history ();
|
||||
playlist->clear_changes ();
|
||||
|
||||
/* XXX need to consider musical time selections here at some point */
|
||||
|
||||
|
|
@ -3077,7 +3077,7 @@ Editor::crop_region_to (nframes64_t start, nframes64_t end)
|
|||
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));
|
||||
}
|
||||
|
|
@ -3117,7 +3117,7 @@ Editor::region_fill_track ()
|
|||
return;
|
||||
}
|
||||
|
||||
pl->clear_history ();
|
||||
pl->clear_changes ();
|
||||
pl->add_region (RegionFactory::create (region), region->last_frame(), times);
|
||||
_session->add_command (new StatefulDiffCommand (pl));
|
||||
}
|
||||
|
|
@ -3161,7 +3161,7 @@ Editor::region_fill_selection ()
|
|||
continue;
|
||||
}
|
||||
|
||||
playlist->clear_history ();
|
||||
playlist->clear_changes ();
|
||||
playlist->add_region (RegionFactory::create (region), start, times);
|
||||
_session->add_command (new StatefulDiffCommand (playlist));
|
||||
}
|
||||
|
|
@ -3196,7 +3196,7 @@ Editor::set_sync_point (nframes64_t where, const RegionSelection& rs)
|
|||
in_command = true;
|
||||
}
|
||||
|
||||
region->clear_history ();
|
||||
region->clear_changes ();
|
||||
region->set_sync_position (where);
|
||||
_session->add_command(new StatefulDiffCommand (region));
|
||||
}
|
||||
|
|
@ -3221,7 +3221,7 @@ Editor::remove_region_sync ()
|
|||
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()));
|
||||
}
|
||||
|
|
@ -3241,7 +3241,7 @@ Editor::naturalize ()
|
|||
|
||||
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()));
|
||||
}
|
||||
|
|
@ -3342,7 +3342,7 @@ Editor::align_selection_relative (RegionPoint point, nframes64_t position, const
|
|||
|
||||
/* move first one specially */
|
||||
|
||||
r->clear_history ();
|
||||
r->clear_changes ();
|
||||
r->set_position (pos, this);
|
||||
_session->add_command(new StatefulDiffCommand (r));
|
||||
|
||||
|
|
@ -3354,7 +3354,7 @@ Editor::align_selection_relative (RegionPoint point, nframes64_t position, const
|
|||
|
||||
boost::shared_ptr<Region> region ((*i)->region());
|
||||
|
||||
region->clear_history ();
|
||||
region->clear_changes ();
|
||||
|
||||
if (dir > 0) {
|
||||
region->set_position (region->position() + distance, this);
|
||||
|
|
@ -3396,7 +3396,7 @@ Editor::align_region (boost::shared_ptr<Region> region, RegionPoint point, nfram
|
|||
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:
|
||||
|
|
@ -3446,7 +3446,7 @@ Editor::trim_region (bool front)
|
|||
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);
|
||||
|
|
@ -3517,7 +3517,7 @@ Editor::trim_region_to_location (const Location& loc, const char* str)
|
|||
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()));
|
||||
}
|
||||
|
|
@ -3555,7 +3555,7 @@ Editor::trim_region_to_edit_point ()
|
|||
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()));
|
||||
}
|
||||
|
|
@ -3593,7 +3593,7 @@ Editor::trim_region_from_edit_point ()
|
|||
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()));
|
||||
}
|
||||
|
|
@ -3648,7 +3648,7 @@ Editor::trim_to_region(bool forward)
|
|||
boost::shared_ptr<Region> region = arv->region();
|
||||
boost::shared_ptr<Playlist> playlist (region->playlist());
|
||||
|
||||
region->clear_history ();
|
||||
region->clear_changes ();
|
||||
|
||||
if(forward){
|
||||
|
||||
|
|
@ -3761,8 +3761,8 @@ Editor::bounce_range_selection (bool replace, bool enable_processing)
|
|||
|
||||
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);
|
||||
|
||||
|
|
@ -4012,7 +4012,7 @@ Editor::remove_clicked_region ()
|
|||
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 ();
|
||||
|
|
@ -4073,7 +4073,7 @@ Editor::remove_selected_regions ()
|
|||
|
||||
if (i == playlists.end()) {
|
||||
|
||||
playlist->clear_history ();
|
||||
playlist->clear_changes ();
|
||||
playlist->freeze ();
|
||||
|
||||
playlists.push_back (playlist);
|
||||
|
|
@ -4131,7 +4131,7 @@ Editor::cut_copy_regions (CutCopyOp op, RegionSelection& rs)
|
|||
}
|
||||
|
||||
if (fl == freezelist.end()) {
|
||||
pl->clear_history();
|
||||
pl->clear_changes();
|
||||
pl->freeze ();
|
||||
freezelist.insert (pl);
|
||||
}
|
||||
|
|
@ -4364,7 +4364,7 @@ Editor::duplicate_some_regions (RegionSelection& regions, float times)
|
|||
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));
|
||||
|
||||
|
|
@ -4405,7 +4405,7 @@ Editor::duplicate_selection (float times)
|
|||
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));
|
||||
|
||||
|
|
@ -4451,7 +4451,7 @@ void
|
|||
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 ();
|
||||
|
|
@ -4487,8 +4487,8 @@ Editor::nudge_track (bool use_edit, bool forwards)
|
|||
continue;
|
||||
}
|
||||
|
||||
playlist->clear_history ();
|
||||
playlist->clear_owned_history ();
|
||||
playlist->clear_changes ();
|
||||
playlist->clear_owned_changes ();
|
||||
|
||||
playlist->nudge_after (start, distance, forwards);
|
||||
|
||||
|
|
@ -4607,7 +4607,7 @@ Editor::normalize_region ()
|
|||
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 ();
|
||||
|
||||
|
|
@ -4643,7 +4643,7 @@ Editor::reset_region_scale_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()));
|
||||
}
|
||||
|
|
@ -4674,7 +4674,7 @@ Editor::adjust_region_scale_amplitude (bool up)
|
|||
continue;
|
||||
}
|
||||
|
||||
arv->region()->clear_history ();
|
||||
arv->region()->clear_changes ();
|
||||
|
||||
double fraction = gain_to_slider_position (arv->audio_region()->scale_amplitude ());
|
||||
|
||||
|
|
@ -4820,7 +4820,7 @@ Editor::fork_region ()
|
|||
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));
|
||||
}
|
||||
|
|
@ -4883,7 +4883,7 @@ Editor::apply_filter (Filter& filter, string command)
|
|||
|
||||
if (arv->audio_region()->apply (filter) == 0) {
|
||||
|
||||
playlist->clear_history ();
|
||||
playlist->clear_changes ();
|
||||
|
||||
if (filter.results.empty ()) {
|
||||
|
||||
|
|
@ -5014,7 +5014,7 @@ Editor::toggle_gain_envelope_visibility ()
|
|||
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()));
|
||||
}
|
||||
|
|
@ -5037,7 +5037,7 @@ Editor::toggle_gain_envelope_active ()
|
|||
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()));
|
||||
}
|
||||
|
|
@ -5058,7 +5058,7 @@ Editor::toggle_region_lock ()
|
|||
_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()));
|
||||
}
|
||||
|
|
@ -5078,7 +5078,7 @@ Editor::toggle_region_lock_style ()
|
|||
_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()));
|
||||
|
|
@ -5100,7 +5100,7 @@ Editor::toggle_region_mute ()
|
|||
_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()));
|
||||
}
|
||||
|
|
@ -5120,7 +5120,7 @@ Editor::toggle_region_opaque ()
|
|||
_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()));
|
||||
}
|
||||
|
|
@ -5260,7 +5260,7 @@ Editor::toggle_fade_active (bool in)
|
|||
have_switch = true;
|
||||
}
|
||||
|
||||
region->clear_history ();
|
||||
region->clear_changes ();
|
||||
|
||||
if (in) {
|
||||
region->set_fade_in_active (!yn);
|
||||
|
|
@ -5362,7 +5362,7 @@ Editor::set_fade_in_active (bool 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));
|
||||
}
|
||||
|
|
@ -5392,7 +5392,7 @@ Editor::set_fade_out_active (bool yn)
|
|||
|
||||
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));
|
||||
}
|
||||
|
|
@ -6021,7 +6021,7 @@ Editor::split_region_at_points (boost::shared_ptr<Region> r, AnalysisFeatureList
|
|||
|
||||
AnalysisFeatureList::const_iterator x;
|
||||
|
||||
pl->clear_history ();
|
||||
pl->clear_changes ();
|
||||
|
||||
x = positions.begin();
|
||||
|
||||
|
|
@ -6559,8 +6559,8 @@ Editor::insert_time (nframes64_t pos, nframes64_t frames, InsertTimeOption opt,
|
|||
|
||||
if (pl) {
|
||||
|
||||
pl->clear_history ();
|
||||
pl->clear_owned_history ();
|
||||
pl->clear_changes ();
|
||||
pl->clear_owned_changes ();
|
||||
|
||||
if (opt == SplitIntersected) {
|
||||
pl->split (pos);
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ Editor::time_stretch (RegionSelection& regions, float fraction)
|
|||
MidiStretch stretch(*_session, request);
|
||||
begin_reversible_command ("midi stretch");
|
||||
stretch.run(regions.front()->region());
|
||||
playlist->clear_history ();
|
||||
playlist->clear_changes ();
|
||||
playlist->replace_region (regions.front()->region(), stretch.results[0],
|
||||
regions.front()->region()->position());
|
||||
_session->add_command (new StatefulDiffCommand (playlist));
|
||||
|
|
@ -337,7 +337,7 @@ Editor::do_timefx (TimeFXDialog& dialog)
|
|||
in_command = true;
|
||||
}
|
||||
|
||||
playlist->clear_history ();
|
||||
playlist->clear_changes ();
|
||||
playlist->replace_region (region, new_region, region->position());
|
||||
_session->add_command (new StatefulDiffCommand (playlist));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2764,7 +2764,7 @@ MidiRegionView::paste (nframes64_t pos, float times, const MidiCutBuffer& mcb)
|
|||
|
||||
trackview.session()->begin_reversible_command (_("paste"));
|
||||
|
||||
_region->clear_history ();
|
||||
_region->clear_changes ();
|
||||
_region->set_length (end_frame, this);
|
||||
trackview.session()->add_command (new StatefulDiffCommand (_region));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1009,7 +1009,7 @@ MidiTimeAxisView::add_region (framepos_t pos, framecnt_t length, bool commit)
|
|||
Editor* real_editor = dynamic_cast<Editor*> (&_editor);
|
||||
|
||||
real_editor->begin_reversible_command (_("create region"));
|
||||
playlist()->clear_history ();
|
||||
playlist()->clear_changes ();
|
||||
|
||||
real_editor->snap_to (pos, 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@ RegionEditor::position_clock_changed ()
|
|||
boost::shared_ptr<Playlist> pl = _region->playlist();
|
||||
|
||||
if (pl) {
|
||||
_region->clear_history ();
|
||||
_region->clear_changes ();
|
||||
_region->set_position (position_clock.current_time(), this);
|
||||
_session->add_command(new StatefulDiffCommand (_region));
|
||||
}
|
||||
|
|
@ -246,7 +246,7 @@ RegionEditor::end_clock_changed ()
|
|||
boost::shared_ptr<Playlist> pl = _region->playlist();
|
||||
|
||||
if (pl) {
|
||||
_region->clear_history ();
|
||||
_region->clear_changes ();
|
||||
_region->trim_end (end_clock.current_time(), this);
|
||||
_session->add_command(new StatefulDiffCommand (_region));
|
||||
}
|
||||
|
|
@ -266,7 +266,7 @@ RegionEditor::length_clock_changed ()
|
|||
boost::shared_ptr<Playlist> pl = _region->playlist();
|
||||
|
||||
if (pl) {
|
||||
_region->clear_history ();
|
||||
_region->clear_changes ();
|
||||
_region->trim_end (_region->position() + frames - 1, this);
|
||||
_session->add_command(new StatefulDiffCommand (_region));
|
||||
}
|
||||
|
|
@ -357,7 +357,7 @@ RegionEditor::sync_offset_absolute_clock_changed ()
|
|||
{
|
||||
_session->begin_reversible_command (_("change region sync point"));
|
||||
|
||||
_region->clear_history ();
|
||||
_region->clear_changes ();
|
||||
_region->set_sync_position (sync_offset_absolute_clock.current_time());
|
||||
_session->add_command (new StatefulDiffCommand (_region));
|
||||
|
||||
|
|
@ -369,7 +369,7 @@ RegionEditor::sync_offset_relative_clock_changed ()
|
|||
{
|
||||
_session->begin_reversible_command (_("change region sync point"));
|
||||
|
||||
_region->clear_history ();
|
||||
_region->clear_changes ();
|
||||
_region->set_sync_position (sync_offset_relative_clock.current_time() + _region->position ());
|
||||
_session->add_command (new StatefulDiffCommand (_region));
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ AudioRegionGainLine::remove_point (ControlPoint& cp)
|
|||
XMLNode &before = alist->get_state();
|
||||
|
||||
if (!rv.audio_region()->envelope_active()) {
|
||||
rv.audio_region()->clear_history ();
|
||||
rv.audio_region()->clear_changes ();
|
||||
rv.audio_region()->set_envelope_active(true);
|
||||
trackview.session()->add_command(new StatefulDiffCommand (rv.audio_region()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1331,8 +1331,8 @@ RouteTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op)
|
|||
}
|
||||
}
|
||||
|
||||
playlist->clear_history ();
|
||||
playlist->clear_owned_history ();
|
||||
playlist->clear_changes ();
|
||||
playlist->clear_owned_changes ();
|
||||
|
||||
switch (op) {
|
||||
case Cut:
|
||||
|
|
@ -1391,7 +1391,7 @@ RouteTimeAxisView::paste (framepos_t pos, float times, Selection& selection, siz
|
|||
pos = session_frame_to_track_frame (pos, track()->speed());
|
||||
}
|
||||
|
||||
pl->clear_history ();
|
||||
pl->clear_changes ();
|
||||
pl->paste (*p, pos, times);
|
||||
_session->add_command (new StatefulDiffCommand (pl));
|
||||
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ public:
|
|||
virtual ~Playlist ();
|
||||
|
||||
void update (const RegionListProperty::ChangeRecord&);
|
||||
void clear_owned_history ();
|
||||
void clear_owned_changes ();
|
||||
void rdiff (std::vector<PBD::StatefulDiffCommand*>&) const;
|
||||
|
||||
boost::shared_ptr<Region> region_by_id (const PBD::ID&);
|
||||
|
|
|
|||
|
|
@ -1470,7 +1470,7 @@ AudioDiskstream::transport_stopped_wallclock (struct tm& when, time_t twhen, boo
|
|||
|
||||
// cerr << _name << ": there are " << capture_info.size() << " capture_info records\n";
|
||||
|
||||
_playlist->clear_history ();
|
||||
_playlist->clear_changes ();
|
||||
_playlist->freeze ();
|
||||
|
||||
for (buffer_position = c->front()->write_source->last_capture_start_frame(), ci = capture_info.begin(); ci != capture_info.end(); ++ci) {
|
||||
|
|
|
|||
|
|
@ -1002,7 +1002,7 @@ MidiDiskstream::transport_stopped_wallclock (struct tm& /*when*/, time_t /*twhen
|
|||
|
||||
_last_capture_sources.insert (_last_capture_sources.end(), srcs.begin(), srcs.end());
|
||||
|
||||
_playlist->clear_history ();
|
||||
_playlist->clear_changes ();
|
||||
_playlist->freeze ();
|
||||
|
||||
uint32_t buffer_position = 0;
|
||||
|
|
|
|||
|
|
@ -527,7 +527,7 @@ Playlist::notify_region_added (boost::shared_ptr<Region> r)
|
|||
pending_contents_change = true;
|
||||
pending_length = true;
|
||||
} else {
|
||||
r->clear_history ();
|
||||
r->clear_changes ();
|
||||
pending_length = false;
|
||||
LengthChanged (); /* EMIT SIGNAL */
|
||||
pending_contents_change = false;
|
||||
|
|
@ -628,7 +628,7 @@ Playlist::flush_notifications (bool from_undo)
|
|||
}
|
||||
|
||||
for (s = pending_adds.begin(); s != pending_adds.end(); ++s) {
|
||||
(*s)->clear_history ();
|
||||
(*s)->clear_changes ();
|
||||
RegionAdded (boost::weak_ptr<Region> (*s)); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
|
|
@ -2092,10 +2092,10 @@ Playlist::rdiff (vector<StatefulDiffCommand*>& cmds) const
|
|||
}
|
||||
|
||||
void
|
||||
Playlist::clear_owned_history ()
|
||||
Playlist::clear_owned_changes ()
|
||||
{
|
||||
RegionLock rlock (this);
|
||||
Stateful::clear_owned_history ();
|
||||
Stateful::clear_owned_changes ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ public:
|
|||
return _current;
|
||||
}
|
||||
|
||||
void clear_history () {
|
||||
void clear_changes () {
|
||||
_have_old = false;
|
||||
}
|
||||
|
||||
|
|
@ -153,7 +153,7 @@ protected:
|
|||
if (v == _old) {
|
||||
/* value has been reset to the value
|
||||
at the start of a history transaction,
|
||||
before clear_history() is called.
|
||||
before clear_changes() is called.
|
||||
thus there is effectively no apparent
|
||||
history for this property.
|
||||
*/
|
||||
|
|
@ -204,7 +204,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
Property<T>* maybe_clone_self_if_found_in_history_node (const XMLNode& node) const {
|
||||
Property<T>* clone_from_xml (const XMLNode& node) const {
|
||||
XMLNodeList const & children = node.children ();
|
||||
XMLNodeList::const_iterator i = children.begin();
|
||||
while (i != children.end() && (*i)->name() != this->property_name()) {
|
||||
|
|
|
|||
|
|
@ -90,21 +90,25 @@ public:
|
|||
|
||||
virtual PropertyBase* clone () const = 0;
|
||||
|
||||
/** Forget about any old value for this state */
|
||||
virtual void clear_history () = 0;
|
||||
/** Forget about any old changes to this property's value */
|
||||
virtual void clear_changes () = 0;
|
||||
|
||||
/** Tell any things we own to forget about their old values */
|
||||
virtual void clear_owned_history () {}
|
||||
virtual void clear_owned_changes () {}
|
||||
|
||||
/** Get any changes in this property as XML and add it to a node */
|
||||
/** Get any changes in this property as XML and add them to a node */
|
||||
virtual void get_changes_as_xml (XMLNode *) const = 0;
|
||||
|
||||
/** Get any changes in this property as Properties and add them to a list */
|
||||
virtual void get_changes_as_properties (PropertyList& changes, Command *) const = 0;
|
||||
|
||||
/** Collect StatefulDiffCommands for changes to anything that we own */
|
||||
virtual void rdiff (std::vector<StatefulDiffCommand*> &) const {}
|
||||
|
||||
virtual PropertyBase* maybe_clone_self_if_found_in_history_node (const XMLNode&) const { return 0; }
|
||||
/** Look in an XML node written by get_changes_as_xml and, if XML from this property
|
||||
* is found, create a property with the changes from the XML.
|
||||
*/
|
||||
virtual PropertyBase* clone_from_xml (const XMLNode &) const { return 0; }
|
||||
|
||||
/** Set our value from an XML node.
|
||||
* @return true if the value was set.
|
||||
|
|
@ -115,7 +119,7 @@ public:
|
|||
virtual void get_value (XMLNode& node) const = 0;
|
||||
|
||||
/** @return true if this property has changed in value since construction or since
|
||||
* the last call to clear_history(), whichever was more recent.
|
||||
* the last call to clear_changes (), whichever was more recent.
|
||||
*/
|
||||
virtual bool changed() const = 0;
|
||||
|
||||
|
|
@ -125,7 +129,7 @@ public:
|
|||
/** Invert the changes in this property */
|
||||
virtual void invert () = 0;
|
||||
|
||||
const gchar*property_name () const { return g_quark_to_string (_property_id); }
|
||||
const gchar* property_name () const { return g_quark_to_string (_property_id); }
|
||||
PropertyID property_id () const { return _property_id; }
|
||||
|
||||
bool operator==(PropertyID pid) const {
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ class SequenceProperty : public PropertyBase
|
|||
return !_changes.added.empty() || !_changes.removed.empty();
|
||||
}
|
||||
|
||||
void clear_history () {
|
||||
void clear_changes () {
|
||||
_changes.added.clear ();
|
||||
_changes.removed.clear ();
|
||||
}
|
||||
|
|
@ -165,7 +165,7 @@ class SequenceProperty : public PropertyBase
|
|||
}
|
||||
}
|
||||
|
||||
SequenceProperty<Container>* maybe_clone_self_if_found_in_history_node (XMLNode const & node) const {
|
||||
SequenceProperty<Container>* clone_from_xml (XMLNode const & node) const {
|
||||
|
||||
XMLNodeList const children = node.children ();
|
||||
|
||||
|
|
@ -186,9 +186,9 @@ class SequenceProperty : public PropertyBase
|
|||
return 0;
|
||||
}
|
||||
|
||||
void clear_owned_history () {
|
||||
void clear_owned_changes () {
|
||||
for (typename Container::iterator i = begin(); i != end(); ++i) {
|
||||
(*i)->clear_history ();
|
||||
(*i)->clear_changes ();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -67,8 +67,8 @@ class Stateful {
|
|||
|
||||
/* history management */
|
||||
|
||||
void clear_history ();
|
||||
virtual void clear_owned_history ();
|
||||
void clear_changes ();
|
||||
virtual void clear_owned_changes ();
|
||||
PropertyList* get_changes_as_properties (Command *) const;
|
||||
virtual void rdiff (std::vector<StatefulDiffCommand*> &) const;
|
||||
bool changed() const;
|
||||
|
|
|
|||
|
|
@ -157,12 +157,12 @@ Stateful::instant_xml (const string& str, const sys::path& directory_path)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/** Forget about any old state for this object */
|
||||
/** Forget about any changes to this object's properties */
|
||||
void
|
||||
Stateful::clear_history ()
|
||||
Stateful::clear_changes ()
|
||||
{
|
||||
for (OwnedPropertyList::iterator i = _properties->begin(); i != _properties->end(); ++i) {
|
||||
i->second->clear_history ();
|
||||
i->second->clear_changes ();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -329,7 +329,7 @@ Stateful::property_factory (const XMLNode& history_node) const
|
|||
PropertyList* prop_list = new PropertyList;
|
||||
|
||||
for (OwnedPropertyList::const_iterator i = _properties->begin(); i != _properties->end(); ++i) {
|
||||
PropertyBase* prop = i->second->maybe_clone_self_if_found_in_history_node (history_node);
|
||||
PropertyBase* prop = i->second->clone_from_xml (history_node);
|
||||
|
||||
if (prop) {
|
||||
prop_list->add (prop);
|
||||
|
|
@ -348,10 +348,10 @@ Stateful::rdiff (vector<StatefulDiffCommand*>& cmds) const
|
|||
}
|
||||
|
||||
void
|
||||
Stateful::clear_owned_history ()
|
||||
Stateful::clear_owned_changes ()
|
||||
{
|
||||
for (OwnedPropertyList::iterator i = _properties->begin(); i != _properties->end(); ++i) {
|
||||
i->second->clear_owned_history ();
|
||||
i->second->clear_owned_changes ();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ using namespace std;
|
|||
using namespace PBD;
|
||||
|
||||
/** Create a new StatefulDiffCommand by examining the changes made to a Stateful
|
||||
* since the last time that clear_history was called on it.
|
||||
* since the last time that clear_changes was called on it.
|
||||
* @param s Stateful object.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ ScalarPropertiesTest::testBasic ()
|
|||
CPPUNIT_ASSERT (_fred == 4);
|
||||
CPPUNIT_ASSERT (_fred.changed() == true);
|
||||
|
||||
_fred.clear_history ();
|
||||
_fred.clear_changes ();
|
||||
CPPUNIT_ASSERT (_fred.changed() == false);
|
||||
|
||||
_fred = 5;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue