mirror of
https://github.com/sshlien/abcmidi.git
synced 2026-05-30 20:09:29 +00:00
abc2midi: allow %%MIDIdef macros to be defined anywhere (#23)
* abc2midi: allow %%MIDIdef macros to be defined anywhere Fix also some lost CHANGES from previous commit. abc2midi: allow %%MIDIdef macros to be defined anywhere, including before the first X: field (outside any tune). Previously %%MIDIdef was only handled inside event_specific() after the started_parsing check,so macros defined in the file header were silently ignored. The %%MIDIdef handling has been moved before the started_parsing check in event_specific() in store.c since macro definitions are context-independent. * Update the golden test files since X:, R: and C: are now emitted
This commit is contained in:
13
store.c
13
store.c
@@ -2363,17 +2363,18 @@ void event_specific(char *package, char *s, int in_I)
|
||||
char *p;
|
||||
int done;
|
||||
|
||||
if (started_parsing == 0) {
|
||||
event_specific_in_header(package,s);
|
||||
return;
|
||||
}
|
||||
|
||||
/* [SS] 2015-06-01 */
|
||||
/* [SS] 2015-06-01 [RK] 2026-03-31 */
|
||||
/* %%MIDIdef macros are context-independent and valid anywhere */
|
||||
if (strcmp(package,"MIDIdef") == 0) {
|
||||
parse_mididef(s);
|
||||
return;
|
||||
}
|
||||
|
||||
if (started_parsing == 0) {
|
||||
event_specific_in_header(package,s);
|
||||
return;
|
||||
}
|
||||
|
||||
if (strcmp(package,"MIDIx") == 0) {
|
||||
process_midix(s);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user