Downloads

This commit is contained in:
Robin E. R. Davies
2025-02-27 03:34:27 -05:00
parent 759132dd4c
commit 229e85d608
11 changed files with 263 additions and 59 deletions
+10
View File
@@ -2388,6 +2388,16 @@ export class PiPedalModel //implements PiPedalModel
this.webSocket?.send("cancelListenForMidiEvent", listenHandle._handle);
}
downloadAudioFile(filePath: string) {
let downloadUrl = this.varServerUrl + "downloadMediaFile?path=" + encodeURIComponent(filePath);
// download with no flashing temporary tab.
let link = window.document.createElement("A") as HTMLLinkElement;
link.href = downloadUrl;
link.setAttribute("download", "");
link.click();
}
download(targetType: string, instanceId: number | string): void {
if (instanceId === -1) return;
let url = this.varServerUrl + targetType + "?id=" + instanceId;