summaryrefslogtreecommitdiff
path: root/libs/ardour/test
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2016-05-19 01:01:08 +1000
committernick_m <mainsbridge@gmail.com>2016-05-27 23:38:16 +1000
commit2d3d7a53556a0b724c91db0dbf991e3d7a78b4fe (patch)
tree5b95d1e2e4389d835f4a7033994fb9c62e97344b /libs/ardour/test
parente5ba2bc34c400a533b3578ebe722eef0183a3d68 (diff)
Tempo ramps - fix ambiguous api, fix flickering tempo curves.
Diffstat (limited to 'libs/ardour/test')
-rw-r--r--libs/ardour/test/bbt_test.cc2
-rw-r--r--libs/ardour/test/framepos_minus_beats_test.cc18
-rw-r--r--libs/ardour/test/framepos_plus_beats_test.cc18
-rw-r--r--libs/ardour/test/framewalk_to_beats_test.cc18
-rw-r--r--libs/ardour/test/midi_clock_slave_test.h4
-rw-r--r--libs/ardour/test/tempo_test.cc14
6 files changed, 37 insertions, 37 deletions
diff --git a/libs/ardour/test/bbt_test.cc b/libs/ardour/test/bbt_test.cc
index 507af574d2..9249c0f175 100644
--- a/libs/ardour/test/bbt_test.cc
+++ b/libs/ardour/test/bbt_test.cc
@@ -16,7 +16,7 @@ BBTTest::addTest ()
Tempo tempo(120);
Meter meter(4.0, 4.0);
- map.add_meter (meter, 0.0, BBT_Time(1, 1, 0));
+ map.add_meter_beat (meter, 0.0, BBT_Time(1, 1, 0));
/* add some good stuff here */
}
diff --git a/libs/ardour/test/framepos_minus_beats_test.cc b/libs/ardour/test/framepos_minus_beats_test.cc
index 6982529bf6..acdcd428fd 100644
--- a/libs/ardour/test/framepos_minus_beats_test.cc
+++ b/libs/ardour/test/framepos_minus_beats_test.cc
@@ -22,8 +22,8 @@ FrameposMinusBeatsTest::singleTempoTest ()
Tempo tempo (bpm);
Meter meter (4, 4);
- map.add_meter (meter, 0.0, BBT_Time (1, 1, 0));
- map.add_tempo (tempo, 0.0, TempoSection::Constant);
+ map.add_meter_beat (meter, 0.0, BBT_Time (1, 1, 0));
+ map.add_tempo_pulse (tempo, 0.0, TempoSection::Constant);
/* Subtract 1 beat from beat 3 of the first bar */
framepos_t r = map.framepos_minus_beats (frames_per_beat * 2, Beats(1));
@@ -42,7 +42,7 @@ FrameposMinusBeatsTest::doubleTempoTest ()
TempoMap map (sampling_rate);
Meter meter (4, 4);
- map.add_meter (meter, 0.0, BBT_Time (1, 1, 0));
+ map.add_meter_beat (meter, 0.0, BBT_Time (1, 1, 0));
/*
120bpm at bar 1, 240bpm at bar 4
@@ -64,9 +64,9 @@ FrameposMinusBeatsTest::doubleTempoTest ()
*/
Tempo tempoA (120);
- map.add_tempo (tempoA, 0.0, TempoSection::Constant);
+ map.add_tempo_pulse (tempoA, 0.0, TempoSection::Constant);
Tempo tempoB (240);
- map.add_tempo (tempoB, 12.0 / tempoA.note_type(), TempoSection::Constant);
+ map.add_tempo_pulse (tempoB, 12.0 / tempoA.note_type(), TempoSection::Constant);
/* Now some tests */
@@ -95,7 +95,7 @@ FrameposMinusBeatsTest::doubleTempoWithMeterTest ()
TempoMap map (sampling_rate);
Meter meterA (4, 4);
- map.add_meter (meterA, 0.0, BBT_Time (1, 1, 0));
+ map.add_meter_beat (meterA, 0.0, BBT_Time (1, 1, 0));
/*
120bpm at bar 1, 240bpm at bar 4
@@ -117,11 +117,11 @@ FrameposMinusBeatsTest::doubleTempoWithMeterTest ()
*/
Tempo tempoA (120);
- map.add_tempo (tempoA, 0.0, TempoSection::Constant);
+ map.add_tempo_pulse (tempoA, 0.0, TempoSection::Constant);
Tempo tempoB (240);
- map.add_tempo (tempoB, 12.0 / tempoA.note_type(), TempoSection::Constant);
+ map.add_tempo_pulse (tempoB, 12.0 / tempoA.note_type(), TempoSection::Constant);
Meter meterB (3, 4);
- map.add_meter (meterB, 12.0 / tempoA.note_type(), BBT_Time (4, 1, 0));
+ map.add_meter_beat (meterB, 12.0 / tempoA.note_type(), BBT_Time (4, 1, 0));
/* Now some tests */
diff --git a/libs/ardour/test/framepos_plus_beats_test.cc b/libs/ardour/test/framepos_plus_beats_test.cc
index f31f73da20..faf304ca82 100644
--- a/libs/ardour/test/framepos_plus_beats_test.cc
+++ b/libs/ardour/test/framepos_plus_beats_test.cc
@@ -21,8 +21,8 @@ FrameposPlusBeatsTest::singleTempoTest ()
Tempo tempo (bpm);
Meter meter (4, 4);
- map.add_meter (meter, 0.0, BBT_Time (1, 1, 0));
- map.add_tempo (tempo, 0.0, TempoSection::Constant);
+ map.add_meter_beat (meter, 0.0, BBT_Time (1, 1, 0));
+ map.add_tempo_pulse (tempo, 0.0, TempoSection::Constant);
/* Add 1 beat to beat 3 of the first bar */
framepos_t r = map.framepos_plus_beats (frames_per_beat * 2, Evoral::Beats(1));
@@ -41,7 +41,7 @@ FrameposPlusBeatsTest::doubleTempoTest ()
TempoMap map (sampling_rate);
Meter meter (4, 4);
- map.add_meter (meter, 0.0, BBT_Time (1, 1, 0));
+ map.add_meter_beat (meter, 0.0, BBT_Time (1, 1, 0));
/*
120bpm at bar 1, 240bpm at bar 4
@@ -63,9 +63,9 @@ FrameposPlusBeatsTest::doubleTempoTest ()
*/
Tempo tempoA (120);
- map.add_tempo (tempoA, 0.0, TempoSection::Constant);
+ map.add_tempo_pulse (tempoA, 0.0, TempoSection::Constant);
Tempo tempoB (240);
- map.add_tempo (tempoB, 12.0 / tempoA.note_type(), TempoSection::Constant);
+ map.add_tempo_pulse (tempoB, 12.0 / tempoA.note_type(), TempoSection::Constant);
/* Now some tests */
@@ -94,7 +94,7 @@ FrameposPlusBeatsTest::doubleTempoWithMeterTest ()
TempoMap map (sampling_rate);
Meter meterA (4, 4);
- map.add_meter (meterA, 0.0, BBT_Time (1, 1, 0));
+ map.add_meter_beat (meterA, 0.0, BBT_Time (1, 1, 0));
/*
120bpm at bar 1, 240bpm at bar 4
@@ -116,11 +116,11 @@ FrameposPlusBeatsTest::doubleTempoWithMeterTest ()
*/
Tempo tempoA (120);
- map.add_tempo (tempoA, 0.0, TempoSection::Constant);
+ map.add_tempo_pulse (tempoA, 0.0, TempoSection::Constant);
Tempo tempoB (240);
- map.add_tempo (tempoB, 12.0 / tempoA.note_type(), TempoSection::Constant);
+ map.add_tempo_pulse (tempoB, 12.0 / tempoA.note_type(), TempoSection::Constant);
Meter meterB (3, 4);
- map.add_meter (meterB, 12.0 / tempoA.note_type(), BBT_Time (4, 1, 0));
+ map.add_meter_beat (meterB, 12.0 / tempoA.note_type(), BBT_Time (4, 1, 0));
/* Now some tests */
diff --git a/libs/ardour/test/framewalk_to_beats_test.cc b/libs/ardour/test/framewalk_to_beats_test.cc
index f895cfb1a4..950789d440 100644
--- a/libs/ardour/test/framewalk_to_beats_test.cc
+++ b/libs/ardour/test/framewalk_to_beats_test.cc
@@ -20,8 +20,8 @@ FramewalkToBeatsTest::singleTempoTest ()
Tempo tempo (bpm);
Meter meter (4, 4);
- map.add_meter (meter, 0.0, BBT_Time (1, 1, 0));
- map.add_tempo (tempo, 0.0, TempoSection::Constant);
+ map.add_meter_beat (meter, 0.0, BBT_Time (1, 1, 0));
+ map.add_tempo_pulse (tempo, 0.0, TempoSection::Constant);
/* Walk 1 beats-worth of frames from beat 3 */
double r = map.framewalk_to_beats (frames_per_beat * 2, frames_per_beat * 1).to_double();
@@ -47,7 +47,7 @@ FramewalkToBeatsTest::doubleTempoTest ()
TempoMap map (sampling_rate);
Meter meter (4, 4);
- map.add_meter (meter, 0.0, BBT_Time (1, 1, 0));
+ map.add_meter_beat (meter, 0.0, BBT_Time (1, 1, 0));
/*
120bpm at bar 1, 240bpm at bar 4
@@ -71,9 +71,9 @@ FramewalkToBeatsTest::doubleTempoTest ()
*/
Tempo tempoA (120);
- map.add_tempo (tempoA, 0.0, TempoSection::Constant);
+ map.add_tempo_pulse (tempoA, 0.0, TempoSection::Constant);
Tempo tempoB (240);
- map.add_tempo (tempoB, 12.0 / tempoB.note_type(), TempoSection::Constant);
+ map.add_tempo_pulse (tempoB, 12.0 / tempoB.note_type(), TempoSection::Constant);
/* Now some tests */
@@ -104,7 +104,7 @@ FramewalkToBeatsTest::tripleTempoTest ()
TempoMap map (sampling_rate);
Meter meter (4, 4);
- map.add_meter (meter, 0.0, BBT_Time (1, 1, 0));
+ map.add_meter_beat (meter, 0.0, BBT_Time (1, 1, 0));
/*
120bpm at bar 1, 240bpm at bar 2, 160bpm at bar 3
@@ -127,11 +127,11 @@ FramewalkToBeatsTest::tripleTempoTest ()
*/
Tempo tempoA (120);
- map.add_tempo (tempoA, 0.0, TempoSection::Constant);
+ map.add_tempo_pulse (tempoA, 0.0, TempoSection::Constant);
Tempo tempoB (240);
- map.add_tempo (tempoB, 4.0 / tempoB.note_type(), TempoSection::Constant);
+ map.add_tempo_pulse (tempoB, 4.0 / tempoB.note_type(), TempoSection::Constant);
Tempo tempoC (160);
- map.add_tempo (tempoC, 8.0 / tempoB.note_type(), TempoSection::Constant);
+ map.add_tempo_pulse (tempoC, 8.0 / tempoB.note_type(), TempoSection::Constant);
/* Walk from 1|3 to 4|1 */
double r = map.framewalk_to_beats (2 * 24e3, (2 * 24e3) + (4 * 12e3) + (4 * 18e3)).to_double();
diff --git a/libs/ardour/test/midi_clock_slave_test.h b/libs/ardour/test/midi_clock_slave_test.h
index ba87f8892a..9b61d2c807 100644
--- a/libs/ardour/test/midi_clock_slave_test.h
+++ b/libs/ardour/test/midi_clock_slave_test.h
@@ -48,8 +48,8 @@ class TestSlaveSessionProxy : public ISlaveSessionProxy {
meter (4.0, 4.0)
{
_tempo_map = new TempoMap (FRAME_RATE);
- _tempo_map->add_tempo (tempo, 0.0, TempoSection::Type::Constant);
- _tempo_map->add_meter (meter, 0.0, Timecode::BBT_Time(1, 1, 0));
+ _tempo_map->add_tempo_pulse (tempo, 0.0, TempoSection::Type::Constant);
+ _tempo_map->add_meter_beat (meter, 0.0, Timecode::BBT_Time(1, 1, 0));
}
// Controlling the mock object
diff --git a/libs/ardour/test/tempo_test.cc b/libs/ardour/test/tempo_test.cc
index 0160708542..621a72dd96 100644
--- a/libs/ardour/test/tempo_test.cc
+++ b/libs/ardour/test/tempo_test.cc
@@ -14,7 +14,7 @@ TempoTest::recomputeMapTest ()
TempoMap map (sampling_rate);
Meter meterA (4, 4);
- map.add_meter (meterA, 0.0, BBT_Time (1, 1, 0));
+ map.add_meter_beat (meterA, 0.0, BBT_Time (1, 1, 0));
/*
120bpm at bar 1, 240bpm at bar 4
@@ -36,11 +36,11 @@ TempoTest::recomputeMapTest ()
*/
Tempo tempoA (120);
- map.add_tempo (tempoA, 0.0, TempoSection::Constant);
+ map.add_tempo_pulse (tempoA, 0.0, TempoSection::Constant);
Tempo tempoB (240);
- map.add_tempo (tempoB, 12.0, TempoSection::Constant);
+ map.add_tempo_pulse (tempoB, 4.0, TempoSection::Constant);
Meter meterB (3, 4);
- map.add_meter (meterB, 12.0, BBT_Time (4, 1, 0));
+ map.add_meter_beat (meterB, 12.0, BBT_Time (4, 1, 0));
list<MetricSection*>::iterator i = map._metrics.begin();
CPPUNIT_ASSERT_EQUAL (framepos_t (0), (*i)->frame ());
@@ -59,9 +59,9 @@ TempoTest::rampTest ()
Meter meterA (4, 4);
Tempo tempoA (77.0, 4.0);
Tempo tempoB (217.0, 4.0);
- map.add_tempo (tempoA, (framepos_t) 0, TempoSection::Ramp);
- map.add_tempo (tempoB, (framepos_t) 60 * sampling_rate, TempoSection::Ramp);
- map.add_meter (meterA, 0.0, BBT_Time (1, 1, 0));
+ map.add_tempo_frame (tempoA, (framepos_t) 0, TempoSection::Ramp);
+ map.add_tempo_frame (tempoB, (framepos_t) 60 * sampling_rate, TempoSection::Ramp);
+ map.add_meter_beat (meterA, 0.0, BBT_Time (1, 1, 0));
/*