summaryrefslogtreecommitdiffstats
path: root/src/client/BlockModel.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2017-12-25 15:26:48 -0500
committerDavid Robillard <d@drobilla.net>2017-12-25 16:26:13 -0500
commit15b3b0e9f8823752f80c7e597a70749813e61c79 (patch)
tree3f324c6e2a455be8b929456dadbf06520889d435 /src/client/BlockModel.cpp
parentd6a9571641bcb34acb3521feb08eea33195fd9ca (diff)
downloadingen-15b3b0e9f8823752f80c7e597a70749813e61c79.tar.gz
ingen-15b3b0e9f8823752f80c7e597a70749813e61c79.tar.bz2
ingen-15b3b0e9f8823752f80c7e597a70749813e61c79.zip
Always use braces
Diffstat (limited to 'src/client/BlockModel.cpp')
-rw-r--r--src/client/BlockModel.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/client/BlockModel.cpp b/src/client/BlockModel.cpp
index a5f2eef0..95819c1e 100644
--- a/src/client/BlockModel.cpp
+++ b/src/client/BlockModel.cpp
@@ -143,9 +143,11 @@ BlockModel::add_port(SPtr<PortModel> pm)
SPtr<const PortModel>
BlockModel::get_port(const Raul::Symbol& symbol) const
{
- for (auto p : _ports)
- if (p->symbol() == symbol)
+ for (auto p : _ports) {
+ if (p->symbol() == symbol) {
return p;
+ }
+ }
return SPtr<PortModel>();
}
@@ -183,10 +185,12 @@ BlockModel::default_port_value_range(SPtr<const PortModel> port,
_min_values, _max_values, nullptr);
}
- if (!std::isnan(_min_values[port->index()]))
+ if (!std::isnan(_min_values[port->index()])) {
min = _min_values[port->index()];
- if (!std::isnan(_max_values[port->index()]))
+ }
+ if (!std::isnan(_max_values[port->index()])) {
max = _max_values[port->index()];
+ }
}
if (port->port_property(_uris.lv2_sampleRate)) {
@@ -208,13 +212,16 @@ BlockModel::port_value_range(SPtr<const PortModel> port,
// Possibly overriden
const Atom& min_atom = port->get_property(_uris.lv2_minimum);
const Atom& max_atom = port->get_property(_uris.lv2_maximum);
- if (min_atom.type() == _uris.forge.Float)
+ if (min_atom.type() == _uris.forge.Float) {
min = min_atom.get<float>();
- if (max_atom.type() == _uris.forge.Float)
+ }
+ if (max_atom.type() == _uris.forge.Float) {
max = max_atom.get<float>();
+ }
- if (max <= min)
+ if (max <= min) {
max = min + 1.0;
+ }
if (port->port_property(_uris.lv2_sampleRate)) {
min *= srate;