3 # Example script to prepare the Ardour session for recording
5 Usually there's a certain state needed to actually start the recording. This example
6 script treats the situation of a podcast recording. When starting the recording the
7 following settings have to be ensured.
9 * Session has to be recenabled
10 * Tracks have to be recenabled
11 * Gain automation have to set on write in order to record events from mute buttons
12 * The playhead has to be at 00:00:00.000
13 * The last (failed) capture has to be cleared
14 * Location markers have to be cleared
16 So this script automizes away the task and lets the podcast moderator by just one
17 action (for example triggerd by a Wiimote) prepare the session for recording.
19 It can be used for example with the python script of the Linux podcasting hacks:
20 https://github.com/linux-podcasting-hacks/wiimote-recording-control
22 Not that this script is more meant as an demo script to demonstrate the
23 possibilities of the Lua interface.
28 ["type"] = "EditorAction",
29 name = "Prepare recording for podcast",
30 author = "Johannes Mueller",
32 Prepares the Ardour session for podcast recording.
34 * Sets the gain automation to "Write" so that muting buttons work.
35 * Recenables all tracks.
37 * Erases the last capture (assuming that it was a failed one)
38 * Rewinds the session to starting point.
39 * Recenables the session.
43 function factory (unused) return function()
44 if Session:actively_recording() then
47 for t in Session:get_tracks():iter() do
48 t:gain_control():set_automation_state(ARDOUR.AutoState.Write)
49 t:rec_enable_control():set_value(1, PBD.GroupControlDisposition.UseGroup)
52 for l in Session:locations():list():iter() do
54 Session:locations():remove(l)
59 Editor:remove_last_capture()
60 Session:maybe_enable_record()