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 CHANGED
@@ -232,6 +232,7 @@ declare class Sampler {
232
232
  }
233
233
 
234
234
  type QueuedPlayerConfig = {
235
+ disableScheduler: boolean;
235
236
  scheduleLookaheadMs: number;
236
237
  scheduleIntervalMs: number;
237
238
  onStart?: (sample: SampleStart) => void;
package/dist/index.d.ts CHANGED
@@ -232,6 +232,7 @@ declare class Sampler {
232
232
  }
233
233
 
234
234
  type QueuedPlayerConfig = {
235
+ disableScheduler: boolean;
235
236
  scheduleLookaheadMs: number;
236
237
  scheduleIntervalMs: number;
237
238
  onStart?: (sample: SampleStart) => void;
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
- scheduleLookaheadMs: (_a = options.scheduleLookaheadMs) != null ? _a : 200,
322
- scheduleIntervalMs: (_b = options.scheduleIntervalMs) != null ? _b : 50,
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();