MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / buildSettings

Function buildSettings

packages/playground/src/apps/ControlApp.ts:73–96  ·  view source on GitHub ↗
(options: ControlAppOptions, viewport: HTMLElement)

Source from the content-addressed store, hash-verified

71}
72
73export function buildSettings(options: ControlAppOptions, viewport: HTMLElement): alphaTab.Settings {
74 const params = new URL(window.location.href).searchParams;
75 const settings = new alphaTab.Settings();
76 applyFonts(settings);
77 settings.fillFromJson({
78 core: {
79 logLevel: (params.get('loglevel') ?? 'info') as alphaTab.json.CoreSettingsJson['logLevel'],
80 engine: params.get('engine') ?? 'default',
81 file: options.file ?? Paths.defaultScore,
82 fontDirectory: options.fontDirectory ?? Paths.fontDirectory
83 },
84 player: {
85 playerMode: alphaTab.PlayerMode.EnabledAutomatic,
86 scrollOffsetX: -10,
87 scrollOffsetY: -20,
88 soundFont: options.soundFont ?? Paths.soundFont,
89 scrollElement: viewport
90 }
91 } satisfies alphaTab.json.SettingsJson);
92 if (options.settings) {
93 settings.fillFromJson(options.settings);
94 }
95 return settings;
96}
97
98export class ControlApp implements Mountable {
99 readonly root: HTMLElement;

Callers 1

constructorMethod · 0.85

Calls 3

fillFromJsonMethod · 0.95
applyFontsFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected