mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-07 14:15:46 +01:00
API for adjusting step duration (gate length)
This commit is contained in:
parent
f127739bcb
commit
870b142f9b
2 changed files with 18 additions and 0 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue