mirror of
https://github.com/iperov/DeepFaceLive.git
synced 2024-12-25 15:31:13 -08:00
28 lines
678 B
Python
28 lines
678 B
Python
from ...python import EventListener
|
|
|
|
from .CSWBase import ControlClient, ControlHost
|
|
|
|
class Signal:
|
|
class Host(ControlHost):
|
|
def __init__(self):
|
|
super().__init__()
|
|
|
|
self._signal_evl = EventListener()
|
|
self._call_on_msg('signal', self._on_msg_signal)
|
|
|
|
def call_on_signal(self, func): self._signal_evl.add(func)
|
|
|
|
def signal(self):
|
|
self._on_msg_signal()
|
|
|
|
def _on_msg_signal(self):
|
|
if self.is_enabled():
|
|
self._signal_evl.call()
|
|
|
|
class Client(ControlClient):
|
|
def signal(self):
|
|
self._send_msg('signal')
|
|
|
|
def _on_reset(self):
|
|
...
|