Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Automated Import / Export
#1
Hi, my goal is to automate importing and exporting in a session to be able to perform batch import/export on the same template (tracks, busses, DSP, etc.).

Importing works quite well with do_import:

Code:
local files = C.StringVector()
files:push_back("some.wav/mid")
local pos = -1
Editor:do_import (files,
    Editing.ImportDistinctFiles, Editing.ImportToTrack, ARDOUR.SrcQuality.SrcBest,
    ARDOUR.MidiTrackNameSource.SMFTrackName, ARDOUR.MidiTempoMapDisposition.SMFTempoIgnore,
    pos, ARDOUR.PluginInfo())

My main struggle is exporting in code.
There is Editor:export_audio(), but that just opens the export dialog.

My question: Is there any function to actually perform the export in scripts?

Or has anyone another approach to achieve that automated import/export idea?

Thanks for all replies! Oyst
Reply
#2
Shocked 
To share my working workaround:
The actual exporting can be triggered under Ubuntu by using the command line tool xdotool for simulating the keyboard key press. This can be called from Lua code by io.popen() and just delayed till the dialog is opened by a simple call of sleep.

Code:
function factory () return function ()
  print ("! os execute")
  local handle = io.popen("sleep 3; xdotool key Return")

  print("! open export dialog")
  Editor:export_audio()

  local result = handle:read("*a")
  print (result)
  handle:close()

  print ("! end")
end end

Was very surprised that this simple hack worked :-O

Unfortunately, this does not help under Windows.
Maybe anyone knows a simple tool to achieve this for Win10?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)