I have written the following code in the script editor:
function factory (params)
return function ()
files = C.StringVector();
pos = -1
Editor:do_import(files, Editing.ImportDistinctFiles, Editing.ImportAsTrack, ARDOUR.SrcQuality.SrcBest, pos, ARDOUR.PluginInfo())
And I get this error:
LuaException: [string “function factory (params)…”]:6: bad argument #6 to ‘do_import’ (PluginInfo expected, got PluginInfo)
The error is not very clear to me.
This is intricate issue: In short this is fixed in ardour-git (since 5.5-567-gddeaa6c52)
The long story: there is (or was) an ambiguity between the C++
boost::weak_ptr<PluginInfo> . Usually the type is implicit when using arguments. But in case of the constructor: The script created a weak-pointer, the function expected a shared-pointer.
Note that the API for do_import() has changed (allow to import tempo-maps from .mid) in recent git:
Editing.ImportDistinctFiles, Editing.ImportAsTrack, ARDOUR.SrcQuality.SrcBest,
Thanks for your fix @x42!
I’ll try it asap.
Is arlua included in Ardour daily builds?
I find it useful for debugging.
It works in ardour 5.5.584, thanks