mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 23:35:03 +01:00
tempo mapping: MappingTwist drag should differentiate between ramped and constant twist
TODO: probably break these into separate ::Drag classes
This commit is contained in:
parent
c452a4816c
commit
ca5e56f98c
3 changed files with 12 additions and 7 deletions
|
|
@ -3588,7 +3588,8 @@ MappingTwistDrag::MappingTwistDrag (Editor* e, ArdourCanvas::Item* i, Temporal::
|
||||||
TempoPoint& prv,
|
TempoPoint& prv,
|
||||||
TempoPoint& fcus,
|
TempoPoint& fcus,
|
||||||
TempoPoint& nxt,
|
TempoPoint& nxt,
|
||||||
XMLNode& before)
|
XMLNode& before,
|
||||||
|
bool ramped)
|
||||||
: Drag (e, i, Temporal::BeatTime)
|
: Drag (e, i, Temporal::BeatTime)
|
||||||
, prev (prv)
|
, prev (prv)
|
||||||
, focus (fcus)
|
, focus (fcus)
|
||||||
|
|
@ -3598,6 +3599,7 @@ MappingTwistDrag::MappingTwistDrag (Editor* e, ArdourCanvas::Item* i, Temporal::
|
||||||
, delta (0.)
|
, delta (0.)
|
||||||
, _before_state (&before)
|
, _before_state (&before)
|
||||||
, _drag_valid (true)
|
, _drag_valid (true)
|
||||||
|
, _do_ramp (ramped)
|
||||||
{
|
{
|
||||||
DEBUG_TRACE (DEBUG::Drags, "New MappingTwistDrag\n");
|
DEBUG_TRACE (DEBUG::Drags, "New MappingTwistDrag\n");
|
||||||
initial_focus_npm = focus.note_types_per_minute ();
|
initial_focus_npm = focus.note_types_per_minute ();
|
||||||
|
|
@ -3660,11 +3662,10 @@ MappingTwistDrag::motion (GdkEvent* event, bool first_move)
|
||||||
delta += scaling_factor * pixel_distance;
|
delta += scaling_factor * pixel_distance;
|
||||||
std::cerr << "pixels " << pixel_distance << " spp " << spp << " SF " << scaling_factor << " delta = " << delta << std::endl;
|
std::cerr << "pixels " << pixel_distance << " spp " << spp << " SF " << scaling_factor << " delta = " << delta << std::endl;
|
||||||
|
|
||||||
bool do_a_ramp = true; // @ben
|
if (_do_ramp) {
|
||||||
if (do_a_ramp) {
|
map->ramped_twist_tempi (prev, focus, next, initial_focus_npm + delta); //was: PRE ... maybe we don't need 2 anymore?
|
||||||
map->ramped_twist_tempi (prev, focus, next, initial_pre_npm + delta);
|
|
||||||
} else {
|
} else {
|
||||||
map->linear_twist_tempi (prev, focus, next, initial_focus_npm + delta);
|
map->constant_twist_tempi (prev, focus, next, initial_focus_npm + delta);
|
||||||
}
|
}
|
||||||
_editor->mid_tempo_change (Editor::MappingChanged);
|
_editor->mid_tempo_change (Editor::MappingChanged);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -957,7 +957,8 @@ public:
|
||||||
Temporal::TempoPoint& prev,
|
Temporal::TempoPoint& prev,
|
||||||
Temporal::TempoPoint& focus,
|
Temporal::TempoPoint& focus,
|
||||||
Temporal::TempoPoint& next,
|
Temporal::TempoPoint& next,
|
||||||
XMLNode&);
|
XMLNode&,
|
||||||
|
bool ramped);
|
||||||
|
|
||||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||||
void motion (GdkEvent *, bool);
|
void motion (GdkEvent *, bool);
|
||||||
|
|
@ -992,6 +993,7 @@ private:
|
||||||
|
|
||||||
XMLNode* _before_state;
|
XMLNode* _before_state;
|
||||||
bool _drag_valid;
|
bool _drag_valid;
|
||||||
|
bool _do_ramp;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3001,7 +3001,9 @@ Editor::choose_mapping_drag (ArdourCanvas::Item* item, GdkEvent* event)
|
||||||
|
|
||||||
/* special case 3: if we are on the left side of the LAST marker: behave as if we clicked the marker prior*/
|
/* special case 3: if we are on the left side of the LAST marker: behave as if we clicked the marker prior*/
|
||||||
TempoPoint* after_after = const_cast<TempoPoint*> (map->next_tempo (*focus));
|
TempoPoint* after_after = const_cast<TempoPoint*> (map->next_tempo (*focus));
|
||||||
if (!after_after) {
|
if (after_after) {
|
||||||
|
after = after_after;
|
||||||
|
} else {
|
||||||
at_end = true;
|
at_end = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue