23 #ifndef LVTK_BUFSIZE_HPP 24 #define LVTK_BUFSIZE_HPP 27 #include <lv2/lv2plug.in/ns/ext/buf-size/buf-size.h> 29 #include <lvtk/ext/options.hpp> 30 #include <lvtk/ext/urid.hpp> 37 uint32_t sequence_size;
52 template <
bool Required = false>
55 template <
class Derived>
56 struct I : Extension<Required>
59 I() : m_checked (false)
78 Derived* plugin (reinterpret_cast<Derived*> (instance));
80 mixin->m_info.bounded =
true;
85 handle_poweroftwo (
void* instance,
FeatureData data)
87 Derived* plugin (reinterpret_cast<Derived*> (instance));
89 mixin->m_info.power_of_two =
true;
96 Derived* plugin (reinterpret_cast<Derived*> (instance));
98 mixin->m_info.fixed =
true;
105 std::clog <<
" [BufSize] validation " 106 <<(this->m_ok ?
"succeeded" :
"failed")<<
"."<<std::endl;
119 Derived* plugin (static_cast<Derived*> (
this));
120 LV2_URID min (plugin->map (LV2_BUF_SIZE__minBlockLength));
121 LV2_URID max (plugin->map (LV2_BUF_SIZE__maxBlockLength));
122 LV2_URID seq_size (plugin->map (LV2_BUF_SIZE__sequenceSize));
125 while (
const Option* opt = iter.next())
128 m_info.min = *(uint32_t*) opt->value;
130 m_info.max = *(uint32_t*) opt->value;
131 if (seq_size == opt->key)
132 m_info.sequence_size = *(uint32_t*) opt->value;
void * FeatureData
Definition: feature.hpp:47
Definition: bufsize.hpp:53
Definition: options.hpp:81
Definition: bufsize.hpp:56
Definition: feature.hpp:34
static void map_feature_handlers(FeatureHandlerMap &hmap)
Definition: bufsize.hpp:67
LV2_Options_Option Option
Definition: options.hpp:39
const BufferInfo & get_buffer_info()
Definition: bufsize.hpp:115
I()
Definition: bufsize.hpp:59
Definition: bufsize.hpp:34
map< string, FeatureHandler > FeatureHandlerMap
Definition: feature.hpp:57