Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export default [
external: [
"webpack",
"webpack/lib/ModuleTypeConstants",
"webpack/lib/util/makeSerializable",
"fs",
"path"
],
Expand All @@ -149,6 +150,7 @@ export default [
external: [
"webpack",
"webpack/lib/ModuleTypeConstants",
"webpack/lib/util/makeSerializable",
"fs",
"path"
],
Expand Down
17 changes: 4 additions & 13 deletions src.compiler/BuilderHelpers.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
import * as ts from 'typescript';
import * as path from 'path'

const ignoredFiles = new Set([
"alphaTab.webpack.ts",
"rollup.config.ts",
"rollup.config.cjs.ts",
"rollup.config.esm.ts",
"rollup.plugin.resolve.ts",
"rollup.plugin.server.ts",
"alphaTab.main.ts",
"alphaTab.worker.ts",
"alphaTab.worklet.ts",
"WebPack.test.ts"
])
const ignoredFiles = [
/rollup.*/
]

export function transpileFilter(file: string): boolean {
const fileName = path.basename(file);
return !ignoredFiles.has(fileName);
return !ignoredFiles.find(e => e.exec(fileName));
}

export function setMethodBody(m: ts.MethodDeclaration, body: ts.FunctionBody): ts.MethodDeclaration {
Expand Down
14 changes: 14 additions & 0 deletions src.compiler/csharp/CSharpAstTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,20 @@ export default class CSharpAstTransformer {
const testClasses: ts.CallExpression[] = [];
const globalExports: ts.ExportDeclaration[] = [];

switch (this._typeScriptFile.statements[0].kind) {
case ts.SyntaxKind.ClassDeclaration:
case ts.SyntaxKind.InterfaceDeclaration:
case ts.SyntaxKind.FunctionDeclaration:
case ts.SyntaxKind.EnumDeclaration:
case ts.SyntaxKind.TypeAliasDeclaration:
break;
default:
if (this.shouldSkip(this._typeScriptFile.statements[0], false)) {
return;
}
break;
}

this._typeScriptFile.statements.forEach(s => {
if (ts.isExportDeclaration(s)) {
globalExports.push(s);
Expand Down
7 changes: 5 additions & 2 deletions src/AlphaTabApiBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1152,8 +1152,11 @@ export class AlphaTabApiBase<TSettings> {
return;
}

if (this.settings.player.enableUserInteraction) {
// for the selection ensure start < end
if (
this.settings.player.enablePlayer &&
this.settings.player.enableCursor &&
this.settings.player.enableUserInteraction
) {
if (this._selectionEnd) {
let startTick: number = this._tickCache?.getBeatStart(this._selectionStart!.beat) ?? this._selectionStart!.beat.absolutePlaybackStart;
let endTick: number = this._tickCache?.getBeatStart(this._selectionEnd!.beat) ?? this._selectionEnd!.beat.absolutePlaybackStart;
Expand Down
11 changes: 4 additions & 7 deletions src/alphaTab.main.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/**@target web */
export * from './alphaTab.core';
import * as alphaTab from './alphaTab.core';

Expand Down Expand Up @@ -45,14 +46,10 @@ alphaTab.Environment.initializeMain(
throw new alphaTab.AlphaTabError(alphaTab.AlphaTabErrorType.General, "Audio Worklets not yet supported in Node.js");
}

if (alphaTab.Environment.isWebPackBundled) {
alphaTab.Logger.debug("AlphaTab", "Creating WebPack compatible worklet");
const alphaTabWorklet = context.audioWorklet; // this name triggers the WebPack Plugin
return alphaTabWorklet.addModule(new URL('./alphaTab.worklet', 'webpack-worklet'));
}
else if (alphaTab.Environment.isWebPackBundled && alphaTab.Environment.webPlatform == alphaTab.WebPlatform.BrowserModule) {
if (alphaTab.Environment.isWebPackBundled ||alphaTab.Environment.webPlatform == alphaTab.WebPlatform.BrowserModule) {
alphaTab.Logger.debug("AlphaTab", "Creating Module worklet");
return context.audioWorklet.addModule(new URL('./alphaTab.worklet', import.meta.url));
const alphaTabWorklet = context.audioWorklet; // this name triggers the WebPack Plugin
return alphaTabWorklet.addModule(new URL('./alphaTab.worklet', import.meta.url));
}

alphaTab.Logger.debug("AlphaTab", "Creating Script worklet");
Expand Down
Loading