summaryrefslogtreecommitdiffstats
path: root/src/server/LV2Plugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/LV2Plugin.cpp')
-rw-r--r--src/server/LV2Plugin.cpp33
1 files changed, 17 insertions, 16 deletions
diff --git a/src/server/LV2Plugin.cpp b/src/server/LV2Plugin.cpp
index 7a43ba67..87072ab0 100644
--- a/src/server/LV2Plugin.cpp
+++ b/src/server/LV2Plugin.cpp
@@ -19,16 +19,18 @@
#include "Engine.hpp"
#include "LV2Block.hpp"
-#include "ingen/Forge.hpp"
-#include "ingen/Log.hpp"
-#include "ingen/URIs.hpp"
-#include "ingen/World.hpp"
+#include <ingen/Forge.hpp>
+#include <ingen/Log.hpp>
+#include <ingen/URI.hpp>
+#include <ingen/URIs.hpp>
+#include <ingen/World.hpp>
+#include <lilv/lilv.h>
+#include <raul/Symbol.hpp>
#include <cstdlib>
#include <string>
-namespace ingen {
-namespace server {
+namespace ingen::server {
LV2Plugin::LV2Plugin(World& world, const LilvPlugin* lplugin)
: PluginImpl(world.uris(),
@@ -70,18 +72,18 @@ LV2Plugin::symbol() const
{
std::string working = uri();
if (working.back() == '/') {
- working = working.substr(0, working.length() - 1);
+ working.resize(working.length() - 1);
}
- while (working.length() > 0) {
- size_t last_slash = working.find_last_of('/');
+ while (!working.empty()) {
+ const size_t last_slash = working.find_last_of('/');
const std::string symbol = working.substr(last_slash+1);
if ( (symbol[0] >= 'a' && symbol[0] <= 'z')
|| (symbol[0] >= 'A' && symbol[0] <= 'Z') ) {
return raul::Symbol::symbolify(symbol);
- } else {
- working = working.substr(0, last_slash);
}
+
+ working.resize(last_slash);
}
return raul::Symbol("lv2_symbol");
@@ -101,9 +103,9 @@ LV2Plugin::instantiate(BufferFactory& bufs,
if (!b->instantiate(bufs, state)) {
delete b;
return nullptr;
- } else {
- return b;
}
+
+ return b;
}
void
@@ -114,7 +116,7 @@ LV2Plugin::load_presets()
LilvNodes* presets = lilv_plugin_get_related(_lilv_plugin, uris.pset_Preset);
if (presets) {
- LILV_FOREACH(nodes, i, presets) {
+ LILV_FOREACH (nodes, i, presets) {
const LilvNode* preset = lilv_nodes_get(presets, i);
lilv_world_load_resource(lworld, preset);
@@ -140,5 +142,4 @@ LV2Plugin::load_presets()
PluginImpl::load_presets();
}
-} // namespace server
-} // namespace ingen
+} // namespace ingen::server