mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 16:24:57 +01:00
check-in of Lua script snippet to determine what program is running
This commit is contained in:
parent
dc4294b89a
commit
04ac151a1b
1 changed files with 22 additions and 0 deletions
22
scripts/s_whoami.lua
Normal file
22
scripts/s_whoami.lua
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
ardour { ["type"] = "Snippet", name = "Who Am I?" }
|
||||
|
||||
function factory() return function()
|
||||
|
||||
function whoami()
|
||||
--pcall is the lua equivalent
|
||||
--of try: ... catch: ...
|
||||
if not pcall(function() local first_check = Session:get_mixbus(0) end) then
|
||||
return "Ardour"
|
||||
else
|
||||
local second_check = Session:get_mixbus(11)
|
||||
if second_check:isnil() then
|
||||
return "Mixbus"
|
||||
else
|
||||
return "32C"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
print(whoami())
|
||||
|
||||
end end
|
||||
Loading…
Add table
Add a link
Reference in a new issue