Button widgets for Lua

Hi,

I’m writing a tool to help me navigate around a long session. My Lua script looks at existing ranges and markers, and indexes them. I’ve constructed a dialog which displays a selection of markers in a specific order. I’d like to add “play” buttons next to existing marker names.

A slightly similar script exists, jump_to_marker.lua. It solves a similar problem, where it needs some input from the user, then executes an action (searches for a matching marker), if found it moves the playhead to the marker, and optionally reopens the window. Unfortunately the opened window loses state - the search term we’ve put in the search box is gone. This might be remedied, but a button (which doesn’t close/reset the window) would have been a better fit, wouldn’t it?

I looked through the source code, and in luadialog.cc I saw a number of widgets, but there wasn’t a Button widget. I could imagine, at least from the Lua perspective, a LuaWidgetButton where you could pass in a closure, and Ardour would run it without closing the dialog.

Side note, there’s a workaround, I can use radio buttons to select one of the markers to play, then ask Ardour to play from the selected marker, and reopen the window. This would require 2 clicks for 1 play: select marker and then press OK. But that’s not what I wanted to discuss in this thread.

Has a button widget been on the Lua scripting radar at any point in Ardour?

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