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
13 changes: 12 additions & 1 deletion packages/alphatab/src/ImporterSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,22 @@ export class ImporterSettings {
*
* * Guitar Pro 7
* * Guitar Pro 6
* * Guitar Pro 3-5
* * MusicXML
*/
public encoding: string = 'utf-8';

/**
* The text encoding to use when decoding strings within GuitarPro3-5 files.
* @since 1.9.0
* @defaultValue `windows-1252`
* @category Importer
* @remarks
* Guitar Pro 3-5 encode strings as system specific ANSI encoding, typically Windows-1252 in western system cultures.
* This is different to the other typically used utf-8 encoding.
* Via this setting the Guitar Pro 3-5 specific decoding can be used.
*/
public gp3To5encoding: string = 'windows-1252';

/**
* If part-groups should be merged into a single track (MusicXML).
* @since 0.9.6
Expand Down
9 changes: 6 additions & 3 deletions packages/alphatab/src/exporter/GpifWriter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -968,12 +968,14 @@ export class GpifWriter {
scoreNode.addElement('PageHeader').setCData('');
scoreNode.addElement('PageFooter').setCData('');

scoreNode.addElement('ScoreSystemsDefaultLayout').setCData(score.defaultSystemsLayout.toString());
scoreNode.addElement('ScoreSystemsLayout').setCData(score.systemsLayout.join(' '));
scoreNode.addElement('ScoreSystemsDefaultLayout').innerText = score.defaultSystemsLayout.toString();
scoreNode.addElement('ScoreSystemsLayout').innerText = score.systemsLayout.join(' ');

scoreNode.addElement('ScoreZoomPolicy').innerText = 'Value';
scoreNode.addElement('ScoreZoom').innerText = '1';
// not fully clear at this point so we rather activate it
// Activate MultiVoice mode. the content looks strange, but
// 0> is 'Multi Voice' off (secondary voices are half-transparent/light-ray)
// 1> is 'Multi Voice' on (secondary voices are fully-visible/black)
scoreNode.addElement('MultiVoice').innerText = '1>';
}

Expand Down Expand Up @@ -1073,6 +1075,7 @@ export class GpifWriter {
trackNode.addElement('ShortName').setCData(track.shortName);
trackNode.addElement('Color').innerText = `${track.color.r} ${track.color.g} ${track.color.b}`;

// this typo is on purpose, guitar pro bug to have SystemsDefautLayout instead of SystemsDefaultLayout
trackNode.addElement('SystemsDefautLayout').innerText = track.defaultSystemsLayout.toString();
trackNode.addElement('SystemsLayout').innerText = track.systemsLayout.join(' ');

Expand Down
12 changes: 11 additions & 1 deletion packages/alphatab/src/generated/ImporterSettingsJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,20 @@ export interface ImporterSettingsJson {
*
* * Guitar Pro 7
* * Guitar Pro 6
* * Guitar Pro 3-5
* * MusicXML
*/
encoding?: string;
/**
* The text encoding to use when decoding strings within GuitarPro3-5 files.
* @since 1.9.0
* @defaultValue `windows-1252`
* @category Importer
* @remarks
* Guitar Pro 3-5 encode strings as system specific ANSI encoding, typically Windows-1252 in western system cultures.
* This is different to the other typically used utf-8 encoding.
* Via this setting the Guitar Pro 3-5 specific decoding can be used.
*/
gp3To5encoding?: string;
/**
* If part-groups should be merged into a single track (MusicXML).
* @since 0.9.6
Expand Down
4 changes: 4 additions & 0 deletions packages/alphatab/src/generated/ImporterSettingsSerializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export class ImporterSettingsSerializer {
}
const o = new Map<string, unknown>();
o.set("encoding", obj.encoding);
o.set("gp3to5encoding", obj.gp3To5encoding);
o.set("mergepartgroupsinmusicxml", obj.mergePartGroupsInMusicXml);
o.set("beattextaslyrics", obj.beatTextAsLyrics);
o.set("maxdecodingbuffersize", obj.maxDecodingBufferSize);
Expand All @@ -31,6 +32,9 @@ export class ImporterSettingsSerializer {
case "encoding":
obj.encoding = v! as string;
return true;
case "gp3to5encoding":
obj.gp3To5encoding = v! as string;
return true;
case "mergepartgroupsinmusicxml":
obj.mergePartGroupsInMusicXml = v! as boolean;
return true;
Expand Down
Loading
Loading