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
45 changes: 21 additions & 24 deletions .github/ISSUE_TEMPLATE/bug_report_form.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,27 @@ body:
description: Providing a minimal reproducible example can help a lot.
validations:
required: false
- type: dropdown
id: version
- type: textarea
id: environment
attributes:
label: Found in Version
description: Which version of alphaTab are you using?
options:
- 1.4 (alpha)
- 1.3
- 1.2
- Other
label: Version and Environment
description: |
Please provide detailed information about your environment, like alphaTab version used, browser, device, .net runtime, Android version,..
Since 1.5.0: You can call `alphaTab.Environment.printEnvironmentInfo()` and copy the printed info. Or enable [debug logs](https://www.alphatab.net/docs/reference/settings/core/loglevel) and they are always printed.
Just grab them from the console/debugger/output/logcat output.
placeholder: |
[AlphaTab][VersionInfo] alphaTab 1.5.0
[AlphaTab][VersionInfo] commit: 43c51b693438c54c0023ba729d7a7aa351e0f1fd
[AlphaTab][VersionInfo] build date: 2025-04-13T12:44:25.644Z
[AlphaTab][VersionInfo] High DPI: 1
[AlphaTab][VersionInfo] Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
[AlphaTab][VersionInfo] Platform: BrowserModule
[AlphaTab][VersionInfo] WebPack: false
[AlphaTab][VersionInfo] Vite: false
[AlphaTab][VersionInfo] Window Size: 1529x1152
[AlphaTab][VersionInfo] Screen Size: 3840x1200

render: bash
validations:
required: true
- type: dropdown
Expand All @@ -72,21 +83,7 @@ body:
- Other
validations:
required: true
- type: textarea
id: environment
attributes:
label: Environment
description: |
examples:
- **OS**: Windows 10 Pro
- **Browser**: Chrome 92.0.4515.159
value: |
- **OS**:
- **Browser**:
- **.net Version**:
render: markdown
validations:
required: true

- type: textarea
id: further
attributes:
Expand Down
16 changes: 14 additions & 2 deletions src.compiler/typescript/AlphaTabGenerator.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import * as ts from 'typescript';
import ts from 'typescript';
import cloneEmit from './CloneEmitter';
import { GENERATED_FILE_HEADER } from './EmitterBase';
import serializerEmit from './SerializerEmitter';
import transpiler from '../TranspilerBase';
import * as fs from 'fs';
import fs from 'fs';
import jsonDeclarationEmit from './JsonDeclarationEmitter';
import { execSync } from 'child_process';

transpiler([{
name: 'Clone',
Expand All @@ -21,11 +22,22 @@ transpiler([{
const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf-8'));
const { version } = packageJson;
const fileHandle = fs.openSync('src/generated/VersionInfo.ts', 'w');
const commit = execSync('git rev-parse HEAD').toString().trim();

fs.writeSync(fileHandle, `\
${GENERATED_FILE_HEADER}


export class VersionInfo {
public static readonly version: string = '${version}';
public static readonly date: string = '${new Date().toISOString()}';
public static readonly commit: string = '${commit}';

public static print(print: (message:string) => void) {
print(\`alphaTab \${VersionInfo.version}\`);
print(\`commit: \${VersionInfo.commit}\`);
print(\`build date: \${VersionInfo.date}\`);
}
}
`);
ts.sys.exit(ts.ExitStatus.Success);
13 changes: 12 additions & 1 deletion src.csharp/AlphaTab/Environment.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using AlphaTab.Collections;
Expand All @@ -14,6 +15,14 @@ public static void PlatformInit()

}

private static void PrintPlatformInfo(System.Action<string> print)
{
print($".net Runtime: {RuntimeInformation.FrameworkDescription}");
print($"Process: {RuntimeInformation.ProcessArchitecture}");
print($"OS Description: {RuntimeInformation.OSDescription}");
print($"OS Arch: {RuntimeInformation.OSArchitecture}");
}

public static Action Throttle(Action action, double delay)
{
CancellationTokenSource? cancellationTokenSource = null;
Expand All @@ -39,4 +48,6 @@ private static void CreatePlatformSpecificRenderEngines(IMap<string, RenderEngin
);
renderEngines.Set("default", renderEngines.Get("skia")!);
}
}


}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package alphaTab

import alphaTab.platform.android.AndroidCanvas
import alphaTab.platform.android.AndroidEnvironment
import android.os.Build
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
Expand All @@ -26,6 +28,15 @@ internal class EnvironmentPartials {
internal fun platformInit() {
}

internal fun printPlatformInfo(print: (message: String) -> Unit) {
print("OS Name: ${System.getProperty("os.name")}");
print("OS Version: ${System.getProperty("os.version")}");
print("Device Brand: ${Build.MANUFACTURER}");
print("Device Model: ${Build.MODEL}");
print("SDK Version: ${Build.VERSION.SDK_INT}");
print("Screen Size: ${AndroidEnvironment.screenWidth}x${AndroidEnvironment.screenHeight}");
}

private val throttleScope = CoroutineScope(Dispatchers.Default)
internal fun throttle(toThrottle: () -> Unit, delay: Double): () -> Unit {
var job: Job? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ internal class AndroidEnvironment {
companion object {
private var _isInitialized: Boolean = false

var screenWidth:Int = 0;
var screenHeight:Int = 0;

@ExperimentalUnsignedTypes
@ExperimentalContracts
public fun initializeAndroid(context: android.content.Context) {
Expand All @@ -21,6 +24,9 @@ internal class AndroidEnvironment {

Environment.HighDpiFactor = context.resources.displayMetrics.density.toDouble()

screenWidth = context.resources.displayMetrics.widthPixels
screenHeight = context.resources.displayMetrics.heightPixels

AndroidCanvas.initialize(context)

var bravuraBytes: ByteArray;
Expand Down
2 changes: 2 additions & 0 deletions src/AlphaTabApiBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ export class AlphaTabApiBase<TSettings> {
uiFacade.initialize(this, settings);
Logger.logLevel = this.settings.core.logLevel;

Environment.printEnvironmentInfo(false);

this.canvasElement = uiFacade.createCanvasElement();
this.container.appendChild(this.canvasElement);
if (
Expand Down
32 changes: 32 additions & 0 deletions src/Environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ import { NoteOrnamentEffectInfo } from './rendering/effects/NoteOrnamentEffectIn
import { RasgueadoEffectInfo } from './rendering/effects/RasgueadoEffectInfo';
import { DirectionsEffectInfo } from './rendering/effects/DirectionsEffectInfo';
import { BeatTimerEffectInfo } from './rendering/effects/BeatTimerEffectInfo';
import { VersionInfo } from './generated/VersionInfo';

/**
* A factory for custom layout engines.
Expand Down Expand Up @@ -855,4 +856,35 @@ export class Environment {

return WebPlatform.Browser;
}

/**
* Prints the environment information for easier troubleshooting.
* @param force Whether to force printing.
*/
public static printEnvironmentInfo(force:boolean = true) {
const printer:(message:string) => void = force ? (message) => {
Logger.log.debug('VersionInfo', message);
} : (message) => {
Logger.debug('VersionInfo', message);
}
VersionInfo.print(printer);
printer(`High DPI: ${Environment.HighDpiFactor}`);
Environment.printPlatformInfo(printer);
}

/**
* @target web
* @partial
*/
private static printPlatformInfo(print: (message:string) => void) {
print(`Browser: ${navigator.userAgent}`);
print(`Platform: ${WebPlatform[Environment.webPlatform]}`);
print(`WebPack: ${Environment.isWebPackBundled}`);
print(`Vite: ${Environment.isViteBundled}`);
if(Environment.webPlatform !== WebPlatform.NodeJs) {
print(`Window Size: ${window.outerWidth}x${window.outerHeight}`);
print(`Screen Size: ${window.screen.width}x${window.screen.height}`);
}

}
}