Skip to content

Commit

Permalink
Make sure idle gets called for VST3
Browse files Browse the repository at this point in the history
Fixes #1
  • Loading branch information
kurasu committed Sep 24, 2018
1 parent 2353a34 commit 7810802
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/common/gui/SurgeGUIEditor.cpp
Expand Up @@ -122,6 +122,10 @@ SurgeGUIEditor::SurgeGUIEditor(void* effect, SurgeSynthesizer* synth) : super(ef
this->synth = synth;

// ToolTipWnd = 0;

#ifdef TARGET_VST3
_idleTimer = new CVSTGUITimer([this](CVSTGUITimer* timer) { idle(); }, 50, false);
#endif
}

SurgeGUIEditor::~SurgeGUIEditor()
Expand Down Expand Up @@ -1127,6 +1131,10 @@ bool PLUGIN_API SurgeGUIEditor::open(void* parent, const PlatformType& platformT
PlatformType platformType = kDefaultNative;
#endif

#ifdef TARGET_VST3
_idleTimer->start();
#endif

CRect wsize(0, 0, window_size_x, window_size_y);
frame = new CFrame(wsize, this);
frame->setBackground(getSurgeBitmap(IDB_BG));
Expand All @@ -1147,7 +1155,12 @@ bool PLUGIN_API SurgeGUIEditor::open(void* parent, const PlatformType& platformT
}

void SurgeGUIEditor::close()
{}
{
#ifdef TARGET_VST3
_idleTimer->stop();
#endif
}

void SurgeGUIEditor::setParameter(long index, float value)
{
if (!frame)
Expand Down
1 change: 1 addition & 0 deletions src/common/gui/SurgeGUIEditor.h
Expand Up @@ -111,4 +111,5 @@ class SurgeGUIEditor : public EditorType, public IControlListener, public IKeybo
float blinktimer = 0;
bool blinkstate = false;
void* _effect = 0;
CVSTGUITimer* _idleTimer = nullptr;
};

0 comments on commit 7810802

Please sign in to comment.