Skip to content

Commit

Permalink
v1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
etiennedemoulin committed Jun 28, 2024
1 parent 858c9de commit 559bfaf
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 24 deletions.
6 changes: 3 additions & 3 deletions max/soundworks/examples/simple-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"lint": "eslint ."
},
"dependencies": {
"@ircam/sc-components": "^3.0.0-alpha.44",
"@soundworks/core": "^4.0.0-alpha.20",
"@soundworks/helpers": "^1.0.0-alpha.11",
"@ircam/sc-components": "^3.0.0-alpha.65",
"@soundworks/core": "^4.0.0-alpha.25",
"@soundworks/helpers": "^1.0.0-alpha.14",
"json5": "^2.2.2",
"lit": "^3.0.2"
},
Expand Down
11 changes: 2 additions & 9 deletions max/soundworks/examples/simple-server/src/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,12 @@ console.log(`
const server = new Server(config);
// configure the server for usage within this application template
server.useDefaultApplicationTemplate();

server.stateManager.registerSchema('globals', globalsSchema);

await server.start();

const globals = await server.stateManager.create('globals');

/**
* Register plugins and schemas
*/
// server.pluginManager.register('my-plugin', plugin);
// server.stateManager.registerSchema('my-schema', definition);

Expand All @@ -47,10 +45,5 @@ server.stateManager.registerUpdateHook('globals', updates => {
}
});

/**
* Launch application (init plugins, http server, etc.)
*/
await server.start();

// and do your own stuff!

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@soundworks/max",
"version": "1.2.0",
"version": "1.2.1",
"description": "A Max client for sharing states with soundworks@v4",
"author": [
"Etienne Démoulin",
Expand All @@ -23,8 +23,8 @@
},
"devDependencies": {
"@ircam/sc-utils": "^1.3.3",
"@soundworks/core": "^4.0.0-alpha.20",
"@soundworks/helpers": "^1.0.0-alpha.11",
"@soundworks/core": "^4.0.0-alpha.25",
"@soundworks/helpers": "^1.0.0-alpha.14",
"chai": "^5.1.0",
"esbuild": "^0.20.2",
"find-process": "^1.4.7",
Expand Down
18 changes: 9 additions & 9 deletions src/max-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ async function attach(schemaName) {

collection.onUpdate(async (state, updates) => {

await Max.outlet("collection", collection.getValues());
await Max.outlet("state", state.getValues());
await Max.outlet("collection", collection.getValuesUnsafe());
await Max.outlet("state", state.getValuesUnsafe());
await Max.outlet("updates", updates);

let hasEvent = false;
Expand All @@ -163,29 +163,29 @@ async function attach(schemaName) {

if (hasEvent) {
setTimeout(async () => {
await Max.outlet("collection", collection.getValues());
await Max.outlet("state", state.getValues());
await Max.outlet("collection", collection.getValuesUnsafe());
await Max.outlet("state", state.getValuesUnsafe());
await Max.outlet("updates", updates);
}, 10);
}
});

collection.onAttach(async state => {
await Max.outlet("collection", collection.getValues());
await Max.outlet("state", state.getValues());
await Max.outlet("collection", collection.getValuesUnsafe());
await Max.outlet("state", state.getValuesUnsafe());
await Max.outlet("updates", {});
});

collection.onDetach(async state => {
await Max.outlet("collection", collection.getValues());
await Max.outlet("collection", collection.getValuesUnsafe());
await Max.outlet("state", {});
await Max.outlet("updates", {});
});

// Send connected value
await Max.outlet("connect", 1);
await Max.outlet("schema", collection.getSchema());
await Max.outlet("collection", collection.getValues());
await Max.outlet("collection", collection.getValuesUnsafe());
await Max.outlet("state", {});
await Max.outlet("updates", {});

Expand Down Expand Up @@ -245,7 +245,7 @@ async function onBang() {
return;
}

await Max.outlet("collection",globals.collection.getValues());
await Max.outlet("collection",globals.collection.getValuesUnsafe());
}

async function onSchema() {
Expand Down

0 comments on commit 559bfaf

Please sign in to comment.