guionly/plugin/chassis.cpp

46 lines
1.2 KiB
C++

#include "chassis.hpp"
START_NAMESPACE_DISTRHO
Chassis::Chassis() : Plugin(parameterCount, 128, 0), sampleRate(getSampleRate()) {
// initial code here
}
// Initialisation functions
void Chassis::initAudioPort(bool input, uint32_t index, AudioPort &port) {
// port.groupId = kPortGroupStereo;
Plugin::initAudioPort(input, index, port);
if (!input && index == 0) port.name = "Left Out";
if (!input && index == 1) port.name = "Right Out";
}
void Chassis::initProgramName(uint32_t index, String &programName) {
return;
}
void Chassis::loadProgram(uint32_t index) {
return;
}
// Processing functions
void Chassis::activate() {
// calculate filter coefficients and stuff
printf("called activate()\n");
}
void Chassis::run(const float **, float **outputs, uint32_t frames, const MidiEvent *midiEvents, uint32_t midiEventCount) {
// flatten the left channel to use as temporary storage, since
// the synth engine only generates a mono channel
bzero(outputs[0], sizeof(float) * frames);
bzero(outputs[1], sizeof(float) * frames);
}
// create the plugin
Plugin *createPlugin() { return new Chassis(); }
END_NAMESPACE_DISTRHO