From 1ef64e4eba622ebca4563cf8609b595bc0673b25 Mon Sep 17 00:00:00 2001 From: themancalledjakob Date: Sat, 7 Oct 2023 13:29:25 +0200 Subject: [PATCH] use liveUpdater in audio --- bin/web/js/audio.js | 19 +------------------ bin/web/js/record.js | 1 + 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/bin/web/js/audio.js b/bin/web/js/audio.js index 088b899..8d12f44 100644 --- a/bin/web/js/audio.js +++ b/bin/web/js/audio.js @@ -612,23 +612,6 @@ const Audio = function(tp, record) { // this is when to monitor live if (!record.isRecording()) { if (!tp.core.val(tp.sheet.sequence.pointer.playing)) { - if (typeof window.immediateUpdate !== 'function') { - window.immediateUpdate = (layer, values) => { - const v = { - ...layer.theatreObject.value, - ...values - }; - const p = layer.values2cppProps(v); - if (p !== false) { - const id = layer.id(); - if (id !== 'artboard') { - Module.setProps(p, layer.id()); - } else { - Module.setArtboardProps(p, layer.id()); - } - } - }; - } let values = {}; propsToSet.forEach((p) => { const newValues = { @@ -643,7 +626,7 @@ const Audio = function(tp, record) { }; }); Object.keys(values).forEach((layerID) => { - immediateUpdate(getLayer(layerID), values[layerID]); + record.liveUpdater.immediateUpdate(getLayer(layerID), values[layerID]); }); } } else { diff --git a/bin/web/js/record.js b/bin/web/js/record.js index 1a654d5..1fad8b6 100644 --- a/bin/web/js/record.js +++ b/bin/web/js/record.js @@ -396,6 +396,7 @@ const Record = function(tp) { }; // public + this.liveUpdater = liveUpdater; this.addRecordButton = addRecordButton; this.addHot = addHot; this.removeHot = removeHot;