def restoreFxBall(self, dict): self.fxballs[dict["id"]] = FxBall(dict["fx"], dict["id"], self.parent.sg_audio, dict["pos"], dict["size"], dict["gradient"], dict["fader"]) self.parent.sg_audio.addFx(dict["fx"], dict["id"]) self.fxballs[dict["id"]].load(dict["controls"]) self.fxballValues = [fx for fx in self.fxballs.values()] self.needBitmap = True self.Refresh()
def restoreFxBalls(self, dict, xfac=1.0, yfac=1.0): if dict != {}: for dic in dict.values(): self.fxballs[dic["id"]] = FxBall(dic["fx"], dic["id"], self.parent.sg_audio, dic["pos"], dic["size"], dic["gradient"], dic["fader"], xfac, yfac) self.parent.sg_audio.addFx(dic["fx"], dic["id"]) self.fxballs[dic["id"]].load(dic["controls"]) self.fxballValues = [fx for fx in self.fxballs.values()] self.needBitmap = True self.Refresh()
def addFxBall(self, fx): key = -1 fxkeys = self.fxballs.keys() for i in range(10): if i not in fxkeys: key = i break if key != -1: self.fxballs[key] = FxBall(fx, key, self.parent.sg_audio, (100,100)) self.parent.sg_audio.addFx(fx, key) self.fxballValues = [fx for fx in self.fxballs.values()] self.needBitmap = True self.Refresh()