summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2016-05-18 00:40:49 +1000
committernick_m <mainsbridge@gmail.com>2016-05-27 23:38:16 +1000
commita68ff8e5408c5043477c3ec6823dd71486380a44 (patch)
tree4cd1b3a3a0621c516648c098bc6d214bfff67d13
parentc3119852c0f6ce5390ce59bed1af2a80169a656f (diff)
Tempo ramps - remove unused code, small meter dilation drag cleanup.
-rw-r--r--libs/ardour/ardour/tempo.h1
-rw-r--r--libs/ardour/tempo.cc41
2 files changed, 7 insertions, 35 deletions
diff --git a/libs/ardour/ardour/tempo.h b/libs/ardour/ardour/tempo.h
index 9274758958..8b9b8b1bef 100644
--- a/libs/ardour/ardour/tempo.h
+++ b/libs/ardour/ardour/tempo.h
@@ -394,7 +394,6 @@ class LIBARDOUR_API TempoMap : public PBD::StatefulDestructible
void gui_move_tempo_frame (TempoSection*, const framepos_t& frame);
void gui_move_tempo_beat (TempoSection*, const double& beat);
- void gui_move_tempo_pulse (TempoSection*, const double& pulse);
void gui_move_meter (MeterSection*, const framepos_t& frame);
void gui_move_meter (MeterSection*, const Timecode::BBT_Time& bbt);
bool gui_change_tempo (TempoSection*, const Tempo& bpm);
diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc
index 36b48b6ef8..8c710ad180 100644
--- a/libs/ardour/tempo.cc
+++ b/libs/ardour/tempo.cc
@@ -2554,28 +2554,6 @@ TempoMap::gui_move_tempo_beat (TempoSection* ts, const double& beat)
}
void
-TempoMap::gui_move_tempo_pulse (TempoSection* ts, const double& pulse)
-{
- Metrics future_map;
- {
- Glib::Threads::RWLock::WriterLock lm (lock);
- TempoSection* tempo_copy = copy_metrics_and_point (_metrics, future_map, ts);
- if (solve_map (future_map, tempo_copy, pulse)) {
- solve_map (_metrics, ts, pulse);
- recompute_meters (_metrics);
- }
- }
-
- Metrics::const_iterator d = future_map.begin();
- while (d != future_map.end()) {
- delete (*d);
- ++d;
- }
-
- MetricPositionChanged (); // Emit Signal
-}
-
-void
TempoMap::gui_move_meter (MeterSection* ms, const framepos_t& frame)
{
Metrics future_map;
@@ -2733,12 +2711,6 @@ TempoMap::gui_dilate_tempo (MeterSection* ms, const framepos_t& frame)
new_bpm = prev_t->tempo_at_frame (prev_t->frame() + fr_off, _frame_rate) * (double) prev_t->note_type();
}
- const double diff = (prev_t->tempo_at_frame (frame, _frame_rate) * prev_t->note_type()) - prev_t->beats_per_minute();
- if (diff > -0.1 && diff < 0.1) {
- new_bpm = prev_t->beats_per_minute() * ((ms->frame() - prev_t->frame())
- / (double) ((ms->frame() + prev_t_frame_contribution) - prev_t->frame()));
- }
-
} else if (prev_t->c_func() > 0.0) {
if (prev_to_prev_t && prev_to_prev_t->type() == TempoSection::Ramp) {
new_bpm = prev_t->tempo_at_frame (prev_t->frame() - frame_contribution, _frame_rate) * (double) prev_t->note_type();
@@ -2746,13 +2718,13 @@ TempoMap::gui_dilate_tempo (MeterSection* ms, const framepos_t& frame)
/* prev_to_prev_t is irrelevant */
new_bpm = prev_t->tempo_at_frame (prev_t->frame() - fr_off, _frame_rate) * (double) prev_t->note_type();
}
+ }
- /* limits - a bit clunky, but meh */
- const double diff = (prev_t->tempo_at_frame (frame, _frame_rate) * prev_t->note_type()) - prev_t->beats_per_minute();
- if (diff > -0.1 && diff < 0.1) {
- new_bpm = prev_t->beats_per_minute() * ((ms->frame() - prev_t->frame())
- / (double) ((ms->frame() + prev_t_frame_contribution) - prev_t->frame()));
- }
+ /* limits - a bit clunky, but meh */
+ const double diff = (prev_t->tempo_at_frame (frame, _frame_rate) * prev_t->note_type()) - prev_t->beats_per_minute();
+ if (diff > -1.0 && diff < 1.0) {
+ new_bpm = prev_t->beats_per_minute() * ((ms->frame() - prev_t->frame())
+ / (double) ((ms->frame() + prev_t_frame_contribution) - prev_t->frame()));
}
prev_t->set_beats_per_minute (new_bpm);
@@ -2809,6 +2781,7 @@ TempoMap::gui_dilate_tempo (TempoSection* ts, const framepos_t& frame, const fra
if (prev_t && prev_t->pulse() > 0.0) {
prev_to_prev_t = const_cast<TempoSection*>(&tempo_section_at_locked (future_map, prev_t->frame() - 1));
}
+
TempoSection* next_t = 0;
for (Metrics::iterator i = future_map.begin(); i != future_map.end(); ++i) {
TempoSection* t = 0;