@opendaw/studio-core 0.0.135 → 0.0.137
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/OfflineEngineRenderer.d.ts +1 -1
- package/dist/OfflineEngineRenderer.d.ts.map +1 -1
- package/dist/OfflineEngineRenderer.js +3 -2
- package/dist/capture/CaptureAudio.d.ts.map +1 -1
- package/dist/capture/CaptureAudio.js +6 -9
- package/dist/capture/CaptureMidi.d.ts.map +1 -1
- package/dist/capture/CaptureMidi.js +10 -15
- package/dist/processors.js +45 -20
- package/dist/processors.js.map +4 -4
- package/dist/project/audio/AudioContentHelpers.d.ts +1 -1
- package/dist/project/audio/AudioContentHelpers.d.ts.map +1 -1
- package/dist/project/audio/AudioContentHelpers.js +5 -1
- package/dist/samples/GlobalSampleLoaderManager.d.ts.map +1 -1
- package/dist/samples/GlobalSampleLoaderManager.js +2 -4
- package/package.json +9 -9
|
@@ -12,7 +12,7 @@ export declare class OfflineEngineRenderer {
|
|
|
12
12
|
get sampleRate(): int;
|
|
13
13
|
get numberOfChannels(): int;
|
|
14
14
|
get totalFrames(): int;
|
|
15
|
-
play(): void
|
|
15
|
+
play(): Promise<void>;
|
|
16
16
|
stop(): void;
|
|
17
17
|
setPosition(position: ppqn): void;
|
|
18
18
|
waitForLoading(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OfflineEngineRenderer.d.ts","sourceRoot":"","sources":["../src/OfflineEngineRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,sBAAsB,EAEtB,GAAG,EAGH,MAAM,EAOT,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAC,SAAS,EAAE,IAAI,EAAC,MAAM,kBAAkB,CAAA;AAIhD,OAAO,EAKH,wBAAwB,EAKxB,yBAAyB,EAC5B,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AAOjC,qBAAa,qBAAqB;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AAE,OAAO,EACf,sBAAsB,EAAE,MAAM,CAAC,wBAAwB,CAAC,EACxD,QAAQ,EAAE,sBAAsB,CAAC,MAAM,CAAC,EACxC,WAAW,CAAC,EAAE,WAAW,EACzB,UAAU,GAAE,GAAY,GACxC,OAAO,CAAC,SAAS,CAAC;IA2BrB,OAAO;IAoBP,IAAI,UAAU,IAAI,GAAG,CAA0B;IAC/C,IAAI,gBAAgB,IAAI,GAAG,CAAgC;IAC3D,IAAI,WAAW,IAAI,GAAG,CAA2B;IAE3C,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAK3B,IAAI,IAAI,IAAI;IAKZ,WAAW,CAAC,QAAQ,EAAE,IAAI,GAAG,IAAI;IAI3B,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAMrC,SAAS,IAAI,IAAI;IAKX,IAAI,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAM3C,MAAM,CACR,MAAM,EAAE,yBAAyB,EACjC,WAAW,EAAE,IAAI,EACjB,QAAQ,EAAE,sBAAsB,CAAC,MAAM,CAAC,EACxC,WAAW,CAAC,EAAE,WAAW,GAC1B,OAAO,CAAC,SAAS,CAAC;CA0CxB"}
|
|
@@ -185,8 +185,9 @@ export class OfflineEngineRenderer {
|
|
|
185
185
|
get sampleRate() { return this.#sampleRate; }
|
|
186
186
|
get numberOfChannels() { return this.#numberOfChannels; }
|
|
187
187
|
get totalFrames() { return this.#totalFrames; }
|
|
188
|
-
play() {
|
|
188
|
+
async play() {
|
|
189
189
|
this.#engineCommands.play();
|
|
190
|
+
await this.#engineCommands.queryLoadingComplete();
|
|
190
191
|
}
|
|
191
192
|
stop() {
|
|
192
193
|
this.#engineCommands.stop(true);
|
|
@@ -230,7 +231,7 @@ export class OfflineEngineRenderer {
|
|
|
230
231
|
while (!await this.#engineCommands.queryLoadingComplete()) {
|
|
231
232
|
await Wait.timeSpan(TimeSpan.millis(100));
|
|
232
233
|
}
|
|
233
|
-
this.play();
|
|
234
|
+
await this.play();
|
|
234
235
|
this.#protocol.render(config).then(channels => {
|
|
235
236
|
polling.terminate();
|
|
236
237
|
if (cancelled) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaptureAudio.d.ts","sourceRoot":"","sources":["../../src/capture/CaptureAudio.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"CaptureAudio.d.ts","sourceRoot":"","sources":["../../src/capture/CaptureAudio.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,uBAAuB,EAEvB,MAAM,EAEN,UAAU,EACb,MAAM,kBAAkB,CAAA;AAGzB,OAAO,EAAC,YAAY,EAAE,eAAe,EAAC,MAAM,uBAAuB,CAAA;AACnE,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AACjC,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAA;AAK/C,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAA;AAE/C,qBAAa,YAAa,SAAQ,OAAO,CAAC,eAAe,CAAC;;gBAsB1C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe;IA+CjG,IAAI,YAAY,IAAI,OAAO,CAAwC;IACnE,IAAI,cAAc,IAAI,cAAc,CAA8B;IAClE,IAAI,cAAc,CAAC,KAAK,EAAE,cAAc,EAQvC;IACD,IAAI,MAAM,IAAI,MAAM,CAAsB;IAC1C,IAAI,eAAe,IAAI,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAA+B;IACnE,IAAI,eAAe,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,EAAmD;IACnF,IAAI,MAAM,IAAI,uBAAuB,CAAC,WAAW,CAAC,CAAsB;IACxE,IAAI,cAAc,IAAI,MAAM,CAAC,MAAM,CAAC,CAEnC;IACD,IAAI,KAAK,IAAI,MAAM,CAAsE;IACzF,IAAI,WAAW,IAAI,MAAM,CAAC,MAAM,CAAC,CAA+D;IAChG,IAAI,gBAAgB,IAAI,MAAM,CAAC,gBAAgB,CAAC,CAE/C;IACD,IAAI,UAAU,IAAI,MAAM,CAAC,SAAS,CAAC,CAAuD;IAC1F,IAAI,qBAAqB,IAAI,MAAM,CAA6C;IAChF,IAAI,eAAe,IAAI,QAAQ,CAA+B;IAC9D,IAAI,cAAc,IAAI,gBAAgB,CAA8B;IACpE,IAAI,eAAe,IAAI,MAAM,CAA+B;IAC5D,IAAI,eAAe,CAAC,KAAK,EAAE,MAAM,EAGhC;IACD,IAAI,UAAU,IAAI,MAAM,CAA0B;IAClD,IAAI,UAAU,CAAC,KAAK,EAAE,MAAM,EAG3B;IACD,IAAI,YAAY,IAAI,OAAO,CAA4B;IACvD,IAAI,YAAY,CAAC,KAAK,EAAE,OAAO,EAG9B;IACD,IAAI,qBAAqB,IAAI,MAAM,CAAC,MAAM,CAAC,CAAqC;IAE1E,sBAAsB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAoC/D,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IA4BvC,cAAc,IAAI,UAAU;CA2H/B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isDefined, isUndefined, MutableObservableOption, Option, RuntimeNotifier, Terminable } from "@opendaw/lib-std";
|
|
2
2
|
import { dbToGain } from "@opendaw/lib-dsp";
|
|
3
3
|
import { Promises } from "@opendaw/lib-runtime";
|
|
4
4
|
import { Capture } from "./Capture";
|
|
@@ -205,7 +205,7 @@ export class CaptureAudio extends Capture {
|
|
|
205
205
|
const deviceId = this.deviceId.getValue().unwrapOrUndefined() ?? AudioDevices.defaultInput?.deviceId;
|
|
206
206
|
const channelCount = this.#requestChannels.unwrapOrElse(2);
|
|
207
207
|
return AudioDevices.requestStream({
|
|
208
|
-
deviceId: isDefined(deviceId) ? {
|
|
208
|
+
deviceId: isDefined(deviceId) ? { ideal: deviceId } : undefined,
|
|
209
209
|
echoCancellation: false,
|
|
210
210
|
noiseSuppression: false,
|
|
211
211
|
autoGainControl: false,
|
|
@@ -216,14 +216,11 @@ export class CaptureAudio extends Capture {
|
|
|
216
216
|
const settings = track?.getSettings();
|
|
217
217
|
const gotDeviceId = settings?.deviceId;
|
|
218
218
|
console.debug(`new stream. device requested: ${deviceId ?? "default"}, got: ${gotDeviceId ?? "unknown"}. channelCount requested: ${channelCount}, got: ${settings?.channelCount}`);
|
|
219
|
-
if (
|
|
220
|
-
|
|
221
|
-
this.#stream.wrap(stream);
|
|
222
|
-
}
|
|
223
|
-
else {
|
|
224
|
-
stream.getAudioTracks().forEach(track => track.stop());
|
|
225
|
-
return Errors.warn(`Could not find audio device with id: '${deviceId}' (got: '${gotDeviceId}')`);
|
|
219
|
+
if (isDefined(deviceId) && deviceId !== gotDeviceId) {
|
|
220
|
+
console.warn(`Requested audio device '${deviceId}' unavailable, using fallback '${gotDeviceId ?? "unknown"}'`);
|
|
226
221
|
}
|
|
222
|
+
this.#rebuildAudioChain(stream);
|
|
223
|
+
this.#stream.wrap(stream);
|
|
227
224
|
});
|
|
228
225
|
}
|
|
229
226
|
#stopStream() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaptureMidi.d.ts","sourceRoot":"","sources":["../../src/capture/CaptureMidi.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"CaptureMidi.d.ts","sourceRoot":"","sources":["../../src/capture/CaptureMidi.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,UAAU,EACb,MAAM,kBAAkB,CAAA;AAIzB,OAAO,EAAC,YAAY,EAAE,cAAc,EAAC,MAAM,uBAAuB,CAAA;AAClE,OAAO,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAA;AAEnD,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AACjC,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAA;AAG/C,qBAAa,WAAY,SAAQ,OAAO,CAAC,cAAc,CAAC;;gBAOxC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc;IA+B/F,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;IAEhC,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,YAAY;IAE5D,IAAI,KAAK,IAAI,MAAM,CAgBlB;IAED,IAAI,WAAW,IAAI,MAAM,CAAC,MAAM,CAAC,CAIhC;IAEK,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAEvC,cAAc,IAAI,UAAU;CAmD/B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isDefined, Notifier, Option, Terminable } from "@opendaw/lib-std";
|
|
2
2
|
import { Events } from "@opendaw/lib-dom";
|
|
3
3
|
import { MidiData } from "@opendaw/lib-midi";
|
|
4
4
|
import { Promises } from "@opendaw/lib-runtime";
|
|
@@ -60,19 +60,7 @@ export class CaptureMidi extends Capture {
|
|
|
60
60
|
.flatMap(deviceId => MidiDevices.findInputDeviceById(deviceId)
|
|
61
61
|
.map(device => device.name));
|
|
62
62
|
}
|
|
63
|
-
async prepareRecording() {
|
|
64
|
-
const inputs = MidiDevices.inputDevices();
|
|
65
|
-
if (inputs.length === 0) {
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
const option = this.deviceId.getValue();
|
|
69
|
-
if (option.nonEmpty()) {
|
|
70
|
-
const deviceId = option.unwrap();
|
|
71
|
-
if (isUndefined(inputs.find(device => deviceId === device.id))) {
|
|
72
|
-
return Errors.warn(`Could not find MIDI device with id: '${deviceId}'`);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
63
|
+
async prepareRecording() { }
|
|
76
64
|
startRecording() {
|
|
77
65
|
return RecordMidi.start({ notifier: this.#notifier, project: this.manager.project, capture: this });
|
|
78
66
|
}
|
|
@@ -80,7 +68,14 @@ export class CaptureMidi extends Capture {
|
|
|
80
68
|
const inputs = MidiDevices.inputDevices();
|
|
81
69
|
const explicit = this.deviceId.getValue().match({
|
|
82
70
|
none: () => inputs,
|
|
83
|
-
some: id =>
|
|
71
|
+
some: id => {
|
|
72
|
+
const filtered = inputs.filter(device => id === device.id);
|
|
73
|
+
if (filtered.length === 0 && inputs.length > 0) {
|
|
74
|
+
console.warn(`Requested MIDI device '${id}' unavailable, listening to all devices`);
|
|
75
|
+
return inputs;
|
|
76
|
+
}
|
|
77
|
+
return filtered;
|
|
78
|
+
}
|
|
84
79
|
});
|
|
85
80
|
const activeNotes = new Int8Array(128);
|
|
86
81
|
this.#stream.ifSome(terminable => terminable.terminate());
|