13
0

Import MIDI markers direct to the source (3/4)

This commit is contained in:
Robin Gareus 2022-11-22 01:46:00 +01:00
parent 4e77bbdd96
commit c8711aacc6
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -729,6 +729,15 @@ Session::import_files (ImportStatus& status)
} else if (smf_reader) { // midi
status.doing_what = string_compose(_("Loading MIDI file %1"), *p);
write_midi_data_to_new_files (smf_reader.get(), status, newfiles, status.split_midi_channels);
if (status.import_markers) {
smf_reader->load_markers ();
for (auto const& m : smf_reader->markers ()) {
Temporal::Beats beats = Temporal::Beats::from_double (m.time_pulses / (double) smf_reader->ppqn ());
// XXX import to all sources (in case split_midi_channels is set)?
newfiles.front()->add_cue_marker (CueMarker (m.text, timepos_t (beats)));
}
}
}
++status.current;