@opendaw/studio-core 0.0.71 → 0.0.74

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.
@@ -3,9 +3,7 @@ import { ProjectSkeleton } from "@opendaw/studio-adapters";
3
3
  import { ProjectProfile } from "../project";
4
4
  import { SampleService } from "../samples";
5
5
  export declare class DawProjectService {
6
- readonly sampleService: SampleService;
7
- constructor(sampleService: SampleService);
8
- importDawproject(): Promise<Option<ProjectSkeleton>>;
9
- exportDawproject(profile: ProjectProfile): Promise<void>;
6
+ static importDawproject(sampleService: SampleService): Promise<Option<ProjectSkeleton>>;
7
+ static exportDawproject(profile: ProjectProfile): Promise<void>;
10
8
  }
11
9
  //# sourceMappingURL=DawProjectService.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DawProjectService.d.ts","sourceRoot":"","sources":["../../src/dawproject/DawProjectService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,MAAM,EAAyB,MAAM,kBAAkB,CAAA;AAKlF,OAAO,EAAC,eAAe,EAAC,MAAM,0BAA0B,CAAA;AAIxD,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CAAA;AACzC,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAA;AAExC,qBAAa,iBAAiB;IACd,QAAQ,CAAC,aAAa,EAAE,aAAa;gBAA5B,aAAa,EAAE,aAAa;IAE3C,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;IA2BpD,gBAAgB,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CA4BjE"}
1
+ {"version":3,"file":"DawProjectService.d.ts","sourceRoot":"","sources":["../../src/dawproject/DawProjectService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,MAAM,EAAyB,MAAM,kBAAkB,CAAA;AAKlF,OAAO,EAAC,eAAe,EAAC,MAAM,0BAA0B,CAAA;AAIxD,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CAAA;AACzC,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAA;AAExC,qBAAa,iBAAiB;WACb,gBAAgB,CAAC,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;WA2BhF,gBAAgB,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CA4BxE"}
@@ -7,11 +7,7 @@ import { DawProject } from "./DawProject";
7
7
  import { FilePickerAcceptTypes } from "../FilePickerAcceptTypes";
8
8
  import { DawProjectImport } from "./DawProjectImporter";
9
9
  export class DawProjectService {
10
- sampleService;
11
- constructor(sampleService) {
12
- this.sampleService = sampleService;
13
- }
14
- async importDawproject() {
10
+ static async importDawproject(sampleService) {
15
11
  const { status, value, error } = await Promises.tryCatch(Files.open({ types: [FilePickerAcceptTypes.DawprojectFileType] }));
16
12
  if (status === "rejected") {
17
13
  if (Errors.isAbort(error)) {
@@ -33,14 +29,14 @@ export class DawProjectService {
33
29
  const { skeleton, audioIds } = importResult.value;
34
30
  await Promise.all(audioIds
35
31
  .map(uuid => resources.fromUUID(uuid))
36
- .map(resource => this.sampleService.importFile({
32
+ .map(resource => sampleService.importFile({
37
33
  uuid: resource.uuid,
38
34
  name: resource.name,
39
35
  arrayBuffer: resource.buffer
40
36
  })));
41
37
  return Option.wrap(skeleton);
42
38
  }
43
- async exportDawproject(profile) {
39
+ static async exportDawproject(profile) {
44
40
  const dialog = RuntimeNotifier.progress({ headline: "Exporting DawProject..." });
45
41
  const { project, meta } = profile;
46
42
  const { status, error, value: zip } = await Promises.tryCatch(DawProject.encode(project.skeleton, project.sampleManager, Xml.element({