Revert to original

Revert to original
This commit is contained in:
Extremesecrecy
2025-07-27 15:52:52 -07:00
parent a753b04b63
commit 3396907782
+6 -31
View File
@@ -1,3 +1,4 @@
@@ -1,3543 +1,3543 @@
// Copyright (c) 2022 Robin Davies // Copyright (c) 2022 Robin Davies
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
@@ -2343,22 +2344,6 @@ export class PiPedalModel //implements PiPedalModel
} }
} }
setPatchProperty(instanceId: number, uri: string, value: any): Promise<boolean> { setPatchProperty(instanceId: number, uri: string, value: any): Promise<boolean> {
// Audio related properties are written without waiting for a reply.
// These URIs correspond to Toob player audio state. The server
// broadcasts changes via on...changed messages, so we don't
// need to wait for the reply when updating them.
const audioProps = [
"http://two-play.com/plugins/toob-player#audioFile",
"http://two-play.com/plugins/toob-player#loop",
"http://two-play.com/plugins/toob-player#seek",
];
if (audioProps.indexOf(uri) >= 0) {
if (this.webSocket) {
this.webSocket.send("setPatchProperty", { instanceId: instanceId, propertyUri: uri, value: value });
}
return Promise.resolve(true);
}
let result = new Promise<boolean>((resolve, reject) => { let result = new Promise<boolean>((resolve, reject) => {
if (this.webSocket) { if (this.webSocket) {
this.webSocket.request<boolean>( this.webSocket.request<boolean>(
@@ -2525,18 +2510,11 @@ export class PiPedalModel //implements PiPedalModel
}); });
} }
setJackServerSettings(jackServerSettings: JackServerSettings): void { setJackServerSettings(jackServerSettings: JackServerSettings): void {
this.webSocket?.request<void>("setJackServerSettings", jackServerSettings) this.webSocket?.request<void>("setJackServerSettings", jackServerSettings)
.catch((error) => { .catch((error) => {
this.showAlert(error); this.showAlert(error);
}); });
} }
applyJackServerSettings(jackServerSettings: JackServerSettings): void {
this.webSocket?.request<void>("applyJackServerSettings", jackServerSettings)
.catch((error) => {
this.showAlert(error);
});
}
updateVst3State(pedalboard: Pedalboard) { updateVst3State(pedalboard: Pedalboard) {
// let it = pedalboard.itemsGenerator(); // let it = pedalboard.itemsGenerator();
@@ -3006,7 +2984,7 @@ export class PiPedalModel //implements PiPedalModel
// notify the server. // notify the server.
let ws = this.webSocket; let ws = this.webSocket;
if (!ws) { if (!ws) {
resolve(); reject("Not connected.");
return; return;
} }
ws.request<void>( ws.request<void>(
@@ -3017,8 +2995,7 @@ export class PiPedalModel //implements PiPedalModel
resolve(); resolve();
}) })
.catch((err) => { .catch((err) => {
// ignore expected disconnects/errors reject(err);
resolve();
}); });
}); });
@@ -3070,13 +3047,12 @@ export class PiPedalModel //implements PiPedalModel
serverConfigSettings serverConfigSettings
) )
.then(() => { .then(() => {
resolve(); //resolve();
}) })
.catch((err) => { .catch((err) => {
// ignore expected disconnects/errors //resolve();
resolve();
}); });
//resolve(); resolve();
}); });
this.expectDisconnect(ReconnectReason.LoadingSettings); this.expectDisconnect(ReconnectReason.LoadingSettings);
@@ -3564,4 +3540,3 @@ export class PiPedalModelFactory {
} }
}; };