@opendaw/studio-core 0.0.115 → 0.0.116
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":"RecordAudio.d.ts","sourceRoot":"","sources":["../../src/capture/RecordAudio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqD,UAAU,EAA6B,MAAM,kBAAkB,CAAA;AAG3H,OAAO,EAAa,mBAAmB,EAA2B,MAAM,0BAA0B,CAAA;AAClG,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAA;AAClC,OAAO,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"RecordAudio.d.ts","sourceRoot":"","sources":["../../src/capture/RecordAudio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqD,UAAU,EAA6B,MAAM,kBAAkB,CAAA;AAG3H,OAAO,EAAa,mBAAmB,EAA2B,MAAM,0BAA0B,CAAA;AAClG,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAA;AAClC,OAAO,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AAIjC,yBAAiB,WAAW,CAAC;IACzB,KAAK,kBAAkB,GAAG;QACtB,gBAAgB,EAAE,gBAAgB,CAAA;QAClC,UAAU,EAAE,SAAS,CAAA;QACrB,aAAa,EAAE,mBAAmB,CAAA;QAClC,OAAO,EAAE,OAAO,CAAA;QAChB,OAAO,EAAE,OAAO,CAAA;QAChB,aAAa,EAAE,MAAM,CAAA;KACxB,CAAA;IAOD,MAAM,CAAC,MAAM,KAAK,GACd,kFAAgF,kBAAkB,KAChG,UAgKL,CAAA;;CACJ"}
|
|
@@ -2,6 +2,7 @@ import { asInstanceOf, Option, quantizeFloor, Terminable, Terminator, tryCatch,
|
|
|
2
2
|
import { PPQN, TimeBase } from "@opendaw/lib-dsp";
|
|
3
3
|
import { AudioFileBox, AudioRegionBox, TrackBox, ValueEventCollectionBox } from "@opendaw/studio-boxes";
|
|
4
4
|
import { ColorCodes, TrackType, UnionBoxTypes } from "@opendaw/studio-adapters";
|
|
5
|
+
import { Recording } from "./Recording";
|
|
5
6
|
import { RecordTrack } from "./RecordTrack";
|
|
6
7
|
export var RecordAudio;
|
|
7
8
|
(function (RecordAudio) {
|
|
@@ -16,7 +17,6 @@ export var RecordAudio;
|
|
|
16
17
|
let lastPosition = 0;
|
|
17
18
|
let currentWaveformOffset = outputLatency;
|
|
18
19
|
let takeNumber = 0;
|
|
19
|
-
let hadCountIn = false;
|
|
20
20
|
const { env: { audioContext: { sampleRate } }, engine: { preferences: { settings: { recording } } } } = project;
|
|
21
21
|
const { loopArea } = timelineBox;
|
|
22
22
|
const createFileBox = () => {
|
|
@@ -117,9 +117,7 @@ export var RecordAudio;
|
|
|
117
117
|
return;
|
|
118
118
|
}
|
|
119
119
|
const currentPosition = owner.getValue();
|
|
120
|
-
// During count-in, just track that we had one
|
|
121
120
|
if (isCountingIn) {
|
|
122
|
-
hadCountIn = true;
|
|
123
121
|
return;
|
|
124
122
|
}
|
|
125
123
|
// From here on, isRecording is true
|
|
@@ -143,10 +141,12 @@ export var RecordAudio;
|
|
|
143
141
|
const preRecordingFrames = recordingWorklet.numberOfFrames;
|
|
144
142
|
const preRecordingSeconds = preRecordingFrames / sampleRate;
|
|
145
143
|
// If there was count-in, use pre-recording frames as offset; otherwise use outputLatency
|
|
146
|
-
const
|
|
144
|
+
const countedIn = Recording.wasCountingIn();
|
|
145
|
+
console.debug("countedIn", countedIn);
|
|
146
|
+
const waveformOffset = countedIn ? preRecordingSeconds : outputLatency;
|
|
147
147
|
editing.modify(() => {
|
|
148
148
|
fileBox = Option.wrap(createFileBox());
|
|
149
|
-
const position = quantizeFloor(currentPosition, beats);
|
|
149
|
+
const position = countedIn ? quantizeFloor(currentPosition, beats) : currentPosition;
|
|
150
150
|
currentTake = Option.wrap(createTakeRegion(position, waveformOffset, null));
|
|
151
151
|
}, false);
|
|
152
152
|
currentWaveformOffset = waveformOffset;
|
|
@@ -39,7 +39,7 @@ export class Recording {
|
|
|
39
39
|
this.#isRecording = false;
|
|
40
40
|
};
|
|
41
41
|
terminator.ownAll(engine.isRecording.subscribe(stop), engine.isCountingIn.subscribe(stop), Terminable.create(() => Recording.#instance = Option.None));
|
|
42
|
-
this.#instance = Option.wrap(new Recording(countIn, engine.position.getValue()));
|
|
42
|
+
this.#instance = Option.wrap(new Recording(countIn && !engine.isPlaying.getValue(), engine.position.getValue()));
|
|
43
43
|
return terminator;
|
|
44
44
|
}
|
|
45
45
|
static #isRecording = false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opendaw/studio-core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.116",
|
|
4
4
|
"license": "LGPL-3.0-or-later",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -33,16 +33,16 @@
|
|
|
33
33
|
"test": "vitest run --config vitest.config.ts"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@opendaw/lib-box": "^0.0.
|
|
36
|
+
"@opendaw/lib-box": "^0.0.76",
|
|
37
37
|
"@opendaw/lib-dawproject": "^0.0.61",
|
|
38
38
|
"@opendaw/lib-dom": "^0.0.75",
|
|
39
39
|
"@opendaw/lib-dsp": "^0.0.75",
|
|
40
|
-
"@opendaw/lib-fusion": "^0.0.
|
|
40
|
+
"@opendaw/lib-fusion": "^0.0.82",
|
|
41
41
|
"@opendaw/lib-runtime": "^0.0.71",
|
|
42
42
|
"@opendaw/lib-std": "^0.0.70",
|
|
43
43
|
"@opendaw/nam-wasm": "^1.0.3",
|
|
44
|
-
"@opendaw/studio-adapters": "^0.0.
|
|
45
|
-
"@opendaw/studio-boxes": "^0.0.
|
|
44
|
+
"@opendaw/studio-adapters": "^0.0.93",
|
|
45
|
+
"@opendaw/studio-boxes": "^0.0.80",
|
|
46
46
|
"@opendaw/studio-enums": "^0.0.66",
|
|
47
47
|
"dropbox": "^10.34.0",
|
|
48
48
|
"y-websocket": "^1.4.5",
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
"@ffmpeg/ffmpeg": "^0.12.15",
|
|
58
58
|
"@ffmpeg/util": "^0.12.2",
|
|
59
59
|
"@opendaw/eslint-config": "^0.0.27",
|
|
60
|
-
"@opendaw/studio-core-processors": "^0.0.
|
|
61
|
-
"@opendaw/studio-core-workers": "^0.0.
|
|
62
|
-
"@opendaw/studio-forge-boxes": "^0.0.
|
|
60
|
+
"@opendaw/studio-core-processors": "^0.0.96",
|
|
61
|
+
"@opendaw/studio-core-workers": "^0.0.88",
|
|
62
|
+
"@opendaw/studio-forge-boxes": "^0.0.80",
|
|
63
63
|
"@opendaw/typescript-config": "^0.0.29"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "ad6836ddfa539c9a2915aa7fbd473e5386887851"
|
|
66
66
|
}
|