Skip to content

Commit

Permalink
assert the context is running
Browse files Browse the repository at this point in the history
  • Loading branch information
tambien committed Nov 12, 2019
1 parent 48c3a98 commit c4153ed
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Tone/core/clock/Clock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { noOp, readOnly } from "../util/Interface";
import { PlaybackState, StateTimeline } from "../util/StateTimeline";
import { TickSignal } from "./TickSignal";
import { TickSource } from "./TickSource";
import { assertContextRunning } from "../util/Debug";

type ClockCallback = (time: Time, ticks?: Ticks) => void;

Expand Down Expand Up @@ -119,8 +120,8 @@ export class Clock<TypeName extends "bpm" | "hertz" = "hertz">
* @param offset Where the tick counter starts counting from.
*/
start(time?: Time, offset?: Ticks): this {
// make sure the context is started
// this.context.resume();
// make sure the context is running
assertContextRunning(this.context);
// start the loop
const computedTime = this.toSeconds(time);
this.log("start", computedTime);
Expand Down

0 comments on commit c4153ed

Please sign in to comment.