From 042445d4f178043cb97aa0388f5bc9a65fcac2df Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 21 Oct 2011 17:40:47 +0000 Subject: Simplify LV2Features. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3561 a436a847-0d15-0410-975c-d299462d15a1 --- src/shared/LV2Features.hpp | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'src/shared/LV2Features.hpp') 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 -#include #include #include "lv2/lv2plug.in/ns/lv2core/lv2.h" @@ -43,6 +41,7 @@ public: class Feature { public: virtual ~Feature() {} + virtual SharedPtr feature(Shared::World* world, Node* node) = 0; }; @@ -51,18 +50,9 @@ public: public: typedef std::vector< SharedPtr > 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(const std::string& uri); - - void add_feature(const std::string& uri, SharedPtr feature); + void add_feature(SharedPtr feature); SharedPtr lv2_features(Shared::World* world, Node* node) const; private: - typedef std::map< std::string, SharedPtr > Features; + typedef std::vector< SharedPtr > Features; Features _features; }; -- cgit v1.2.1