clear hydra in mini repl
This commit is contained in:
parent
4a87df6426
commit
d0510f862a
1 changed files with 6 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
import { useState, useRef, useCallback, useMemo, useEffect } from 'react';
|
import { useState, useRef, useCallback, useMemo, useEffect } from 'react';
|
||||||
import { Icon } from './Icon';
|
import { Icon } from './Icon';
|
||||||
import { silence, noteToMidi, _mod } from '@strudel/core';
|
import { silence, noteToMidi, _mod } from '@strudel/core';
|
||||||
|
import { clearHydra } from '@strudel/hydra';
|
||||||
import { getDrawContext, getPunchcardPainter } from '@strudel/draw';
|
import { getDrawContext, getPunchcardPainter } from '@strudel/draw';
|
||||||
import { transpiler } from '@strudel/transpiler';
|
import { transpiler } from '@strudel/transpiler';
|
||||||
import { getAudioContext, webaudioOutput, initAudioOnFirstClick } from '@strudel/webaudio';
|
import { getAudioContext, webaudioOutput, initAudioOnFirstClick } from '@strudel/webaudio';
|
||||||
|
|
@ -78,6 +79,11 @@ export function MiniRepl({
|
||||||
onUpdateState: (state) => {
|
onUpdateState: (state) => {
|
||||||
setReplState({ ...state });
|
setReplState({ ...state });
|
||||||
},
|
},
|
||||||
|
onToggle: (playing) => {
|
||||||
|
if (!playing) {
|
||||||
|
clearHydra();
|
||||||
|
}
|
||||||
|
},
|
||||||
beforeStart: () => audioReady,
|
beforeStart: () => audioReady,
|
||||||
afterEval: ({ code }) => setVersionDefaultsFrom(code),
|
afterEval: ({ code }) => setVersionDefaultsFrom(code),
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue