From 25e944875e181186eeb59a124c1822e5b55d2248 Mon Sep 17 00:00:00 2001 From: Good Guy Date: Fri, 4 Sep 2020 09:17:01 -0600 Subject: [PATCH] fix auto id 'that' blunder, tweak keyfrm popup speed undo --- cinelerra-5.1/cinelerra/auto.C | 2 +- cinelerra-5.1/cinelerra/keyframepopup.C | 11 ++++++++--- cinelerra-5.1/cinelerra/keyframepopup.h | 1 + 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/cinelerra-5.1/cinelerra/auto.C b/cinelerra-5.1/cinelerra/auto.C index 03d4aa01..cd950dad 100644 --- a/cinelerra-5.1/cinelerra/auto.C +++ b/cinelerra-5.1/cinelerra/auto.C @@ -69,7 +69,7 @@ void Auto::copy(int64_t start, int64_t end, FileXML *file, int default_only) void Auto::copy_from(Auto *that) { - this->orig_id = orig_id; + this->orig_id = that->orig_id; this->position = that->position; } diff --git a/cinelerra-5.1/cinelerra/keyframepopup.C b/cinelerra-5.1/cinelerra/keyframepopup.C index 83086792..c3dcaea1 100644 --- a/cinelerra-5.1/cinelerra/keyframepopup.C +++ b/cinelerra-5.1/cinelerra/keyframepopup.C @@ -629,6 +629,7 @@ KeySpeedPatch::KeySpeedPatch(MWindow *mwindow, PatchGUI *gui, { this->mwindow = mwindow; this->gui = gui; + need_undo = 1; } KeySpeedPatch::~KeySpeedPatch() { @@ -693,8 +694,10 @@ void KeySpeedPatch::update_speed(float v) float change = v - current->get_value(gui->edge); if( !change ) return; gui->change_source = 1; - int need_undo = !speed_autos->auto_exists_for_editing(position); - mwindow->undo->update_undo_before(_("speed"), need_undo ? 0 : this); + if( need_undo ) { + need_undo = 0; + mwindow->undo->update_undo_before(_("speed"), this); + } current->bump_value(v, gui->edge, gui->span); if( track->is_ganged() ) { TrackCanvas *track_canvas = gui->patchbay->pane->canvas; @@ -720,8 +723,10 @@ int KeySpeedOK::handle_event() { MWindow *mwindow = key_speed_patch->mwindow; mwindow->speed_after(1, 1); - mwindow->undo->update_undo_after(_("speed"), + if( !key_speed_patch->need_undo ) { + mwindow->undo->update_undo_after(_("speed"), LOAD_AUTOMATION + LOAD_EDITS + LOAD_TIMEBAR); + } mwindow->resync_guis(); mwindow->gui->close_keyvalue_popup(); return 1; diff --git a/cinelerra-5.1/cinelerra/keyframepopup.h b/cinelerra-5.1/cinelerra/keyframepopup.h index c2b16311..16342eb0 100644 --- a/cinelerra-5.1/cinelerra/keyframepopup.h +++ b/cinelerra-5.1/cinelerra/keyframepopup.h @@ -210,6 +210,7 @@ public: KeySpeedOK *key_speed_ok; KeySpeedAutoEdge *auto_edge; KeySpeedAutoSpan *auto_span; + int need_undo; }; class KeySpeedOK : public BC_Button -- 2.26.2