audio chan pos rework, batchrender deadlock, titler/crikey grab_event tweak, thread...
[goodguy/history.git] / cinelerra-5.1 / cinelerra / undostack.C
index acc6544f010dd0467b2150b206fd1b38d08a3221..1bb781022695ec1ba5059c834c236902924a7696 100644 (file)
@@ -35,6 +35,23 @@ UndoStack::~UndoStack()
 {
 }
 
+UndoStackItem *UndoStack::get_current_undo()
+{
+       UndoStackItem *item = current;
+       if( item &&  (number_of(item) % 2) ) item = item->previous;
+       if( item && !(number_of(item) % 2) ) item = item->previous;
+       return item;
+}
+
+UndoStackItem *UndoStack::get_current_redo()
+{
+       UndoStackItem *item = current ? current : first;
+       if( item &&  (number_of(item) % 2) ) item = item->next;
+       if( item && !(number_of(item) % 2) ) item = item->next;
+       return item;
+}
+
+
 UndoStackItem* UndoStack::push()
 {
 // current is only 0 if before first undo
@@ -76,11 +93,6 @@ UndoStackItem* UndoStack::push()
        return current;
 }
 
-void UndoStack::pull()
-{
-       if(current) current = PREVIOUS;
-}
-
 UndoStackItem* UndoStack::pull_next()
 {
 // use first entry if none