@grame/faustwasm 0.8.0 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/standalone/create-node.js +31 -1
- package/assets/standalone/faust-ui/index.js +2 -2
- package/assets/standalone/faust-ui/index.js.map +1 -1
- package/assets/standalone/faustwasm/index.d.ts +2 -2
- package/assets/standalone/faustwasm/index.js +8 -36
- package/assets/standalone/faustwasm/index.js.map +2 -2
- package/assets/standalone/index-pwa.js +125 -90
- package/assets/standalone/index-template.js +43 -22
- package/assets/standalone/index.js +36 -19
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +8 -36
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs-bundle/index.d.ts +2 -2
- package/dist/cjs-bundle/index.js +8 -36
- package/dist/cjs-bundle/index.js.map +2 -2
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +8 -36
- package/dist/esm/index.js.map +2 -2
- package/dist/esm-bundle/index.d.ts +2 -2
- package/dist/esm-bundle/index.js +8 -36
- package/dist/esm-bundle/index.js.map +2 -2
- package/package.json +2 -2
- package/src/FaustAudioWorkletNode.ts +4 -30
- package/src/FaustScriptProcessorNode.ts +4 -30
- package/test/faustlive-wasm/faust-ui/index.js +2 -2
- package/test/faustlive-wasm/faust-ui/index.js.map +1 -1
- package/test/faustlive-wasm/faustwasm/index.d.ts +2 -2
- package/test/faustlive-wasm/faustwasm/index.js +8 -36
- package/test/faustlive-wasm/faustwasm/index.js.map +2 -2
|
@@ -135,6 +135,36 @@ async function createFaustUI(divFaustUI, faustNode) {
|
|
|
135
135
|
faustUI.resize();
|
|
136
136
|
};
|
|
137
137
|
|
|
138
|
+
async function requestPermissions() {
|
|
139
|
+
|
|
140
|
+
// Explicitly request permission on iOS before calling startSensors()
|
|
141
|
+
if (typeof window.DeviceMotionEvent !== "undefined" && typeof window.DeviceMotionEvent.requestPermission === "function") {
|
|
142
|
+
try {
|
|
143
|
+
const permissionState = await window.DeviceMotionEvent.requestPermission();
|
|
144
|
+
if (permissionState !== "granted") {
|
|
145
|
+
console.warn("Motion sensor permission denied.");
|
|
146
|
+
} else {
|
|
147
|
+
console.log("Motion sensor permission granted.");
|
|
148
|
+
}
|
|
149
|
+
} catch (error) {
|
|
150
|
+
console.error("Error requesting motion sensor permission:", error);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (typeof window.DeviceOrientationEvent !== "undefined" && typeof window.DeviceOrientationEvent.requestPermission === "function") {
|
|
155
|
+
try {
|
|
156
|
+
const permissionState = await window.DeviceOrientationEvent.requestPermission();
|
|
157
|
+
if (permissionState !== "granted") {
|
|
158
|
+
console.warn("Orientation sensor permission denied.");
|
|
159
|
+
} else {
|
|
160
|
+
console.log("Orientation sensor permission granted.");
|
|
161
|
+
}
|
|
162
|
+
} catch (error) {
|
|
163
|
+
console.error("Error requesting orientation sensor permission:", error);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
138
168
|
// Export the functions
|
|
139
|
-
export { createFaustNode, createFaustUI, connectToAudioInput };
|
|
169
|
+
export { createFaustNode, createFaustUI, connectToAudioInput, requestPermissions };
|
|
140
170
|
|
|
@@ -946,10 +946,10 @@ class Group extends _AbstractComponent__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
|
946
946
|
if (!metaIn) return { metaObject };
|
|
947
947
|
metaIn.forEach((m) => Object.assign(metaObject, m));
|
|
948
948
|
if (metaObject.style) {
|
|
949
|
-
const enumsRegex = /\{(?:(?:'|_|-)(.+?)(?:'|_|-):([-+]?[0-9]*\.?[0-9]
|
|
949
|
+
const enumsRegex = /\{(?:(?:'|_|-)(.+?)(?:'|_|-):([-+]?[0-9]*\.?[0-9]+);)+(?:(?:'|_|-)(.+?)(?:'|_|-):([-+]?[0-9]*\.?[0-9]+))\}/;
|
|
950
950
|
const matched = metaObject.style.match(enumsRegex);
|
|
951
951
|
if (matched) {
|
|
952
|
-
const itemsRegex = /(?:(?:'|_|-)(.+?)(?:'|_|-):([-+]?[0-9]*\.?[0-9]
|
|
952
|
+
const itemsRegex = /(?:(?:'|_|-)(.+?)(?:'|_|-):([-+]?[0-9]*\.?[0-9]+))/g;
|
|
953
953
|
const enums = {};
|
|
954
954
|
let item;
|
|
955
955
|
while (item = itemsRegex.exec(matched[0])) {
|