13
0

support SMF markers without labels

This commit is contained in:
Paul Davis 2021-05-09 17:51:55 -06:00
parent bfb5bfcd2d
commit c45be2266e

View File

@ -599,22 +599,26 @@ SMF::load_markers ()
if (smf_event_is_metadata(event)) { if (smf_event_is_metadata(event)) {
if (event->midi_buffer[1] == 0x06) { if (event->midi_buffer[1] == 0x06) {
string marker = smf_event_decode (event); char const * txt = smf_event_decode (event);
if (!marker.empty()) { string marker;
if (marker.find ("Marker: ") == 0) { if (txt != 0) {
marker = marker.substr (8); marker = txt;
}
_markers.push_back (MarkerAt (marker, event->time_pulses));
} }
if (marker.find ("Marker: ") == 0) {
marker = marker.substr (8);
}
_markers.push_back (MarkerAt (marker, event->time_pulses));
} }
if (event->midi_buffer[1] == 0x07) { if (event->midi_buffer[1] == 0x07) {
string marker = smf_event_decode (event); char const * txt = smf_event_decode (event);
if (!marker.empty()) { string marker;
if (marker.find ("Cue Point: ") == 0) { if (txt != 0) {
marker = marker.substr (8); marker = txt;
}
_markers.push_back (MarkerAt (marker, event->time_pulses));
} }
if (marker.find ("Cue Point: ") == 0) {
marker = marker.substr (8);
}
_markers.push_back (MarkerAt (marker, event->time_pulses));
} }
} }
} }