diff --git a/libs/ardour/ardour/step_sequencer.h b/libs/ardour/ardour/step_sequencer.h index c15d1c2ac6..8396002438 100644 --- a/libs/ardour/ardour/step_sequencer.h +++ b/libs/ardour/ardour/step_sequencer.h @@ -59,6 +59,7 @@ class Step : public PBD::Stateful { void adjust_velocity (int amt); void adjust_pitch (int amt); + void adjust_duration (double amt); void adjust_octave (int amt); Mode mode() const { return _mode; } diff --git a/libs/ardour/step_sequencer.cc b/libs/ardour/step_sequencer.cc index 07e9d6ecae..43c180cccb 100644 --- a/libs/ardour/step_sequencer.cc +++ b/libs/ardour/step_sequencer.cc @@ -104,6 +104,23 @@ Step::set_enabled (bool yn) _enabled = yn; } +void +Step::adjust_duration (double amt) +{ + const double new_dur = _duration + amt; + + if (new_dur > 1.0) { + _duration = 1.0; + } else if (new_dur < 1.0/64.0) { + _duration = 0.0; + } else { + _duration = new_dur; + } + + PropertyChange pc; + PropertyChanged (pc); +} + void Step::adjust_pitch (int amt) {