View Issue Details

IDProjectCategoryView StatusLast Update
0008277ardourbugspublic2020-06-30 08:45
Reporterlaex Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
PlatformUbuntuOSMint 19.3OS Version(any)
Product Version6.0 
Summary0008277: No undo for scripted fade outs (in many cases)
DescriptionWhen Lua scripting fade ins and outs for audio regions, the fade outs (in many cases) do not register an undo correctly (as do the fade ins) and therefore cannot be undone! I did a lot of test rounds with virgin Ardour6 config folders, old and freshly created projects… It is 100% reproducible on my machine - try this basic example script:

<script>
-- prepare undo operation
Session:begin_reversible_command ("FADE IN AND OUT")
local add_undo = false -- keep track if something has changed

local sel = Editor:get_selection ()
for r in sel.regions:regionlist ():iter () do

    -- prepare selected region(s) for undo
    r:to_stateful ():clear_changes ()

    local ar = r:to_audioregion ()
    
    ar:set_fade_out_shape (ARDOUR.FadeShape.FadeLinear)
    ar:set_fade_out_length (100000)
    ar:set_fade_out_active (true)

    ar:set_fade_in_shape (ARDOUR.FadeShape.FadeLinear)
    ar:set_fade_in_length (100000)
    ar:set_fade_in_active (true)

    -- save changes for selected region(s) (if any) to undo command
    if not Session:add_stateful_diff_command (r:to_statefuldestructible ()):empty () then
        add_undo = true
    end

end

-- all done, commit the combined Undo Operation
if add_undo then
    -- the 'nil' Command here means to use the collected diffs added above
    Session:commit_reversible_command (nil)
else
    Session:abort_reversible_command ()
end
</script>
Steps To ReproduceIt works perfectly (as expected) with:
+ Freshly recorded regions
+ Regions of freshly opened (existing) projects
+ Regions that have been moved within their track
+ Regions that have been shortened or extended by moving their boundaries

Fade-Out-Undo doesn’t work with:
+ A region that got moved to another track
+ Imported audio files/regions
+ Regions that have been cut apart (both new regions don’t work)
+ Region that got copied with Ctrl+drag (“original” region still works) or Ctrl+c/x/Ctrl+v
(Once project is saved and reopened, also those regions work as expected (again)!)
Additional InformationOn the fade-in-side everything seems to be perfect! When scripting fade ins and fade outs in one script, fade ins are undo-able perfectly, the fade outs (in cases mentioned above) don't react to undo. When scripting ONLY fade outs: Interestingly, the undo command is not even registered/available for the dysfunctioning cases mentioned above!
TagsNo tags attached.

Activities

laex

2020-06-30 08:45

reporter   ~0024529

see attached animation for example:
fadeOutBug.gif (362,456 bytes)

Issue History

Date Modified Username Field Change
2020-06-30 08:43 laex New Issue
2020-06-30 08:45 laex File Added: fadeOutBug.gif
2020-06-30 08:45 laex Note Added: 0024529