13
0

allow importing tempo maps at selected position.

This commit is contained in:
nick_m 2017-01-06 02:14:17 +11:00
parent a196ce68fd
commit 3060a458eb
2 changed files with 5 additions and 5 deletions

View File

@ -1421,7 +1421,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void import_audio (bool as_tracks); void import_audio (bool as_tracks);
void do_import (std::vector<std::string> paths, bool split, bool as_tracks); void do_import (std::vector<std::string> paths, bool split, bool as_tracks);
void import_smf_tempo_map (Evoral::SMF const &); void import_smf_tempo_map (Evoral::SMF const &, framepos_t pos);
void move_to_start (); void move_to_start ();
void move_to_end (); void move_to_end ();
void center_playhead (); void center_playhead ();

View File

@ -262,7 +262,7 @@ Editor::get_nth_selected_midi_track (int nth) const
} }
void void
Editor::import_smf_tempo_map (Evoral::SMF const & smf) Editor::import_smf_tempo_map (Evoral::SMF const & smf, framepos_t pos)
{ {
if (!_session) { if (!_session) {
return; return;
@ -296,8 +296,8 @@ Editor::import_smf_tempo_map (Evoral::SMF const & smf)
} }
} else { } else {
new_map.replace_tempo (new_map.tempo_section_at_frame (0), tempo, (t->time_pulses/smf.ppqn()) / 4.0, 0, TempoSection::Constant, AudioTime); new_map.replace_meter (new_map.meter_section_at_frame (0), meter, bbt, pos, AudioTime);
new_map.replace_meter (new_map.meter_section_at_frame (0), meter, bbt, 0, AudioTime); new_map.replace_tempo (new_map.tempo_section_at_frame (0), tempo, 0.0, pos, TempoSection::Constant, AudioTime);
have_initial_meter = true; have_initial_meter = true;
} }
@ -340,7 +340,7 @@ Editor::do_import (vector<string> paths,
continue; continue;
} }
if (smf.num_tempos() > 0) { if (smf.num_tempos() > 0) {
import_smf_tempo_map (smf); import_smf_tempo_map (smf, pos);
smf.close (); smf.close ();
break; break;
} }