fix auto id 'that' blunder, tweak keyfrm popup speed undo
authorGood Guy <good1.2guy@gmail.com>
Fri, 4 Sep 2020 15:17:01 +0000 (09:17 -0600)
committerGood Guy <good1.2guy@gmail.com>
Fri, 4 Sep 2020 15:17:01 +0000 (09:17 -0600)
cinelerra-5.1/cinelerra/auto.C
cinelerra-5.1/cinelerra/keyframepopup.C
cinelerra-5.1/cinelerra/keyframepopup.h

index 03d4aa016eb5d72b67122f79554e0f9ae8aad314..cd950dad0fae9907a1668391c7fa548a9a967fd1 100644 (file)
@@ -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;
 }
 
index 830867929e6b4d1ecbd32a2913ee356907845a17..c3dcaea1c73024d3f0ee7980e749f1ec78cb8187 100644 (file)
@@ -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;
index c2b1631120cf146c518e94ad1afc280bc76e586f..16342eb0438810e5909782301ded4b386cb15e80 100644 (file)
@@ -210,6 +210,7 @@ public:
        KeySpeedOK *key_speed_ok;
        KeySpeedAutoEdge *auto_edge;
        KeySpeedAutoSpan *auto_span;
+       int need_undo;
 };
 
 class KeySpeedOK : public BC_Button