@opendaw/studio-core 0.0.18 → 0.0.19

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": "@opendaw/studio-core",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "license": "LGPL-3.0-or-later",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -23,26 +23,26 @@
23
23
  "scripts": {
24
24
  "build": "tsc",
25
25
  "lint": "eslint \"**/*.ts\"",
26
- "test": "echo \"No tests to run\""
26
+ "test": "vitest run --config vitest.config.ts"
27
27
  },
28
28
  "dependencies": {
29
- "@opendaw/lib-box": "^0.0.18",
30
- "@opendaw/lib-dawproject": "^0.0.4",
31
- "@opendaw/lib-dom": "^0.0.18",
32
- "@opendaw/lib-dsp": "^0.0.18",
33
- "@opendaw/lib-fusion": "^0.0.18",
34
- "@opendaw/lib-runtime": "^0.0.18",
35
- "@opendaw/lib-std": "^0.0.18",
36
- "@opendaw/studio-adapters": "^0.0.18",
37
- "@opendaw/studio-boxes": "^0.0.18",
38
- "@opendaw/studio-enums": "^0.0.18"
29
+ "@opendaw/lib-box": "^0.0.19",
30
+ "@opendaw/lib-dawproject": "^0.0.5",
31
+ "@opendaw/lib-dom": "^0.0.19",
32
+ "@opendaw/lib-dsp": "^0.0.19",
33
+ "@opendaw/lib-fusion": "^0.0.19",
34
+ "@opendaw/lib-runtime": "^0.0.19",
35
+ "@opendaw/lib-std": "^0.0.19",
36
+ "@opendaw/studio-adapters": "^0.0.19",
37
+ "@opendaw/studio-boxes": "^0.0.19",
38
+ "@opendaw/studio-enums": "^0.0.19"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@opendaw/eslint-config": "^0.0.18",
42
- "@opendaw/studio-core-processors": "^0.0.18",
43
- "@opendaw/studio-core-workers": "^0.0.12",
44
- "@opendaw/studio-forge-boxes": "^0.0.18",
45
- "@opendaw/typescript-config": "^0.0.18"
42
+ "@opendaw/studio-core-processors": "^0.0.19",
43
+ "@opendaw/studio-core-workers": "^0.0.13",
44
+ "@opendaw/studio-forge-boxes": "^0.0.19",
45
+ "@opendaw/typescript-config": "^0.0.19"
46
46
  },
47
- "gitHead": "c5a09134e8559ca6d8b2f7f45f6b6a409466c51b"
47
+ "gitHead": "8d9e873aad633820cd26f76dc447674728401495"
48
48
  }
@@ -1,7 +0,0 @@
1
- import { Project } from "./Project";
2
- import { ProjectEnv } from "./ProjectEnv";
3
- export declare namespace DawProjectIO {
4
- const decode: (env: ProjectEnv, arrayBuffer: ArrayBuffer) => Promise<Project>;
5
- const encode: ({ rootBox, timelineBox }: Project) => string;
6
- }
7
- //# sourceMappingURL=DawProjectIO.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DawProjectIO.d.ts","sourceRoot":"","sources":["../src/DawProjectIO.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AAejC,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAA;AAIvC,yBAAiB,YAAY,CAAC;IACnB,MAAM,MAAM,GAAU,KAAK,UAAU,EAAE,aAAa,WAAW,KAAG,OAAO,CAAC,OAAO,CAevF,CAAA;IAEM,MAAM,MAAM,GAAI,0BAAwB,OAAO,KAAG,MAqCxD,CAAA;CAYJ"}
@@ -1,73 +0,0 @@
1
- import { Project } from "./Project";
2
- import { IndexedBox } from "@opendaw/lib-box";
3
- import { AudioUnitBox, TrackBox } from "@opendaw/studio-boxes";
4
- import { Xml } from "@opendaw/lib-xml";
5
- import { ApplicationSchema, BooleanParameterSchema, ChannelSchema, ProjectSchema, RealParameterSchema, TimeSignatureParameterSchema, TrackSchema, TransportSchema, Unit } from "@opendaw/lib-dawproject";
6
- import { asDefined } from "@opendaw/lib-std";
7
- import JSZip from "jszip";
8
- export var DawProjectIO;
9
- (function (DawProjectIO) {
10
- DawProjectIO.decode = async (env, arrayBuffer) => {
11
- const zip = await JSZip.loadAsync(arrayBuffer);
12
- const { transport, arrangement } = Xml.parse(asDefined(await zip.file("project.xml")
13
- ?.async("string"), "No project.xml found"), ProjectSchema);
14
- const project = Project.new(env);
15
- const { timelineBox, boxGraph } = project;
16
- boxGraph.beginTransaction();
17
- {
18
- timelineBox.bpm.setValue(transport?.tempo?.value ?? 120.0);
19
- timelineBox.signature.nominator.setValue(transport?.timeSignature?.numerator ?? 4);
20
- timelineBox.signature.denominator.setValue(transport?.timeSignature?.denominator ?? 4);
21
- // TODO :-)
22
- }
23
- boxGraph.endTransaction();
24
- return project;
25
- };
26
- DawProjectIO.encode = ({ rootBox, timelineBox }) => {
27
- const trackBoxes = IndexedBox.collectIndexedBoxes(rootBox.audioUnits, AudioUnitBox)
28
- .flatMap(audioUnitBox => IndexedBox.collectIndexedBoxes(audioUnitBox.tracks, TrackBox));
29
- const rootNode = Xml.element({
30
- version: "1.0",
31
- application: Xml.element({
32
- name: "openDAW",
33
- version: "0.1"
34
- }, ApplicationSchema),
35
- transport: createTransport(timelineBox),
36
- structure: [
37
- Xml.element({
38
- id: "0",
39
- contentType: "notes",
40
- channel: Xml.element({
41
- audioChannels: 2,
42
- mute: Xml.element({ value: true }, BooleanParameterSchema)
43
- }, ChannelSchema),
44
- tracks: [
45
- Xml.element({
46
- id: "01",
47
- contentType: "audio"
48
- }, TrackSchema),
49
- Xml.element({
50
- id: "02",
51
- contentType: "audio"
52
- }, TrackSchema)
53
- ]
54
- }, TrackSchema),
55
- Xml.element({
56
- id: "1",
57
- contentType: "audio"
58
- }, TrackSchema)
59
- ]
60
- }, ProjectSchema);
61
- return Xml.pretty(Xml.toElement("Project", rootNode));
62
- };
63
- const createTransport = (timelineBox) => Xml.element({
64
- tempo: Xml.element({
65
- unit: Unit.BPM,
66
- value: timelineBox.bpm.getValue()
67
- }, RealParameterSchema),
68
- timeSignature: Xml.element({
69
- numerator: timelineBox.signature.nominator.getValue(),
70
- denominator: timelineBox.signature.denominator.getValue()
71
- }, TimeSignatureParameterSchema)
72
- }, TransportSchema);
73
- })(DawProjectIO || (DawProjectIO = {}));