Make tempo tests use the api more correctly.
- TempoMap initially contains a tempo and meter. using add_tempo/meter() using the position of an existing section does the right thing, but prints a warning. Use replace_tempo/meter().
This commit is contained in:
parent
4ddb6b74f5
commit
9acfdb31a2
|
@ -22,8 +22,8 @@ FrameposMinusBeatsTest::singleTempoTest ()
|
|||
Tempo tempo (bpm);
|
||||
Meter meter (4, 4);
|
||||
|
||||
map.add_meter (meter, 0.0, BBT_Time (1, 1, 0), 0, AudioTime);
|
||||
map.add_tempo (tempo, 0.0, 0, TempoSection::Constant, AudioTime);
|
||||
map.replace_meter (map.first_meter(), meter, BBT_Time (1, 1, 0), (framepos_t) 0, AudioTime);
|
||||
map.replace_tempo (map.first_tempo(), tempo, 0.0, 0, TempoSection::Constant, AudioTime);
|
||||
|
||||
/* 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), 0, AudioTime);
|
||||
map.replace_meter (map.first_meter(), meter, BBT_Time (1, 1, 0), (framepos_t) 0, AudioTime);
|
||||
|
||||
/*
|
||||
120bpm at bar 1, 240bpm at bar 4
|
||||
|
@ -64,7 +64,7 @@ FrameposMinusBeatsTest::doubleTempoTest ()
|
|||
*/
|
||||
|
||||
Tempo tempoA (120);
|
||||
map.add_tempo (tempoA, 0.0, 0, TempoSection::Constant, AudioTime);
|
||||
map.replace_tempo (map.first_tempo(), tempoA, 0.0, 0, TempoSection::Constant, AudioTime);
|
||||
Tempo tempoB (240);
|
||||
map.add_tempo (tempoB, 12.0 / tempoA.note_type(), 0, TempoSection::Constant, MusicTime);
|
||||
|
||||
|
@ -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), 0, AudioTime);
|
||||
map.replace_meter (map.first_meter(), meterA, BBT_Time (1, 1, 0), (framepos_t) 0, AudioTime);
|
||||
|
||||
/*
|
||||
120bpm at bar 1, 240bpm at bar 4
|
||||
|
@ -117,7 +117,7 @@ FrameposMinusBeatsTest::doubleTempoWithMeterTest ()
|
|||
*/
|
||||
|
||||
Tempo tempoA (120);
|
||||
map.add_tempo (tempoA, 0.0, 0, TempoSection::Constant, AudioTime);
|
||||
map.replace_tempo (map.first_tempo(), tempoA, 0.0, 0, TempoSection::Constant, AudioTime);
|
||||
Tempo tempoB (240);
|
||||
map.add_tempo (tempoB, 12.0 / tempoA.note_type(), 0, TempoSection::Constant, MusicTime);
|
||||
Meter meterB (3, 4);
|
||||
|
|
|
@ -21,8 +21,8 @@ FrameposPlusBeatsTest::singleTempoTest ()
|
|||
Tempo tempo (bpm);
|
||||
Meter meter (4, 4);
|
||||
|
||||
map.add_meter (meter, 0.0, BBT_Time (1, 1, 0), 0, AudioTime);
|
||||
map.add_tempo (tempo, 0.0, 0, TempoSection::Constant, AudioTime);
|
||||
map.replace_meter (map.first_meter(), meter, BBT_Time (1, 1, 0), (framepos_t) 0, AudioTime);
|
||||
map.replace_tempo (map.first_tempo(), tempo, 0.0, 0, TempoSection::Constant, AudioTime);
|
||||
|
||||
/* 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), 0, AudioTime);
|
||||
map.replace_meter (map.first_meter(), meter, BBT_Time (1, 1, 0), (framepos_t) 0, AudioTime);
|
||||
|
||||
/*
|
||||
120bpm at bar 1, 240bpm at bar 4
|
||||
|
@ -63,7 +63,7 @@ FrameposPlusBeatsTest::doubleTempoTest ()
|
|||
*/
|
||||
|
||||
Tempo tempoA (120);
|
||||
map.add_tempo (tempoA, 0.0, 0, TempoSection::Constant, AudioTime);
|
||||
map.replace_tempo (map.first_tempo(), tempoA, 0.0, 0, TempoSection::Constant, AudioTime);
|
||||
Tempo tempoB (240);
|
||||
map.add_tempo (tempoB, 12.0 / tempoA.note_type(), 0, TempoSection::Constant, MusicTime);
|
||||
|
||||
|
@ -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), 0, AudioTime);
|
||||
map.replace_meter (map.first_meter(), meterA, BBT_Time (1, 1, 0), (framepos_t) 0, AudioTime);
|
||||
|
||||
/*
|
||||
120bpm at bar 1, 240bpm at bar 4
|
||||
|
@ -116,7 +116,7 @@ FrameposPlusBeatsTest::doubleTempoWithMeterTest ()
|
|||
*/
|
||||
|
||||
Tempo tempoA (120);
|
||||
map.add_tempo (tempoA, 0.0, 0, TempoSection::Constant, AudioTime);
|
||||
map.replace_tempo (map.first_tempo(), tempoA, 0.0, 0, TempoSection::Constant, AudioTime);
|
||||
Tempo tempoB (240);
|
||||
map.add_tempo (tempoB, 12.0 / tempoA.note_type(), 0, TempoSection::Constant, MusicTime);
|
||||
Meter meterB (3, 4);
|
||||
|
|
|
@ -20,8 +20,8 @@ FramewalkToBeatsTest::singleTempoTest ()
|
|||
Tempo tempo (bpm);
|
||||
Meter meter (4, 4);
|
||||
|
||||
map.add_meter (meter, 0.0, BBT_Time (1, 1, 0), 0, AudioTime);
|
||||
map.add_tempo (tempo, 0.0, 0, TempoSection::Constant, AudioTime);
|
||||
map.replace_meter (map.meter_section_at_frame (0), meter, BBT_Time (1, 1, 0), (framepos_t) 0, AudioTime);
|
||||
map.replace_tempo (map.tempo_section_at_frame (0), tempo, 0.0, 0, TempoSection::Constant, AudioTime);
|
||||
|
||||
/* 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), 0, AudioTime);
|
||||
map.replace_meter (map.meter_section_at_frame (0), meter, BBT_Time (1, 1, 0), (framepos_t) 0, AudioTime);
|
||||
|
||||
/*
|
||||
120bpm at bar 1, 240bpm at bar 4
|
||||
|
@ -71,7 +71,7 @@ FramewalkToBeatsTest::doubleTempoTest ()
|
|||
*/
|
||||
|
||||
Tempo tempoA (120);
|
||||
map.add_tempo (tempoA, 0.0, 0, TempoSection::Constant, AudioTime);
|
||||
map.replace_tempo (map.tempo_section_at_frame (0), tempoA, 0.0, 0, TempoSection::Constant, AudioTime);
|
||||
Tempo tempoB (240);
|
||||
map.add_tempo (tempoB, 12.0 / tempoB.note_type(), 0, TempoSection::Constant, MusicTime);
|
||||
|
||||
|
@ -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), 0, AudioTime);
|
||||
map.replace_meter (map.meter_section_at_frame (0), meter, BBT_Time (1, 1, 0), (framepos_t) 0, AudioTime);
|
||||
|
||||
/*
|
||||
120bpm at bar 1, 240bpm at bar 2, 160bpm at bar 3
|
||||
|
@ -127,7 +127,7 @@ FramewalkToBeatsTest::tripleTempoTest ()
|
|||
*/
|
||||
|
||||
Tempo tempoA (120);
|
||||
map.add_tempo (tempoA, 0.0, 0, TempoSection::Constant, AudioTime);
|
||||
map.replace_tempo (map.tempo_section_at_frame (0), tempoA, 0.0, 0, TempoSection::Constant, AudioTime);
|
||||
Tempo tempoB (240);
|
||||
map.add_tempo (tempoB, 4.0 / tempoB.note_type(), 0, TempoSection::Constant, MusicTime);
|
||||
Tempo tempoC (160);
|
||||
|
|
|
@ -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), 0, AudioTime);
|
||||
map.replace_meter (map.first_meter(), meterA, BBT_Time (1, 1, 0), (framepos_t) 0, AudioTime);
|
||||
|
||||
/*
|
||||
120bpm at bar 1, 240bpm at bar 4
|
||||
|
@ -36,7 +36,7 @@ TempoTest::recomputeMapTest ()
|
|||
*/
|
||||
|
||||
Tempo tempoA (120);
|
||||
map.add_tempo (tempoA, 0.0, 0, TempoSection::Constant, AudioTime);
|
||||
map.replace_tempo (map.first_tempo(), tempoA, 0.0, 0, TempoSection::Constant, AudioTime);
|
||||
Tempo tempoB (240);
|
||||
map.add_tempo (tempoB, 3.0, 0, TempoSection::Constant, MusicTime);
|
||||
Meter meterB (3, 4);
|
||||
|
@ -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, 0.0, 0, TempoSection::Ramp, AudioTime);
|
||||
map.replace_tempo (map.first_tempo(), tempoA, 0.0, 0, TempoSection::Ramp, AudioTime);
|
||||
map.add_tempo (tempoB, 0.0, (framepos_t) 60 * sampling_rate, TempoSection::Ramp, AudioTime);
|
||||
map.add_meter (meterA, 0.0, BBT_Time (1, 1, 0), 0, AudioTime);
|
||||
map.replace_meter (map.first_meter(), meterA, BBT_Time (1, 1, 0), (framepos_t) 0, AudioTime);
|
||||
|
||||
/*
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user