From 3060a458eb092ac5dd5fb86c0d57e435671d8766 Mon Sep 17 00:00:00 2001 From: nick_m Date: Fri, 6 Jan 2017 02:14:17 +1100 Subject: [PATCH] allow importing tempo maps at selected position. --- gtk2_ardour/editor.h | 2 +- gtk2_ardour/editor_audio_import.cc | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 8a719b54fd..b96f67ab6b 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -1421,7 +1421,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void import_audio (bool as_tracks); void do_import (std::vector 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_end (); void center_playhead (); diff --git a/gtk2_ardour/editor_audio_import.cc b/gtk2_ardour/editor_audio_import.cc index a75ecad7e0..c835796325 100644 --- a/gtk2_ardour/editor_audio_import.cc +++ b/gtk2_ardour/editor_audio_import.cc @@ -262,7 +262,7 @@ Editor::get_nth_selected_midi_track (int nth) const } void -Editor::import_smf_tempo_map (Evoral::SMF const & smf) +Editor::import_smf_tempo_map (Evoral::SMF const & smf, framepos_t pos) { if (!_session) { return; @@ -296,8 +296,8 @@ Editor::import_smf_tempo_map (Evoral::SMF const & smf) } } 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, 0, AudioTime); + new_map.replace_meter (new_map.meter_section_at_frame (0), meter, bbt, pos, AudioTime); + new_map.replace_tempo (new_map.tempo_section_at_frame (0), tempo, 0.0, pos, TempoSection::Constant, AudioTime); have_initial_meter = true; } @@ -340,7 +340,7 @@ Editor::do_import (vector paths, continue; } if (smf.num_tempos() > 0) { - import_smf_tempo_map (smf); + import_smf_tempo_map (smf, pos); smf.close (); break; }