-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDolet8Parts.plg
executable file
·159 lines (143 loc) · 12.6 KB
/
Dolet8Parts.plg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
{
Initialize "() {
// Dolet 8 for Sibelius
// Copyright © 2003-2023 MakeMusic, Inc.
// Check for Sibelius 5 because LocalizeData depends
// on Sibelius 5 functions. During Run, we will check
// for Sibelius 2019.5 so we can display a message box
// instead of just disappearing from the menu.
if (Sibelius.ProgramVersion >= 5000) {
// Localize first so we get correct plug-in menu name.
LocalizeData();
AddToPluginsMenu(_PluginMenuName, 'Run');
}
}"
ExportThisPart "(ThisScore, PartNumber) {
// Dolet 8 for Sibelius
// Copyright © 2003-2023 MakeMusic, Inc.
// Switch to the part, but do not show it.
// Otherwise we can wind up with a lot of extra
// part windows when we are done.
ThisScore.CurrentDynamicPart = ThisScore.DynamicParts[PartNumber];
fContinue = True;
fOK = Dolet8.SetXMLFileNameForPart(PartNumber);
if (fOK) {
fOK = Dolet8.ExportXML();
}
// If a user cancels out of one export,
// see if the rest should be cancelled.
if (not fOK) {
fContinue = Sibelius.YesNoMessageBox(_Continue);
}
if (not fContinue) {
return False;
}
return True;
}"
Run "() {
// Dolet 8 for Sibelius
// Copyright © 2003-2023 MakeMusic, Inc.
// Check for version 2019.5
if (Sibelius.ProgramVersion < 19500) {
Sibelius.MessageBox(_SibVersionTooEarly);
return False;
}
// Check to see if we have any dynamic parts.
// If not, display a message and quit. We could
// offer to create a default set of parts, but
// if the parts have not been created and edited,
// it seems best to just skip it for now.
oThisScore = Sibelius.ActiveScore;
oThisPart = oThisScore.CurrentDynamicPart;
oParts = oThisScore.DynamicParts;
nParts = oParts.NumChildren;
if (nParts <= 1) {
Sibelius.MessageBox(_NoDynamicParts);
return False;
}
// Instead of selecting the folder where the MusicXML
// part files will go, just put them in the same folder
// as the score. SelectFolder does not default to the
// right location, and you cannot get to the ManuScript
// File object from a Score, only by iterating through
// a Folder.
fContinue = Sibelius.YesNoMessageBox(_Overwrite);
if (not fContinue) {
return False;
}
// For performance testing
Sibelius.ResetStopWatch(3);
for i = 1 to nParts {
fOK = ExportThisPart(oThisScore, i);
if (not fOK) {
return False;
}
}
// Go back to the original part
oThisScore.CurrentDynamicPart = oThisPart;
// For performance testing
nSeconds = Sibelius.GetElapsedSeconds(3);
// trace('Elapsed seconds: ' & nSeconds);
}"
LocalizeData "() {
// Dolet 8 for Sibelius
// Copyright © 2003-2023 MakeMusic, Inc.
// For localization, look up application language.
// We can then change the global strings if the
// returned value is something other than 'English'.
// We currently support the languages included with
// Sibelius 5. Sibelius 2021.2 also has 'Russian',
// 'Brazilian Portuguese', and 'Simplified Chinese'.
// For those we stay with the English wordings.
switch (Sibelius.ApplicationLanguage) {
case ('German') {
_Continue = 'Möchten Sie dem Rest der Exporte fortfahren?';
_NoDynamicParts = 'Diese Datei enthält keine dynamische Stimmen. Sie erstellen dynamische Stimmen mit dem Befehl Stimmen > Zwischenablage > Einfügen.';
_Overwrite = 'Hierbei werden vorhandene MusicXML-Dateien mit dem selben Dateinamen wie die Stimme-Dateien überschrieben. Möchten Sie fortfahren?';
_PluginMenuName = 'Exportieren dynamische Stimmen als MusicXML';
_SibVersionTooEarly = 'Dieses Plug-In benötigt Sibelius 2019.5 oder neuer.';
}
case ('French') {
_Continue = 'Do you want to continue with the rest of the part export?';
_NoDynamicParts = 'Ce fichier ne contient pas de parties dynamiques. Vous pouvez en créer à l\'aide de menu Parties, Paramétrage, Nouvelle partie.';
_Overwrite = 'Ceci va écraser les fichiers MusicXML existants qui ont le même nom que les fichiers parties. Voulez vous continuer ?';
_PluginMenuName = 'Exporter parties dynamiques en MusicXML';
_SibVersionTooEarly = 'Cette extension nécessite Sibelius 2019.5 ou une version plus récente.';
}
case ('Italian') {
_Continue = 'Do you want to continue with the rest of the part export?';
_NoDynamicParts = 'This file has no parts. You can create parts by clicking Parti > Configurazione > Nuova Parte.';
_Overwrite = 'This will overwrite MusicXML files with the same name as the part files. Do you want to continue?';
_PluginMenuName = 'Esportazione parti dinamiche in MusicXML';
_SibVersionTooEarly = 'Questo plug-in richiede Sibelius versione 2019.5 o più recente.';
}
case ('Spanish') {
_Continue = 'Do you want to continue with the rest of the part export?';
_NoDynamicParts = 'Este archivo no contiene partes dinámicas. Puede crear partes dinámicas accediendo al menú Partes > Configuración > Nueva parte.';
_Overwrite = 'Se sobrescribirán los archivos de MusicXML existentes con el mismo nombre que los archivos de parte. ¿Continuar de todos modos?';
_PluginMenuName = 'Exportar partes dinámicas a MusicXML';
_SibVersionTooEarly = 'Este plug-in requiere Sibelius versión 2019.5 o superior.';
}
case ('Japanese') {
_Continue = 'Do you want to continue with the rest of the part export?';
_NoDynamicParts = 'This file has no parts. You can create parts by clicking パート > Setup > New Part.';
_Overwrite = 'パートファイルと同じ名称のMusicXMLファイルが既に存在します。上書きしますか?';
_PluginMenuName = 'パート譜をMusicXMLにエクスポート';
_SibVersionTooEarly = 'このプラグインは、Sibelius バージョン 2019.5 以降に対応します。';
}
default {
_Continue = 'Do you want to continue with the rest of the part export?';
_NoDynamicParts = 'This file has no parts. You can create parts by clicking Parts > Setup > New Part.';
_Overwrite = 'This will overwrite MusicXML files with the same name as the part files. Do you want to continue?';
_PluginMenuName = 'Export Parts to MusicXML';
_SibVersionTooEarly = 'This plug-in requires Sibelius version 2019.5 or later.';
}
}
}"
_Continue "Do you want to continue with the rest of the part export?"
_NoDynamicParts "This file has no parts. You can create parts by clicking Parts > Setup > New Part."
_Overwrite "This will overwrite MusicXML files with the same name as the part files. Do you want to continue?"
_PluginMenuName "Export Parts to MusicXML"
_SibVersionTooEarly "This plug-in requires Sibelius version 2019.5 or later."
}