Skip to content

Commit

Permalink
Disable Animated OSC (#1073)
Browse files Browse the repository at this point in the history
The Animated OSC was just too confusing - is it the real LFO; what
rate; what envelope; which modulation. So just disable it and think
about it some other time.

Closes #1017
  • Loading branch information
baconpaul authored Aug 22, 2019
1 parent d5034cb commit a0eb7f4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/common/gui/COscillatorDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,20 @@ void COscillatorDisplay::draw(CDrawContext* dc)
for (int c = 0; c < 2; ++c)
{
osces[c] = nullptr;

#if OSC_MOD_ANIMATION
if (!is_mod && c > 0 )
continue;
#else
if (c > 0)
continue;
#endif

tp[c][oscdata->pitch.param_id_in_scene].f = 0;
for (int i = 0; i < n_osc_params; i++)
tp[c][oscdata->p[i].param_id_in_scene].i = oscdata->p[i].val.i;

#if OSC_MOD_ANIMATION
if (c == 1 )
{
auto modOut = 1.0;
Expand Down Expand Up @@ -101,6 +108,7 @@ void COscillatorDisplay::draw(CDrawContext* dc)
iter++;
}
}
#endif

osces[c] = spawn_osc(oscdata->type.val.i, storage, oscdata, tp[c]);
}
Expand Down
7 changes: 7 additions & 0 deletions src/common/gui/COscillatorDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include "CDIBitmap.h"
#include "DspUtilities.h"

#define OSC_MOD_ANIMATION 0

class COscillatorDisplay : public VSTGUI::CControl, public VSTGUI::IDropTarget
{
public:
Expand Down Expand Up @@ -52,6 +54,7 @@ class COscillatorDisplay : public VSTGUI::CControl, public VSTGUI::IDropTarget
virtual VSTGUI::CMouseEventResult onMouseUp(VSTGUI::CPoint& where, const VSTGUI::CButtonState& buttons);
virtual VSTGUI::CMouseEventResult onMouseMoved(VSTGUI::CPoint& where, const VSTGUI::CButtonState& buttons);

#if OSC_MOD_ANIMATION
void setIsMod(bool b)
{
is_mod = b;
Expand All @@ -65,6 +68,7 @@ class COscillatorDisplay : public VSTGUI::CControl, public VSTGUI::IDropTarget
{
mod_time += 1.0 / 30.0;
}
#endif

protected:
void populateMenu(VSTGUI::COptionMenu* m, int selectedItem);
Expand All @@ -75,9 +79,12 @@ class COscillatorDisplay : public VSTGUI::CControl, public VSTGUI::IDropTarget
unsigned controlstate;

bool doingDrag = false;

#if OSC_MOD_ANIMATION
bool is_mod = false;
modsources modsource = ms_original;
float mod_time = 0;
#endif
VSTGUI::CRect rnext, rprev, rmenu;
VSTGUI::CPoint lastpos;
CLASS_METHODS(COscillatorDisplay, VSTGUI::CControl)
Expand Down
5 changes: 5 additions & 0 deletions src/common/gui/SurgeGUIEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,14 @@ void SurgeGUIEditor::idle()
}
}

#if OSC_MOD_ANIMATION
if (mod_editor && oscdisplay)
{
((COscillatorDisplay*)oscdisplay)->tickModTime();
oscdisplay->setDirty(true);
oscdisplay->invalid();
}
#endif

if (polydisp)
{
Expand Down Expand Up @@ -524,13 +526,16 @@ void SurgeGUIEditor::refresh_mod()
s->invalid();
}
}
#if OSC_MOD_ANIMATION
if (oscdisplay)
{
((COscillatorDisplay*)oscdisplay)->setIsMod(mod_editor);
((COscillatorDisplay*)oscdisplay)->setModSource(modsource);
oscdisplay->invalid();
oscdisplay->setDirty(true);
}
#endif

synth->storage.CS_ModRouting.leave();
for (int i = 1; i < n_modsources; i++)
{
Expand Down

0 comments on commit a0eb7f4

Please sign in to comment.