Added VST SDK support.
This commit is contained in:
parent
a1482ec110
commit
8e09f58944
25 changed files with 850 additions and 23 deletions
|
|
@ -5,6 +5,13 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
static int loaded, instances;
|
||||
static struct Steinberg_Vst_ProcessContext last_context;
|
||||
void xtc_fixture_context(double *tempo, int64_t *position, double *music, uint32_t *flags);
|
||||
void xtc_fixture_context(double *tempo, int64_t *position, double *music, uint32_t *flags)
|
||||
{
|
||||
*tempo=last_context.tempo; *position=last_context.projectTimeSamples;
|
||||
*music=last_context.projectTimeMusic; *flags=last_context.state;
|
||||
}
|
||||
static const Steinberg_TUID cid = SMTG_INLINE_UID(0x58544333,0x12345678,0x12345678,0x12345678);
|
||||
typedef struct { Steinberg_Vst_IComponent component; Steinberg_Vst_IAudioProcessor processor; unsigned int refs; int initialized, active, started; } instance;
|
||||
static instance *from_processor(void *p) { return (instance *)((char *)p - offsetof(instance,processor)); }
|
||||
|
|
@ -48,6 +55,8 @@ static Steinberg_tresult process(void *self, struct Steinberg_Vst_ProcessData *d
|
|||
{
|
||||
instance *p=from_processor(self);int32_t i;Steinberg_int32 index=-1,offset=-1;Steinberg_Vst_ParamValue value=-1;
|
||||
Steinberg_Vst_IParameterChanges *changes=data->outputParameterChanges;Steinberg_Vst_IParamValueQueue *queue;Steinberg_Vst_ParamID id=7;
|
||||
assert(data->processContext && data->processContext->sampleRate > 0);
|
||||
last_context = *data->processContext;
|
||||
assert(p->started && changes && changes->lpVtbl->getParameterCount(changes)==0);
|
||||
queue=changes->lpVtbl->addParameterData(changes,&id,&index);assert(queue && index==0);
|
||||
assert(queue->lpVtbl->getParameterId(queue)==7 && queue->lpVtbl->getPointCount(queue)==0);
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ static Steinberg_tresult process(void *self, struct Steinberg_Vst_ProcessData *d
|
|||
Steinberg_Vst_IEventList *events = data->inputEvents;
|
||||
int32_t count = events->lpVtbl->getEventCount(events);
|
||||
assert(p->started && data->numInputs == 0);
|
||||
assert(data->processContext && data->processContext->sampleRate > 0 && data->processContext->tempo > 0);
|
||||
for (i = 0; i < data->numSamples; ++i) {
|
||||
while (j < count) {
|
||||
struct Steinberg_Vst_Event event;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue