Choose Top Region always at position 001|01|000

Hi Ardourists,

I’m using Editor:access_action(“Region”,“choose-top-region-context-menu”) to bring up the ‘Choose Top Region’ box, but the position shown is (almost?) always 001|01|000 even when my selected regions are not at the beginning, meaning that the list contains the regions at the beginning of the track, not the selected ones. This follows these actions:

    Editor:access_action("Editor", "split-region") 
    Editor:access_action("Editor", "set-loop-from-edit-range")
    Editor:access_action("Transport","Loop")
    Editor:access_action("Region","choose-top-region-context-menu")

The loop that plays is the expected one, over the selection. Is there some way I should be specifying the position?

Ardour 8.12, Ubuntu Studio 24.04.

1 Like

A bit of followup…
The position seems to be at the last mouse right-click, which makes sense in the context of the user invoking the context menu, but not from a script.
However, if I don’t use the context-menu version of the command, the region list (usually?) contains the regions on both sides of the split, which is also not what I want.

In the Ardour source, this is the RegionLayeringOrderEditor defined in region_layering_order_editor.cc, yes? Can I somehow call set_context with the desired position from my Lua script? I’m not clear on the capabilities here.