From 5880e51e920929cc5beb189535916b76476745a6 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 26 Feb 2024 21:49:52 +0100 Subject: [PATCH] Add Icon to ADM/BWF script, and preseed it --- gtk2_ardour/luainstance.cc | 3 +++ share/scripts/_adm_bwf.lua | 13 ++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/luainstance.cc b/gtk2_ardour/luainstance.cc index 9e657efbc0..35e81bf656 100644 --- a/gtk2_ardour/luainstance.cc +++ b/gtk2_ardour/luainstance.cc @@ -1547,6 +1547,9 @@ LuaInstance::pre_seed_scripts () int id = 0; pre_seed_script ("Mixer Screenshot", id); pre_seed_script ("List Plugins", id); +#ifdef Mixbus + pre_seed_script ("Import ADM BWF File", id); +#endif } bool diff --git a/share/scripts/_adm_bwf.lua b/share/scripts/_adm_bwf.lua index 4ecd09c403..3b9c00c484 100644 --- a/share/scripts/_adm_bwf.lua +++ b/share/scripts/_adm_bwf.lua @@ -2,7 +2,7 @@ ardour { ["type"] = "EditorAction", name = "Import ADM BWF File", author = "Ardour Team", - description = [[...]] + description = [[Load dynamic meta-data from an ADM file, import audio channels to the timeline and copy fixed settings for export.]] } function factory () return function () @@ -132,3 +132,14 @@ function factory () return function () Session:surround_master():surround_return():set_bed_mix (true, rv['file'], imap:to_array ()) print ("OK") end end + +function icon (params) return function (ctx, width, height, fg) + local wh = math.min (width, height) + ctx:set_source_rgba (ARDOUR.LuaAPI.color_to_rgba (fg)) + ctx:arc (0.5 * width - wh * 0.3, 0.5 * height, wh * .275, -0.5 * math.pi , 0.5 * math.pi) + ctx:close_path () + ctx:fill () + ctx:arc (0.5 * width + wh * 0.3, 0.5 * height, wh * .275, 0.5 * math.pi , 1.5 * math.pi) + ctx:close_path () + ctx:fill () +end end