WebSockets: add method for retrieving surface manifest in ardour.js
This commit is contained in:
parent
3d8e430324
commit
68ecf6c0b3
@ -42,6 +42,21 @@ export class Ardour {
|
||||
}
|
||||
}
|
||||
|
||||
async getSurfaceManifest () {
|
||||
const response = await fetch('manifest.xml');
|
||||
|
||||
if (response.status == 200) {
|
||||
const xmlText = await response.text();
|
||||
const xmlDoc = new DOMParser().parseFromString(xmlText, 'text/xml');
|
||||
return {
|
||||
name: xmlDoc.getElementsByTagName('Name')[0].getAttribute('value'),
|
||||
description: xmlDoc.getElementsByTagName('Description')[0].getAttribute('value')
|
||||
}
|
||||
} else {
|
||||
throw new Error(`HTTP response status ${response.status}`);
|
||||
}
|
||||
}
|
||||
|
||||
// TO DO - add methods for dealing with messages flowing from/to the WebSockets channel
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user