summaryrefslogtreecommitdiff
path: root/vst
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2012-01-23 20:29:45 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2012-01-23 20:29:45 +0100
commitf58c2e7aee2e392bdeea68abea960db0178b0a98 (patch)
treeb674698c92d6b4e937d913c968a6aec6a369570a /vst
parent2589b7b5dacdf55133c045a238c1187cc2ac7517 (diff)
New with GUI.
Diffstat (limited to 'vst')
-rw-r--r--vst/drumgizmo_vst.cc65
-rw-r--r--vst/drumgizmo_vst.h20
-rw-r--r--vst/input_vst.cc2
3 files changed, 51 insertions, 36 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;
}
diff --git a/vst/drumgizmo_vst.h b/vst/drumgizmo_vst.h
index cf44cf7..5e063ff 100644
--- a/vst/drumgizmo_vst.h
+++ b/vst/drumgizmo_vst.h
@@ -31,10 +31,13 @@
#include <public.sdk/source/vst2.x/aeffeditor.h>
#include <drumgizmo.h>
+#include <plugingui.h>
#include "input_vst.h"
#include "output_vst.h"
+class DGEditor;
+
class DrumGizmoVst : public AudioEffectX
{
public:
@@ -91,6 +94,23 @@ private:
size_t pos;
sample_t *buffer;
size_t buffer_size;
+
+ DGEditor *editor;
+};
+
+class DGEditor : public AEffEditor {
+public:
+ DGEditor(AudioEffect* effect);
+
+ bool open(void* ptr);
+ void close();
+ bool isOpen();
+ void idle();
+
+private:
+ DrumGizmoVst* dgeff;
+ PluginGUI *plugingui;
+ DrumGizmo *drumgizmo;
};
#endif/*__DRUMGIZMO_DRUMGIZMO_VST_H__*/
diff --git a/vst/input_vst.cc b/vst/input_vst.cc
index 525c687..52015ad 100644
--- a/vst/input_vst.cc
+++ b/vst/input_vst.cc
@@ -45,7 +45,7 @@ bool InputVST::init(Instruments &instruments)
mmap.midimap = p.midimap;
for(size_t i = 0; i < instruments.size(); i++) {
- mmap.instrmap[instruments[i]->name()] = i;
+ mmap.instrmap[instruments[i].name()] = i;
}
return true;