From 6172de314466845f084a00b00538b6d44bf9db9b Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 7 Dec 2023 03:47:31 +0100 Subject: [PATCH] Vapor: add Lua bindings --- libs/ardour/luabindings.cc | 24 ++++++++++++++++++++++++ share/scripts/_dump_latency.lua | 7 +++++++ 2 files changed, 31 insertions(+) diff --git a/libs/ardour/luabindings.cc b/libs/ardour/luabindings.cc index e9f9e6d04b..5265d17837 100644 --- a/libs/ardour/luabindings.cc +++ b/libs/ardour/luabindings.cc @@ -97,6 +97,8 @@ #include "ardour/solo_isolate_control.h" #include "ardour/solo_safe_control.h" #include "ardour/stripable.h" +#include "ardour/surround_send.h" +#include "ardour/surround_pannable.h" #include "ardour/track.h" #include "ardour/tempo.h" #include "ardour/user_bundle.h" @@ -1474,6 +1476,8 @@ LuaBindings::common (lua_State* L) .addFunction ("playback_latency", &Route::playback_latency) .addFunction ("monitoring_state", &Route::monitoring_state) .addFunction ("monitoring_control", &Route::monitoring_control) + .addFunction ("surround_send", &Route::surround_send) + .addFunction ("surround_return", &Route::surround_return) .endClass () .deriveWSPtrClass ("Playlist") @@ -1828,6 +1832,7 @@ LuaBindings::common (lua_State* L) .addCast ("to_peakmeter") .addCast ("to_monitorprocessor") .addCast ("to_send") + .addCast ("to_surroundsend") .addCast ("to_internalsend") .addCast ("to_polarityprocessor") .addCast ("to_delayline") @@ -1891,6 +1896,25 @@ LuaBindings::common (lua_State* L) .addFunction ("feeds", &InternalSend::feeds) .endClass () + .deriveWSPtrClass ("SurroundPannable") + .addData ("name", &SurroundPannable::pan_pos_x) + .addData ("name", &SurroundPannable::pan_pos_y) + .addData ("name", &SurroundPannable::pan_pos_z) + .addData ("name", &SurroundPannable::pan_size) + .addData ("name", &SurroundPannable::pan_snap) + .endClass () + + .deriveWSPtrClass ("SurroundSend") + .addFunction ("get_delay_in", &SurroundSend::get_delay_in) + .addFunction ("get_delay_out", &SurroundSend::get_delay_out) + .addFunction ("gain_control", &SurroundSend::gain_control) + .addFunction ("n_pannables", &SurroundSend::gain_control) + .addFunction ("pannable", &SurroundSend::pannable) + .endClass () + + .deriveWSPtrClass ("SurroundReturn") + .endClass () + .deriveWSPtrClass ("Return") .endClass () diff --git a/share/scripts/_dump_latency.lua b/share/scripts/_dump_latency.lua index 7024376ecc..8c4788e772 100644 --- a/share/scripts/_dump_latency.lua +++ b/share/scripts/_dump_latency.lua @@ -31,6 +31,13 @@ function factory () return function () proc:capture_offset(), proc:playback_offset(), proc:to_send():get_delay_in(), proc:to_send():get_delay_out() )) + elseif all_procs and not proc:to_surroundsend():isnil () then + print (string.format (" * %-27s L: %4d in: %4d out: %4d capt: %4d play %4d DLY-SRC: %4d DLY-DST: %4d", + string.sub (proc:name(), 0, 27) , proc:signal_latency(), + proc:input_latency(), proc:output_latency(), + proc:capture_offset(), proc:playback_offset(), + proc:to_surroundsend():get_delay_in(), proc:to_surroundsend():get_delay_out() + )) elseif all_procs or not proc:to_diskioprocessor():isnil () then print (string.format (" * %-27s L: %4d in: %4d out: %4d capt: %4d play %4d", string.sub (proc:name(), 0, 27) , proc:signal_latency(),