@@ -151,6 +151,23 @@ MP_DEFINE_CONST_FUN_OBJ_1(synthio_miditrack_get_sample_rate_obj, synthio_miditra
151
151
MP_PROPERTY_GETTER (synthio_miditrack_sample_rate_obj ,
152
152
(mp_obj_t )& synthio_miditrack_get_sample_rate_obj );
153
153
154
+ //| error_location: Optional[int]
155
+ //| """Offset, in bytes within the midi data, of a decoding error"""
156
+ //|
157
+ STATIC mp_obj_t synthio_miditrack_obj_get_error_location (mp_obj_t self_in ) {
158
+ synthio_miditrack_obj_t * self = MP_OBJ_TO_PTR (self_in );
159
+ check_for_deinit (self );
160
+ mp_int_t location = common_hal_synthio_miditrack_get_error_location (self );
161
+ if (location >= 0 ) {
162
+ return MP_OBJ_NEW_SMALL_INT (location );
163
+ }
164
+ return mp_const_none ;
165
+ }
166
+ MP_DEFINE_CONST_FUN_OBJ_1 (synthio_miditrack_get_error_location_obj , synthio_miditrack_obj_get_error_location );
167
+
168
+ MP_PROPERTY_GETTER (synthio_miditrack_error_location_obj ,
169
+ (mp_obj_t )& synthio_miditrack_get_error_location_obj );
170
+
154
171
STATIC const mp_rom_map_elem_t synthio_miditrack_locals_dict_table [] = {
155
172
// Methods
156
173
{ MP_ROM_QSTR (MP_QSTR_deinit ), MP_ROM_PTR (& synthio_miditrack_deinit_obj ) },
@@ -159,6 +176,7 @@ STATIC const mp_rom_map_elem_t synthio_miditrack_locals_dict_table[] = {
159
176
160
177
// Properties
161
178
{ MP_ROM_QSTR (MP_QSTR_sample_rate ), MP_ROM_PTR (& synthio_miditrack_sample_rate_obj ) },
179
+ { MP_ROM_QSTR (MP_QSTR_error_location ), MP_ROM_PTR (& synthio_miditrack_error_location_obj ) },
162
180
};
163
181
STATIC MP_DEFINE_CONST_DICT (synthio_miditrack_locals_dict , synthio_miditrack_locals_dict_table );
164
182
0 commit comments