diff options
author | David Robillard <d@drobilla.net> | 2017-12-25 15:26:48 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2017-12-25 16:26:13 -0500 |
commit | 15b3b0e9f8823752f80c7e597a70749813e61c79 (patch) | |
tree | 3f324c6e2a455be8b929456dadbf06520889d435 /src/server/internals | |
parent | d6a9571641bcb34acb3521feb08eea33195fd9ca (diff) | |
download | ingen-15b3b0e9f8823752f80c7e597a70749813e61c79.tar.gz ingen-15b3b0e9f8823752f80c7e597a70749813e61c79.tar.bz2 ingen-15b3b0e9f8823752f80c7e597a70749813e61c79.zip |
Always use braces
Diffstat (limited to 'src/server/internals')
-rw-r--r-- | src/server/internals/Controller.cpp | 3 | ||||
-rw-r--r-- | src/server/internals/Note.cpp | 15 |
2 files changed, 12 insertions, 6 deletions
diff --git a/src/server/internals/Controller.cpp b/src/server/internals/Controller.cpp index 0366cbf0..36c735ce 100644 --- a/src/server/internals/Controller.cpp +++ b/src/server/internals/Controller.cpp @@ -157,8 +157,9 @@ ControllerNode::control(RunContext& context, uint8_t control_num, uint8_t val, F if (log_port_val > 0.0f) { // haaaaack, stupid negatives and logarithms Sample log_offset = 0; - if (min_port_val < 0) + if (min_port_val < 0) { log_offset = fabs(min_port_val); + } const Sample min = log(min_port_val + 1 + log_offset); const Sample max = log(max_port_val + 1 + log_offset); scaled_value = expf(nval * (max - min) + min) - 1 - log_offset; diff --git a/src/server/internals/Note.cpp b/src/server/internals/Note.cpp index 9b157d54..dc282417 100644 --- a/src/server/internals/Note.cpp +++ b/src/server/internals/Note.cpp @@ -130,13 +130,15 @@ NoteNode::NoteNode(InternalPlugin* plugin, bool NoteNode::prepare_poly(BufferFactory& bufs, uint32_t poly) { - if (!_polyphonic) + if (!_polyphonic) { return true; + } BlockImpl::prepare_poly(bufs, poly); - if (_prepared_voices && poly <= _prepared_voices->size()) + if (_prepared_voices && poly <= _prepared_voices->size()) { return true; + } _prepared_voices = bufs.maid().make_managed<Voices>( poly, *_voices, Voice()); @@ -147,8 +149,9 @@ NoteNode::prepare_poly(BufferFactory& bufs, uint32_t poly) bool NoteNode::apply_poly(RunContext& context, uint32_t poly) { - if (!BlockImpl::apply_poly(context, poly)) + if (!BlockImpl::apply_poly(context, poly)) { return false; + } if (_prepared_voices) { assert(_polyphony <= _prepared_voices->size()); @@ -383,9 +386,11 @@ NoteNode::sustain_off(RunContext& context, FrameTime time) _sustain = false; - for (uint32_t i=0; i < _polyphony; ++i) - if ((*_voices)[i].state == Voice::State::HOLDING) + for (uint32_t i=0; i < _polyphony; ++i) { + if ((*_voices)[i].state == Voice::State::HOLDING) { free_voice(context, i, time); + } + } } void |