From da0fd472f401c221cb40e832cb3f7463623b59cc Mon Sep 17 00:00:00 2001 From: Casey Primozic Date: Thu, 9 Nov 2023 02:13:38 -0800 Subject: [PATCH] Export some more functions for headless mode * Expose some event scheduling functions --- src/headless/index.tsx | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/headless/index.tsx b/src/headless/index.tsx index 6dfa8d46..d00a5614 100644 --- a/src/headless/index.tsx +++ b/src/headless/index.tsx @@ -1,7 +1,16 @@ // prettier-ignore import './headlessFlagSideEffect'; -import { startAll, stopAll } from 'src/eventScheduler/eventScheduler'; +import { + scheduleMIDIEventBeats, + scheduleEventBeatsRelative, + scheduleEventTimeAbsolute, + scheduleEventTimeRelativeToStart, + scheduleEventTimeRelativeToCurTime, + postMIDIEventToAudioThread, + startAll, + stopAll, +} from 'src/eventScheduler/eventScheduler'; import { getGlobalBpm, setGlobalBpm } from 'src/globalMenu/GlobalMenu'; import { createBrowserNotSupportedMessage } from 'src/misc/BrowserNotSupported'; import { connect, disconnect } from 'src/patchNetwork/interface'; @@ -40,5 +49,20 @@ export const initHeadlessWebSynth = async ({ engine.init(); - return { getState, dispatch, startAll, stopAll, disconnect, connect, getGlobalBpm, setGlobalBpm }; + return { + getState, + dispatch, + startAll, + stopAll, + disconnect, + connect, + getGlobalBpm, + setGlobalBpm, + scheduleMIDIEventBeats, + scheduleEventBeatsRelative, + scheduleEventTimeAbsolute, + scheduleEventTimeRelativeToStart, + scheduleEventTimeRelativeToCurTime, + postMIDIEventToAudioThread, + }; };