@opendaw/studio-core 0.0.71 → 0.0.72

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ProjectMigration.d.ts","sourceRoot":"","sources":["../../src/project/ProjectMigration.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAC,eAAe,EAAC,MAAM,0BAA0B,CAAA;AAIxD,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAA;AASvC,qBAAa,gBAAgB;WACZ,OAAO,CAAC,GAAG,EAAE,UAAU,EAAE,EAAC,QAAQ,EAAE,cAAc,EAAC,EAAE,eAAe;CAmOpF"}
1
+ {"version":3,"file":"ProjectMigration.d.ts","sourceRoot":"","sources":["../../src/project/ProjectMigration.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAC,eAAe,EAAC,MAAM,0BAA0B,CAAA;AAIxD,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAA;AASvC,qBAAa,gBAAgB;WACZ,OAAO,CAAC,GAAG,EAAE,UAAU,EAAE,EAAC,QAAQ,EAAE,cAAc,EAAC,EAAE,eAAe;CAyOpF"}
@@ -42,11 +42,11 @@ export class ProjectMigration {
42
42
  for (const box of boxGraph.boxes()) {
43
43
  await box.accept({
44
44
  visitAudioFileBox: async (box) => {
45
- const { startInSeconds, endInSeconds } = box;
46
- if (isIntEncodedAsFloat(startInSeconds.getValue()) || isIntEncodedAsFloat(endInSeconds.getValue())) {
45
+ const { startInSeconds, endInSeconds, fileName } = box;
46
+ if (isIntEncodedAsFloat(startInSeconds.getValue()) || isIntEncodedAsFloat(endInSeconds.getValue()) || endInSeconds.getValue() === 0) {
47
47
  const audioData = await loadAudioData(box.address.uuid);
48
48
  const seconds = audioData.numberOfFrames / audioData.sampleRate;
49
- console.debug("Migrate 'AudioFileBox' to float sec", seconds.toFixed(3));
49
+ console.debug(`Migrate 'AudioFileBox' to float sec (${fileName.getValue()})`, seconds.toFixed(3));
50
50
  boxGraph.beginTransaction();
51
51
  startInSeconds.setValue(0);
52
52
  endInSeconds.setValue(seconds);
@@ -111,6 +111,12 @@ export class ProjectMigration {
111
111
  box.events.refer(ValueEventCollectionBox.create(boxGraph, UUID.generate()).owners);
112
112
  boxGraph.endTransaction();
113
113
  }
114
+ if (isIntEncodedAsFloat(box.duration.getValue())) {
115
+ console.debug("Migrate 'AudioClipBox' to float");
116
+ boxGraph.beginTransaction();
117
+ box.duration.setValue(Float.floatToIntBits(box.duration.getValue()));
118
+ boxGraph.endTransaction();
119
+ }
114
120
  if (box.playback.getValue() === AudioPlayback.Pitch) {
115
121
  console.debug("Migrate 'AudioClipBox' to new PitchStretchBox");
116
122
  boxGraph.beginTransaction();
@@ -11,7 +11,7 @@ export declare class ProjectProfile {
11
11
  save(): Promise<void>;
12
12
  saveAs(meta: ProjectMeta): Promise<Option<ProjectProfile>>;
13
13
  saved(): boolean;
14
- hasChanges(): boolean;
14
+ hasUnsavedChanges(): boolean;
15
15
  subscribeMetaData(observer: Observer<ProjectMeta>): Subscription;
16
16
  updateCover(cover: Option<ArrayBuffer>): void;
17
17
  updateMetaData<KEY extends keyof ProjectMeta>(key: KEY, value: ProjectMeta[KEY]): void;
@@ -1 +1 @@
1
- {"version":3,"file":"ProjectProfile.d.ts","sourceRoot":"","sources":["../../src/project/ProjectProfile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAC,MAAM,kBAAkB,CAAA;AAC1F,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAA;AACzC,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AAIjC,qBAAa,cAAc;;gBAYX,IAAI,EAAE,IAAI,CAAC,KAAK,EAChB,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,WAAW,EACjB,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,EAC1B,YAAY,GAAE,OAAe;IAUzC,IAAI,IA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7C,IAAI,IAAI,IAAI,WAAW,CAAoB;IAC3C,IAAI,KAAK,IAAI,MAAM,CAAC,WAAW,CAAC,CAAqB;IAE/C,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAWrB,MAAM,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IAuBhE,KAAK,IAAI,OAAO;IAChB,iBAAiB,IAAI,OAAO;IAE5B,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAAC,GAAG,YAAY;IAIhE,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,GAAG,IAAI;IAK7C,cAAc,CAAC,GAAG,SAAS,MAAM,WAAW,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,IAAI;IAOtF,gBAAgB,IAAI,IAAI;IAExB,aAAa,IAAI,cAAc;IAM/B,QAAQ,IAAI,MAAM;CAcrB"}
@@ -24,8 +24,12 @@ export class ProjectProfile {
24
24
  get cover() { return this.#cover; }
25
25
  async save() {
26
26
  this.updateModifyDate();
27
+ this.#project.editing.mark();
27
28
  return this.#saved
28
- ? ProjectProfile.#writeFiles(this).then(() => { this.#hasChanges = false; })
29
+ ? ProjectProfile.#writeFiles(this).then(() => {
30
+ this.#hasChanges = false;
31
+ this.#project.editing.markSaved();
32
+ })
29
33
  : Promise.reject("Project has not been saved");
30
34
  }
31
35
  async saveAs(meta) {
@@ -41,16 +45,18 @@ export class ProjectProfile {
41
45
  return Option.wrap(profile);
42
46
  }
43
47
  else {
48
+ this.#project.editing.mark();
44
49
  return ProjectProfile.#writeFiles(this).then(() => {
45
50
  this.#saved = true;
46
51
  this.#hasChanges = false;
52
+ this.#project.editing.markSaved();
47
53
  this.#metaUpdated.notify(this.meta);
48
54
  return Option.None;
49
55
  });
50
56
  }
51
57
  }
52
58
  saved() { return this.#saved; }
53
- hasChanges() { return this.#hasChanges; }
59
+ hasUnsavedChanges() { return this.#project.editing.hasUnsavedChanges() || this.#hasChanges; }
54
60
  subscribeMetaData(observer) {
55
61
  return this.#metaUpdated.subscribe(observer);
56
62
  }
@@ -50,6 +50,7 @@ export var AudioContentFactory;
50
50
  const { boxGraph, targetTrack, index, audioFileBox, sample: { name, duration: durationInSeconds } } = props;
51
51
  const collectionBox = ValueEventCollectionBox.create(boxGraph, UUID.generate());
52
52
  return AudioClipBox.create(boxGraph, UUID.generate(), box => {
53
+ box.timeBase.setValue(TimeBase.Seconds);
53
54
  box.duration.setValue(durationInSeconds);
54
55
  box.clips.refer(targetTrack.clips);
55
56
  box.hue.setValue(ColorCodes.forTrackType(targetTrack.type.getValue()));
@@ -57,7 +58,6 @@ export var AudioContentFactory;
57
58
  box.label.setValue(name);
58
59
  box.file.refer(audioFileBox);
59
60
  box.events.refer(collectionBox.owners);
60
- box.timeBase.setValue(TimeBase.Seconds);
61
61
  box.index.setValue(index);
62
62
  });
63
63
  };
@@ -1 +1 @@
1
- {"version":3,"file":"AudioContentModifier.d.ts","sourceRoot":"","sources":["../../../src/project/audio/AudioContentModifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,IAAI,EAAgC,MAAM,kBAAkB,CAAA;AAS/E,OAAO,EAAC,sBAAsB,EAAwB,MAAM,0BAA0B,CAAA;AAItF,yBAAiB,oBAAoB,CAAC;IAC3B,MAAM,cAAc,GAAU,UAAU,aAAa,CAAC,sBAAsB,CAAC,KAAG,OAAO,CAAC,IAAI,CAOlG,CAAA;IAEM,MAAM,cAAc,GAAU,UAAU,aAAa,CAAC,sBAAsB,CAAC,KAAG,OAAO,CAAC,IAAI,CA2BlG,CAAA;IAEM,MAAM,aAAa,GAAU,UAAU,aAAa,CAAC,sBAAsB,CAAC,KAAG,OAAO,CAAC,IAAI,CA2CjG,CAAA;CA2BJ"}
1
+ {"version":3,"file":"AudioContentModifier.d.ts","sourceRoot":"","sources":["../../../src/project/audio/AudioContentModifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,IAAI,EAAgC,MAAM,kBAAkB,CAAA;AAS/E,OAAO,EAAC,sBAAsB,EAAwB,MAAM,0BAA0B,CAAA;AAItF,yBAAiB,oBAAoB,CAAC;IAC3B,MAAM,cAAc,GAAU,UAAU,aAAa,CAAC,sBAAsB,CAAC,KAAG,OAAO,CAAC,IAAI,CAOlG,CAAA;IAEM,MAAM,cAAc,GAAU,UAAU,aAAa,CAAC,sBAAsB,CAAC,KAAG,OAAO,CAAC,IAAI,CA2BlG,CAAA;IAEM,MAAM,aAAa,GAAU,UAAU,aAAa,CAAC,sBAAsB,CAAC,KAAG,OAAO,CAAC,IAAI,CA2CjG,CAAA;CA4BJ"}
@@ -105,6 +105,7 @@ export var AudioContentModifier;
105
105
  box.duration.setValue(file.endInSeconds);
106
106
  box.accept({
107
107
  visitAudioRegionBox: (box) => {
108
+ console.debug("RESET");
108
109
  box.loopOffset.setValue(0);
109
110
  box.loopDuration.setValue(file.endInSeconds);
110
111
  }
@@ -154,9 +154,9 @@ export class RegionClipResolver {
154
154
  case "start":
155
155
  if (UnionAdapterTypes.isLoopableRegion(region)) {
156
156
  const delta = task.position - region.position;
157
- region.box.position.setValue(region.position + delta);
158
- region.box.duration.setValue(region.duration - delta);
159
- region.box.loopOffset.setValue(mod(region.loopOffset + delta, region.loopDuration));
157
+ region.position = region.position + delta;
158
+ region.duration = region.duration - delta;
159
+ region.loopOffset = mod(region.loopOffset + delta, region.loopDuration);
160
160
  }
161
161
  else {
162
162
  return panic("Not yet implemented");
@@ -164,7 +164,7 @@ export class RegionClipResolver {
164
164
  break;
165
165
  case "complete":
166
166
  if (UnionAdapterTypes.isLoopableRegion(region)) {
167
- region.box.duration.setValue(task.position - task.region.position);
167
+ region.duration = task.position - task.region.position;
168
168
  }
169
169
  else {
170
170
  return panic("Not yet implemented");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opendaw/studio-core",
3
- "version": "0.0.71",
3
+ "version": "0.0.72",
4
4
  "license": "LGPL-3.0-or-later",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -31,15 +31,15 @@
31
31
  "test": "vitest run --config vitest.config.ts"
32
32
  },
33
33
  "dependencies": {
34
- "@opendaw/lib-box": "^0.0.55",
34
+ "@opendaw/lib-box": "^0.0.56",
35
35
  "@opendaw/lib-dawproject": "^0.0.41",
36
36
  "@opendaw/lib-dom": "^0.0.56",
37
37
  "@opendaw/lib-dsp": "^0.0.55",
38
- "@opendaw/lib-fusion": "^0.0.56",
38
+ "@opendaw/lib-fusion": "^0.0.57",
39
39
  "@opendaw/lib-runtime": "^0.0.55",
40
40
  "@opendaw/lib-std": "^0.0.55",
41
- "@opendaw/studio-adapters": "^0.0.59",
42
- "@opendaw/studio-boxes": "^0.0.56",
41
+ "@opendaw/studio-adapters": "^0.0.60",
42
+ "@opendaw/studio-boxes": "^0.0.57",
43
43
  "@opendaw/studio-enums": "^0.0.47",
44
44
  "dropbox": "^10.34.0",
45
45
  "y-websocket": "^1.4.5",
@@ -54,10 +54,10 @@
54
54
  "@ffmpeg/ffmpeg": "^0.12.15",
55
55
  "@ffmpeg/util": "^0.12.2",
56
56
  "@opendaw/eslint-config": "^0.0.22",
57
- "@opendaw/studio-core-processors": "^0.0.61",
58
- "@opendaw/studio-core-workers": "^0.0.54",
59
- "@opendaw/studio-forge-boxes": "^0.0.56",
57
+ "@opendaw/studio-core-processors": "^0.0.62",
58
+ "@opendaw/studio-core-workers": "^0.0.55",
59
+ "@opendaw/studio-forge-boxes": "^0.0.57",
60
60
  "@opendaw/typescript-config": "^0.0.22"
61
61
  },
62
- "gitHead": "a0b81560a705608a348e969dcc5c1a13a90d888b"
62
+ "gitHead": "99f8c7e3c6aadfea5e9fef05027b6817ab5bdf31"
63
63
  }