aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/vst/src/vstedit.cpp
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2005-03-11 04:58:01 +0000
committerThomas Grill <xovo@users.sourceforge.net>2005-03-11 04:58:01 +0000
commit27da08004c5f024a0f35e3cb4c2b3942548ebcfa (patch)
treec89092a5e8d13c11719b7975b9557efbf3ca131f /externals/grill/vst/src/vstedit.cpp
parent467591c8ba03dbd60ceada93482460de3b888838 (diff)
restructured VSThost code
better shell support fix for build system update for flext build systemcleanups VSTTime info added event processing (like Midi in) svn path=/trunk/; revision=2617
Diffstat (limited to 'externals/grill/vst/src/vstedit.cpp')
-rw-r--r--externals/grill/vst/src/vstedit.cpp76
1 files changed, 76 insertions, 0 deletions
diff --git a/externals/grill/vst/src/vstedit.cpp b/externals/grill/vst/src/vstedit.cpp
new file mode 100644
index 00000000..804e83ca
--- /dev/null
+++ b/externals/grill/vst/src/vstedit.cpp
@@ -0,0 +1,76 @@
+/*
+vst~ - VST plugin object for PD
+based on the work of Jarno Seppänen and Mark Williamson
+
+Copyright (c)2003-2005 Thomas Grill (gr@grrrr.org)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+*/
+
+#include "vsthost.h"
+#include "editor.h"
+
+
+void VSTPlugin::Edit(bool open)
+{
+ if(Is()) {
+ if(open) {
+ if(HasEditor() && !IsEdited())
+ StartEditor(this);
+ }
+ else if(IsEdited())
+ StopEditor(this);
+ }
+}
+
+void VSTPlugin::StartEditing(WHandle h)
+{
+ FLEXT_ASSERT(h != NULL);
+ Dispatch(effEditOpen,0,0,hwnd = h);
+// Dispatch(effEditTop);
+
+ TitleEditor(this,title.c_str());
+}
+
+void VSTPlugin::StopEditing()
+{
+ if(Is()) {
+ Dispatch(effEditClose);
+ hwnd = NULL;
+ }
+}
+
+void VSTPlugin::Visible(bool vis)
+{
+ if(Is() && IsEdited()) ShowEditor(this,vis);
+}
+
+bool VSTPlugin::IsVisible() const
+{
+ return Is() && IsEdited() && IsEditorShown(this);
+}
+
+
+void VSTPlugin::SetPos(int x,int y,bool upd)
+{
+ if(Is()) {
+ posx = x; posy = y;
+ if(upd && IsEdited()) MoveEditor(this,posx,posy);
+ }
+}
+
+void VSTPlugin::SetCaption(bool c)
+{
+ if(Is()) {
+ caption = c;
+ if(IsEdited()) CaptionEditor(this,c);
+ }
+}
+
+void VSTPlugin::SetTitle(const char *t)
+{
+ if(Is()) {
+ title = t;
+ if(IsEdited()) TitleEditor(this,t);
+ }
+}