smplr 0.15.0 → 0.15.1
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/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -316,10 +316,11 @@ function compose(a, b) {
|
|
|
316
316
|
} : a != null ? a : b;
|
|
317
317
|
}
|
|
318
318
|
function getConfig(options) {
|
|
319
|
-
var _a, _b;
|
|
319
|
+
var _a, _b, _c;
|
|
320
320
|
const config = {
|
|
321
|
-
|
|
322
|
-
|
|
321
|
+
disableScheduler: (_a = options.disableScheduler) != null ? _a : false,
|
|
322
|
+
scheduleLookaheadMs: (_b = options.scheduleLookaheadMs) != null ? _b : 200,
|
|
323
|
+
scheduleIntervalMs: (_c = options.scheduleIntervalMs) != null ? _c : 50,
|
|
323
324
|
onStart: options.onStart,
|
|
324
325
|
onEnded: options.onEnded
|
|
325
326
|
};
|
|
@@ -357,6 +358,9 @@ var QueuedPlayer = class {
|
|
|
357
358
|
}
|
|
358
359
|
start(sample) {
|
|
359
360
|
var _a;
|
|
361
|
+
if (__privateGet(this, _config2).disableScheduler) {
|
|
362
|
+
return this.player.start(sample);
|
|
363
|
+
}
|
|
360
364
|
const context = this.player.context;
|
|
361
365
|
const now = context.currentTime;
|
|
362
366
|
const startAt = (_a = sample.time) != null ? _a : now;
|
|
@@ -394,6 +398,9 @@ var QueuedPlayer = class {
|
|
|
394
398
|
}
|
|
395
399
|
stop(sample) {
|
|
396
400
|
var _a;
|
|
401
|
+
if (__privateGet(this, _config2).disableScheduler) {
|
|
402
|
+
return this.player.stop(sample);
|
|
403
|
+
}
|
|
397
404
|
this.player.stop(sample);
|
|
398
405
|
if (!sample) {
|
|
399
406
|
__privateGet(this, _queue).clear();
|