Skip to content

Commit

Permalink
Export some more functions for headless mode
Browse files Browse the repository at this point in the history
 * Expose some event scheduling functions
  • Loading branch information
Ameobea committed Nov 9, 2023
1 parent bb46030 commit da0fd47
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions src/headless/index.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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,
};
};

0 comments on commit da0fd47

Please sign in to comment.