Advertisement
Guest User

Untitled

a guest
Sep 17th, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.08 KB | None | 0 0
  1. typedef struct {
  2.     const char* uri;
  3.     LV2_URID    urid;
  4.     LV2_Atom*   value;
  5. } StateKey;
  6.  
  7. static LV2_Handle
  8. instantiate(const LV2_Descriptor*     descriptor,
  9.             double                    rate,
  10.             const char*               path,
  11.             const LV2_Feature* const* features)
  12. {
  13.     /* ... */
  14.     State*   state        = &self->state;
  15.     StateKey state_dict[] = {
  16.         { EG_PARAMS_URI "#int",    0, (LV2_Atom*)&state->aint },
  17.         { EG_PARAMS_URI "#long",   0, (LV2_Atom*)&state->along },
  18.         { EG_PARAMS_URI "#float",  0, (LV2_Atom*)&state->afloat },
  19.         { EG_PARAMS_URI "#double", 0, (LV2_Atom*)&state->adouble },
  20.         { EG_PARAMS_URI "#bool",   0, (LV2_Atom*)&state->abool },
  21.         { EG_PARAMS_URI "#string", 0, (LV2_Atom*)&state->astring },
  22.         { EG_PARAMS_URI "#path",   0, (LV2_Atom*)&state->apath },
  23.         { EG_PARAMS_URI "#lfo",    0, (LV2_Atom*)&state->lfo },
  24.         { EG_PARAMS_URI "#spring", 0, (LV2_Atom*)&state->spring },
  25.         { NULL, 0, NULL }
  26.     };
  27.  
  28.     for (StateKey* entry = state_dict; entry->uri; entry++) {
  29.         entry->urid = self->map->map(self->map->handle, entry->uri);
  30.     }
  31.  
  32.     /* ... */
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement