X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fmainundo.C;h=4a921cf4e082191a7065f80397eb3e0866204525;hb=86bd203ac1fc29d93f63d13e2979468f06bdc3a2;hp=bd048c10de5fa84fcc816206386b8079b753192c;hpb=ae3fc4be2e74120251506615bb29b853c6e10ff6;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/mainundo.C b/cinelerra-5.1/cinelerra/mainundo.C index bd048c10..4a921cf4 100644 --- a/cinelerra-5.1/cinelerra/mainundo.C +++ b/cinelerra-5.1/cinelerra/mainundo.C @@ -22,6 +22,7 @@ #include "asset.h" #include "assets.h" #include "bctimer.h" +#include "clipedls.h" #include "edl.h" #include "filexml.h" #include "mainindexes.h" @@ -30,7 +31,6 @@ #include "mainundo.h" #include "mwindow.h" #include "mwindowgui.h" -#include "nestededls.h" #include #include "undostack.h" @@ -55,10 +55,7 @@ void MainUndo::update_undo_entry(const char *description, { FileXML file; - mwindow->edl->save_xml(&file, - "", - 0, - 0); + mwindow->edl->save_xml(&file, ""); file.terminate_string(); if(changes_made) mwindow->session->changes_made = 1; @@ -190,11 +187,13 @@ int MainUndo::redo_load_flags() int MainUndo::undo() { mwindow->undo_commercial(); - - UndoStackItem *current = next_undo(); -// Now have an even number + UndoStackItem *current = undo_stack->current; + if( current ) { + undo_stack->current = next_undo(); + if( undo_stack->number_of(current) % 2 ) + current = PREVIOUS; // Now have an even number + } if( current ) { - undo_stack->current = current; // Set the redo text to the current description if( mwindow->gui ) { UndoStackItem *next = NEXT; @@ -262,16 +261,11 @@ int MainUndo::load_from_undo(FileXML *file, uint32_t load_flags) if( load_flags & LOAD_SESSION ) mwindow->close_mixers(); mwindow->edl->load_xml(file, load_flags); - for(Asset *asset = mwindow->edl->assets->first; - asset; - asset = asset->next) - { + for( Asset *asset=mwindow->edl->assets->first; asset; asset=asset->next ) { mwindow->mainindexes->add_next_asset(0, asset); } - - for(int i = 0; i < mwindow->edl->nested_edls->size(); i++) - { - EDL *nested_edl = mwindow->edl->nested_edls->get(i); + for( int i=0; iedl->nested_edls.size(); ++i ) { + EDL *nested_edl = mwindow->edl->nested_edls[i]; mwindow->mainindexes->add_next_asset(0, nested_edl); } mwindow->mainindexes->start_build(); @@ -284,10 +278,7 @@ int MainUndo::load_from_undo(FileXML *file, uint32_t load_flags) void MainUndo::reset_creators() { - for(UndoStackItem *current = undo_stack->first; - current; - current = NEXT) - { + for( UndoStackItem *current=undo_stack->first; current; current=NEXT ) { current->set_creator(0); } }