summaryrefslogtreecommitdiffstats
path: root/src/shared/LV2Features.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-10-21 17:40:47 +0000
committerDavid Robillard <d@drobilla.net>2011-10-21 17:40:47 +0000
commit042445d4f178043cb97aa0388f5bc9a65fcac2df (patch)
tree8c78656c6c326eb5409467aced5658c56e7bdd74 /src/shared/LV2Features.hpp
parentefe47ea54e71b359dde85c0f272e7fc3934b85e3 (diff)
downloadingen-042445d4f178043cb97aa0388f5bc9a65fcac2df.tar.gz
ingen-042445d4f178043cb97aa0388f5bc9a65fcac2df.tar.bz2
ingen-042445d4f178043cb97aa0388f5bc9a65fcac2df.zip
Simplify LV2Features.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3561 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/shared/LV2Features.hpp')
-rw-r--r--src/shared/LV2Features.hpp22
1 files changed, 5 insertions, 17 deletions
diff --git a/src/shared/LV2Features.hpp b/src/shared/LV2Features.hpp
index 75bbcda3..f33cc605 100644
--- a/src/shared/LV2Features.hpp
+++ b/src/shared/LV2Features.hpp
@@ -18,8 +18,6 @@
#ifndef INGEN_SHARED_LV2FEATURES_HPP
#define INGEN_SHARED_LV2FEATURES_HPP
-#include <map>
-#include <string>
#include <vector>
#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
@@ -43,6 +41,7 @@ public:
class Feature {
public:
virtual ~Feature() {}
+
virtual SharedPtr<LV2_Feature> feature(Shared::World* world,
Node* node) = 0;
};
@@ -51,18 +50,9 @@ public:
public:
typedef std::vector< SharedPtr<LV2_Feature> > FeatureVector;
- explicit FeatureArray(FeatureVector& features)
- : _features(features)
- {
- _array = (LV2_Feature**)malloc(sizeof(LV2_Feature) * (features.size() + 1));
- _array[features.size()] = NULL;
- for (size_t i = 0; i < features.size(); ++i)
- _array[i] = features[i].get();
- }
+ explicit FeatureArray(FeatureVector& features);
- ~FeatureArray() {
- free(_array);
- }
+ ~FeatureArray();
LV2_Feature** array() { return _array; }
@@ -71,15 +61,13 @@ public:
LV2_Feature** _array;
};
- SharedPtr<Feature> feature(const std::string& uri);
-
- void add_feature(const std::string& uri, SharedPtr<Feature> feature);
+ void add_feature(SharedPtr<Feature> feature);
SharedPtr<FeatureArray> lv2_features(Shared::World* world,
Node* node) const;
private:
- typedef std::map< std::string, SharedPtr<Feature> > Features;
+ typedef std::vector< SharedPtr<Feature> > Features;
Features _features;
};