From eae1292a01b4111e6ae2b36dcf8b4ea9266150e0 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 23 Feb 2020 17:17:24 +0100 Subject: pausejabber --- cli/app/search/live.py | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 -- cgit v1.2.3-70-g09d2