From b8ba99ba65af3c5b95d822baf2c498f89698e9f3 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Mon, 10 Feb 2020 10:06:52 +0100 Subject: [PATCH] Add place holder for leaf generation --- voicegardens/static/voicegardens.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/voicegardens/static/voicegardens.js b/voicegardens/static/voicegardens.js index 66d1fe2..7153aee 100644 --- a/voicegardens/static/voicegardens.js +++ b/voicegardens/static/voicegardens.js @@ -134,6 +134,14 @@ function leaf_minimise() { leafButton.position(20, 180); } +function gardenShapes() { + /* + * Re-generate a shape back into the environment. If we have reached the + * shape limit, then replace the first shape instead of adding one more. This + * has to do with performance. + */ + return; +} function setupRecording() { /** @@ -166,7 +174,7 @@ function setupRecording() { leafButton.class("button"); leafButton.mouseOver(leaf_enlarge); leafButton.mouseOut(leaf_minimise); - + leafButton.mousePressed(gardenShapes); } class GeneratedShape { @@ -473,9 +481,7 @@ function draw() { let soundBlob = recording.getBlob(); let recordedSound = new p5.SoundFile(new p5.File(soundBlob)); let newShape = new GeneratedShape(recordedSound); - shapes.push(newShape); - newSoundJustRecorded = false; }