mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-12 01:26:31 +01:00
Tempo ramps - correct fix for adding/replacing meters.
This commit is contained in:
parent
89ba10c05a
commit
9fb78d091d
1 changed files with 9 additions and 9 deletions
|
|
@ -1095,7 +1095,6 @@ TempoMap::add_meter_locked (const Meter& meter, double beat, const BBT_Time& whe
|
||||||
|
|
||||||
const double pulse = pulse_at_beat_locked (_metrics, beat);
|
const double pulse = pulse_at_beat_locked (_metrics, beat);
|
||||||
MeterSection* new_meter = new MeterSection (pulse, beat, where, meter.divisions_per_bar(), meter.note_divisor());
|
MeterSection* new_meter = new MeterSection (pulse, beat, where, meter.divisions_per_bar(), meter.note_divisor());
|
||||||
new_meter->set_frame (frame_at_pulse_locked (_metrics, pulse));
|
|
||||||
|
|
||||||
do_insert (new_meter);
|
do_insert (new_meter);
|
||||||
|
|
||||||
|
|
@ -1109,17 +1108,17 @@ TempoMap::add_meter_locked (const Meter& meter, double beat, const BBT_Time& whe
|
||||||
MeterSection*
|
MeterSection*
|
||||||
TempoMap::add_meter_locked (const Meter& meter, framepos_t frame, double beat, const Timecode::BBT_Time& where, bool recompute)
|
TempoMap::add_meter_locked (const Meter& meter, framepos_t frame, double beat, const Timecode::BBT_Time& where, bool recompute)
|
||||||
{
|
{
|
||||||
|
/* add meter-locked tempo */
|
||||||
|
TempoSection* t = add_tempo_locked (tempo_at_locked (_metrics, frame), frame, true, TempoSection::Ramp);
|
||||||
|
if (t) {
|
||||||
|
t->set_locked_to_meter (true);
|
||||||
|
}
|
||||||
|
|
||||||
MeterSection* new_meter = new MeterSection (frame, beat, where, meter.divisions_per_bar(), meter.note_divisor());
|
MeterSection* new_meter = new MeterSection (frame, beat, where, meter.divisions_per_bar(), meter.note_divisor());
|
||||||
TempoSection* t = 0;
|
new_meter->set_pulse (pulse_at_frame_locked (_metrics, frame));
|
||||||
double pulse = pulse_at_frame_locked (_metrics, frame);
|
|
||||||
new_meter->set_pulse (pulse);
|
|
||||||
|
|
||||||
do_insert (new_meter);
|
do_insert (new_meter);
|
||||||
|
|
||||||
/* add meter-locked tempo */
|
|
||||||
t = add_tempo_locked (tempo_at_locked (_metrics, frame), frame, true, TempoSection::Ramp);
|
|
||||||
t->set_locked_to_meter (true);
|
|
||||||
|
|
||||||
if (recompute) {
|
if (recompute) {
|
||||||
solve_map (_metrics, new_meter, frame);
|
solve_map (_metrics, new_meter, frame);
|
||||||
}
|
}
|
||||||
|
|
@ -2263,7 +2262,7 @@ TempoMap::solve_map (Metrics& imaginary, MeterSection* section, const BBT_Time&
|
||||||
for (Metrics::iterator i = imaginary.begin(); i != imaginary.end(); ++i) {
|
for (Metrics::iterator i = imaginary.begin(); i != imaginary.end(); ++i) {
|
||||||
MeterSection* m;
|
MeterSection* m;
|
||||||
if ((m = dynamic_cast<MeterSection*> (*i)) != 0) {
|
if ((m = dynamic_cast<MeterSection*> (*i)) != 0) {
|
||||||
if (m->bbt().bars == when.bars) {
|
if (m != section && m->bbt().bars == when.bars) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2359,6 +2358,7 @@ TempoMap::solve_map (Metrics& imaginary, MeterSection* section, const BBT_Time&
|
||||||
|
|
||||||
MetricSectionSorter cmp;
|
MetricSectionSorter cmp;
|
||||||
imaginary.sort (cmp);
|
imaginary.sort (cmp);
|
||||||
|
|
||||||
if (section->position_lock_style() == AudioTime) {
|
if (section->position_lock_style() == AudioTime) {
|
||||||
/* we're setting the pulse */
|
/* we're setting the pulse */
|
||||||
section->set_position_lock_style (MusicTime);
|
section->set_position_lock_style (MusicTime);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue