Exclude Lua Convovler from unit-test (fails because of missing IR)
authorRobin Gareus <robin@gareus.org>
Thu, 5 Sep 2019 18:17:57 +0000 (20:17 +0200)
committerRobin Gareus <robin@gareus.org>
Thu, 5 Sep 2019 18:17:57 +0000 (20:17 +0200)
libs/ardour/test/lua_script_test.cc
scripts/__convolv.lua [new file with mode: 0644]
scripts/_convolv.lua [deleted file]

index bb658a207acd1855301974bf882ceacd0153f69a..081e3f989942c2b2ff4878845cb467ae54551d8a 100644 (file)
@@ -74,6 +74,16 @@ LuaScriptTest::dsp_script_test ()
                boost::shared_ptr<Processor> processor (new PluginInsert (*_session, p));
                processor->enable (true);
 
+               if (Glib::path_get_basename ((*i)->path).find ("__") == 0) {
+                       std::cout << " .. skip processing test\n";
+                       /* Example scripts (filename with leading underscore), that
+                        * use a double-underscore at the beginning of the file-name
+                        * are excluded from unit-tests (e.g. "Lua Convolver"
+                        * requires IR files).
+                        */
+                       continue;
+               }
+
                int rv = r->add_processor (processor, boost::shared_ptr<Processor>(), 0);
                CPPUNIT_ASSERT_MESSAGE ((*i)->name, rv == 0);
                processor->enable (true);
diff --git a/scripts/__convolv.lua b/scripts/__convolv.lua
new file mode 100644 (file)
index 0000000..b8d8262
--- /dev/null
@@ -0,0 +1,59 @@
+ardour { ["type"] = "dsp", name = "Lua Convolver", license = "MIT", author = "Ardour Lua Task Force", description = [[Another simple DSP example]] }
+
+function dsp_ioconfig () return
+       {
+               { audio_in = 1, audio_out = 1},
+               { audio_in = 1, audio_out = 2},
+               { audio_in = 2, audio_out = 2},
+       }
+end
+
+local conv, mode, ir_file
+
+ir_file = "/tmp/reverbs/St Nicolaes Church.wav"
+ir_file = "/tmp/reverbs/Large Wide Echo Hall.wav"
+
+function dsp_configure (ins, outs)
+       if outs:n_audio() == 1 then
+               assert (ins:n_audio() == 1)
+               mode = ARDOUR.DSP.IRChannelConfig.Mono
+       elseif ins:n_audio() == 1 then
+               assert (outs:n_audio() == 2)
+               mode = ARDOUR.DSP.IRChannelConfig.MonoToStereo
+       else
+               assert (ins:n_audio() == 2)
+               assert (outs:n_audio() == 2)
+               mode = ARDOUR.DSP.IRChannelConfig.Stereo
+       end
+
+       local irs = ARDOUR.DSP.IRSettings()
+       irs.gain = 0.5
+       conv = ARDOUR.DSP.Convolver (Session, ir_file, mode, irs)
+       collectgarbage ()
+end
+
+function dsp_latency ()
+       if conv then
+               return conv:latency()
+       else
+               return 0
+       end
+end
+
+-- the DSP callback function to process audio audio
+-- "ins" and "outs" are http://manual.ardour.org/lua-scripting/class_reference/#C:FloatArray
+function dsp_run (ins, outs, n_samples)
+       assert (#ins <= #outs)
+
+       for c = 1, #ins do
+               if ins[c] ~= outs[c] then -- if processing is not in-place..
+                       ARDOUR.DSP.copy_vector (outs[c], ins[c], n_samples) -- ..copy data from input to output.
+               end
+       end
+
+       if #outs == 1 then
+               conv:run (outs[1], n_samples)
+       else
+               conv:run_stereo (outs[1], outs[2], n_samples)
+       end
+end
diff --git a/scripts/_convolv.lua b/scripts/_convolv.lua
deleted file mode 100644 (file)
index b8d8262..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-ardour { ["type"] = "dsp", name = "Lua Convolver", license = "MIT", author = "Ardour Lua Task Force", description = [[Another simple DSP example]] }
-
-function dsp_ioconfig () return
-       {
-               { audio_in = 1, audio_out = 1},
-               { audio_in = 1, audio_out = 2},
-               { audio_in = 2, audio_out = 2},
-       }
-end
-
-local conv, mode, ir_file
-
-ir_file = "/tmp/reverbs/St Nicolaes Church.wav"
-ir_file = "/tmp/reverbs/Large Wide Echo Hall.wav"
-
-function dsp_configure (ins, outs)
-       if outs:n_audio() == 1 then
-               assert (ins:n_audio() == 1)
-               mode = ARDOUR.DSP.IRChannelConfig.Mono
-       elseif ins:n_audio() == 1 then
-               assert (outs:n_audio() == 2)
-               mode = ARDOUR.DSP.IRChannelConfig.MonoToStereo
-       else
-               assert (ins:n_audio() == 2)
-               assert (outs:n_audio() == 2)
-               mode = ARDOUR.DSP.IRChannelConfig.Stereo
-       end
-
-       local irs = ARDOUR.DSP.IRSettings()
-       irs.gain = 0.5
-       conv = ARDOUR.DSP.Convolver (Session, ir_file, mode, irs)
-       collectgarbage ()
-end
-
-function dsp_latency ()
-       if conv then
-               return conv:latency()
-       else
-               return 0
-       end
-end
-
--- the DSP callback function to process audio audio
--- "ins" and "outs" are http://manual.ardour.org/lua-scripting/class_reference/#C:FloatArray
-function dsp_run (ins, outs, n_samples)
-       assert (#ins <= #outs)
-
-       for c = 1, #ins do
-               if ins[c] ~= outs[c] then -- if processing is not in-place..
-                       ARDOUR.DSP.copy_vector (outs[c], ins[c], n_samples) -- ..copy data from input to output.
-               end
-       end
-
-       if #outs == 1 then
-               conv:run (outs[1], n_samples)
-       else
-               conv:run_stereo (outs[1], outs[2], n_samples)
-       end
-end