Event class added to misc.

defaultkwarg subs added. iniitialize event subscriptions.

base class observable thread now checks for currently registered events.

make capi call if polling strip/bus levels and ldirty not in events.
This commit is contained in:
onyx-and-iris
2022-08-02 09:17:11 +01:00
parent b7c716daf4
commit 446848fe89
5 changed files with 66 additions and 15 deletions

View File

@@ -102,7 +102,10 @@ class FactoryBase(Remote):
"""Base class for factories, subclasses Remote."""
def __init__(self, kind_id: str, **kwargs):
defaultkwargs = {"sync": False, "ratelimit": 0.033}
defaultevents = {"pdirty": True, "mdirty": True, "midi": True, "ldirty": False}
if "subs" in kwargs:
defaultevents = defaultevents | kwargs.pop("subs")
defaultkwargs = {"sync": False, "ratelimit": 0.033, "subs": defaultevents}
kwargs = defaultkwargs | kwargs
self.kind = kindmap(kind_id)
super().__init__(**kwargs)