summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorNikolaus Gullotta <nikolaus.gullotta@gmail.com>2018-07-31 14:13:34 -0500
committerNikolaus Gullotta <nikolaus.gullotta@gmail.com>2018-07-31 14:13:34 -0500
commit04ac151a1b46a6fcde5fa540e79912206d9bf8d6 (patch)
treecd5347a220ad16d617c01500190d814734500558 /scripts
parentdc4294b89a5000fa60fb2b045704010e0090de4d (diff)
check-in of Lua script snippet to determine what program is running
Diffstat (limited to 'scripts')
-rw-r--r--scripts/s_whoami.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/scripts/s_whoami.lua b/scripts/s_whoami.lua
new file mode 100644
index 0000000000..d391d65095
--- /dev/null
+++ b/scripts/s_whoami.lua
@@ -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