Lifecycle — required by all plugin types
| Export | Signature | Notes |
amp_plugin_info | const AmpPluginInfo* (void) | Static metadata; api_version must equal 2. |
amp_plugin_init | int (const AmpHostContext*) | Return 0 = OK. Receives sample rate, channels, buffer size, data dir, log. |
amp_plugin_shutdown | void (void) | Cleanup before the library is unloaded. |
DSP — type 1 (AMP_PLUGIN_DSP)
| Export | Signature | Thread |
amp_plugin_dsp_process required | void (float* samples, int frames, int channels) | audio — realtime-safe, in place, interleaved PCM [-1,1] |
| Export | Signature | Returns |
amp_plugin_input_can_decode | int (const char* ext) | 1 if you handle this extension |
amp_plugin_input_open | void* (const char* path, int* sr, int* ch) | opaque handle (sets sample rate + channels) |
amp_plugin_input_read | int (void* h, float* buf, int maxFrames) | frames produced (0 = EOF) |
amp_plugin_input_close | void (void* h) | — |
Visualization — type 3 (AMP_PLUGIN_VISUALIZATION)
| Export | Signature | Thread |
amp_plugin_vis_push required | void (const float* samples, int frames, int channels) | audio — copy to a lock-free buffer, render off-thread |
Crossfader — type 4 (AMP_PLUGIN_CROSSFADER)
| Export | Signature | Notes |
amp_plugin_crossfader_blend required | void (const float* a, const float* b, float* out, int frames, int ch, float position) | position 0=A · 0.5=equal · 1=B. Realtime-safe. |
Parameter API — optional (DSP + Crossfader)
| Export | Signature |
amp_plugin_set_param | void (const char* name, double value) |
amp_plugin_get_param | double (const char* name) |
amp_plugin_get_param_count | int (void) |
amp_plugin_get_param_info | const AmpParamInfo* (int index) |
Provide these and the host builds a generic parameter UI (sliders/dropdowns) automatically — no Qt required.
AmpParamInfo carries name, label, unit, min, max, default, is_enum, enum_names.
Custom Qt UI — optional (shared Qt runtime only)
| Export | Signature |
amp_plugin_create_ui | void* (void* parent_qwidget) → returns QWidget* |
amp_plugin_destroy_ui | void (void* widget) |
Only export these if your plugin
shares the host's Qt runtime. Bundling your own Qt? Use the parameter API instead.
Symbol-name constants
The header defines string constants for every export (e.g. AMP_SYM_INFO "amp_plugin_info",
AMP_SYM_DSP_PROCESS, AMP_SYM_CROSSFADER_BLEND) for safe dlsym/
GetProcAddress probing. The host rejects any plugin whose api_version ≠ 2.