Skip to content
Merged
36 changes: 35 additions & 1 deletion packages/alphatab/src/importer/alphaTex/AlphaTex1EnumMappings.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import type { AlphaTexAccidentalMode, AlphaTexVoiceMode } from '@coderline/alphatab/importer/alphaTex/AlphaTexShared';
import type { TabRhythmMode } from '@coderline/alphatab/NotationSettings';
import type {
AlphaTexAccidentalMode,
AlphaTexStaffType,
AlphaTexVoiceMode
} from '@coderline/alphatab/importer/alphaTex/AlphaTexShared';
import type { BarLineStyle } from '@coderline/alphatab/model/Bar';
import type { BarreShape } from '@coderline/alphatab/model/BarreShape';
import type { BendStyle } from '@coderline/alphatab/model/BendStyle';
import type { BendType } from '@coderline/alphatab/model/BendType';
import type { Clef } from '@coderline/alphatab/model/Clef';
import type { Direction } from '@coderline/alphatab/model/Direction';
import type { DynamicValue } from '@coderline/alphatab/model/DynamicValue';
import type { StaffPlacement, SystemDisplay } from '@coderline/alphatab/model/ElementDisplay';
import type { FermataType } from '@coderline/alphatab/model/Fermata';
import type { GraceType } from '@coderline/alphatab/model/GraceType';
import type { KeySignature } from '@coderline/alphatab/model/KeySignature';
Expand Down Expand Up @@ -84,6 +90,15 @@ export class AlphaTex1EnumMappings {
public static readonly alphaTexVoiceModeReversed = AlphaTex1EnumMappings._reverse(
AlphaTex1EnumMappings.alphaTexVoiceMode
);
public static readonly alphaTexStaffType = new Map<string, AlphaTexStaffType>([
['score', 0],
['tabs', 1],
['slash', 2],
['numbered', 3]
]);
public static readonly alphaTexStaffTypeReversed = AlphaTex1EnumMappings._reverse(
AlphaTex1EnumMappings.alphaTexStaffType
);
public static readonly noteAccidentalMode = new Map<string, NoteAccidentalMode>([
['default', 0],
['forcenone', 1],
Expand Down Expand Up @@ -422,6 +437,25 @@ export class AlphaTex1EnumMappings {
public static readonly barNumberDisplayReversed = AlphaTex1EnumMappings._reverse(
AlphaTex1EnumMappings.barNumberDisplay
);
public static readonly staffPlacement = new Map<string, StaffPlacement>([
['allstaves', 0],
['primary', 1]
]);
public static readonly staffPlacementReversed = AlphaTex1EnumMappings._reverse(
AlphaTex1EnumMappings.staffPlacement
);
public static readonly systemDisplay = new Map<string, SystemDisplay>([
['allsystems', 0],
['firstsystemonly', 1]
]);
public static readonly systemDisplayReversed = AlphaTex1EnumMappings._reverse(AlphaTex1EnumMappings.systemDisplay);
public static readonly tabRhythmMode = new Map<string, TabRhythmMode>([
['hidden', 0],
['showwithbeams', 1],
['showwithbars', 2],
['automatic', 3]
]);
public static readonly tabRhythmModeReversed = AlphaTex1EnumMappings._reverse(AlphaTex1EnumMappings.tabRhythmMode);
public static readonly keySignaturesMinorReversed = new Map<KeySignature, string>([
[-7, 'abminor'],
[-6, 'ebminor'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ export class AlphaTex1LanguageDefinitions {
['hideemptystaves', null],
['hideemptystavesinfirstsystem', null],
['showsinglestaffbrackets', null],
['defaultbarnumberdisplay', [[[[100, 107], 0, ['allbars', 'firstofsystem', 'hide']]]]]
['defaultbarnumberdisplay', [[[[100, 107], 0, ['allbars', 'firstofsystem', 'hide']]]]],
['defaultstaffdisplay', [[[[100, 107], 5, ['score', 'tabs', 'slash', 'numbered']]]]]
]);
public static readonly staffMetaDataSignatures = AlphaTex1LanguageDefinitions._signatures([
['tuning', [[[[100, 107], 0, ['piano', 'none', 'voice']]], [[[100, 107], 5]]]],
Expand Down Expand Up @@ -231,7 +232,8 @@ export class AlphaTex1LanguageDefinitions {
],
['displaytranspose', [[[[106], 0]]]],
['transpose', [[[[106], 0]]]],
['instrument', [[[[106], 0]], [[[107, 100], 0]], [[[100], 0, ['percussion']]]]]
['instrument', [[[[106], 0]], [[[107, 100], 0]], [[[100], 0, ['percussion']]]]],
['staffdisplay', [[[[100, 107], 5, ['score', 'tabs', 'slash', 'numbered']]]]]
]);
public static readonly structuralMetaDataSignatures = AlphaTex1LanguageDefinitions._signatures([
[
Expand Down Expand Up @@ -491,7 +493,8 @@ export class AlphaTex1LanguageDefinitions {
]
]
],
['barnumber', [[[[107, 100], 0]], [[[106], 0]]]]
['barnumber', [[[[107, 100], 0]], [[[106], 0]]]],
['bardisplay', [[[[100, 107], 5, ['score', 'tabs', 'slash', 'numbered']]]]]
]);
public static readonly metaDataProperties = AlphaTex1LanguageDefinitions._metaProps([
[
Expand Down Expand Up @@ -551,6 +554,37 @@ export class AlphaTex1LanguageDefinitions {
['hideemptystavesinfirstsystem', null],
['showsinglestaffbrackets', null],
['defaultbarnumberdisplay', null],
[
'defaultstaffdisplay',
[
[
'clefvisibility',
[[], [[[107], 0, ['true', 'false']]], [[[100], 0, ['true', 'false']]], [[[106], 0, ['1', '0']]]]
],
['clefplacement', [[[[100, 107], 0, ['allstaves', 'primary']]]]],
['clefsystems', [[[[100, 107], 0, ['allsystems', 'firstsystemonly']]]]],
[
'ksvisibility',
[[], [[[107], 0, ['true', 'false']]], [[[100], 0, ['true', 'false']]], [[[106], 0, ['1', '0']]]]
],
['ksplacement', [[[[100, 107], 0, ['allstaves', 'primary']]]]],
['kssystems', [[[[100, 107], 0, ['allsystems', 'firstsystemonly']]]]],
[
'tsvisibility',
[[], [[[107], 0, ['true', 'false']]], [[[100], 0, ['true', 'false']]], [[[106], 0, ['1', '0']]]]
],
['tsplacement', [[[[100, 107], 0, ['allstaves', 'primary']]]]],
['tssystems', [[[[100, 107], 0, ['allsystems', 'firstsystemonly']]]]],
[
'restsvisibility',
[[], [[[107], 0, ['true', 'false']]], [[[100], 0, ['true', 'false']]], [[[106], 0, ['1', '0']]]]
],
['restsplacement', [[[[100, 107], 0, ['allstaves', 'primary']]]]],
['restssystems', [[[[100, 107], 0, ['allsystems', 'firstsystemonly']]]]],
['barnumber', [[[[100, 107], 0, ['allbars', 'firstofsystem', 'hide']]]]],
['rhythm', [[[[100, 107], 0, ['hidden', 'showwithbeams', 'showwithbars', 'automatic']]]]]
]
],
[
'tuning',
[
Expand Down Expand Up @@ -583,6 +617,37 @@ export class AlphaTex1LanguageDefinitions {
['displaytranspose', null],
['transpose', null],
['instrument', null],
[
'staffdisplay',
[
[
'clefvisibility',
[[], [[[107], 0, ['true', 'false']]], [[[100], 0, ['true', 'false']]], [[[106], 0, ['1', '0']]]]
],
['clefplacement', [[[[100, 107], 0, ['allstaves', 'primary']]]]],
['clefsystems', [[[[100, 107], 0, ['allsystems', 'firstsystemonly']]]]],
[
'ksvisibility',
[[], [[[107], 0, ['true', 'false']]], [[[100], 0, ['true', 'false']]], [[[106], 0, ['1', '0']]]]
],
['ksplacement', [[[[100, 107], 0, ['allstaves', 'primary']]]]],
['kssystems', [[[[100, 107], 0, ['allsystems', 'firstsystemonly']]]]],
[
'tsvisibility',
[[], [[[107], 0, ['true', 'false']]], [[[100], 0, ['true', 'false']]], [[[106], 0, ['1', '0']]]]
],
['tsplacement', [[[[100, 107], 0, ['allstaves', 'primary']]]]],
['tssystems', [[[[100, 107], 0, ['allsystems', 'firstsystemonly']]]]],
[
'restsvisibility',
[[], [[[107], 0, ['true', 'false']]], [[[100], 0, ['true', 'false']]], [[[106], 0, ['1', '0']]]]
],
['restsplacement', [[[[100, 107], 0, ['allstaves', 'primary']]]]],
['restssystems', [[[[100, 107], 0, ['allsystems', 'firstsystemonly']]]]],
['barnumber', [[[[100, 107], 0, ['allbars', 'firstofsystem', 'hide']]]]],
['rhythm', [[[[100, 107], 0, ['hidden', 'showwithbeams', 'showwithbars', 'automatic']]]]]
]
],
['ts', null],
['ro', null],
['rc', null],
Expand Down Expand Up @@ -610,7 +675,31 @@ export class AlphaTex1LanguageDefinitions {
['voicemode', null],
['barnumberdisplay', null],
['beaming', null],
['barnumber', null]
['barnumber', null],
[
'bardisplay',
[
[
'clefvisibility',
[[], [[[107], 0, ['true', 'false']]], [[[100], 0, ['true', 'false']]], [[[106], 0, ['1', '0']]]]
],
['clefplacement', [[[[100, 107], 0, ['allstaves', 'primary']]]]],
['clefsystems', [[[[100, 107], 0, ['allsystems', 'firstsystemonly']]]]],
[
'ksvisibility',
[[], [[[107], 0, ['true', 'false']]], [[[100], 0, ['true', 'false']]], [[[106], 0, ['1', '0']]]]
],
['ksplacement', [[[[100, 107], 0, ['allstaves', 'primary']]]]],
['kssystems', [[[[100, 107], 0, ['allsystems', 'firstsystemonly']]]]],
[
'tsvisibility',
[[], [[[107], 0, ['true', 'false']]], [[[100], 0, ['true', 'false']]], [[[106], 0, ['1', '0']]]]
],
['tsplacement', [[[[100, 107], 0, ['allstaves', 'primary']]]]],
['tssystems', [[[[100, 107], 0, ['allsystems', 'firstsystemonly']]]]],
['barnumber', [[[[100, 107], 0, ['allbars', 'firstofsystem', 'hide']]]]]
]
]
]);
public static readonly metaDataSignatures = [
AlphaTex1LanguageDefinitions.scoreMetaDataSignatures,
Expand Down
Loading
Loading