Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef struct {
- const char* uri;
- LV2_URID urid;
- LV2_Atom* value;
- } StateKey;
- static LV2_Handle
- instantiate(const LV2_Descriptor* descriptor,
- double rate,
- const char* path,
- const LV2_Feature* const* features)
- {
- /* ... */
- State* state = &self->state;
- StateKey state_dict[] = {
- { EG_PARAMS_URI "#int", 0, (LV2_Atom*)&state->aint },
- { EG_PARAMS_URI "#long", 0, (LV2_Atom*)&state->along },
- { EG_PARAMS_URI "#float", 0, (LV2_Atom*)&state->afloat },
- { EG_PARAMS_URI "#double", 0, (LV2_Atom*)&state->adouble },
- { EG_PARAMS_URI "#bool", 0, (LV2_Atom*)&state->abool },
- { EG_PARAMS_URI "#string", 0, (LV2_Atom*)&state->astring },
- { EG_PARAMS_URI "#path", 0, (LV2_Atom*)&state->apath },
- { EG_PARAMS_URI "#lfo", 0, (LV2_Atom*)&state->lfo },
- { EG_PARAMS_URI "#spring", 0, (LV2_Atom*)&state->spring },
- { NULL, 0, NULL }
- };
- for (StateKey* entry = state_dict; entry->uri; entry++) {
- entry->urid = self->map->map(self->map->handle, entry->uri);
- }
- /* ... */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement