summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2016-03-26 06:16:47 +1100
committernick_m <mainsbridge@gmail.com>2016-05-27 23:38:12 +1000
commita64e46a6b3a6eda0a75103dc81b2c369b8306c95 (patch)
tree3657ff420df78398fe1a0ae011c06e6ab6fba0e0
parenta84527cd17fd375cb16268970260863fb5549952 (diff)
Tempo ramps - allow constraint-drag of first tempo.
-rw-r--r--gtk2_ardour/editor_drag.cc20
-rw-r--r--gtk2_ardour/editor_drag.h1
2 files changed, 8 insertions, 13 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index 71367d7a62..863d0da04a 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -3254,6 +3254,7 @@ TempoMarkerDrag::TempoMarkerDrag (Editor* e, ArdourCanvas::Item* i, bool c)
_marker = reinterpret_cast<TempoMarker*> (_item->get_data ("marker"));
_real_section = &_marker->tempo();
+ _movable = _real_section->movable();
assert (_marker);
}
@@ -3273,11 +3274,7 @@ TempoMarkerDrag::setup_pointer_frame_offset ()
void
TempoMarkerDrag::motion (GdkEvent* event, bool first_move)
{
- if (!_marker->tempo().movable()) {
- return;
- }
-
- if (first_move) {
+ if (first_move && _movable) {
// create a dummy marker for visual representation of moving the
// section, because whether its a copy or not, we're going to
@@ -3314,13 +3311,14 @@ TempoMarkerDrag::motion (GdkEvent* event, bool first_move)
framepos_t const pf = adjusted_current_frame (event);
Tempo const tp = _marker->tempo();
- _marker->set_position (pf);
if (Keyboard::modifier_state_equals (event->button.state, ArdourKeyboard::constraint_modifier ())) {
- double new_bpm = tp.beats_per_minute() + ((grab_y() - current_pointer_y()) / 4.0);
- _real_section->set_beats_per_minute (new_bpm);
+ //_marker->set_position (pf);
+ double new_bpm = _real_section->beats_per_minute() + ((last_pointer_y() - current_pointer_y()) / 5.0);
_editor->session()->tempo_map().gui_change_tempo (_real_section, Tempo (new_bpm, _real_section->note_type()));
- } else {
+ } else if (_movable) {
+
+ _marker->set_position (pf);
/* just here for a check/laugh
if (_real_section->position_lock_style() == MusicTime) {
const double baf = _editor->session()->tempo_map().beat_at_frame (pf);
@@ -3344,10 +3342,6 @@ TempoMarkerDrag::finished (GdkEvent* event, bool movement_occurred)
return;
}
- if (!_marker->tempo().movable()) {
- return;
- }
-
//motion (event, false);
TempoMap& map (_editor->session()->tempo_map());
diff --git a/gtk2_ardour/editor_drag.h b/gtk2_ardour/editor_drag.h
index 1864514753..caee8ad6ba 100644
--- a/gtk2_ardour/editor_drag.h
+++ b/gtk2_ardour/editor_drag.h
@@ -737,6 +737,7 @@ private:
ARDOUR::TempoSection* _real_section;
bool _copy;
+ bool _movable;
XMLNode* before_state;
};