Tempo ramps - fix music-locked meter drags.
This commit is contained in:
parent
eeb20bc392
commit
36ec551a8a
@ -3178,17 +3178,18 @@ MeterMarkerDrag::motion (GdkEvent* event, bool first_move)
|
|||||||
TempoMap& map (_editor->session()->tempo_map());
|
TempoMap& map (_editor->session()->tempo_map());
|
||||||
/* get current state */
|
/* get current state */
|
||||||
before_state = &map.get_state();
|
before_state = &map.get_state();
|
||||||
/* remove the section while we drag it */
|
|
||||||
//map.remove_meter (section, true);
|
|
||||||
}
|
}
|
||||||
_marker->hide();
|
_marker->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
framepos_t const pf = adjusted_current_frame (event);
|
framepos_t const pf = adjusted_current_frame (event);
|
||||||
|
double const baf = _editor->session()->tempo_map().beat_at_frame (pf);
|
||||||
_marker->set_position (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);
|
_editor->session()->tempo_map().gui_move_meter (_real_section, _marker->meter(), pf);
|
||||||
|
}
|
||||||
show_verbose_cursor_time (pf);
|
show_verbose_cursor_time (pf);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3206,7 +3207,7 @@ MeterMarkerDrag::finished (GdkEvent* event, bool movement_occurred)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
motion (event, false);
|
//motion (event, false);
|
||||||
|
|
||||||
Timecode::BBT_Time when;
|
Timecode::BBT_Time when;
|
||||||
|
|
||||||
|
@ -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_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 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 Timecode::BBT_Time& where);
|
||||||
void replace_meter (const MeterSection&, const Meter&, const framepos_t& frame);
|
void replace_meter (const MeterSection&, const Meter&, const framepos_t& frame);
|
||||||
|
@ -1079,7 +1079,6 @@ TempoMap::get_new_order(MeterSection* section, const Meter& mt, const framepos_t
|
|||||||
if (prev_ms) {
|
if (prev_ms) {
|
||||||
if (m->frame() > frame){
|
if (m->frame() > frame){
|
||||||
pair<double, BBT_Time> b_bbt = make_pair (beat_at_frame_locked (frame), BBT_Time (1, 1, 0));
|
pair<double, BBT_Time> b_bbt = make_pair (beat_at_frame_locked (frame), BBT_Time (1, 1, 0));
|
||||||
|
|
||||||
section->set_beat (b_bbt);
|
section->set_beat (b_bbt);
|
||||||
prev_ms = section;
|
prev_ms = section;
|
||||||
continue;
|
continue;
|
||||||
@ -1149,6 +1148,21 @@ TempoMap::gui_move_meter (MeterSection* ms, const Meter& mt, const framepos_t&
|
|||||||
MetricPositionChanged (); // Emit Signal
|
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
|
void
|
||||||
TempoMap::add_tempo (const Tempo& tempo, double where, ARDOUR::TempoSection::Type type)
|
TempoMap::add_tempo (const Tempo& tempo, double where, ARDOUR::TempoSection::Type type)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user