View Single Post
Old 12-18-2016, 04:51 AM   #1
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default ReaScript: Undo_EndBlock with flags != -1 are not added to undo history

The undo text shows up in the menu bar of the main window, but it is not added to the list of undo points in the Undo History window.

EDIT: Could the meanings of the flags be added to the API documentation? The only place where this info is available on the internet, is in the thread Changing ReaScript Undo Name.

EDIT 2: If this behavior is intentional and not a bug, could the devs please confirm? In this case, these flags could be very useful for ending undo blocks without creating undo points. For example, if a scripts calls native Actions in a deferred loop using OnCommand, these flags can be used to bracket the Actions inside an undo block, thereby preventing the creation of undo points in each cycle.

EDIT 2017-06-04: I notice that some info regarding undo flags have been added to the ReaScript Introduction page:

-1: All undo info
0: ???? When only calling actions via OnCommand, since these create their own undo points
1: track configurations (track/master vol/pan/routing, ALL envelopes (master included))
2: track/master FX
4: track items
8: project states (loop selection, markers, regions)
16: freeze states

The page also states that:

"If you are simply calling other actions (via Main_OnCommand or similar functions), [the undo flags] should be 0. If you modify the state of the project directly, it's safest to set the bitmask to -1."

"A more specific combination of flags may be an optimization, depending on what your script is doing."

Last edited by juliansader; 06-04-2017 at 11:43 PM.
juliansader is offline   Reply With Quote