diff --git a/assets/template.html b/assets/template.html index 853d981..7fcf68c 100644 --- a/assets/template.html +++ b/assets/template.html @@ -290,6 +290,7 @@ + diff --git a/bin/web/js/audio.js b/bin/web/js/audio.js index 57a47d7..57cdec0 100644 --- a/bin/web/js/audio.js +++ b/bin/web/js/audio.js @@ -621,12 +621,12 @@ const Audio = function(tp, record) { analyser.smoothingTimeConstant = 0.85; window.analyser = analyser; - const distortion = audioCtx.createWaveShaper(); - const gainNode = audioCtx.createGain(); - const biquadFilter = audioCtx.createBiquadFilter(); - const convolver = audioCtx.createConvolver(); + //const distortion = audioCtx.createWaveShaper(); + //const gainNode = audioCtx.createGain(); + //const biquadFilter = audioCtx.createBiquadFilter(); + //const convolver = audioCtx.createConvolver(); - const echoDelay = createEchoDelayEffect(audioCtx); + //const echoDelay = createEchoDelayEffect(audioCtx); // Distortion curve for the waveshaper, thanks to Kevin Ennis // http://stackoverflow.com/questions/22312841/waveshaper-node-in-webaudio-how-to-emulate-distortion @@ -663,7 +663,6 @@ const Audio = function(tp, record) { audioData, function(buffer) { soundSource = audioCtx.createBufferSource(); - convolver.buffer = buffer; }, function(e) { console.log("Audio::audioCtx.decodeAudioData", "Error with decoding audio data" + e.err); @@ -692,12 +691,7 @@ const Audio = function(tp, record) { .getUserMedia(constraints) .then(function(stream) { source = audioCtx.createMediaStreamSource(stream); - source.connect(distortion); - distortion.connect(biquadFilter); - biquadFilter.connect(gainNode); - convolver.connect(gainNode); - echoDelay.placeBetween(gainNode, analyser); - analyser.connect(audioCtx.destination); + source.connect(analyser); visualize(); voiceChange(); diff --git a/bin/web/js/main.js b/bin/web/js/main.js index cbbf5ed..3719162 100644 --- a/bin/web/js/main.js +++ b/bin/web/js/main.js @@ -151,6 +151,11 @@ const findInjectPanel = () => { bottomButtonsContainer.classList.add("bottomButtonsContainer"); panel.append(bottomButtonsContainer); } + const hideuiButton = document.querySelector('#hide_ui'); + if (hideuiButton !== null) { + bottomButtonsContainer.append(hideuiButton); + hideuiButton.classList.add("main_panel_button"); + } const exportButton = document.querySelector('#exporter_open'); if (exportButton !== null) { bottomButtonsContainer.append(exportButton); @@ -531,6 +536,30 @@ window.renderFrames = exporter.renderFrames; const layer_panel = document.querySelector('#layer_panel'); -const initPanels = () => { - //makeDraggable(layer_panel); +const ui = (show) => { + if (show && tp.studio.ui.isHidden) { + tp.studio.ui.restore(); + } else if (!show && !tp.studio.ui.isHidden) { + tp.studio.ui.hide(); + } +}; + +const handleUiKeypress = (e) => { + if (e.key.toLowerCase() === 'q') { + document.removeEventListener('keypress', handleUiKeypress); + ui(true); + } +}; + +const initPanels = () => { + let hideuiButton = document.querySelector('#hide_ui'); + if (hideuiButton === null) { + hideuiButton = tp.getPanel().querySelector('#hide_ui'); + } + if (hideuiButton !== null) { + hideuiButton.addEventListener('click', () => { + ui(false); + document.addEventListener('keypress', handleUiKeypress); + }); + } }; diff --git a/bin/web/js/theatre-play.js b/bin/web/js/theatre-play.js index 0df8955..97e5b9a 100644 --- a/bin/web/js/theatre-play.js +++ b/bin/web/js/theatre-play.js @@ -97,7 +97,7 @@ const TheatrePlay = function(autoInit = false) { if (typeof value === 'undefined') { return false; } - }; + } return this.sheet.sequence.__experimental_getKeyframes(prop); }; // wtf, this function was being written in one go