summaryrefslogtreecommitdiff
path: root/vst/drumgizmo_vst.cc
diff options
context:
space:
mode:
Diffstat (limited to 'vst/drumgizmo_vst.cc')
-rw-r--r--vst/drumgizmo_vst.cc65
1 files changed, 30 insertions, 35 deletions
diff --git a/vst/drumgizmo_vst.cc b/vst/drumgizmo_vst.cc
index 5ada7cb..381f2f9 100644
--- a/vst/drumgizmo_vst.cc
+++ b/vst/drumgizmo_vst.cc
@@ -33,41 +33,36 @@
#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;
- }
+DGEditor::DGEditor(AudioEffect* effect)
+{
+ dgeff = (DrumGizmoVst*)effect;
+ plugingui = NULL;
+ drumgizmo = dgeff->drumgizmo;
+}
- void close()
- {
- plugingui->hide();
- }
+bool DGEditor::open(void* ptr)
+{
+ if(!plugingui) plugingui = new PluginGUI(drumgizmo);
+ plugingui->show();
+ return true;
+}
- bool isOpen()
- {
- return false;
- }
+void DGEditor::close()
+{
+ plugingui->hide();
+ delete plugingui;
+ plugingui = NULL;
+}
- void idle()
- {
- plugingui->processEvents();
- }
+bool DGEditor::isOpen()
+{
+ return plugingui != NULL;;
+}
-private:
- DrumGizmoVst* dgeff;
- PluginGUI *plugingui;
-};
+void DGEditor::idle()
+{
+ if(plugingui) plugingui->processEvents();
+}
AudioEffect* createEffectInstance(audioMasterCallback audioMaster)
{
@@ -97,7 +92,7 @@ DrumGizmoVst::DrumGizmoVst(audioMasterCallback audioMaster)
canProcessReplacing();
isSynth();
- char id[] = "DGV2"; // Four bytes typecasted into an unsigned integer
+ char id[] = "DGV4"; // Four bytes typecasted into an unsigned integer
setUniqueID(*(unsigned int*)id);
// setUniqueID((unsigned int)time(NULL));
@@ -107,7 +102,7 @@ DrumGizmoVst::DrumGizmoVst(audioMasterCallback audioMaster)
initProcess();
suspend();
- DGEditor *editor = new DGEditor(this);
+ editor = new DGEditor(this);
setEditor(editor);
}
@@ -253,7 +248,7 @@ bool DrumGizmoVst::getProgramNameIndexed(VstInt32 category, VstInt32 index,
bool DrumGizmoVst::getEffectName(char* name)
{
- vst_strncpy(name, "DrumGizmoA", kVstMaxEffectNameLen);
+ vst_strncpy(name, "DrumGizmo4", kVstMaxEffectNameLen);
return true;
}
@@ -265,7 +260,7 @@ bool DrumGizmoVst::getVendorString(char* text)
bool DrumGizmoVst::getProductString(char* text)
{
- vst_strncpy(text, "Vst SynthA", kVstMaxProductStrLen);
+ vst_strncpy(text, "Vst Synth", kVstMaxProductStrLen);
return true;
}