LUA script: Abort current recording and start over with count-in

I just made a script that makes “Stop and forget + record again” as simple as one click. Maybe someone find it useful. I borrowed the icon from elsewhere and just slighly upgraded :slight_smile:

ardour {
	["type"] = "EditorAction",
	name = "Abort and Restart recording w. count-in",
	author = "Skygge",
	description = [[Abort current recording and start over with count-in.]]
}

function factory (unused) return function()
	if (Session:actively_recording()) then
		Editor:access_action ("Transport", "ToggleRollForgetCapture")
	end
	
	if (Session:transport_rolling ()) then
		Editor:access_action ("Transport", "Stop")
	end
	
	Session:maybe_enable_record()
	Editor:access_action ("Transport", "RecordCountIn")
	
end end


function icon (params) return function (ctx, width, height)
        local x = width * .5
        local y = height * .5
        local r = math.min (x, y) * .45
        local q = math.min (x, y) * .49

        ctx:arc (x - q , y, r, 0, 2 * math.pi)
        ctx:set_source_rgba (.9, .3, .3, 1.0)
        ctx:fill_preserve ()
        ctx:set_source_rgba (0, 0, 0, .8)
        ctx:set_line_width (1)
        ctx:stroke ()

        ctx:move_to (x - 2 * r, y - r)
        ctx:line_to (x * .5 + r, y + r)
        ctx:set_source_rgba (0, 0, 0, .8)
        ctx:set_line_width (2)
        ctx:stroke ()
        
        ctx:move_to (x * .5 + r, y - r)
        ctx:line_to (x - 2 * r, y + r)
        ctx:set_source_rgba (0, 0, 0, .8)
        ctx:set_line_width (2)
        ctx:stroke ()
        
        ctx:arc (x + q, y, r, 0, 2 * math.pi)
        ctx:set_source_rgba (.9, .3, .3, 1.0)
        ctx:fill_preserve ()
        ctx:set_source_rgba (0, 0, 0, .8)
        ctx:set_line_width (1)
        ctx:stroke ()
end end

Nice work! Thanks for sharing.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.