API for adjusting step duration (gate length)
This commit is contained in:
@@ -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; }
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user