summaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-12-13 01:19:10 -0500
committerDavid Robillard <d@drobilla.net>2022-12-14 18:04:27 -0500
commitfa611574101cd657a0716aaf2028b5bc852d4a8a (patch)
tree7fce4411abeaa06a5eb33ebcb13c317743d4cada /src/client
parent4b56cdf7a925dafd5e4ac085874d2afe294ec456 (diff)
downloadingen-fa611574101cd657a0716aaf2028b5bc852d4a8a.tar.gz
ingen-fa611574101cd657a0716aaf2028b5bc852d4a8a.tar.bz2
ingen-fa611574101cd657a0716aaf2028b5bc852d4a8a.zip
Use std::optional
Diffstat (limited to 'src/client')
-rw-r--r--src/client/PluginModel.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp
index 306846ee..4e0391f2 100644
--- a/src/client/PluginModel.cpp
+++ b/src/client/PluginModel.cpp
@@ -20,8 +20,6 @@
#include "ingen/client/PluginUI.hpp"
#include "lv2/core/lv2.h"
-#include <boost/optional/optional.hpp>
-
#include <cctype>
#include <cstring>
#include <memory>
@@ -115,32 +113,32 @@ PluginModel::get_property(const URI& key) const
}
if (_lilv_plugin) {
- boost::optional<const Atom&> ret;
- LilvNode* lv2_pred = lilv_new_uri(_lilv_world, key.c_str());
- LilvNodes* values = lilv_plugin_get_value(_lilv_plugin, lv2_pred);
+ const Atom* ret = nullptr;
+ LilvNode* lv2_pred = lilv_new_uri(_lilv_world, key.c_str());
+ LilvNodes* values = lilv_plugin_get_value(_lilv_plugin, lv2_pred);
lilv_node_free(lv2_pred);
LILV_FOREACH (nodes, i, values) {
const LilvNode* value = lilv_nodes_get(values, i);
if (lilv_node_is_uri(value)) {
- ret = set_property(
+ ret = &set_property(
key, _uris.forge.make_urid(URI(lilv_node_as_uri(value))));
break;
}
if (lilv_node_is_string(value)) {
- ret = set_property(
+ ret = &set_property(
key, _uris.forge.alloc(lilv_node_as_string(value)));
break;
}
if (lilv_node_is_float(value)) {
- ret = set_property(
+ ret = &set_property(
key, _uris.forge.make(lilv_node_as_float(value)));
break;
}
if (lilv_node_is_int(value)) {
- ret = set_property(
+ ret = &set_property(
key, _uris.forge.make(lilv_node_as_int(value)));
break;
}