Skip to content

Commit

Permalink
Release of Resonate 0.5.0-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
98ahni authored Sep 20, 2024
1 parent 3d42b87 commit ef02795
Show file tree
Hide file tree
Showing 23 changed files with 3,827 additions and 1 deletion.
1 change: 1 addition & 0 deletions 0.5.0-beta/Resonate.js

Large diffs are not rendered by default.

Binary file added 0.5.0-beta/Resonate.wasm
Binary file not shown.
70 changes: 70 additions & 0 deletions 0.5.0-beta/ResonateInstallWPA.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// VV WPA support
const CACHE_NAME = `Resonate`;

// Use the install event to pre-cache all initial resources.
self.addEventListener('install', event => {
event.waitUntil((async () => {
const cache = await caches.open(CACHE_NAME);
cache.addAll([
'./Resonate.js',
'./Resonate.wasm',
'./index.html',
'./icons/ResonateIcon.png',
'./icons/ResonateIconLarge.png',
'./icons/ResonateIconUnsaved.png',
'./plugins/audiostretchworker.js',
'./plugins/timestretch.js',
'./public/plugins/RubberBand.js',
'./public/plugins/RubberBand.js.mem',
'./public/plugins/paulstretch.js',
'./public/plugins/VexWarp/tools.js',
'./public/plugins/VexWarp/stretch.js',
'./public/plugins/VexWarp/require.js',
'./public/plugins/VexWarp/main.js',
'./public/plugins/VexWarp/jquery-2.0.3.js',
'./public/plugins/VexWarp/dsp.js',
]);
})());
});

self.addEventListener('fetch', event => {
event.respondWith((async () => {
const cache = await caches.open(CACHE_NAME);

//const injectHeaders = (request)=>{
// const headers = new Headers(request.headers);
// headers.set('Cross-Origin-Embedder-Policy', 'require-corp');
// headers.set('Cross-Origin-Opener-Policy', 'same-origin');
// const newRequest = new Request(request, {
// mode: request.mode,
// credentials: request.credentials,
// headers: headers
// });
// return newRequest;
//};

// Get the resource from the cache.
//const cachedResponse = await cache.match(event.request);
//if (cachedResponse) {
// return cachedResponse;
//} else {
try {
// If the resource was not in the cache, try the network.
//const fetchResponse = await fetch(injectHeaders(event.request));
const fetchResponse = await fetch(event.request);

if(event.request.method != 'POST'){
// Save the resource in the cache and return it.
cache.put(event.request, fetchResponse.clone());
}
return fetchResponse;
} catch (e) {
// The network failed.
const cachedResponse = await cache.match(event.request);
if (cachedResponse) {
return cachedResponse;
}
}
//}
})());
});
Binary file added 0.5.0-beta/icons/ResonateIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 0.5.0-beta/icons/ResonateIconLarge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 0.5.0-beta/icons/ResonateIconLarger.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 0.5.0-beta/icons/ResonateIconUnsaved.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions 0.5.0-beta/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!doctypehtml><html lang=en-us><head><meta charset=utf-8><meta content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"name=viewport><link crossorigin=use-credentials href=./manifest.json rel=manifest><title>Resonate</title><style>body{margin:0;background-color:#000}.emscripten{position:absolute;top:0;left:0;margin:0;border:0;width:100%;height:100%;overflow:hidden;display:block;image-rendering:optimizeSpeed;image-rendering:-moz-crisp-edges;image-rendering:-o-crisp-edges;image-rendering:-webkit-optimize-contrast;image-rendering:optimize-contrast;image-rendering:crisp-edges;image-rendering:pixelated;-ms-interpolation-mode:nearest-neighbor}</style><script>const default_console_log=console.log,default_console_warn=console.warn,default_console_error=console.error;fetch("/console",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"log",data:["Log server open"]})}).then((o=>{405!=o.status&&(console.log=(...o)=>{fetch("/console",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"log",data:o})}).then((()=>{}),(()=>{console.log=default_console_log,console.warn=default_console_warn,console.error=default_console_error})),default_console_log.apply(console,o)},console.warn=(...o)=>{fetch("/console",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"warn",data:o})}).then((()=>{}),(()=>{console.log=default_console_log,console.warn=default_console_warn,console.error=default_console_error})),default_console_warn.apply(console,o)},console.error=(...o)=>{fetch("/console",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"error",data:o})}).then((()=>{}),(()=>{console.log=default_console_log,console.warn=default_console_warn,console.error=default_console_error})),default_console_error.apply(console,o)})}))</script></head><body><canvas class=emscripten id=canvas onclick=_jsPrepPlayback() oncontextmenu=event.preventDefault()></canvas><script>var Module;(async()=>{Module={preRun:[],postRun:[],print:function(e){e=Array.prototype.slice.call(arguments).join(" "),console.log(e)},printErr:function(e){e=Array.prototype.slice.call(arguments).join(" "),console.error(e)},canvas:document.getElementById("canvas"),setStatus:function(e){console.log("status: "+e)},monitorRunDependencies:function(e){}},window.onerror=function(e,n,o,r,t){console.error("onerror: "+e.name+": "+e.message+"\n\t/bin/public/"+n.split("/").slice(-1)+":"+o+":"+r),console.error(t.stack),alert("OnError: \n"+e.name+": "+e.message)};{const e=await navigator.gpu.requestAdapter(),n=await e.requestDevice();Module.preinitializedWebGPUDevice=n}"serviceWorker"in navigator&&navigator.serviceWorker.register("./ResonateInstallWPA.js",{scope:"./"})})()</script><script src=plugins/timestretch.js></script><script src=https://apis.google.com/js/api.js async defer onload=""></script><script src=https://accounts.google.com/gsi/client async defer onload=""></script><script src=Resonate.js async></script></body></html>
21 changes: 21 additions & 0 deletions 0.5.0-beta/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"lang": "en-us",
"name": "Resonate",
"short_name": "Resonate",
"description": "A timing tool for ECHO",
"start_url": "./",
"background_color": "#5e5966",
"theme_color": "#17141f",
"orientation": "any",
"display": "standalone",
"icons": [
{
"src": "./icons/ResonateIconLarge.png",
"sizes": "256x256"
},
{
"src": "./icons/ResonateIconLarger.png",
"sizes": "512x512"
}
]
}
17 changes: 17 additions & 0 deletions 0.5.0-beta/plugins/RubberBand.js

Large diffs are not rendered by default.

Binary file added 0.5.0-beta/plugins/RubberBand.js.mem
Binary file not shown.
Loading

0 comments on commit ef02795

Please sign in to comment.