summaryrefslogtreecommitdiff
path: root/vst/drumgizmo_vst.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2011-12-17 10:38:24 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2011-12-17 10:38:24 +0100
commitce28ce03c3e1727b21c43d96cebe90600bb35fde (patch)
tree39b2254ef9e0d237fe8fb1ac19355040ed248b83 /vst/drumgizmo_vst.cc
parent2f4c1dea5b6610f8ca202dc8b1546e87a77c91ab (diff)
Make use of GUI (currently broken)
Diffstat (limited to 'vst/drumgizmo_vst.cc')
-rw-r--r--vst/drumgizmo_vst.cc55
1 files changed, 50 insertions, 5 deletions
diff --git a/vst/drumgizmo_vst.cc b/vst/drumgizmo_vst.cc
index 730a67b..5ada7cb 100644
--- a/vst/drumgizmo_vst.cc
+++ b/vst/drumgizmo_vst.cc
@@ -28,9 +28,47 @@
#include "constants.h"
+#include <time.h>
+
#define NUM_PROGRAMS 0
#define NUM_PARAMS 0
+#include <plugingui.h>
+
+class DGEditor : public AEffEditor {
+public:
+ DGEditor(AudioEffect* effect)
+ {
+ dgeff = (DrumGizmoVst*)effect;
+ plugingui = new PluginGUI(dgeff->drumgizmo);
+ }
+
+ bool open(void* ptr)
+ {
+ plugingui->show();
+ return true;
+ }
+
+ void close()
+ {
+ plugingui->hide();
+ }
+
+ bool isOpen()
+ {
+ return false;
+ }
+
+ void idle()
+ {
+ plugingui->processEvents();
+ }
+
+private:
+ DrumGizmoVst* dgeff;
+ PluginGUI *plugingui;
+};
+
AudioEffect* createEffectInstance(audioMasterCallback audioMaster)
{
return new DrumGizmoVst(audioMaster);
@@ -58,12 +96,19 @@ DrumGizmoVst::DrumGizmoVst(audioMasterCallback audioMaster)
setNumOutputs(NUM_OUTPUTS);
canProcessReplacing();
isSynth();
- char id[] = "DGV1"; // Four bytes typecasted into an unsigned integer
+
+ char id[] = "DGV2"; // Four bytes typecasted into an unsigned integer
setUniqueID(*(unsigned int*)id);
+
+ // setUniqueID((unsigned int)time(NULL));
+
}
initProcess();
suspend();
+
+ DGEditor *editor = new DGEditor(this);
+ setEditor(editor);
}
DrumGizmoVst::~DrumGizmoVst()
@@ -208,7 +253,7 @@ bool DrumGizmoVst::getProgramNameIndexed(VstInt32 category, VstInt32 index,
bool DrumGizmoVst::getEffectName(char* name)
{
- vst_strncpy(name, "DrumGizmo", kVstMaxEffectNameLen);
+ vst_strncpy(name, "DrumGizmoA", kVstMaxEffectNameLen);
return true;
}
@@ -220,7 +265,7 @@ bool DrumGizmoVst::getVendorString(char* text)
bool DrumGizmoVst::getProductString(char* text)
{
- vst_strncpy(text, "Vst Synth", kVstMaxProductStrLen);
+ vst_strncpy(text, "Vst SynthA", kVstMaxProductStrLen);
return true;
}
@@ -286,7 +331,7 @@ VstInt32 DrumGizmoVst::getMidiProgramCategory(VstInt32 channel,
{
cat->parentCategoryIndex = -1; // -1:no parent category
cat->flags = 0; // reserved, none defined yet, zero.
- VstInt32 category = cat->thisCategoryIndex;
+ // VstInt32 category = cat->thisCategoryIndex;
vst_strncpy(cat->name, "Drums", 63);
return 1;
}
@@ -331,7 +376,7 @@ void DrumGizmoVst::processReplacing(float** inputs, float** outputs,
{
output->setOutputs(outputs);
- if(buffer_size != sampleFrames) {
+ if(buffer_size != (size_t)sampleFrames) {
if(buffer) free(buffer);
buffer_size = sampleFrames;
buffer = (sample_t*)malloc(sizeof(sample_t) * buffer_size);