From 2609047b03a5ea49a97a688fc5ff91bf15ec5a5d Mon Sep 17 00:00:00 2001 From: Jennifer Taylor Date: Sat, 29 May 2021 00:21:42 +0000 Subject: [PATCH] Add a few more wrapper calls to our AEPLib implementation. --- bemani/format/afp/render.py | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/bemani/format/afp/render.py b/bemani/format/afp/render.py index 88e7cdc..b4501c1 100644 --- a/bemani/format/afp/render.py +++ b/bemani/format/afp/render.py @@ -340,7 +340,31 @@ class AEPLib: return meth(frame) except AttributeError: # Function does not exist! - print(f"WARNING: Tried to call {'gotoAndPlay'}({frame}) on {thisptr} but that method doesn't exist!") + print(f"WARNING: Tried to call gotoAndPlay({frame}) on {thisptr} but that method doesn't exist!") + return UNDEFINED + + def deepGotoAndPlay(self, thisptr: Any, frame: Any) -> Any: + # I don't know how this differs from regular gotoAndPlay. + try: + meth = getattr(thisptr, 'gotoAndPlay') + + # Call it, set the return on the stack. + return meth(frame) + except AttributeError: + # Function does not exist! + print(f"WARNING: Tried to call gotoAndPlay({frame}) on {thisptr} but that method doesn't exist!") + return UNDEFINED + + def stop(self, thisptr: Any) -> Any: + # This appears to be a wrapper to allow calling stop on clips. + try: + meth = getattr(thisptr, 'stop') + + # Call it, set the return on the stack. + return meth() + except AttributeError: + # Function does not exist! + print(f"WARNING: Tried to call stop() on {thisptr} but that method doesn't exist!") return UNDEFINED