@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/dist/Project.d.ts +3 -1
- package/dist/Project.d.ts.map +1 -1
- package/dist/Project.js +17 -2
- package/dist/dawproject/DawProjectExporter.d.ts +8 -0
- package/dist/dawproject/DawProjectExporter.d.ts.map +1 -0
- package/dist/dawproject/DawProjectExporter.js +29 -0
- package/dist/dawproject/DawProjectExporter.test.d.ts +2 -0
- package/dist/dawproject/DawProjectExporter.test.d.ts.map +1 -0
- package/dist/dawproject/DawProjectExporter.test.js +16 -0
- package/dist/dawproject/DawProjectIO.d.ts +20 -0
- package/dist/dawproject/DawProjectIO.d.ts.map +1 -0
- package/dist/dawproject/DawProjectIO.js +31 -0
- package/dist/dawproject/DawProjectImport.test.d.ts +2 -0
- package/dist/dawproject/DawProjectImport.test.d.ts.map +1 -0
- package/dist/dawproject/DawProjectImport.test.js +16 -0
- package/dist/dawproject/DawProjectImporter.d.ts +12 -0
- package/dist/dawproject/DawProjectImporter.d.ts.map +1 -0
- package/dist/dawproject/DawProjectImporter.js +273 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/processors.js +2 -2
- package/dist/processors.js.map +4 -4
- package/dist/workers.js +2 -2
- package/dist/workers.js.map +3 -3
- package/package.json +17 -17
- package/dist/DawProjectIO.d.ts +0 -7
- package/dist/DawProjectIO.d.ts.map +0 -1
- package/dist/DawProjectIO.js +0 -73
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@opendaw/studio-core",
|
3
|
-
"version": "0.0.
|
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": "
|
26
|
+
"test": "vitest run --config vitest.config.ts"
|
27
27
|
},
|
28
28
|
"dependencies": {
|
29
|
-
"@opendaw/lib-box": "^0.0.
|
30
|
-
"@opendaw/lib-dawproject": "^0.0.
|
31
|
-
"@opendaw/lib-dom": "^0.0.
|
32
|
-
"@opendaw/lib-dsp": "^0.0.
|
33
|
-
"@opendaw/lib-fusion": "^0.0.
|
34
|
-
"@opendaw/lib-runtime": "^0.0.
|
35
|
-
"@opendaw/lib-std": "^0.0.
|
36
|
-
"@opendaw/studio-adapters": "^0.0.
|
37
|
-
"@opendaw/studio-boxes": "^0.0.
|
38
|
-
"@opendaw/studio-enums": "^0.0.
|
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.
|
43
|
-
"@opendaw/studio-core-workers": "^0.0.
|
44
|
-
"@opendaw/studio-forge-boxes": "^0.0.
|
45
|
-
"@opendaw/typescript-config": "^0.0.
|
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": "
|
47
|
+
"gitHead": "8d9e873aad633820cd26f76dc447674728401495"
|
48
48
|
}
|
package/dist/DawProjectIO.d.ts
DELETED
@@ -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"}
|
package/dist/DawProjectIO.js
DELETED
@@ -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 = {}));
|