25 #ifndef LVTK_OPTIONS_HPP
26 #define LVTK_OPTIONS_HPP
28 #include <lv2/lv2plug.in/ns/ext/options/options.h>
31 #ifndef LVTK_OPTIONS_IFACE
32 #define LVTK_OPTIONS_IFACE 1
76 : index (0),m_size (0), p_opts (options)
86 if (p_opts == 0 || (p_opts[index].key == 0 &&
87 p_opts[index].value == 0))
90 return &p_opts[index++];
93 uint32_t size()
const {
return m_size; }
118 template <
bool Required = false>
122 template <
class Derived>
123 struct I : Extension<Required>
127 I() : p_supplied_opts (0) { }
140 Derived* plugin (reinterpret_cast<Derived*> (instance));
142 mixin->p_supplied_opts = (
Option*) data;
151 std::clog <<
" [Options] validation "
152 <<(this->m_ok ?
"succeeded" :
"failed")<<
"."<<std::endl;
161 #if LVTK_OPTIONS_IFACE
162 if (! strcmp (uri, LV2_OPTIONS__interface)) {
216 static uint32_t _get (LV2_Handle handle, LV2_Options_Option* options)
218 Derived* plugin (reinterpret_cast<Derived*> (handle));
219 return plugin->get_options (options);
222 static uint32_t _set (LV2_Handle handle,
const LV2_Options_Option* options)
224 Derived* plugin (reinterpret_cast<Derived*> (handle));
225 return plugin->set_options (options);