Better architectural distinction between live coding mode and composition mode

This commit is contained in:
2025-10-15 11:04:27 +02:00
parent 46925f5c2e
commit bbdb01200e
11 changed files with 434 additions and 160 deletions

View File

@ -2,6 +2,7 @@ import { getContext, setContext } from 'svelte';
import { ProjectManager } from '../project-system/project-manager';
import { ProjectDatabase } from '../project-system/db';
import { createCsoundStore } from '../csound/store';
import { ExecutionContext } from '../csound/execution-context';
import { createEditorSettingsStore } from '../stores/editorSettings';
import { ProjectEditor } from '../stores/projectEditor.svelte';
import { UIState } from '../stores/uiState.svelte';
@ -11,6 +12,7 @@ import type { EditorSettingsStore } from '../stores/editorSettings';
export interface AppContext {
projectManager: ProjectManager;
csound: CsoundStore;
executionContext: ExecutionContext;
editorSettings: EditorSettingsStore;
projectEditor: ProjectEditor;
uiState: UIState;
@ -21,9 +23,13 @@ const APP_CONTEXT_KEY = Symbol('app-context');
export function createAppContext(): AppContext {
const db = new ProjectDatabase();
const projectManager = new ProjectManager(db);
const csound = createCsoundStore();
const executionContext = new ExecutionContext(csound, 'composition');
return {
projectManager,
csound: createCsoundStore(),
csound,
executionContext,
editorSettings: createEditorSettingsStore(),
projectEditor: new ProjectEditor(projectManager),
uiState: new UIState()