13
0

Tempo ramps - fix music-locked meter drags.

This commit is contained in:
nick_m 2016-03-04 18:33:05 +11:00
parent eeb20bc392
commit 36ec551a8a
3 changed files with 24 additions and 7 deletions

View File

@ -3178,17 +3178,18 @@ MeterMarkerDrag::motion (GdkEvent* event, bool first_move)
TempoMap& map (_editor->session()->tempo_map());
/* get current state */
before_state = &map.get_state();
/* remove the section while we drag it */
//map.remove_meter (section, true);
}
_marker->hide();
}
framepos_t const pf = adjusted_current_frame (event);
double const baf = _editor->session()->tempo_map().beat_at_frame (pf);
_marker->set_position (pf);
if (_marker->meter().position_lock_style() == MusicTime) {
_editor->session()->tempo_map().gui_move_meter (_real_section, _marker->meter(), baf);
} else {
_editor->session()->tempo_map().gui_move_meter (_real_section, _marker->meter(), pf);
}
show_verbose_cursor_time (pf);
}
@ -3206,7 +3207,7 @@ MeterMarkerDrag::finished (GdkEvent* event, bool movement_occurred)
return;
}
motion (event, false);
//motion (event, false);
Timecode::BBT_Time when;

View File

@ -384,6 +384,8 @@ class LIBARDOUR_API TempoMap : public PBD::StatefulDestructible
void gui_move_tempo (TempoSection*, const Tempo& bpm, const framepos_t& frame);
void gui_move_meter (MeterSection*, const Meter& mt, const framepos_t& frame);
void gui_move_meter (MeterSection*, const Meter& mt, const double& beat);
void replace_meter (const MeterSection&, const Meter&, const Timecode::BBT_Time& where);
void replace_meter (const MeterSection&, const Meter&, const framepos_t& frame);

View File

@ -1079,7 +1079,6 @@ TempoMap::get_new_order(MeterSection* section, const Meter& mt, const framepos_t
if (prev_ms) {
if (m->frame() > frame){
pair<double, BBT_Time> b_bbt = make_pair (beat_at_frame_locked (frame), BBT_Time (1, 1, 0));
section->set_beat (b_bbt);
prev_ms = section;
continue;
@ -1149,6 +1148,21 @@ TempoMap::gui_move_meter (MeterSection* ms, const Meter& mt, const framepos_t&
MetricPositionChanged (); // Emit Signal
}
void
TempoMap::gui_move_meter (MeterSection* ms, const Meter& mt, const double& beat)
{
{
Glib::Threads::RWLock::WriterLock lm (lock);
Metrics new_order = get_new_order (ms, mt, beat);
metrics.clear();
metrics = new_order;
recompute_meters ();
}
MetricPositionChanged (); // Emit Signal
}
void
TempoMap::add_tempo (const Tempo& tempo, double where, ARDOUR::TempoSection::Type type)
{