diff options
author | David Robillard <d@drobilla.net> | 2010-12-17 05:06:39 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-12-17 05:06:39 +0000 |
commit | 623a23dcd7bf6910a10594dc2599f31574c93860 (patch) | |
tree | b86b25c0cf168b3369e83a8c347e140abcd79a54 /src/engine | |
parent | c5d81c429f913c16c1d616b6737dd12d4d5996c2 (diff) | |
download | machina-623a23dcd7bf6910a10594dc2599f31574c93860.tar.gz machina-623a23dcd7bf6910a10594dc2599f31574c93860.tar.bz2 machina-623a23dcd7bf6910a10594dc2599f31574c93860.zip |
Fix node duration when step recording.
git-svn-id: http://svn.drobilla.net/lad/trunk/machina@2738 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/MachineBuilder.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/engine/MachineBuilder.cpp b/src/engine/MachineBuilder.cpp index 7c65feb..3078cc2 100644 --- a/src/engine/MachineBuilder.cpp +++ b/src/engine/MachineBuilder.cpp @@ -63,6 +63,11 @@ MachineBuilder::is_delay_node(SharedPtr<Node> node) const void MachineBuilder::set_node_duration(SharedPtr<Node> node, Raul::TimeDuration d) const { + if (_step) { + node->set_duration(TimeStamp(d.unit(), 1, 0)); + return; + } + Raul::TimeStamp q_dur = Quantizer::quantize(TimeStamp(d.unit(), _quantization), d); // Never quantize a note to duration 0 @@ -172,10 +177,7 @@ MachineBuilder::event(Raul::TimeStamp time_offset, SharedPtr<Node> resolved = *i; resolved->set_exit_action(SharedPtr<Action>(new MidiAction(ev_size, buf))); - if (_step) - set_node_duration(resolved, TimeStamp(t.unit())); - else - set_node_duration(resolved, t - resolved->enter_time()); + set_node_duration(resolved, t - resolved->enter_time()); // Last active note if (_active_nodes.size() == 1) { |