@@ -90,6 +90,8 @@ struct hp_info {
90
90
char in_instrument_list ;
91
91
char in_instrument ;
92
92
char in_layer ;
93
+ char in_drumkit_component ;
94
+
93
95
char counted_cur_inst ;
94
96
int cur_off ;
95
97
char cur_buf [MAX_CHAR_DATA ];
@@ -106,7 +108,7 @@ startElement(void *userData, const char *name, const char **atts)
106
108
info -> cur_off = 0 ;
107
109
if (info -> in_info ) {
108
110
if (info -> in_instrument ) {
109
- if (!strcmp (name ,"layer" ) && !info -> scan_only ) {
111
+ if (!strcmp (name ,"layer" ) && !info -> scan_only ) {
110
112
info -> in_layer = 1 ;
111
113
info -> cur_layer = malloc (sizeof (struct instrument_layer ));
112
114
memset (info -> cur_layer ,0 ,sizeof (struct instrument_layer ));
@@ -121,6 +123,10 @@ startElement(void *userData, const char *name, const char **atts)
121
123
} else {
122
124
if (!strcmp (name ,"instrumentList" ))
123
125
info -> in_instrument_list = 1 ;
126
+
127
+ if (! strcmp (name ,"drumkitComponent" ))
128
+ info -> in_drumkit_component = 1 ;
129
+
124
130
}
125
131
} else {
126
132
if (!strcmp (name ,"drumkit_info" ))
@@ -135,7 +141,7 @@ endElement(void *userData, const char *name)
135
141
if (info -> cur_off == MAX_CHAR_DATA ) info -> cur_off -- ;
136
142
info -> cur_buf [info -> cur_off ]= '\0' ;
137
143
138
- if (info -> in_info && !info -> in_instrument_list && !strcmp (name ,"name" ))
144
+ if (info -> in_info && ! info -> in_drumkit_component && ! info -> in_instrument_list && !strcmp (name ,"name" ))
139
145
info -> kit_info -> name = strdup (info -> cur_buf );
140
146
if (info -> scan_only && info -> in_info && !info -> in_instrument_list && !strcmp (name ,"info" ))
141
147
info -> kit_info -> desc = strdup (info -> cur_buf );
@@ -188,6 +194,9 @@ endElement(void *userData, const char *name)
188
194
info -> in_instrument = 0 ;
189
195
}
190
196
if (info -> in_instrument_list && !strcmp (name ,"instrumentList" )) info -> in_instrument_list = 0 ;
197
+ if (info -> in_drumkit_component && ! strcmp (name , "drumkitComponent" ))
198
+ info -> in_drumkit_component = 0 ;
199
+
191
200
if (info -> in_info && !strcmp (name ,"drumkit_info" )) info -> in_info = 0 ;
192
201
}
193
202
0 commit comments