Tempo ramps - make moving music-locked meters less flakey, remove some code.
This commit is contained in:
parent
5e2280eead
commit
29e0b2e5bf
|
@ -3174,10 +3174,7 @@ MeterMarkerDrag::motion (GdkEvent* event, bool first_move)
|
||||||
} else {
|
} else {
|
||||||
_editor->begin_reversible_command (_("copy meter mark"));
|
_editor->begin_reversible_command (_("copy meter mark"));
|
||||||
|
|
||||||
Timecode::BBT_Time bbt;
|
Timecode::BBT_Time bbt = _real_section->bbt();
|
||||||
map.bbt_time (adjusted_current_frame (event, false), bbt);
|
|
||||||
/* round bbt to bars */
|
|
||||||
map.round_bbt (bbt, -1);
|
|
||||||
|
|
||||||
/* we can't add a meter where one currently exists */
|
/* we can't add a meter where one currently exists */
|
||||||
if (_real_section->frame() < adjusted_current_frame (event, false)) {
|
if (_real_section->frame() < adjusted_current_frame (event, false)) {
|
||||||
|
@ -3200,11 +3197,18 @@ MeterMarkerDrag::motion (GdkEvent* event, bool first_move)
|
||||||
if (_marker->meter().position_lock_style() == MusicTime) {
|
if (_marker->meter().position_lock_style() == MusicTime) {
|
||||||
TempoMap& map (_editor->session()->tempo_map());
|
TempoMap& map (_editor->session()->tempo_map());
|
||||||
Timecode::BBT_Time bbt;
|
Timecode::BBT_Time bbt;
|
||||||
map.bbt_time (adjusted_current_frame (event, false), bbt);
|
map.bbt_time (pf, bbt);
|
||||||
/* round bbt to bars */
|
/* round bbt to bars */
|
||||||
map.round_bbt (bbt, -1);
|
map.round_bbt (bbt, -1);
|
||||||
const double beat = map.bbt_to_beats (bbt);
|
|
||||||
_editor->session()->tempo_map().gui_move_meter (_real_section, beat);
|
if (bbt.bars > _real_section->bbt().bars) {
|
||||||
|
const double pulse = _real_section->pulse() + (_real_section->note_divisor() / _real_section->divisions_per_bar());
|
||||||
|
_editor->session()->tempo_map().gui_move_meter (_real_section, pulse);
|
||||||
|
} else if (bbt.bars < _real_section->bbt().bars) {
|
||||||
|
const MeterSection& prev_m = map.meter_section_at (pf);
|
||||||
|
const double pulse = _real_section->pulse() - (prev_m.note_divisor() / prev_m.divisions_per_bar());
|
||||||
|
_editor->session()->tempo_map().gui_move_meter (_real_section, pulse);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
_editor->session()->tempo_map().gui_move_meter (_real_section, pf);
|
_editor->session()->tempo_map().gui_move_meter (_real_section, pf);
|
||||||
}
|
}
|
||||||
|
|
|
@ -391,7 +391,7 @@ class LIBARDOUR_API TempoMap : public PBD::StatefulDestructible
|
||||||
void gui_move_tempo_frame (TempoSection*, const framepos_t& frame);
|
void gui_move_tempo_frame (TempoSection*, const framepos_t& frame);
|
||||||
void gui_move_tempo_beat (TempoSection*, const double& frame);
|
void gui_move_tempo_beat (TempoSection*, const double& frame);
|
||||||
void gui_move_meter (MeterSection*, const framepos_t& frame);
|
void gui_move_meter (MeterSection*, const framepos_t& frame);
|
||||||
void gui_move_meter (MeterSection*, const double& beat);
|
void gui_move_meter (MeterSection*, const double& pulse);
|
||||||
bool gui_change_tempo (TempoSection*, const Tempo& bpm);
|
bool gui_change_tempo (TempoSection*, const Tempo& bpm);
|
||||||
|
|
||||||
bool can_solve_bbt (TempoSection* section, const Timecode::BBT_Time& bbt);
|
bool can_solve_bbt (TempoSection* section, const Timecode::BBT_Time& bbt);
|
||||||
|
|
|
@ -1932,23 +1932,7 @@ TempoMap::solve_map (Metrics& imaginary, TempoSection* section, const framepos_t
|
||||||
recompute_meters (imaginary);
|
recompute_meters (imaginary);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#if (0)
|
|
||||||
MetricSectionSorter cmp;
|
|
||||||
imaginary.sort (cmp);
|
|
||||||
if (section->position_lock_style() == MusicTime) {
|
|
||||||
/* we're setting the frame */
|
|
||||||
section->set_position_lock_style (AudioTime);
|
|
||||||
recompute_tempos (imaginary);
|
|
||||||
section->set_position_lock_style (MusicTime);
|
|
||||||
} else {
|
|
||||||
recompute_tempos (imaginary);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (check_solved (imaginary, true)) {
|
|
||||||
recompute_meters (imaginary);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
//dump (imaginary, std::cerr);
|
//dump (imaginary, std::cerr);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -2023,23 +2007,7 @@ TempoMap::solve_map (Metrics& imaginary, TempoSection* section, const double& pu
|
||||||
recompute_meters (imaginary);
|
recompute_meters (imaginary);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#if (0)
|
|
||||||
MetricSectionFrameSorter fcmp;
|
|
||||||
imaginary.sort (fcmp);
|
|
||||||
if (section->position_lock_style() == AudioTime) {
|
|
||||||
/* we're setting the pulse */
|
|
||||||
section->set_position_lock_style (MusicTime);
|
|
||||||
recompute_tempos (imaginary);
|
|
||||||
section->set_position_lock_style (AudioTime);
|
|
||||||
} else {
|
|
||||||
recompute_tempos (imaginary);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (check_solved (imaginary, false)) {
|
|
||||||
recompute_meters (imaginary);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
//dump (imaginary, std::cerr);
|
//dump (imaginary, std::cerr);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -2347,11 +2315,11 @@ TempoMap::gui_move_meter (MeterSection* ms, const framepos_t& frame)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
TempoMap::gui_move_meter (MeterSection* ms, const double& beat)
|
TempoMap::gui_move_meter (MeterSection* ms, const double& pulse)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
Glib::Threads::RWLock::WriterLock lm (lock);
|
Glib::Threads::RWLock::WriterLock lm (lock);
|
||||||
solve_map (_metrics, ms, pulse_at_beat_locked (_metrics, beat));
|
solve_map (_metrics, ms, pulse);
|
||||||
}
|
}
|
||||||
|
|
||||||
MetricPositionChanged (); // Emit Signal
|
MetricPositionChanged (); // Emit Signal
|
||||||
|
|
Loading…
Reference in New Issue
Block a user