Play sound node

This commit is contained in:
pythongosssss
2023-08-05 22:20:15 +01:00
parent d6e7f99b69
commit 6f1cea74cf
3 changed files with 63 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
# Hack: string type that is always equal in not equal comparisons
class AnyType(str):
def __ne__(self, __value: object) -> bool:
return False
# Our any instance wants to be a wildcard string
any = AnyType("*")
class PlaySound:
@classmethod
def INPUT_TYPES(s):
return {"required": {
"any": (any, {}),
"mode": (["always", "on empty queue"], {}),
}}
FUNCTION = "nop"
INPUT_IS_LIST = True
OUTPUT_NODE = True
RETURN_TYPES = ()
CATEGORY = "utils"
def IS_CHANGED(self, **kwargs):
return float("NaN")
def nop(self, any, mode):
return {"ui": {"a":[]}, "result": ()}
NODE_CLASS_MAPPINGS = {
"PlaySound|pysssss": PlaySound,
}
NODE_DISPLAY_NAME_MAPPINGS = {
"PlaySound|pysssss": "PlaySound 🐍",
}