@opendaw/studio-core 0.0.133 → 0.0.134

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.
@@ -66,7 +66,7 @@ export class CaptureMidi extends Capture {
66
66
  await MidiDevices.requestPermission();
67
67
  }
68
68
  else {
69
- return Errors.warn("MIDI not available");
69
+ console.warn("MIDI not available");
70
70
  }
71
71
  }
72
72
  const inputs = MidiDevices.inputDevices();
@@ -1 +1 @@
1
- {"version":3,"file":"RecordMidi.d.ts","sourceRoot":"","sources":["../../src/capture/RecordMidi.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,QAAQ,EAKR,UAAU,EAGb,MAAM,kBAAkB,CAAA;AAGzB,OAAO,EAAa,UAAU,EAA2B,MAAM,0BAA0B,CAAA;AACzF,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAA;AAClC,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AAGjC,yBAAiB,UAAU,CAAC;IACxB,KAAK,iBAAiB,GAAG;QACrB,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;QAC/B,OAAO,EAAE,OAAO,CAAC;QACjB,OAAO,EAAE,OAAO,CAAA;KACnB,CAAA;IAgBD,MAAM,CAAC,MAAM,KAAK,GAAI,gCAA8B,iBAAiB,KAAG,UA4KvE,CAAA;;CACJ"}
1
+ {"version":3,"file":"RecordMidi.d.ts","sourceRoot":"","sources":["../../src/capture/RecordMidi.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,QAAQ,EAKR,UAAU,EAGb,MAAM,kBAAkB,CAAA;AAGzB,OAAO,EAAa,UAAU,EAA2B,MAAM,0BAA0B,CAAA;AACzF,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAA;AAClC,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AAGjC,yBAAiB,UAAU,CAAC;IACxB,KAAK,iBAAiB,GAAG;QACrB,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;QAC/B,OAAO,EAAE,OAAO,CAAC;QACjB,OAAO,EAAE,OAAO,CAAA;KACnB,CAAA;IAgBD,MAAM,CAAC,MAAM,KAAK,GAAI,gCAA8B,iBAAiB,KAAG,UA0LvE,CAAA;;CACJ"}
@@ -1,4 +1,4 @@
1
- import { asInstanceOf, Option, quantizeCeil, quantizeFloor, Terminator, UUID } from "@opendaw/lib-std";
1
+ import { asInstanceOf, Option, quantizeCeil, quantizeFloor, Terminable, Terminator, UUID } from "@opendaw/lib-std";
2
2
  import { PPQN } from "@opendaw/lib-dsp";
3
3
  import { NoteEventBox, NoteEventCollectionBox, NoteRegionBox, TrackBox } from "@opendaw/studio-boxes";
4
4
  import { ColorCodes, NoteSignal, TrackType, UnionBoxTypes } from "@opendaw/studio-adapters";
@@ -111,10 +111,17 @@ export var RecordMidi;
111
111
  editing.modify(() => {
112
112
  currentTake.ifSome(take => {
113
113
  const actualDurationPPQN = take.regionBox.duration.getValue();
114
+ if (actualDurationPPQN <= 0) {
115
+ take.regionBox.delete();
116
+ currentTake = Option.None;
117
+ return;
118
+ }
114
119
  finalizeTake(take, actualDurationPPQN);
115
120
  positionOffset += actualDurationPPQN;
116
121
  });
117
- startNewTake(loopFrom);
122
+ if (currentTake.nonEmpty()) {
123
+ startNewTake(loopFrom);
124
+ }
118
125
  }, false);
119
126
  }
120
127
  lastPosition = currentPosition;
@@ -185,6 +192,13 @@ export var RecordMidi;
185
192
  }
186
193
  }
187
194
  }));
195
+ terminator.own(Terminable.create(() => {
196
+ currentTake.ifSome(({ regionBox }) => {
197
+ if (regionBox.isAttached() && regionBox.duration.getValue() <= 0) {
198
+ editing.modify(() => regionBox.delete(), false);
199
+ }
200
+ });
201
+ }));
188
202
  return terminator;
189
203
  };
190
204
  })(RecordMidi || (RecordMidi = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opendaw/studio-core",
3
- "version": "0.0.133",
3
+ "version": "0.0.134",
4
4
  "license": "LGPL-3.0-or-later",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -63,5 +63,5 @@
63
63
  "@opendaw/studio-forge-boxes": "^0.0.87",
64
64
  "@opendaw/typescript-config": "^0.0.29"
65
65
  },
66
- "gitHead": "84641f3d74f1f617b872b75a5d33a714e681f9e7"
66
+ "gitHead": "182f552c67bba34800cf3ca216c509b11266b8fc"
67
67
  }