Browse Source

Fix recursive mutation when changing control values from plugin UI.

model-merge
Ben Niemann 3 years ago
parent
commit
2b32d0c015
  1. 5
      noisicaa/audioproc/engine/plugin_host_process.py
  2. 6
      noisicaa/music/graph.py

5
noisicaa/audioproc/engine/plugin_host_process.py

@ -364,7 +364,10 @@ class PluginHostProcess(core.ProcessBase):
task.add_done_callback(self.__control_value_change_done)
def __control_value_change_done(self, task: concurrent.futures.Future) -> None:
task.result()
try:
task.result()
except:
logger.error("Exception in CONTROL_VALUE_CHANGE call:\n%s", traceback.format_exc())
class PluginHostSubprocess(core.SubprocessMixin, PluginHostProcess):

6
noisicaa/music/graph.py

@ -87,12 +87,11 @@ class ControlValueMap(object):
if isinstance(change, model_base.PropertyListInsert):
new_value = change.new_value
old_value = self.__get(new_value.name)
self.__control_values[new_value.name] = new_value
self.control_value_changed.call(
new_value.name,
model_base.PropertyValueChange(
self.__node, new_value.name, old_value, new_value))
self.__control_values[new_value.name] = new_value
elif isinstance(change, model_base.PropertyListDelete):
pass
@ -100,12 +99,11 @@ class ControlValueMap(object):
elif isinstance(change, model_base.PropertyListSet):
new_value = change.new_value
old_value = self.__get(new_value.name)
self.__control_values[new_value.name] = new_value
self.control_value_changed.call(
new_value.name,
model_base.PropertyValueChange(
self.__node, new_value.name, old_value, new_value))
self.__control_values[new_value.name] = new_value
else:
raise TypeError(type(change))

Loading…
Cancel
Save