File tree Expand file tree Collapse file tree 4 files changed +15
-1
lines changed
Expand file tree Collapse file tree 4 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,14 @@ int LuaMidiPipe::size (lua_State* L)
169169 return 1 ;
170170}
171171
172+ int LuaMidiPipe::clear (lua_State* L)
173+ {
174+ auto * pipe = *(LuaMidiPipe**) lua_touserdata (L, 1 );
175+ for (int i = pipe->buffers .size (); --i >= 0 ;)
176+ (**pipe->buffers .getUnchecked (i)).buffer .clear ();
177+ return 0 ;
178+ }
179+
172180}
173181
174182static int midipipe_new (lua_State* L)
@@ -191,6 +199,7 @@ static const luaL_Reg methods[] = {
191199 { " get" , Element::LuaMidiPipe::get },
192200 { " resize" , Element::LuaMidiPipe::resize },
193201 { " size" , Element::LuaMidiPipe::size },
202+ { " clear" , Element::LuaMidiPipe::clear },
194203 { nullptr , nullptr }
195204};
196205
Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ class LuaMidiPipe final
8383 static int get (lua_State* L);
8484 static int resize (lua_State* L);
8585 static int size (lua_State* L);
86+ static int clear (lua_State* L);
8687
8788private:
8889 lua_State* state = nullptr ;
Original file line number Diff line number Diff line change @@ -316,7 +316,7 @@ struct LuaNode::Context
316316
317317 local a = AudioBuffer (__ln_validate_nchans, __ln_validate_nframes)
318318 local m = MidiPipe (__ln_validate_nmidi)
319-
319+
320320 for _ = 1,4 do
321321 for i = 0,m:size() - 1 do
322322 local b = m:get(i)
Original file line number Diff line number Diff line change 1616 along with this program. If not, see <https://www.gnu.org/licenses/>.
1717*/
1818
19+ // FIXME: Local lua paths in release build
20+ #if JUCE_DEBUG
21+
1922#include " Tests.h"
2023#include " scripting/ScriptManager.h"
2124#include " scripting/LuaBindings.h"
@@ -41,3 +44,4 @@ class ScriptManagerTest : public UnitTestBase
4144};
4245
4346static ScriptManagerTest sScriptManagerTest ;
47+ #endif
You can’t perform that action at this time.
0 commit comments