From 6e60818136e3c016d9ca7f6ae74a13a99c9c0757 Mon Sep 17 00:00:00 2001 From: themancalledjakob Date: Fri, 22 Mar 2024 17:49:29 +0100 Subject: [PATCH 1/4] fix selection after deleting selected layer dependencies hashes: openFrameworks d78075f4bca6be2a2533c6e51a75cc1f18404501 ofxMsdfgen e14da13d02c4dff04fb69d7923469f606924e6c3 ofxGPUFont d482bb7cbdf6b296fa4ab5abcf73fb5ff8c8b239 ofxVariableLab 8df98846248a93aa068989a3ebd0d2f0f16e5e69 ofxProfiler a868e34fa1a79189dd4fbdede2938e308535e5e8 theatre 86d3e07f6f2c75fd6e08fca8c97e3617c9e23b18 --- bin/em/variabletime/web/js/artboard.js | 29 ++++++++++++++++++++++++++ bin/em/variabletime/web/js/main.js | 13 +++++++++--- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/bin/em/variabletime/web/js/artboard.js b/bin/em/variabletime/web/js/artboard.js index 065f091..6638c30 100644 --- a/bin/em/variabletime/web/js/artboard.js +++ b/bin/em/variabletime/web/js/artboard.js @@ -173,6 +173,35 @@ const Artboard = function(tp, domElement = false, autoInit = true) { this.hide = () => { // nothing to do }; + const getHierarchyPanelButton = () => { + if (hierarchyPanelButton === null) { + hierarchyPanelButton = tp.shadowRoot.querySelector(`.layerMover${this.id()}`); + } + return hierarchyPanelButton; + }; + this.isSelected = () => { + const panel = getHierarchyPanelButton(); + if (panel === null) { + return false; + } else { + const notSelected = panel.querySelector('.not-selected'); + return !notSelected; + } + }; + this.select = () => { + const panel = getHierarchyPanelButton(); + const selectables = panel.querySelector('.not-selected'); + if (selectables !== null && typeof selectables.dispatchEvent === 'function') { + var clickEvent = new MouseEvent("click", { + "view": window, + "bubbles": true, + "cancelable": false + }); + selectables.dispatchEvent(clickEvent); + } else { + window.debugElement = panel; + } + }; // action if (typeof domElement !== 'object') { diff --git a/bin/em/variabletime/web/js/main.js b/bin/em/variabletime/web/js/main.js index 95d8617..8268145 100644 --- a/bin/em/variabletime/web/js/main.js +++ b/bin/em/variabletime/web/js/main.js @@ -121,10 +121,7 @@ window.showAbout = () => { if (getAbout() === null) { return; } - getAbout().classList.remove("hidden"); - - } window.hideAbout = () => { if (getAbout() !== null) { @@ -524,9 +521,19 @@ const deleteLayer = (id, saveProject = true) => { } }); } + const wasSelected = layers[index].isSelected(); layers[index].prepareForDepartureFromThisBeautifulExperience(); layers.splice(index, 1); delete layersById[id]; + if (wasSelected) { + if (layers.length > index + 1) { + layers[index].select(); + } else if (layers.length > 0) { + layers[layers.length - 1].select(); + } else { + artboard.select(); + } + } if (saveProject) { setTimeout(() => { tp.saveProject(); From 94081b93450018b9c9d68146d08543f3a7286635 Mon Sep 17 00:00:00 2001 From: themancalledjakob Date: Fri, 22 Mar 2024 18:14:51 +0100 Subject: [PATCH 2/4] add stoprecording button in notice dependencies hashes: openFrameworks d78075f4bca6be2a2533c6e51a75cc1f18404501 ofxMsdfgen e14da13d02c4dff04fb69d7923469f606924e6c3 ofxGPUFont d482bb7cbdf6b296fa4ab5abcf73fb5ff8c8b239 ofxVariableLab 8df98846248a93aa068989a3ebd0d2f0f16e5e69 ofxProfiler a868e34fa1a79189dd4fbdede2938e308535e5e8 theatre 86d3e07f6f2c75fd6e08fca8c97e3617c9e23b18 --- bin/em/variabletime/web/css/demo.css | 3 +++ bin/em/variabletime/web/js/record.js | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/em/variabletime/web/css/demo.css b/bin/em/variabletime/web/css/demo.css index fa9a791..a3c2336 100755 --- a/bin/em/variabletime/web/css/demo.css +++ b/bin/em/variabletime/web/css/demo.css @@ -266,6 +266,9 @@ body.debug div:not(.centerLine) { #notice_recording.visible { display: flex; } +#notice_recording button { + pointer-events: all; +} #notice_recording.impenetrable { pointer-events: all; background-color: rgba(0,0,0,0.5); diff --git a/bin/em/variabletime/web/js/record.js b/bin/em/variabletime/web/js/record.js index 924a538..951c095 100644 --- a/bin/em/variabletime/web/js/record.js +++ b/bin/em/variabletime/web/js/record.js @@ -469,9 +469,9 @@ const Record = function(tp) { document.querySelector('#notice_recording') .classList.add('visible'); document.querySelector('#notice_recording') - .classList.remove('imprenetrable'); + .classList.remove('impenetrable'); document.querySelector('#notice_recording .what p').innerHTML = 'recording'; - document.querySelector('#notice_recording .details p').innerHTML = ''; + document.querySelector('#notice_recording .details p').innerHTML = ''; if (!isInitialized) { init(); } From ede5b5d44c5abe2cd4a7c1e0dc74de6adf696f5d Mon Sep 17 00:00:00 2001 From: themancalledjakob Date: Fri, 22 Mar 2024 18:15:26 +0100 Subject: [PATCH 3/4] buttons order dependencies hashes: openFrameworks d78075f4bca6be2a2533c6e51a75cc1f18404501 ofxMsdfgen e14da13d02c4dff04fb69d7923469f606924e6c3 ofxGPUFont d482bb7cbdf6b296fa4ab5abcf73fb5ff8c8b239 ofxVariableLab 8df98846248a93aa068989a3ebd0d2f0f16e5e69 ofxProfiler a868e34fa1a79189dd4fbdede2938e308535e5e8 theatre 86d3e07f6f2c75fd6e08fca8c97e3617c9e23b18 --- bin/em/variabletime/web/css/theatre.css | 31 +++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/bin/em/variabletime/web/css/theatre.css b/bin/em/variabletime/web/css/theatre.css index bdf866b..e5fdf51 100644 --- a/bin/em/variabletime/web/css/theatre.css +++ b/bin/em/variabletime/web/css/theatre.css @@ -46,6 +46,37 @@ .panel>.bottomButtonsContainer { order: 3; + display: flex; + flex-direction: column; +} + +.panel>.bottomButtonsContainer #start_new_project { + order: 1; + margin: 7px 10px 0px 10px; +} +.panel>.bottomButtonsContainer #open_project { + order: 2; + margin: 7px 10px 0px 10px; +} +.panel>.bottomButtonsContainer #save_project { + order: 3; + margin: 7px 10px 0px 10px; +} +.panel>.bottomButtonsContainer #add_font { + order: 4; + margin: 7px 10px 0px 10px; +} +.panel>.bottomButtonsContainer #upload_audio { + order: 5; + margin: 7px 10px 0px 10px; +} +.panel>.bottomButtonsContainer #exporter_open { + order: 6; + margin: 7px 10px 0px 10px; +} +.panel>.bottomButtonsContainer #hide_ui { + order: 7; + margin: 7px 10px; } .panelWrapper {} From 4ef2ee46708f93d95aeeb37204c2352d34d3ad08 Mon Sep 17 00:00:00 2001 From: themancalledjakob Date: Fri, 22 Mar 2024 18:16:04 +0100 Subject: [PATCH 4/4] alert when microphone has no permission dependencies hashes: openFrameworks d78075f4bca6be2a2533c6e51a75cc1f18404501 ofxMsdfgen e14da13d02c4dff04fb69d7923469f606924e6c3 ofxGPUFont d482bb7cbdf6b296fa4ab5abcf73fb5ff8c8b239 ofxVariableLab 8df98846248a93aa068989a3ebd0d2f0f16e5e69 ofxProfiler a868e34fa1a79189dd4fbdede2938e308535e5e8 theatre 86d3e07f6f2c75fd6e08fca8c97e3617c9e23b18 --- bin/em/variabletime/web/js/audio.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bin/em/variabletime/web/js/audio.js b/bin/em/variabletime/web/js/audio.js index 77557e2..9c3b4f6 100644 --- a/bin/em/variabletime/web/js/audio.js +++ b/bin/em/variabletime/web/js/audio.js @@ -44,6 +44,7 @@ const Audio = function(tp, record) { //}, //}); let started = false; + let allowedMicrophone = true; // TODO: actually use this let mapping = {}; let savedMapping = {}; @@ -915,7 +916,15 @@ const Audio = function(tp, record) { visualize(); }) .catch(function(err) { - console.log("The following gUM error occured: " + err); + console.log("Audio::init","The following gUM error occured: " + err); + const noPermission = err.message.toLowerCase().indexOf('permission') >= 0; + if (noPermission) { + if (allowedMicrophone) { + alert("We don't have permission to access the microphone. Microphone input will be silent."); + } + allowedMicrophone = false; + // TODO: actually use this + } }); } else { console.log("getUserMedia not supported on your browser!");