Plugin API Reference

The host ↔ plugin C ABI for Mcaster1AMP Plugin SDK v2 (AMP_PLUGIN_API_VERSION 2). Download the SDK →

Lifecycle — required by all plugin types

ExportSignatureNotes
amp_plugin_infoconst AmpPluginInfo* (void)Static metadata; api_version must equal 2.
amp_plugin_initint (const AmpHostContext*)Return 0 = OK. Receives sample rate, channels, buffer size, data dir, log.
amp_plugin_shutdownvoid (void)Cleanup before the library is unloaded.

DSP — type 1 (AMP_PLUGIN_DSP)

ExportSignatureThread
amp_plugin_dsp_process requiredvoid (float* samples, int frames, int channels)audio — realtime-safe, in place, interleaved PCM [-1,1]

Input — type 2 (AMP_PLUGIN_INPUT)

ExportSignatureReturns
amp_plugin_input_can_decodeint (const char* ext)1 if you handle this extension
amp_plugin_input_openvoid* (const char* path, int* sr, int* ch)opaque handle (sets sample rate + channels)
amp_plugin_input_readint (void* h, float* buf, int maxFrames)frames produced (0 = EOF)
amp_plugin_input_closevoid (void* h)—

Visualization — type 3 (AMP_PLUGIN_VISUALIZATION)

ExportSignatureThread
amp_plugin_vis_push requiredvoid (const float* samples, int frames, int channels)audio — copy to a lock-free buffer, render off-thread

Crossfader — type 4 (AMP_PLUGIN_CROSSFADER)

ExportSignatureNotes
amp_plugin_crossfader_blend requiredvoid (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)

ExportSignature
amp_plugin_set_paramvoid (const char* name, double value)
amp_plugin_get_paramdouble (const char* name)
amp_plugin_get_param_countint (void)
amp_plugin_get_param_infoconst 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)

ExportSignature
amp_plugin_create_uivoid* (void* parent_qwidget) → returns QWidget*
amp_plugin_destroy_uivoid (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.