diff options
Diffstat (limited to 'src/client/BlockModel.cpp')
-rw-r--r-- | src/client/BlockModel.cpp | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/client/BlockModel.cpp b/src/client/BlockModel.cpp index cdfb3fcd..998c118d 100644 --- a/src/client/BlockModel.cpp +++ b/src/client/BlockModel.cpp @@ -26,7 +26,6 @@ #include "raul/Path.hpp" #include "raul/Symbol.hpp" -#include <algorithm> #include <cassert> #include <cmath> #include <cstdlib> @@ -35,8 +34,7 @@ #include <string> #include <utility> -namespace ingen { -namespace client { +namespace ingen::client { BlockModel::BlockModel(URIs& uris, const std::shared_ptr<PluginModel>& plugin, @@ -47,8 +45,7 @@ BlockModel::BlockModel(URIs& uris, , _num_values(0) , _min_values(nullptr) , _max_values(nullptr) -{ -} +{} BlockModel::BlockModel(URIs& uris, URI plugin_uri, const raul::Path& path) : ObjectModel(uris, path) @@ -56,8 +53,7 @@ BlockModel::BlockModel(URIs& uris, URI plugin_uri, const raul::Path& path) , _num_values(0) , _min_values(nullptr) , _max_values(nullptr) -{ -} +{} BlockModel::BlockModel(const BlockModel& copy) : ObjectModel(copy) @@ -206,8 +202,9 @@ BlockModel::default_port_value_range( } if (port->port_property(_uris.lv2_sampleRate)) { - min *= srate; - max *= srate; + const auto frate = static_cast<float>(srate); + min *= frate; + max *= frate; } } @@ -236,8 +233,9 @@ BlockModel::port_value_range(const std::shared_ptr<const PortModel>& port, } if (port->port_property(_uris.lv2_sampleRate)) { - min *= srate; - max *= srate; + const auto frate = static_cast<float>(srate); + min *= frate; + max *= frate; } } @@ -247,11 +245,13 @@ BlockModel::label() const const Atom& name_property = get_property(_uris.lv2_name); if (name_property.type() == _uris.forge.String) { return name_property.ptr<char>(); - } else if (plugin_model()) { + } + + if (plugin_model()) { return plugin_model()->human_name(); - } else { - return symbol().c_str(); } + + return symbol().c_str(); } std::string @@ -293,5 +293,4 @@ BlockModel::set(const std::shared_ptr<ObjectModel>& model) ObjectModel::set(model); } -} // namespace client -} // namespace ingen +} // namespace ingen::client |