@octoseq/visualiser 0.1.0-main.994cb4e → 0.1.0-main.9d89c16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octoseq/visualiser",
3
- "version": "0.1.0-main.994cb4e",
3
+ "version": "0.1.0-main.9d89c16",
4
4
  "description": "WASM-based visualiser for Octoseq",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -56,6 +56,11 @@ export class WasmVisualiser {
56
56
  * Returns a JSON array of signal names.
57
57
  */
58
58
  get_signal_names(): string;
59
+ /**
60
+ * Get a list of all registered mesh asset IDs.
61
+ * Returns a JSON array of asset IDs.
62
+ */
63
+ list_mesh_assets(): string;
59
64
  /**
60
65
  * Push pre-extracted events for a band.
61
66
  *
@@ -117,6 +122,12 @@ export class WasmVisualiser {
117
122
  * Check if frequency bands are currently set.
118
123
  */
119
124
  has_frequency_bands(): boolean;
125
+ /**
126
+ * Register a mesh asset from OBJ content.
127
+ * The asset will be available as `mesh.load(asset_id)` in scripts.
128
+ * Returns true if successful, false if parsing failed.
129
+ */
130
+ register_mesh_asset(asset_id: string, obj_content: string): boolean;
120
131
  /**
121
132
  * Set the frequency band structure for band-aware processing.
122
133
  * The JSON format matches the TypeScript FrequencyBandStructure type.
@@ -137,6 +148,11 @@ export class WasmVisualiser {
137
148
  * Clear the frequency band structure.
138
149
  */
139
150
  clear_frequency_bands(): void;
151
+ /**
152
+ * Unregister a mesh asset.
153
+ * Returns true if the asset was unregistered, false if it didn't exist.
154
+ */
155
+ unregister_mesh_asset(asset_id: string): boolean;
140
156
  /**
141
157
  * Get the number of frequency bands.
142
158
  */
@@ -201,6 +217,7 @@ export interface InitOutput {
201
217
  readonly wasmvisualiser_has_frequency_bands: (a: number) => number;
202
218
  readonly wasmvisualiser_has_script: (a: number) => number;
203
219
  readonly wasmvisualiser_isolate_entity: (a: number, b: bigint) => void;
220
+ readonly wasmvisualiser_list_mesh_assets: (a: number) => [number, number];
204
221
  readonly wasmvisualiser_load_script: (a: number, b: number, c: number) => number;
205
222
  readonly wasmvisualiser_new: () => number;
206
223
  readonly wasmvisualiser_push_band_events: (a: number, b: number, c: number, d: number, e: number) => number;
@@ -208,6 +225,7 @@ export interface InitOutput {
208
225
  readonly wasmvisualiser_push_data: (a: number, b: number, c: number, d: number) => void;
209
226
  readonly wasmvisualiser_push_signal: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
210
227
  readonly wasmvisualiser_push_zoom_data: (a: number, b: number, c: number, d: number) => void;
228
+ readonly wasmvisualiser_register_mesh_asset: (a: number, b: number, c: number, d: number, e: number) => number;
211
229
  readonly wasmvisualiser_render: (a: number, b: number) => void;
212
230
  readonly wasmvisualiser_resize: (a: number, b: number, c: number) => void;
213
231
  readonly wasmvisualiser_run_analysis: (a: number, b: number, c: number, d: number, e: number) => [number, number];
@@ -218,6 +236,7 @@ export interface InitOutput {
218
236
  readonly wasmvisualiser_set_sigmoid_k: (a: number, b: number) => void;
219
237
  readonly wasmvisualiser_set_time: (a: number, b: number) => void;
220
238
  readonly wasmvisualiser_take_script_diagnostics_json: (a: number) => [number, number];
239
+ readonly wasmvisualiser_unregister_mesh_asset: (a: number, b: number, c: number) => number;
221
240
  readonly wasmvisualiser_push_rotation_data: (a: number, b: number, c: number, d: number) => void;
222
241
  readonly init_panic_hook: () => void;
223
242
  readonly wasm_bindgen__convert__closures_____invoke__h9d1c5a23ecfcd5c8: (a: number, b: number, c: any) => void;
package/pkg/visualiser.js CHANGED
@@ -421,6 +421,23 @@ export class WasmVisualiser {
421
421
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
422
422
  }
423
423
  }
424
+ /**
425
+ * Get a list of all registered mesh asset IDs.
426
+ * Returns a JSON array of asset IDs.
427
+ * @returns {string}
428
+ */
429
+ list_mesh_assets() {
430
+ let deferred1_0;
431
+ let deferred1_1;
432
+ try {
433
+ const ret = wasm.wasmvisualiser_list_mesh_assets(this.__wbg_ptr);
434
+ deferred1_0 = ret[0];
435
+ deferred1_1 = ret[1];
436
+ return getStringFromWasm0(ret[0], ret[1]);
437
+ } finally {
438
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
439
+ }
440
+ }
424
441
  /**
425
442
  * Push pre-extracted events for a band.
426
443
  *
@@ -549,6 +566,22 @@ export class WasmVisualiser {
549
566
  const ret = wasm.wasmvisualiser_has_frequency_bands(this.__wbg_ptr);
550
567
  return ret !== 0;
551
568
  }
569
+ /**
570
+ * Register a mesh asset from OBJ content.
571
+ * The asset will be available as `mesh.load(asset_id)` in scripts.
572
+ * Returns true if successful, false if parsing failed.
573
+ * @param {string} asset_id
574
+ * @param {string} obj_content
575
+ * @returns {boolean}
576
+ */
577
+ register_mesh_asset(asset_id, obj_content) {
578
+ const ptr0 = passStringToWasm0(asset_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
579
+ const len0 = WASM_VECTOR_LEN;
580
+ const ptr1 = passStringToWasm0(obj_content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
581
+ const len1 = WASM_VECTOR_LEN;
582
+ const ret = wasm.wasmvisualiser_register_mesh_asset(this.__wbg_ptr, ptr0, len0, ptr1, len1);
583
+ return ret !== 0;
584
+ }
552
585
  /**
553
586
  * Set the frequency band structure for band-aware processing.
554
587
  * The JSON format matches the TypeScript FrequencyBandStructure type.
@@ -597,6 +630,18 @@ export class WasmVisualiser {
597
630
  clear_frequency_bands() {
598
631
  wasm.wasmvisualiser_clear_frequency_bands(this.__wbg_ptr);
599
632
  }
633
+ /**
634
+ * Unregister a mesh asset.
635
+ * Returns true if the asset was unregistered, false if it didn't exist.
636
+ * @param {string} asset_id
637
+ * @returns {boolean}
638
+ */
639
+ unregister_mesh_asset(asset_id) {
640
+ const ptr0 = passStringToWasm0(asset_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
641
+ const len0 = WASM_VECTOR_LEN;
642
+ const ret = wasm.wasmvisualiser_unregister_mesh_asset(this.__wbg_ptr, ptr0, len0);
643
+ return ret !== 0;
644
+ }
600
645
  /**
601
646
  * Get the number of frequency bands.
602
647
  * @returns {number}
@@ -1577,21 +1622,21 @@ function __wbg_get_imports() {
1577
1622
  const ret = getStringFromWasm0(arg0, arg1);
1578
1623
  return ret;
1579
1624
  };
1580
- imports.wbg.__wbindgen_cast_76d0cfa31f1ac8a4 = function(arg0, arg1) {
1581
- // Cast intrinsic for `Closure(Closure { dtor_idx: 2169, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx: 2170, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1625
+ imports.wbg.__wbindgen_cast_9983f14242864161 = function(arg0, arg1) {
1626
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 2225, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx: 2226, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1582
1627
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__heb49a8f426ac2d2e, wasm_bindgen__convert__closures_____invoke__h9d1c5a23ecfcd5c8);
1583
1628
  return ret;
1584
1629
  };
1630
+ imports.wbg.__wbindgen_cast_adb0bbfefc4aa204 = function(arg0, arg1) {
1631
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 2357, function: Function { arguments: [Externref], shim_idx: 2358, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1632
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hf5eaa61ced318e08, wasm_bindgen__convert__closures_____invoke__h53437a38721e89f7);
1633
+ return ret;
1634
+ };
1585
1635
  imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
1586
1636
  // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
1587
1637
  const ret = getArrayU8FromWasm0(arg0, arg1);
1588
1638
  return ret;
1589
1639
  };
1590
- imports.wbg.__wbindgen_cast_cf6801dce1a51fdc = function(arg0, arg1) {
1591
- // Cast intrinsic for `Closure(Closure { dtor_idx: 2301, function: Function { arguments: [Externref], shim_idx: 2302, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1592
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hf5eaa61ced318e08, wasm_bindgen__convert__closures_____invoke__h53437a38721e89f7);
1593
- return ret;
1594
- };
1595
1640
  imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
1596
1641
  // Cast intrinsic for `F64 -> Externref`.
1597
1642
  const ret = arg0;
Binary file
@@ -20,6 +20,7 @@ export const wasmvisualiser_get_signal_names: (a: number) => [number, number];
20
20
  export const wasmvisualiser_has_frequency_bands: (a: number) => number;
21
21
  export const wasmvisualiser_has_script: (a: number) => number;
22
22
  export const wasmvisualiser_isolate_entity: (a: number, b: bigint) => void;
23
+ export const wasmvisualiser_list_mesh_assets: (a: number) => [number, number];
23
24
  export const wasmvisualiser_load_script: (a: number, b: number, c: number) => number;
24
25
  export const wasmvisualiser_new: () => number;
25
26
  export const wasmvisualiser_push_band_events: (a: number, b: number, c: number, d: number, e: number) => number;
@@ -27,6 +28,7 @@ export const wasmvisualiser_push_band_signal: (a: number, b: number, c: number,
27
28
  export const wasmvisualiser_push_data: (a: number, b: number, c: number, d: number) => void;
28
29
  export const wasmvisualiser_push_signal: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
29
30
  export const wasmvisualiser_push_zoom_data: (a: number, b: number, c: number, d: number) => void;
31
+ export const wasmvisualiser_register_mesh_asset: (a: number, b: number, c: number, d: number, e: number) => number;
30
32
  export const wasmvisualiser_render: (a: number, b: number) => void;
31
33
  export const wasmvisualiser_resize: (a: number, b: number, c: number) => void;
32
34
  export const wasmvisualiser_run_analysis: (a: number, b: number, c: number, d: number, e: number) => [number, number];
@@ -37,6 +39,7 @@ export const wasmvisualiser_set_musical_time: (a: number, b: number, c: number)
37
39
  export const wasmvisualiser_set_sigmoid_k: (a: number, b: number) => void;
38
40
  export const wasmvisualiser_set_time: (a: number, b: number) => void;
39
41
  export const wasmvisualiser_take_script_diagnostics_json: (a: number) => [number, number];
42
+ export const wasmvisualiser_unregister_mesh_asset: (a: number, b: number, c: number) => number;
40
43
  export const wasmvisualiser_push_rotation_data: (a: number, b: number, c: number, d: number) => void;
41
44
  export const init_panic_hook: () => void;
42
45
  export const wasm_bindgen__convert__closures_____invoke__h9d1c5a23ecfcd5c8: (a: number, b: number, c: any) => void;