mirror of
https://codeberg.org/uzu/strudel
synced 2026-08-07 07:15:25 -04:00
change variable name
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { errorLogger } from '@strudel/core';
|
||||
import { useSettings, storeStartupScript } from '../../../settings.mjs';
|
||||
import { useSettings, storePrebakeScript } from '../../../settings.mjs';
|
||||
import { SpecialActionInput } from '../button/action-button';
|
||||
|
||||
async function importScript(script) {
|
||||
@@ -8,7 +8,7 @@ async function importScript(script) {
|
||||
|
||||
reader.onload = () => {
|
||||
const text = reader.result;
|
||||
storeStartupScript(text);
|
||||
storePrebakeScript(text);
|
||||
};
|
||||
|
||||
reader.onerror = () => {
|
||||
|
||||
@@ -115,7 +115,7 @@ export function SettingsTab({ started }) {
|
||||
isTabIndentationEnabled,
|
||||
isMultiCursorEnabled,
|
||||
patternAutoStart,
|
||||
startupScript,
|
||||
prebakeScript,
|
||||
} = useSettings();
|
||||
const shouldAlwaysSync = isUdels();
|
||||
const canChangeAudioDevice = AudioContext.prototype.setSinkId != null;
|
||||
|
||||
@@ -11,11 +11,6 @@ const baseNoTrailing = BASE_URL.endsWith('/') ? BASE_URL.slice(0, -1) : BASE_URL
|
||||
const baseCDN = 'https://strudel.b-cdn.net';
|
||||
|
||||
export async function prebake() {
|
||||
// const settings = settingsMap.get()
|
||||
|
||||
// const prebakeScript = settings.startupScript || '';
|
||||
// await evaluate(prebakeScript);
|
||||
|
||||
// https://archive.org/details/SalamanderGrandPianoV3
|
||||
// License: CC-by http://creativecommons.org/licenses/by/3.0/ Author: Alexander Holm
|
||||
await Promise.all([
|
||||
|
||||
@@ -47,7 +47,7 @@ if (typeof window !== 'undefined') {
|
||||
multiChannelOrbits: parseBoolean(multiChannelOrbits),
|
||||
});
|
||||
modulesLoading = loadModules();
|
||||
// prebakeScript = evaluate(settingsMap.get().startupScript ?? '')
|
||||
// prebakeScript = evaluate(settingsMap.get().prebakeScript ?? '')
|
||||
presets = prebake();
|
||||
drawContext = getDrawContext();
|
||||
clearCanvas = () => drawContext.clearRect(0, 0, drawContext.canvas.height, drawContext.canvas.width);
|
||||
@@ -64,7 +64,7 @@ async function getModule(name) {
|
||||
const initialCode = `// LOADING`;
|
||||
|
||||
export function useReplContext() {
|
||||
const { isSyncEnabled, audioEngineTarget, startupScript } = useSettings();
|
||||
const { isSyncEnabled, audioEngineTarget, prebakeScript } = useSettings();
|
||||
const shouldUseWebaudio = audioEngineTarget !== audioEngineTargets.osc;
|
||||
const defaultOutput = shouldUseWebaudio ? webaudioOutput : superdirtOutput;
|
||||
const getTime = shouldUseWebaudio ? getAudioContextCurrentTime : getPerformanceTimeSeconds;
|
||||
@@ -86,7 +86,7 @@ export function useReplContext() {
|
||||
drawContext,
|
||||
prebake: async () =>
|
||||
Promise.all([modulesLoading, presets]).then(() => {
|
||||
return evaluate(startupScript ?? '');
|
||||
return evaluate(prebakeScript ?? '');
|
||||
}),
|
||||
onUpdateState: (state) => {
|
||||
setReplState({ ...state });
|
||||
|
||||
@@ -45,7 +45,7 @@ export const defaultSettings = {
|
||||
isPanelOpen: true,
|
||||
togglePanelTrigger: 'click', //click | hover
|
||||
userPatterns: '{}',
|
||||
startupScript: '//edit this script to run code on startup\n',
|
||||
prebakeScript: '',
|
||||
audioEngineTarget: audioEngineTargets.webaudio,
|
||||
isButtonRowHidden: false,
|
||||
isCSSAnimationDisabled: false,
|
||||
@@ -109,7 +109,7 @@ export const setActiveFooter = (tab) => settingsMap.setKey('activeFooter', tab);
|
||||
export const setPanelPinned = (bool) => settingsMap.setKey('isPanelPinned', bool);
|
||||
export const setIsPanelOpened = (bool) => settingsMap.setKey('isPanelOpen', bool);
|
||||
|
||||
export const storeStartupScript = (script) => settingsMap.setKey('startupScript', script);
|
||||
export const storePrebakeScript = (script) => settingsMap.setKey('prebakeScript', script);
|
||||
|
||||
export const setIsZen = (active) => settingsMap.setKey('isZen', !!active);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user