@opendaw/studio-core 0.0.56 → 0.0.57
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/AudioOfflineRenderer.d.ts.map +1 -1
- package/dist/AudioOfflineRenderer.js +30 -17
- package/dist/EffectBox.d.ts +2 -2
- package/dist/EffectBox.d.ts.map +1 -1
- package/dist/EffectFactories.d.ts +3 -0
- package/dist/EffectFactories.d.ts.map +1 -1
- package/dist/EffectFactories.js +40 -27
- package/dist/EffectFactory.d.ts +3 -2
- package/dist/EffectFactory.d.ts.map +1 -1
- package/dist/Engine.d.ts +2 -0
- package/dist/Engine.d.ts.map +1 -1
- package/dist/EngineFacade.d.ts +2 -0
- package/dist/EngineFacade.d.ts.map +1 -1
- package/dist/EngineFacade.js +2 -0
- package/dist/EngineWorklet.d.ts +2 -0
- package/dist/EngineWorklet.d.ts.map +1 -1
- package/dist/EngineWorklet.js +13 -1
- package/dist/ExternalLib.d.ts +6 -0
- package/dist/ExternalLib.d.ts.map +1 -0
- package/dist/ExternalLib.js +11 -0
- package/dist/FilePickerAcceptTypes.d.ts +1 -0
- package/dist/FilePickerAcceptTypes.d.ts.map +1 -1
- package/dist/FilePickerAcceptTypes.js +4 -0
- package/dist/Preferences.d.ts +2 -0
- package/dist/Preferences.d.ts.map +1 -1
- package/dist/Preferences.js +2 -1
- package/dist/capture/RecordAudio.d.ts +1 -1
- package/dist/capture/RecordAudio.d.ts.map +1 -1
- package/dist/capture/RecordAudio.js +4 -5
- package/dist/capture/RecordMidi.d.ts +1 -1
- package/dist/capture/RecordMidi.d.ts.map +1 -1
- package/dist/capture/RecordMidi.js +1 -2
- package/dist/capture/Recording.js +2 -2
- package/dist/dawproject/AudioUnitExportLayout.d.ts.map +1 -1
- package/dist/dawproject/AudioUnitExportLayout.js +1 -1
- package/dist/dawproject/BuiltinDevices.d.ts +3 -3
- package/dist/dawproject/BuiltinDevices.d.ts.map +1 -1
- package/dist/dawproject/BuiltinDevices.js +1 -1
- package/dist/dawproject/DawProject.d.ts +3 -3
- package/dist/dawproject/DawProject.d.ts.map +1 -1
- package/dist/dawproject/DawProject.js +6 -5
- package/dist/dawproject/DawProjectExporter.d.ts +2 -2
- package/dist/dawproject/DawProjectExporter.d.ts.map +1 -1
- package/dist/dawproject/DawProjectExporter.js +5 -6
- package/dist/dawproject/DawProjectExporter.test.js +24 -28
- package/dist/dawproject/DawProjectImporter.d.ts.map +1 -1
- package/dist/dawproject/DawProjectImporter.js +3 -6
- package/dist/dawproject/DawProjectService.d.ts.map +1 -1
- package/dist/dawproject/DawProjectService.js +11 -1
- package/dist/dawproject/DeviceIO.d.ts +1 -1
- package/dist/dawproject/DeviceIO.d.ts.map +1 -1
- package/dist/dawproject/DeviceIO.js +2 -2
- package/dist/index.d.ts +1 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -9
- package/dist/processors.js +19 -17
- package/dist/processors.js.map +4 -4
- package/dist/project/Project.d.ts +2 -2
- package/dist/project/Project.d.ts.map +1 -1
- package/dist/project/Project.js +18 -64
- package/dist/project/ProjectApi.d.ts +5 -8
- package/dist/project/ProjectApi.d.ts.map +1 -1
- package/dist/project/ProjectApi.js +8 -59
- package/dist/project/ProjectBundle.d.ts.map +1 -1
- package/dist/project/ProjectBundle.js +3 -2
- package/dist/project/ProjectMigration.d.ts.map +1 -1
- package/dist/project/ProjectMigration.js +64 -3
- package/dist/project/ProjectStorage.js +2 -2
- package/dist/project/index.d.ts +0 -1
- package/dist/project/index.d.ts.map +1 -1
- package/dist/project/index.js +0 -1
- package/dist/samples/OpenSampleAPI.d.ts.map +1 -1
- package/dist/samples/OpenSampleAPI.js +6 -0
- package/dist/samples/SampleService.js +1 -1
- package/dist/soundfont/DefaultSoundfontLoader.d.ts.map +1 -1
- package/dist/soundfont/DefaultSoundfontLoader.js +3 -2
- package/dist/soundfont/SoundfontService.d.ts.map +1 -1
- package/dist/soundfont/SoundfontService.js +2 -2
- package/dist/ui/RegionClipResolver.d.ts +37 -0
- package/dist/ui/RegionClipResolver.d.ts.map +1 -0
- package/dist/ui/RegionClipResolver.js +179 -0
- package/dist/ui/RegionClipResolver.test.d.ts +2 -0
- package/dist/ui/RegionClipResolver.test.d.ts.map +1 -0
- package/dist/ui/RegionClipResolver.test.js +166 -0
- package/dist/ui/RegionModifyStrategies.d.ts +25 -0
- package/dist/ui/RegionModifyStrategies.d.ts.map +1 -0
- package/dist/ui/RegionModifyStrategies.js +25 -0
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +2 -0
- package/dist/workers-main.js +4 -2
- package/dist/workers-main.js.map +3 -3
- package/dist/ysync/YService.js +2 -2
- package/package.json +15 -15
- package/dist/AudioUnitOrdering.d.ts +0 -3
- package/dist/AudioUnitOrdering.d.ts.map +0 -1
- package/dist/AudioUnitOrdering.js +0 -7
- package/dist/ColorCodes.d.ts +0 -7
- package/dist/ColorCodes.d.ts.map +0 -1
- package/dist/ColorCodes.js +0 -32
- package/dist/Colors.d.ts +0 -15
- package/dist/Colors.d.ts.map +0 -1
- package/dist/Colors.js +0 -23
- package/dist/InstrumentBox.d.ts +0 -3
- package/dist/InstrumentBox.d.ts.map +0 -1
- package/dist/InstrumentBox.js +0 -1
- package/dist/InstrumentFactories.d.ts +0 -33
- package/dist/InstrumentFactories.d.ts.map +0 -1
- package/dist/InstrumentFactories.js +0 -122
- package/dist/InstrumentFactory.d.ts +0 -13
- package/dist/InstrumentFactory.d.ts.map +0 -1
- package/dist/InstrumentFactory.js +0 -1
- package/dist/InstrumentOptions.d.ts +0 -9
- package/dist/InstrumentOptions.d.ts.map +0 -1
- package/dist/InstrumentOptions.js +0 -1
- package/dist/InstrumentProduct.d.ts +0 -8
- package/dist/InstrumentProduct.d.ts.map +0 -1
- package/dist/InstrumentProduct.js +0 -1
- package/dist/project/ProjectUtils.d.ts +0 -12
- package/dist/project/ProjectUtils.d.ts.map +0 -1
- package/dist/project/ProjectUtils.js +0 -153
- package/dist/utils/AutofitUtils.d.ts +0 -7
- package/dist/utils/AutofitUtils.d.ts.map +0 -1
- package/dist/utils/AutofitUtils.js +0 -78
- package/dist/utils/index.d.ts +0 -2
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -1
package/dist/ysync/YService.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Errors, Option, panic, RuntimeNotifier, TimeSpan, UUID } from "@opendaw
|
|
|
2
2
|
import { BoxGraph } from "@opendaw/lib-box";
|
|
3
3
|
import { Promises } from "@opendaw/lib-runtime";
|
|
4
4
|
import { BoxIO, UserInterfaceBox } from "@opendaw/studio-boxes";
|
|
5
|
-
import {
|
|
5
|
+
import { ProjectSkeleton } from "@opendaw/studio-adapters";
|
|
6
6
|
import { YSync } from "./YSync";
|
|
7
7
|
import * as Y from "yjs";
|
|
8
8
|
import { WebsocketProvider } from "y-websocket";
|
|
@@ -63,7 +63,7 @@ export var YService;
|
|
|
63
63
|
}
|
|
64
64
|
const boxGraph = new BoxGraph(Option.wrap(BoxIO.create));
|
|
65
65
|
const sync = await YSync.joinRoom({ boxGraph, boxes, conflict: () => project.invalid() });
|
|
66
|
-
const mandatoryBoxes =
|
|
66
|
+
const mandatoryBoxes = ProjectSkeleton.findMandatoryBoxes(boxGraph);
|
|
67
67
|
const project = Project.skeleton(env, {
|
|
68
68
|
boxGraph,
|
|
69
69
|
mandatoryBoxes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opendaw/studio-core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.57",
|
|
4
4
|
"license": "LGPL-3.0-or-later",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -30,16 +30,16 @@
|
|
|
30
30
|
"test": "vitest run --config vitest.config.ts"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@opendaw/lib-box": "^0.0.
|
|
34
|
-
"@opendaw/lib-dawproject": "^0.0.
|
|
35
|
-
"@opendaw/lib-dom": "^0.0.
|
|
36
|
-
"@opendaw/lib-dsp": "^0.0.
|
|
37
|
-
"@opendaw/lib-fusion": "^0.0.
|
|
38
|
-
"@opendaw/lib-runtime": "^0.0.
|
|
39
|
-
"@opendaw/lib-std": "^0.0.
|
|
40
|
-
"@opendaw/studio-adapters": "^0.0.
|
|
41
|
-
"@opendaw/studio-boxes": "^0.0.
|
|
42
|
-
"@opendaw/studio-enums": "^0.0.
|
|
33
|
+
"@opendaw/lib-box": "^0.0.48",
|
|
34
|
+
"@opendaw/lib-dawproject": "^0.0.34",
|
|
35
|
+
"@opendaw/lib-dom": "^0.0.48",
|
|
36
|
+
"@opendaw/lib-dsp": "^0.0.48",
|
|
37
|
+
"@opendaw/lib-fusion": "^0.0.48",
|
|
38
|
+
"@opendaw/lib-runtime": "^0.0.48",
|
|
39
|
+
"@opendaw/lib-std": "^0.0.48",
|
|
40
|
+
"@opendaw/studio-adapters": "^0.0.49",
|
|
41
|
+
"@opendaw/studio-boxes": "^0.0.48",
|
|
42
|
+
"@opendaw/studio-enums": "^0.0.39",
|
|
43
43
|
"dropbox": "^10.34.0",
|
|
44
44
|
"y-websocket": "^1.4.5",
|
|
45
45
|
"yjs": "^13.6.27",
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
"@ffmpeg/ffmpeg": "^0.12.15",
|
|
54
54
|
"@ffmpeg/util": "^0.12.2",
|
|
55
55
|
"@opendaw/eslint-config": "^0.0.20",
|
|
56
|
-
"@opendaw/studio-core-processors": "^0.0.
|
|
57
|
-
"@opendaw/studio-core-workers": "^0.0.
|
|
58
|
-
"@opendaw/studio-forge-boxes": "^0.0.
|
|
56
|
+
"@opendaw/studio-core-processors": "^0.0.49",
|
|
57
|
+
"@opendaw/studio-core-workers": "^0.0.44",
|
|
58
|
+
"@opendaw/studio-forge-boxes": "^0.0.48",
|
|
59
59
|
"@opendaw/typescript-config": "^0.0.20"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "cbdb8e49076f45a6d703e9dd348e1d0e1113e1dc"
|
|
62
62
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AudioUnitOrdering.d.ts","sourceRoot":"","sources":["../src/AudioUnitOrdering.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,kBAAkB,CAAA;AAGpC,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAKxC,CAAA"}
|
package/dist/ColorCodes.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { AudioUnitType } from "@opendaw/studio-enums";
|
|
2
|
-
import { TrackType } from "@opendaw/studio-adapters";
|
|
3
|
-
export declare namespace ColorCodes {
|
|
4
|
-
const forAudioType: (type?: AudioUnitType) => string;
|
|
5
|
-
const forTrackType: (type?: TrackType) => number;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=ColorCodes.d.ts.map
|
package/dist/ColorCodes.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ColorCodes.d.ts","sourceRoot":"","sources":["../src/ColorCodes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAC,SAAS,EAAC,MAAM,0BAA0B,CAAA;AAGlD,yBAAiB,UAAU,CAAC;IACjB,MAAM,YAAY,GAAI,OAAO,aAAa,KAAG,MAanD,CAAA;IAEM,MAAM,YAAY,GAAI,OAAO,SAAS,KAAG,MAW/C,CAAA;CACJ"}
|
package/dist/ColorCodes.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { AudioUnitType } from "@opendaw/studio-enums";
|
|
2
|
-
import { TrackType } from "@opendaw/studio-adapters";
|
|
3
|
-
import { Colors } from "./Colors";
|
|
4
|
-
export var ColorCodes;
|
|
5
|
-
(function (ColorCodes) {
|
|
6
|
-
ColorCodes.forAudioType = (type) => {
|
|
7
|
-
switch (type) {
|
|
8
|
-
case AudioUnitType.Output:
|
|
9
|
-
return Colors.blue;
|
|
10
|
-
case AudioUnitType.Aux:
|
|
11
|
-
return Colors.purple;
|
|
12
|
-
case AudioUnitType.Bus:
|
|
13
|
-
return Colors.orange;
|
|
14
|
-
case AudioUnitType.Instrument:
|
|
15
|
-
return Colors.green;
|
|
16
|
-
default:
|
|
17
|
-
return Colors.dark;
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
ColorCodes.forTrackType = (type) => {
|
|
21
|
-
switch (type) {
|
|
22
|
-
case TrackType.Audio:
|
|
23
|
-
return 200;
|
|
24
|
-
case TrackType.Notes:
|
|
25
|
-
return 45;
|
|
26
|
-
case TrackType.Value:
|
|
27
|
-
return 156;
|
|
28
|
-
default:
|
|
29
|
-
return 0;
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
})(ColorCodes || (ColorCodes = {}));
|
package/dist/Colors.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare const Colors: {
|
|
2
|
-
blue: string;
|
|
3
|
-
green: string;
|
|
4
|
-
yellow: string;
|
|
5
|
-
cream: string;
|
|
6
|
-
orange: string;
|
|
7
|
-
red: string;
|
|
8
|
-
purple: string;
|
|
9
|
-
bright: string;
|
|
10
|
-
gray: string;
|
|
11
|
-
dark: string;
|
|
12
|
-
shadow: string;
|
|
13
|
-
black: string;
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=Colors.d.ts.map
|
package/dist/Colors.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Colors.d.ts","sourceRoot":"","sources":["../src/Colors.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,MAAM;;;;;;;;;;;;;CAalB,CAAA"}
|
package/dist/Colors.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { InaccessibleProperty } from "@opendaw/lib-std";
|
|
2
|
-
const getPropertyValue = (() => {
|
|
3
|
-
if (typeof document === "undefined") {
|
|
4
|
-
// This will compile in React but fails at runtime when no document is available
|
|
5
|
-
return (_property) => InaccessibleProperty;
|
|
6
|
-
}
|
|
7
|
-
const computedStyle = getComputedStyle(document.documentElement);
|
|
8
|
-
return (property) => computedStyle.getPropertyValue(property);
|
|
9
|
-
})();
|
|
10
|
-
export const Colors = {
|
|
11
|
-
blue: getPropertyValue("--color-blue"),
|
|
12
|
-
green: getPropertyValue("--color-green"),
|
|
13
|
-
yellow: getPropertyValue("--color-yellow"),
|
|
14
|
-
cream: getPropertyValue("--color-cream"),
|
|
15
|
-
orange: getPropertyValue("--color-orange"),
|
|
16
|
-
red: getPropertyValue("--color-red"),
|
|
17
|
-
purple: getPropertyValue("--color-purple"),
|
|
18
|
-
bright: getPropertyValue("--color-bright"),
|
|
19
|
-
gray: getPropertyValue("--color-gray"),
|
|
20
|
-
dark: getPropertyValue("--color-dark"),
|
|
21
|
-
shadow: getPropertyValue("--color-shadow"),
|
|
22
|
-
black: getPropertyValue("--color-black")
|
|
23
|
-
};
|
package/dist/InstrumentBox.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { MIDIOutputDeviceBox, NanoDeviceBox, PlayfieldDeviceBox, SoundfontDeviceBox, TapeDeviceBox, VaporisateurDeviceBox } from "@opendaw/studio-boxes";
|
|
2
|
-
export type InstrumentBox = TapeDeviceBox | VaporisateurDeviceBox | NanoDeviceBox | PlayfieldDeviceBox | SoundfontDeviceBox | MIDIOutputDeviceBox;
|
|
3
|
-
//# sourceMappingURL=InstrumentBox.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InstrumentBox.d.ts","sourceRoot":"","sources":["../src/InstrumentBox.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,qBAAqB,EACxB,MAAM,uBAAuB,CAAA;AAE9B,MAAM,MAAM,aAAa,GACrB,aAAa,GACX,qBAAqB,GACrB,aAAa,GACb,kBAAkB,GAClB,kBAAkB,GAClB,mBAAmB,CAAA"}
|
package/dist/InstrumentBox.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { byte, UUID } from "@opendaw/lib-std";
|
|
2
|
-
import { InstrumentFactory } from "./InstrumentFactory";
|
|
3
|
-
export declare namespace InstrumentFactories {
|
|
4
|
-
const Tape: InstrumentFactory;
|
|
5
|
-
const Nano: InstrumentFactory;
|
|
6
|
-
type PlayfieldAttachment = ReadonlyArray<{
|
|
7
|
-
note: byte;
|
|
8
|
-
uuid: UUID.Bytes;
|
|
9
|
-
name: string;
|
|
10
|
-
durationInSeconds: number;
|
|
11
|
-
exclude: boolean;
|
|
12
|
-
}>;
|
|
13
|
-
const Playfield: InstrumentFactory<PlayfieldAttachment>;
|
|
14
|
-
const Vaporisateur: InstrumentFactory;
|
|
15
|
-
const MIDIOutput: InstrumentFactory;
|
|
16
|
-
const Soundfont: InstrumentFactory<{
|
|
17
|
-
uuid: UUID.String;
|
|
18
|
-
name: string;
|
|
19
|
-
}>;
|
|
20
|
-
const Named: {
|
|
21
|
-
Vaporisateur: InstrumentFactory<never>;
|
|
22
|
-
Playfield: InstrumentFactory<PlayfieldAttachment>;
|
|
23
|
-
Nano: InstrumentFactory<never>;
|
|
24
|
-
Tape: InstrumentFactory<never>;
|
|
25
|
-
Soundfont: InstrumentFactory<{
|
|
26
|
-
uuid: UUID.String;
|
|
27
|
-
name: string;
|
|
28
|
-
}>;
|
|
29
|
-
MIDIOutput: InstrumentFactory<never>;
|
|
30
|
-
};
|
|
31
|
-
type Keys = keyof typeof Named;
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=InstrumentFactories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InstrumentFactories.d.ts","sourceRoot":"","sources":["../src/InstrumentFactories.ts"],"names":[],"mappings":"AAYA,OAAO,EAAC,IAAI,EAAa,IAAI,EAAC,MAAM,kBAAkB,CAAA;AAKtD,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAA;AAGrD,yBAAiB,mBAAmB,CAAC;IAC1B,MAAM,IAAI,EAAE,iBAmBlB,CAAA;IAEM,MAAM,IAAI,EAAE,iBAwBlB,CAAA;IAED,KAAY,mBAAmB,GAAG,aAAa,CAAC;QAC5C,IAAI,EAAE,IAAI,CAAA;QACV,IAAI,EAAE,IAAI,CAAC,KAAK,CAAA;QAChB,IAAI,EAAE,MAAM,CAAA;QACZ,iBAAiB,EAAE,MAAM,CAAA;QACzB,OAAO,EAAE,OAAO,CAAA;KACnB,CAAC,CAAA;IAEK,MAAM,SAAS,EAAE,iBAAiB,CAAC,mBAAmB,CA4B5D,CAAA;IAEM,MAAM,YAAY,EAAE,iBAqB1B,CAAA;IAEM,MAAM,UAAU,EAAE,iBAexB,CAAA;IAEM,MAAM,SAAS,EAAE,iBAAiB,CAAC;QAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAqB5E,CAAA;IAEM,MAAM,KAAK;;;;;;kBAvBgC,IAAI,CAAC,MAAM;kBAAQ,MAAM;;;KAuBM,CAAA;IACjF,KAAY,IAAI,GAAG,MAAM,OAAO,KAAK,CAAA;CAYxC"}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { AudioFileBox, MIDIOutputDeviceBox, NanoDeviceBox, PlayfieldDeviceBox, PlayfieldSampleBox, SoundfontDeviceBox, SoundfontFileBox, TapeDeviceBox, VaporisateurDeviceBox } from "@opendaw/studio-boxes";
|
|
2
|
-
import { isDefined, UUID } from "@opendaw/lib-std";
|
|
3
|
-
import { Waveform } from "@opendaw/lib-dsp";
|
|
4
|
-
import { IconSymbol, TrackType } from "@opendaw/studio-adapters";
|
|
5
|
-
export var InstrumentFactories;
|
|
6
|
-
(function (InstrumentFactories) {
|
|
7
|
-
InstrumentFactories.Tape = {
|
|
8
|
-
defaultName: "Tape",
|
|
9
|
-
defaultIcon: IconSymbol.Tape,
|
|
10
|
-
description: "Plays audio regions & clips",
|
|
11
|
-
trackType: TrackType.Audio,
|
|
12
|
-
create: (boxGraph, host, name, icon, _attachment) => TapeDeviceBox.create(boxGraph, UUID.generate(), box => {
|
|
13
|
-
box.label.setValue(name);
|
|
14
|
-
box.icon.setValue(IconSymbol.toName(icon));
|
|
15
|
-
box.flutter.setValue(0.2);
|
|
16
|
-
box.wow.setValue(0.05);
|
|
17
|
-
box.noise.setValue(0.02);
|
|
18
|
-
box.saturation.setValue(0.5);
|
|
19
|
-
box.host.refer(host);
|
|
20
|
-
})
|
|
21
|
-
};
|
|
22
|
-
InstrumentFactories.Nano = {
|
|
23
|
-
defaultName: "Nano",
|
|
24
|
-
defaultIcon: IconSymbol.NanoWave,
|
|
25
|
-
description: "Simple sampler",
|
|
26
|
-
trackType: TrackType.Notes,
|
|
27
|
-
create: (boxGraph, host, name, icon, _attachment) => {
|
|
28
|
-
const fileUUID = UUID.parse("c1678daa-4a47-4cba-b88f-4f4e384663c3");
|
|
29
|
-
const fileDuration = 5.340;
|
|
30
|
-
const audioFileBox = boxGraph.findBox(fileUUID)
|
|
31
|
-
.unwrapOrElse(() => AudioFileBox.create(boxGraph, fileUUID, box => {
|
|
32
|
-
box.fileName.setValue("Rhode");
|
|
33
|
-
box.endInSeconds.setValue(fileDuration);
|
|
34
|
-
}));
|
|
35
|
-
return NanoDeviceBox.create(boxGraph, UUID.generate(), box => {
|
|
36
|
-
box.label.setValue(name);
|
|
37
|
-
box.icon.setValue(IconSymbol.toName(icon));
|
|
38
|
-
box.file.refer(audioFileBox);
|
|
39
|
-
box.host.refer(host);
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
InstrumentFactories.Playfield = {
|
|
44
|
-
defaultName: "Playfield",
|
|
45
|
-
defaultIcon: IconSymbol.Playfield,
|
|
46
|
-
description: "Drum computer",
|
|
47
|
-
trackType: TrackType.Notes,
|
|
48
|
-
create: (boxGraph, host, name, icon, attachment) => {
|
|
49
|
-
const deviceBox = PlayfieldDeviceBox.create(boxGraph, UUID.generate(), box => {
|
|
50
|
-
box.label.setValue(name);
|
|
51
|
-
box.icon.setValue(IconSymbol.toName(icon));
|
|
52
|
-
box.host.refer(host);
|
|
53
|
-
});
|
|
54
|
-
if (isDefined(attachment)) {
|
|
55
|
-
attachment.filter(({ note, uuid, name, durationInSeconds, exclude }) => {
|
|
56
|
-
const fileBox = useAudioFile(boxGraph, uuid, name, durationInSeconds);
|
|
57
|
-
PlayfieldSampleBox.create(boxGraph, UUID.generate(), box => {
|
|
58
|
-
box.device.refer(deviceBox.samples);
|
|
59
|
-
box.file.refer(fileBox);
|
|
60
|
-
box.index.setValue(note);
|
|
61
|
-
box.exclude.setValue(exclude);
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
return deviceBox;
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
InstrumentFactories.Vaporisateur = {
|
|
69
|
-
defaultName: "Vaporisateur",
|
|
70
|
-
defaultIcon: IconSymbol.Piano,
|
|
71
|
-
description: "Classic subtractive synthesizer",
|
|
72
|
-
trackType: TrackType.Notes,
|
|
73
|
-
create: (boxGraph, host, name, icon, _attachment) => VaporisateurDeviceBox.create(boxGraph, UUID.generate(), box => {
|
|
74
|
-
box.label.setValue(name);
|
|
75
|
-
box.icon.setValue(IconSymbol.toName(icon));
|
|
76
|
-
box.tune.setInitValue(0.0);
|
|
77
|
-
box.cutoff.setInitValue(1000.0);
|
|
78
|
-
box.resonance.setInitValue(0.1);
|
|
79
|
-
box.attack.setInitValue(0.005);
|
|
80
|
-
box.release.setInitValue(0.1);
|
|
81
|
-
box.waveform.setInitValue(Waveform.sine);
|
|
82
|
-
box.host.refer(host);
|
|
83
|
-
})
|
|
84
|
-
};
|
|
85
|
-
InstrumentFactories.MIDIOutput = {
|
|
86
|
-
defaultName: "MIDIOutput",
|
|
87
|
-
defaultIcon: IconSymbol.Midi,
|
|
88
|
-
description: "MIDI Output",
|
|
89
|
-
trackType: TrackType.Notes,
|
|
90
|
-
create: (boxGraph, host, name, icon, _attachment) => MIDIOutputDeviceBox.create(boxGraph, UUID.generate(), box => {
|
|
91
|
-
box.label.setValue(name);
|
|
92
|
-
box.icon.setValue(IconSymbol.toName(icon));
|
|
93
|
-
box.host.refer(host);
|
|
94
|
-
})
|
|
95
|
-
};
|
|
96
|
-
InstrumentFactories.Soundfont = {
|
|
97
|
-
defaultName: "Soundfont",
|
|
98
|
-
defaultIcon: IconSymbol.Book,
|
|
99
|
-
description: "Soundfont Player",
|
|
100
|
-
trackType: TrackType.Notes,
|
|
101
|
-
create: (boxGraph, host, name, icon, attachment) => {
|
|
102
|
-
attachment ??= { uuid: "d9f51577-2096-4671-9067-27ca2e12b329", name: "Upright Piano KW" };
|
|
103
|
-
const soundFontUUIDAsString = attachment.uuid;
|
|
104
|
-
const soundfontUUID = UUID.parse(soundFontUUIDAsString);
|
|
105
|
-
const soundfontBox = useSoundfontFile(boxGraph, soundfontUUID, attachment.name);
|
|
106
|
-
return SoundfontDeviceBox.create(boxGraph, UUID.generate(), box => {
|
|
107
|
-
box.label.setValue(name);
|
|
108
|
-
box.icon.setValue(IconSymbol.toName(icon));
|
|
109
|
-
box.host.refer(host);
|
|
110
|
-
box.file.refer(soundfontBox);
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
InstrumentFactories.Named = { Vaporisateur: InstrumentFactories.Vaporisateur, Playfield: InstrumentFactories.Playfield, Nano: InstrumentFactories.Nano, Tape: InstrumentFactories.Tape, Soundfont: InstrumentFactories.Soundfont, MIDIOutput: InstrumentFactories.MIDIOutput };
|
|
115
|
-
const useAudioFile = (boxGraph, fileUUID, name, duration) => boxGraph.findBox(fileUUID)
|
|
116
|
-
.unwrapOrElse(() => AudioFileBox.create(boxGraph, fileUUID, box => {
|
|
117
|
-
box.fileName.setValue(name);
|
|
118
|
-
box.endInSeconds.setValue(duration);
|
|
119
|
-
}));
|
|
120
|
-
const useSoundfontFile = (boxGraph, fileUUID, name) => boxGraph.findBox(fileUUID)
|
|
121
|
-
.unwrapOrElse(() => SoundfontFileBox.create(boxGraph, fileUUID, box => box.fileName.setValue(name)));
|
|
122
|
-
})(InstrumentFactories || (InstrumentFactories = {}));
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { IconSymbol, TrackType } from "@opendaw/studio-adapters";
|
|
2
|
-
import { BoxGraph, Field } from "@opendaw/lib-box";
|
|
3
|
-
import { BoxIO } from "@opendaw/studio-boxes";
|
|
4
|
-
import { InstrumentBox } from "./InstrumentBox";
|
|
5
|
-
import { Pointers } from "@opendaw/studio-enums";
|
|
6
|
-
export interface InstrumentFactory<T = never> {
|
|
7
|
-
defaultName: string;
|
|
8
|
-
defaultIcon: IconSymbol;
|
|
9
|
-
description: string;
|
|
10
|
-
trackType: TrackType;
|
|
11
|
-
create: (boxGraph: BoxGraph<BoxIO.TypeMap>, host: Field<Pointers.InstrumentHost | Pointers.AudioOutput>, name: string, icon: IconSymbol, attachment?: T) => InstrumentBox;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=InstrumentFactory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InstrumentFactory.d.ts","sourceRoot":"","sources":["../src/InstrumentFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,SAAS,EAAC,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAC,KAAK,EAAC,MAAM,uBAAuB,CAAA;AAC3C,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAC,QAAQ,EAAC,MAAM,uBAAuB,CAAA;AAE9C,MAAM,WAAW,iBAAiB,CAAC,CAAC,GAAG,KAAK;IACxC,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,UAAU,CAAA;IACvB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,SAAS,CAAA;IACpB,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,EACjC,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,cAAc,GAAG,QAAQ,CAAC,WAAW,CAAC,EAC3D,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,UAAU,EAChB,UAAU,CAAC,EAAE,CAAC,KAAK,aAAa,CAAA;CAC5C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { IconSymbol } from "@opendaw/studio-adapters";
|
|
2
|
-
import { int } from "@opendaw/lib-std";
|
|
3
|
-
export type InstrumentOptions<T = never> = {
|
|
4
|
-
name?: string;
|
|
5
|
-
icon?: IconSymbol;
|
|
6
|
-
index?: int;
|
|
7
|
-
attachment?: T;
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=InstrumentOptions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InstrumentOptions.d.ts","sourceRoot":"","sources":["../src/InstrumentOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAC,GAAG,EAAC,MAAM,kBAAkB,CAAA;AAEpC,MAAM,MAAM,iBAAiB,CAAC,CAAC,GAAG,KAAK,IAAI;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,UAAU,CAAC;IAAC,KAAK,CAAC,EAAE,GAAG,CAAC;IAAC,UAAU,CAAC,EAAE,CAAC,CAAA;CAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { AudioUnitBox, TrackBox } from "@opendaw/studio-boxes";
|
|
2
|
-
import { InstrumentBox } from "./InstrumentBox";
|
|
3
|
-
export type InstrumentProduct = {
|
|
4
|
-
audioUnitBox: AudioUnitBox;
|
|
5
|
-
instrumentBox: InstrumentBox;
|
|
6
|
-
trackBox: TrackBox;
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=InstrumentProduct.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InstrumentProduct.d.ts","sourceRoot":"","sources":["../src/InstrumentProduct.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,QAAQ,EAAC,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAA;AAE7C,MAAM,MAAM,iBAAiB,GAAG;IAC5B,YAAY,EAAE,YAAY,CAAA;IAC1B,aAAa,EAAE,aAAa,CAAA;IAC5B,QAAQ,EAAE,QAAQ,CAAA;CACrB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ppqn } from "@opendaw/lib-dsp";
|
|
2
|
-
import { AnyRegionBox } from "@opendaw/studio-adapters";
|
|
3
|
-
import { Project } from "./Project";
|
|
4
|
-
import { AudioUnitBox } from "@opendaw/studio-boxes";
|
|
5
|
-
export declare namespace ProjectUtils {
|
|
6
|
-
const extractAudioUnits: (audioUnitBoxes: ReadonlyArray<AudioUnitBox>, targetProject: Project, options?: {
|
|
7
|
-
includeAux?: boolean;
|
|
8
|
-
includeBus?: boolean;
|
|
9
|
-
}) => void;
|
|
10
|
-
const extractRegions: (regionBoxes: ReadonlyArray<AnyRegionBox>, targetProject: Project, insertPosition?: ppqn) => void;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=ProjectUtils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectUtils.d.ts","sourceRoot":"","sources":["../../src/project/ProjectUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,kBAAkB,CAAA;AACrC,OAAO,EAAC,YAAY,EAAgB,MAAM,0BAA0B,CAAA;AACpE,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AAcjC,OAAO,EAEH,YAAY,EAOf,MAAM,uBAAuB,CAAA;AAI9B,yBAAiB,YAAY,CAAC;IAMnB,MAAM,iBAAiB,GAAI,gBAAgB,aAAa,CAAC,YAAY,CAAC,EAC3C,eAAe,OAAO,EACtB,UAAS;QAAE,UAAU,CAAC,EAAE,OAAO,CAAC;QAAC,UAAU,CAAC,EAAE,OAAO,CAAA;KAAO,KAAG,IAehG,CAAA;IAEM,MAAM,cAAc,GAAI,aAAa,aAAa,CAAC,YAAY,CAAC,EACxC,eAAe,OAAO,EACtB,iBAAgB,IAAU,KAAG,IAkD3D,CAAA;CA6FJ"}
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import { UnionBoxTypes } from "@opendaw/studio-adapters";
|
|
2
|
-
import { Arrays, asInstanceOf, assert, ByteArrayInput, isInstanceOf, SetMultimap, UUID } from "@opendaw/lib-std";
|
|
3
|
-
import { AudioFileBox, AudioUnitBox, AuxSendBox, SelectionBox, SoundfontFileBox, TrackBox } from "@opendaw/studio-boxes";
|
|
4
|
-
import { IndexedBox, PointerField } from "@opendaw/lib-box";
|
|
5
|
-
import { AudioUnitOrdering } from "../AudioUnitOrdering";
|
|
6
|
-
export var ProjectUtils;
|
|
7
|
-
(function (ProjectUtils) {
|
|
8
|
-
const isSameGraph = ({ graph: a }, { graph: b }) => a === b;
|
|
9
|
-
const compareIndex = (a, b) => a.index.getValue() - b.index.getValue();
|
|
10
|
-
ProjectUtils.extractAudioUnits = (audioUnitBoxes, targetProject, options = {}) => {
|
|
11
|
-
assert(Arrays.satisfy(audioUnitBoxes, isSameGraph), "AudioUnits must share the same BoxGraph");
|
|
12
|
-
// TODO Implement include options.
|
|
13
|
-
assert(!options.includeAux && !options.includeBus, "Options are not yet implemented");
|
|
14
|
-
const { boxGraph, masterBusBox, rootBox } = targetProject;
|
|
15
|
-
const dependencies = audioUnitBoxes
|
|
16
|
-
.flatMap(box => Array.from(box.graph.dependenciesOf(box, { alwaysFollowMandatory: true }).boxes))
|
|
17
|
-
.filter(box => box.name !== SelectionBox.ClassName && box.name !== AuxSendBox.ClassName);
|
|
18
|
-
const uuidMap = generateTransferMap(audioUnitBoxes, dependencies, rootBox.audioUnits.address.uuid, masterBusBox.address.uuid);
|
|
19
|
-
boxGraph.beginTransaction();
|
|
20
|
-
copy(uuidMap, boxGraph, audioUnitBoxes, dependencies);
|
|
21
|
-
reorderAudioUnits(uuidMap, audioUnitBoxes, rootBox);
|
|
22
|
-
boxGraph.endTransaction();
|
|
23
|
-
boxGraph.verifyPointers();
|
|
24
|
-
};
|
|
25
|
-
ProjectUtils.extractRegions = (regionBoxes, targetProject, insertPosition = 0.0) => {
|
|
26
|
-
assert(Arrays.satisfy(regionBoxes, isSameGraph), "Region smust be from the same BoxGraph");
|
|
27
|
-
const regionBoxSet = new Set(regionBoxes);
|
|
28
|
-
const trackBoxSet = new Set();
|
|
29
|
-
const audioUnitBoxSet = new SetMultimap();
|
|
30
|
-
// Collect AudioUnits and Tracks
|
|
31
|
-
regionBoxes.forEach(regionBox => {
|
|
32
|
-
const trackBox = asInstanceOf(regionBox.regions.targetVertex.unwrap().box, TrackBox);
|
|
33
|
-
trackBoxSet.add(trackBox);
|
|
34
|
-
const audioUnitBox = asInstanceOf(trackBox.tracks.targetVertex.unwrap().box, AudioUnitBox);
|
|
35
|
-
audioUnitBoxSet.add(audioUnitBox, trackBox);
|
|
36
|
-
});
|
|
37
|
-
console.debug(`Found ${audioUnitBoxSet.keyCount()} audioUnits`);
|
|
38
|
-
console.debug(`Found ${trackBoxSet.size} tracks`);
|
|
39
|
-
const audioUnitBoxes = [...audioUnitBoxSet.keys()];
|
|
40
|
-
const { boxGraph, masterBusBox, rootBox } = targetProject;
|
|
41
|
-
const excludeBox = box => (isInstanceOf(box, TrackBox) && !trackBoxSet.has(box))
|
|
42
|
-
|| (UnionBoxTypes.isRegionBox(box) && !regionBoxSet.has(box));
|
|
43
|
-
const dependencies = audioUnitBoxes
|
|
44
|
-
.flatMap(box => Array.from(box.graph.dependenciesOf(box, { excludeBox, alwaysFollowMandatory: true }).boxes))
|
|
45
|
-
.filter(box => box.name !== SelectionBox.ClassName && box.name !== AuxSendBox.ClassName);
|
|
46
|
-
const uuidMap = generateTransferMap(audioUnitBoxes, dependencies, rootBox.audioUnits.address.uuid, masterBusBox.address.uuid);
|
|
47
|
-
boxGraph.beginTransaction();
|
|
48
|
-
copy(uuidMap, boxGraph, audioUnitBoxes, dependencies);
|
|
49
|
-
reorderAudioUnits(uuidMap, audioUnitBoxes, rootBox);
|
|
50
|
-
// reorder track indices
|
|
51
|
-
audioUnitBoxSet.forEach((_, trackBoxes) => [...trackBoxes]
|
|
52
|
-
.sort(compareIndex)
|
|
53
|
-
.forEach((source, index) => {
|
|
54
|
-
const box = boxGraph
|
|
55
|
-
.findBox(uuidMap.get(source.address.uuid).target)
|
|
56
|
-
.unwrap("Target Track has not been copied");
|
|
57
|
-
asInstanceOf(box, TrackBox).index.setValue(index);
|
|
58
|
-
}));
|
|
59
|
-
// move new regions to the target position
|
|
60
|
-
const minPosition = regionBoxes.reduce((min, region) => Math.min(min, region.position.getValue()), Number.MAX_VALUE);
|
|
61
|
-
const delta = insertPosition - minPosition;
|
|
62
|
-
regionBoxes.forEach((source) => {
|
|
63
|
-
const box = boxGraph
|
|
64
|
-
.findBox(uuidMap.get(source.address.uuid).target)
|
|
65
|
-
.unwrap("Target Track has not been copied");
|
|
66
|
-
const position = UnionBoxTypes.asRegionBox(box).position;
|
|
67
|
-
position.setValue(position.getValue() + delta);
|
|
68
|
-
});
|
|
69
|
-
boxGraph.endTransaction();
|
|
70
|
-
boxGraph.verifyPointers();
|
|
71
|
-
};
|
|
72
|
-
const generateTransferMap = (audioUnitBoxes, dependencies, rootBoxUUID, masterBusBoxUUID) => {
|
|
73
|
-
const uuidMap = UUID.newSet(({ source }) => source);
|
|
74
|
-
uuidMap.addMany([
|
|
75
|
-
...audioUnitBoxes
|
|
76
|
-
.filter(({ output: { targetAddress } }) => targetAddress.nonEmpty())
|
|
77
|
-
.map(box => ({
|
|
78
|
-
source: box.output.targetAddress.unwrap().uuid,
|
|
79
|
-
target: masterBusBoxUUID
|
|
80
|
-
})),
|
|
81
|
-
...audioUnitBoxes
|
|
82
|
-
.map(box => ({
|
|
83
|
-
source: box.collection.targetAddress.unwrap("AudioUnitBox was not connected to a RootBox").uuid,
|
|
84
|
-
target: rootBoxUUID
|
|
85
|
-
})),
|
|
86
|
-
...audioUnitBoxes
|
|
87
|
-
.map(box => ({
|
|
88
|
-
source: box.address.uuid,
|
|
89
|
-
target: UUID.generate()
|
|
90
|
-
})),
|
|
91
|
-
...dependencies
|
|
92
|
-
.map(({ address: { uuid }, name }) => ({
|
|
93
|
-
source: uuid,
|
|
94
|
-
target: name === AudioFileBox.ClassName || name === SoundfontFileBox.ClassName
|
|
95
|
-
? uuid
|
|
96
|
-
: UUID.generate()
|
|
97
|
-
}))
|
|
98
|
-
]);
|
|
99
|
-
return uuidMap;
|
|
100
|
-
};
|
|
101
|
-
const copy = (uuidMap, boxGraph, audioUnitBoxes, dependencies) => {
|
|
102
|
-
PointerField.decodeWith({
|
|
103
|
-
map: (_pointer, newAddress) => newAddress.map(address => uuidMap.opt(address.uuid).match({
|
|
104
|
-
none: () => address,
|
|
105
|
-
some: ({ target }) => address.moveTo(target)
|
|
106
|
-
}))
|
|
107
|
-
}, () => {
|
|
108
|
-
audioUnitBoxes
|
|
109
|
-
.forEach((source) => {
|
|
110
|
-
const input = new ByteArrayInput(source.toArrayBuffer());
|
|
111
|
-
const key = source.name;
|
|
112
|
-
const uuid = uuidMap.get(source.address.uuid).target;
|
|
113
|
-
boxGraph.createBox(key, uuid, box => box.read(input));
|
|
114
|
-
});
|
|
115
|
-
dependencies
|
|
116
|
-
.forEach((source) => {
|
|
117
|
-
const input = new ByteArrayInput(source.toArrayBuffer());
|
|
118
|
-
const key = source.name;
|
|
119
|
-
const uuid = uuidMap.get(source.address.uuid).target;
|
|
120
|
-
if (source instanceof AudioFileBox || source instanceof SoundfontFileBox) {
|
|
121
|
-
// Those boxes keep their UUID. So if they are already in the graph, we can just read them.
|
|
122
|
-
if (boxGraph.findBox(source.address.uuid).nonEmpty()) {
|
|
123
|
-
source.read(input);
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
boxGraph.createBox(key, uuid, box => box.read(input));
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
};
|
|
131
|
-
const reorderAudioUnits = (uuidMap, audioUnitBoxes, rootBox) => {
|
|
132
|
-
audioUnitBoxes
|
|
133
|
-
.toSorted(compareIndex)
|
|
134
|
-
.forEach((box) => {
|
|
135
|
-
// That is a bit slow, but we are probably not dealing with too many audioUnits at this point.
|
|
136
|
-
const boxes = IndexedBox.collectIndexedBoxes(rootBox.audioUnits, AudioUnitBox);
|
|
137
|
-
const order = AudioUnitOrdering[box.type.getValue()];
|
|
138
|
-
let index = 0 | 0;
|
|
139
|
-
for (; index < boxes.length; index++) {
|
|
140
|
-
if (AudioUnitOrdering[boxes[index].type.getValue()] > order) {
|
|
141
|
-
break;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
const insertIndex = index;
|
|
145
|
-
while (index < boxes.length) {
|
|
146
|
-
boxes[index].index.setValue(++index);
|
|
147
|
-
}
|
|
148
|
-
asInstanceOf(rootBox.graph
|
|
149
|
-
.findBox(uuidMap.get(box.address.uuid).target)
|
|
150
|
-
.unwrap("Target Track has not been copied"), AudioUnitBox).index.setValue(insertIndex);
|
|
151
|
-
});
|
|
152
|
-
};
|
|
153
|
-
})(ProjectUtils || (ProjectUtils = {}));
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Project } from "../index";
|
|
2
|
-
import { AudioRegionBoxAdapter } from "@opendaw/studio-adapters";
|
|
3
|
-
export declare namespace AutofitUtils {
|
|
4
|
-
const changeBpm: (project: Project, newBpm: number, mark: boolean) => void;
|
|
5
|
-
const regionsToAutofit: (project: Project, regions: ReadonlyArray<AudioRegionBoxAdapter>) => void;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=AutofitUtils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AutofitUtils.d.ts","sourceRoot":"","sources":["../../src/utils/AutofitUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,UAAU,CAAA;AAChC,OAAO,EAAsB,qBAAqB,EAAkB,MAAM,0BAA0B,CAAA;AAKpG,yBAAiB,YAAY,CAAC;IAGnB,MAAM,SAAS,GAAI,SAAS,OAAO,EAAE,QAAQ,MAAM,EAAE,MAAM,OAAO,KAAG,IAsC3E,CAAA;IAEM,MAAM,gBAAgB,GAAI,SAAS,OAAO,EAAE,SAAS,aAAa,CAAC,qBAAqB,CAAC,SAgC/F,CAAA;CACJ"}
|