LV2 Toolkit  1.2.0
feature.hpp
1 /*
2  feature.hpp - Support file for writing LV2 plugins in C++
3  Copyright (C) 2012 Michael Fisher <mfisher31@gmail.com>
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 3 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 01222-1307 USA
18 */
25 #ifndef LVTK_FEATURE_HPP
26 #define LVTK_FEATURE_HPP
27 
28 #include <map>
29 #include <string>
30 #include <vector>
31 
32 #include <lv2/lv2plug.in/ns/lv2core/lv2.h>
33 
34 namespace lvtk {
35 
36  using std::map;
37  using std::string;
38  using std::vector;
39 
41  typedef LV2_Feature Feature;
42 
44  typedef vector<const Feature*> FeatureVec;
45 
47  typedef void* FeatureData;
48 
54  typedef void(*FeatureHandler)(void* instance, void* data);
55 
57  typedef map<string, FeatureHandler> FeatureHandlerMap;
58 
60  {
61  public:
62  FeatureIter (const Feature* const* features)
63  : m_index (0), p_feats (features) { }
64 
65  inline const Feature*
66  next()
67  {
68  if (NULL == p_feats[m_index])
69  return NULL;
70  return p_feats[m_index++];
71  }
72 
73  private:
74  uint32_t m_index;
75  const Feature* const* p_feats;
76  };
77 } /* namespace lvtk */
78 
79 #endif /* LVTK_FEATURE_HPP */
void(* FeatureHandler)(void *instance, void *data)
Definition: feature.hpp:54
void * FeatureData
Definition: feature.hpp:47
LV2_Feature Feature
Definition: feature.hpp:41
Definition: feature.hpp:34
vector< const Feature * > FeatureVec
Definition: feature.hpp:44
Definition: feature.hpp:59
map< string, FeatureHandler > FeatureHandlerMap
Definition: feature.hpp:57