summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2017-02-26 02:22:19 +1100
committerRobin Gareus <robin@gareus.org>2017-02-27 20:16:10 +0100
commit97c4c2a28c19b7979ecbfd2eff28a351dfae1e6a (patch)
tree01a697ce2c07e532170288d33fae384d07b4f8ce /gtk2_ardour
parentac19a51d38906f347baeb767d9b011955030921c (diff)
complete changes to tempo type.
- this implements in the intention behind the previous commit. a tempo mark is constant until its end has been changed by a shift-drag on the next marker.
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor_audio_import.cc4
-rw-r--r--gtk2_ardour/editor_drag.cc5
-rw-r--r--gtk2_ardour/editor_markers.cc12
-rw-r--r--gtk2_ardour/editor_ops.cc5
-rw-r--r--gtk2_ardour/editor_tempodisplay.cc8
5 files changed, 15 insertions, 19 deletions
diff --git a/gtk2_ardour/editor_audio_import.cc b/gtk2_ardour/editor_audio_import.cc
index d006b2ca15..adbb113aac 100644
--- a/gtk2_ardour/editor_audio_import.cc
+++ b/gtk2_ardour/editor_audio_import.cc
@@ -290,7 +290,7 @@ Editor::import_smf_tempo_map (Evoral::SMF const & smf, framepos_t pos)
Timecode::BBT_Time bbt; /* 1|1|0 which is correct for the no-meter case */
if (have_initial_meter) {
- new_map.add_tempo (tempo, (t->time_pulses/smf.ppqn()) / 4.0, 0, TempoSection::Constant, MusicTime);
+ new_map.add_tempo (tempo, (t->time_pulses/smf.ppqn()) / 4.0, 0, MusicTime);
if (!(meter == last_meter)) {
bbt = new_map.bbt_at_quarter_note ((t->time_pulses/smf.ppqn()));
new_map.add_meter (meter, t->time_pulses, bbt, 0, MusicTime);
@@ -298,7 +298,7 @@ Editor::import_smf_tempo_map (Evoral::SMF const & smf, framepos_t pos)
} else {
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);
+ new_map.replace_tempo (new_map.tempo_section_at_frame (0), tempo, 0.0, pos, AudioTime);
have_initial_meter = true;
}
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index c5d7c68ad8..96e83bf4d5 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -3431,15 +3431,14 @@ TempoMarkerDrag::motion (GdkEvent* event, bool first_move)
} else {
const Tempo tempo (_marker->tempo());
const framepos_t frame = adjusted_current_frame (event) + 1;
- const TempoSection::Type type = _real_section->type();
_editor->begin_reversible_command (_("copy tempo mark"));
if (_real_section->position_lock_style() == MusicTime) {
const int32_t divisions = _editor->get_grid_music_divisions (event->button.state);
- _real_section = map.add_tempo (tempo, map.exact_qn_at_frame (frame, divisions), 0, type, MusicTime);
+ _real_section = map.add_tempo (tempo, map.exact_qn_at_frame (frame, divisions), 0, MusicTime);
} else {
- _real_section = map.add_tempo (tempo, 0.0, frame, type, AudioTime);
+ _real_section = map.add_tempo (tempo, 0.0, frame, AudioTime);
}
if (!_real_section) {
diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc
index 7918cec6cb..23ab470f7c 100644
--- a/gtk2_ardour/editor_markers.cc
+++ b/gtk2_ardour/editor_markers.cc
@@ -1417,21 +1417,20 @@ Editor::toggle_marker_lock_style ()
const double pulse = tsp->pulse();
const framepos_t frame = tsp->frame();
- const TempoSection::Type type = tsp->type();
const PositionLockStyle pls = (tsp->position_lock_style() == AudioTime) ? MusicTime : AudioTime;
const Tempo tempo (tsp->note_types_per_minute(), tsp->note_type(), tsp->end_note_types_per_minute());
begin_reversible_command (_("change tempo lock style"));
XMLNode &before = _session->tempo_map().get_state();
- _session->tempo_map().replace_tempo (*tsp, tempo, pulse, frame, type, pls);
+ _session->tempo_map().replace_tempo (*tsp, tempo, pulse, frame, pls);
XMLNode &after = _session->tempo_map().get_state();
_session->add_command(new MementoCommand<TempoMap>(_session->tempo_map(), &before, &after));
commit_reversible_command ();
}
}
-
+/* actally just resets the ts to constant using initial tempo */
void
Editor::toggle_tempo_type ()
{
@@ -1442,16 +1441,15 @@ Editor::toggle_tempo_type ()
if (tm) {
TempoSection* tsp = &tm->tempo();
- const Tempo tempo (tsp->note_types_per_minute(), tsp->note_type(), tsp->end_note_types_per_minute());
+ const Tempo tempo (tsp->note_types_per_minute(), tsp->note_type());
const double pulse = tsp->pulse();
const framepos_t frame = tsp->frame();
- const TempoSection::Type type = (tsp->type() == TempoSection::Ramp) ? TempoSection::Constant : TempoSection::Ramp;
const PositionLockStyle pls = tsp->position_lock_style();
- begin_reversible_command (_("change tempo type"));
+ begin_reversible_command (_("set tempo to constant"));
XMLNode &before = _session->tempo_map().get_state();
- _session->tempo_map().replace_tempo (*tsp, tempo, pulse, frame, type, pls);
+ _session->tempo_map().replace_tempo (*tsp, tempo, pulse, frame, pls);
XMLNode &after = _session->tempo_map().get_state();
_session->add_command(new MementoCommand<TempoMap>(_session->tempo_map(), &before, &after));
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index 21dcce19fd..67f90fd43d 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -6714,8 +6714,9 @@ Editor::define_one_bar (framepos_t start, framepos_t end)
} else if (t.frame() == start) {
_session->tempo_map().change_existing_tempo_at (start, beats_per_minute, t.note_type(), t.end_note_types_per_minute());
} else {
- const Tempo tempo (beats_per_minute, t.note_type(), t.end_note_types_per_minute());
- _session->tempo_map().add_tempo (tempo, 0.0, start, TempoSection::Constant, AudioTime);
+ /* constant tempo */
+ const Tempo tempo (beats_per_minute, t.note_type());
+ _session->tempo_map().add_tempo (tempo, 0.0, start, AudioTime);
}
XMLNode& after (_session->tempo_map().get_state());
diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc
index 162179a7b9..35b4783f20 100644
--- a/gtk2_ardour/editor_tempodisplay.cc
+++ b/gtk2_ardour/editor_tempodisplay.cc
@@ -404,7 +404,7 @@ Editor::mouse_add_new_tempo_event (framepos_t frame)
if (pulse > 0.0) {
XMLNode &before = map.get_state();
/* add music-locked ramped (?) tempo using the bpm/note type at frame*/
- map.add_tempo (map.tempo_at_frame (frame), pulse, 0, TempoSection::Ramp, MusicTime);
+ map.add_tempo (map.tempo_at_frame (frame), pulse, 0, MusicTime);
XMLNode &after = map.get_state();
_session->add_command(new MementoCommand<TempoMap>(map, &before, &after));
@@ -531,17 +531,15 @@ Editor::edit_tempo_section (TempoSection* section)
Timecode::BBT_Time when;
tempo_dialog.get_bbt_time (when);
- const TempoSection::Type ttype (tempo_dialog.get_tempo_type());
-
begin_reversible_command (_("replace tempo mark"));
XMLNode &before = _session->tempo_map().get_state();
if (tempo_dialog.get_lock_style() == AudioTime) {
framepos_t const f = _session->tempo_map().predict_tempo_position (section, when).second;
- _session->tempo_map().replace_tempo (*section, tempo, 0.0, f, ttype, AudioTime);
+ _session->tempo_map().replace_tempo (*section, tempo, 0.0, f, AudioTime);
} else {
double const p = _session->tempo_map().predict_tempo_position (section, when).first;
- _session->tempo_map().replace_tempo (*section, tempo, p, 0, ttype, MusicTime);
+ _session->tempo_map().replace_tempo (*section, tempo, p, 0, MusicTime);
}
XMLNode &after = _session->tempo_map().get_state();