diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-02-23 17:17:24 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-02-23 17:17:24 +0100 |
| commit | eae1292a01b4111e6ae2b36dcf8b4ea9266150e0 (patch) | |
| tree | 50b3b2b0214b13ac8aa9cf69ded85905b6b9815a | |
| parent | c384a0cbf0c204e6dbeccd71d3966d53217c4e2e (diff) | |
pausejabber
| -rw-r--r-- | cli/app/search/live.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cli/app/search/live.py b/cli/app/search/live.py index 251a9f5..7dbe98f 100644 --- a/cli/app/search/live.py +++ b/cli/app/search/live.py @@ -231,6 +231,7 @@ class InterpolatorVariable: class Interpolator: def __init__(self): + self.paused = False self.stopped = False self.opts = {} self.sin_params = {} @@ -374,6 +375,7 @@ class Interpolator: opt[key] = param.value.tolist() else: opt[key] = param.value + opt['paused'] = self.paused return opt def set_value(self, key, value): @@ -457,6 +459,12 @@ class Interpolator: self.set_category(payload) if cmd == 'setEncoding': self.set_encoding(json.loads(payload)) + if cmd == 'play': + print("set_opt: paused True") + self.paused = False + if cmd == 'pause': + print("set_opt: paused False") + self.paused = True if cmd == 'stop': self.stopped = True pass @@ -541,6 +549,9 @@ class Listener: print("Loading network...") elif i == 1: print("Processing!") + elif interpolator.paused: + time.sleep(0.5) + continue elif interpolator.stopped: print("Stopping...") return |
