Skip to content

Commit

Permalink
Revert "Merge pull request surge-synthesizer#20 from kmatheussen/master"
Browse files Browse the repository at this point in the history
This reverts commit 23ce7da, reversing
changes made to 48b82a9.
  • Loading branch information
abique committed Nov 28, 2018
1 parent 23ce7da commit 29418f2
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 102 deletions.
14 changes: 6 additions & 8 deletions premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ VSTGUI = "vst3sdk/vstgui4/vstgui/";

defines
{
"VSTGUI_ENABLE_DEPRECATED_METHODS=1"
"VSTGUI_ENABLE_DEPRECATED_METHODS=0"
}

floatingpoint "Fast"
Expand Down Expand Up @@ -81,15 +81,10 @@ elseif (os.istarget("linux")) then

defines { "WINDOWS=0" }

buildoptions {
"-std=c++17",
"`pkg-config --cflags freetype2 xcb xcb-cursor xkbcommon-x11 cairo`",
}
buildoptions { "-std=c++17" }
links { }
buildoptions { }
linkoptions {
"`pkg-config --libs freetype2 xcb xcb-cursor xkbcommon-x11 cairo`",
}
linkoptions { }

platforms { "x64" }

Expand Down Expand Up @@ -216,6 +211,8 @@ function plugincommon()

buildoptions {
"-Wno-unused-variable",
"`pkg-config gtkmm-3.0 --cflags`",
"-std=c++14"
}

files
Expand Down Expand Up @@ -246,6 +243,7 @@ function plugincommon()
}

linkoptions {
"`pkg-config gtkmm-3.0 --libs`",
}
elseif (os.istarget("windows")) then

Expand Down
126 changes: 63 additions & 63 deletions src/common/SurgePatch.cpp

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/common/gui/COscillatorDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,12 @@ CMouseEventResult COscillatorDisplay::onMouseDown(CPoint& where, const CButtonSt
{
CRect menurect(0, 0, 0, 0);
menurect.offset(where.x, where.y);
COptionMenu* contextMenu = new COptionMenu(menurect, 0, 0, 0, 0, CParamDisplay::kNoDrawStyle);
COptionMenu* contextMenu = new COptionMenu(menurect, 0, 0, 0, 0, kNoDrawStyle);

for (int c = 0; c < storage->wt_category.size(); c++)
{
char name[namechars];
COptionMenu* subMenu = new COptionMenu(getViewSize(), 0, c, 0, 0, CParamDisplay::kNoDrawStyle);
COptionMenu* subMenu = new COptionMenu(getViewSize(), 0, c, 0, 0, kNoDrawStyle);
subMenu->setNbItemsPerColumn(32);
int sub = 0;
int p;
Expand All @@ -271,7 +271,7 @@ CMouseEventResult COscillatorDisplay::onMouseDown(CPoint& where, const CButtonSt
if (storage->wt_list[p].category == c)
{
sprintf(name, "%s", storage->wt_list[p].name.c_str());
auto actionItem = new CCommandMenuItem(CCommandMenuItem::Desc(name, 0));
auto actionItem = new CCommandMenuItem(name);
auto action = [this, p](CCommandMenuItem* item) { this->loadWavetable(p); };

actionItem->setActions(action, nullptr);
Expand Down
6 changes: 3 additions & 3 deletions src/common/gui/CPatchBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ CMouseEventResult CPatchBrowser::onMouseDown(CPoint& where, const CButtonState&

CRect menurect(0, 0, 0, 0);
menurect.offset(where.x, where.y);
COptionMenu* contextMenu = new COptionMenu(menurect, 0, 0, 0, 0, CParamDisplay::kNoDrawStyle);
COptionMenu* contextMenu = new COptionMenu(menurect, 0, 0, 0, 0, kNoDrawStyle);

int main_e = 0;
// if RMB is down, only show the current category
Expand Down Expand Up @@ -88,7 +88,7 @@ CMouseEventResult CPatchBrowser::onMouseDown(CPoint& where, const CButtonState&
subMenu = contextMenu;
else
{
subMenu = new COptionMenu(getViewSize(), nullptr, main_e, 0, 0, CParamDisplay::kNoDrawStyle);
subMenu = new COptionMenu(getViewSize(), nullptr, main_e, 0, 0, kNoDrawStyle);
subMenu->setNbItemsPerColumn(32);
}

Expand All @@ -100,7 +100,7 @@ CMouseEventResult CPatchBrowser::onMouseDown(CPoint& where, const CButtonState&
// sprintf(name,"%i. %s",p,storage->patch_list[p].name.c_str());
sprintf(name, "%s", storage->patch_list[p].name.c_str());

auto actionItem = new CCommandMenuItem(CCommandMenuItem::Desc(name,0));
auto actionItem = new CCommandMenuItem(name);
auto action = [this, p](CCommandMenuItem* item) { this->loadPatch(p); };

actionItem->setActions(action, nullptr);
Expand Down
4 changes: 2 additions & 2 deletions src/common/gui/CSnapshotMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void CSnapshotMenu::populate()
{
strcpy(txt, snapshot->Attribute("name"));

auto actionItem = new CCommandMenuItem(CCommandMenuItem::Desc(txt,0));
auto actionItem = new CCommandMenuItem(txt);
auto action = [this, snapshot, type_id](CCommandMenuItem* item) {
this->loadSnapshot(type_id, snapshot);
};
Expand All @@ -73,7 +73,7 @@ void CSnapshotMenu::populate()
}
else
{
auto actionItem = new CCommandMenuItem(CCommandMenuItem::Desc(txt, 0));
auto actionItem = new CCommandMenuItem(txt);
auto action = [this, type_id](CCommandMenuItem* item) {
this->loadSnapshot(type_id, nullptr);
};
Expand Down
38 changes: 19 additions & 19 deletions src/common/gui/CSurgeSlider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ CSurgeSlider::CSurgeSlider(

CRect size;

if (style & CSlider::kHorizontal)
if (style & kHorizontal)
{
pTray = getSurgeBitmap(IDB_FADERH_BG);
pHandle = getSurgeBitmap(IDB_FADERH_HANDLE);
Expand All @@ -61,8 +61,8 @@ CSurgeSlider::CSurgeSlider(
}
else
{
if (!(style & CSlider::kTop))
style |= CSlider::kBottom; // CSlider::kBottom by default
if (!(style & kTop))
style |= kBottom; // kBottom by default

pTray = getSurgeBitmap(IDB_FADERV_BG);
pHandle = getSurgeBitmap(IDB_FADERV_HANDLE);
Expand Down Expand Up @@ -128,7 +128,7 @@ void CSurgeSlider::draw(CDrawContext* dc)

CRect size = getViewSize();

if (style & CSlider::kHorizontal)
if (style & kHorizontal)
{
if (style & kSemitone)
typey = 2;
Expand Down Expand Up @@ -157,14 +157,14 @@ void CSurgeSlider::draw(CDrawContext* dc)
{
// CRect trect(0,0,pTray->getWidth(),pTray->getHeight());
CRect trect;
if (style & CSlider::kHorizontal)
if (style & kHorizontal)
trect = CRect(0, 0, 133, 14);
else
trect = CRect(0, 0, 16, 75);

trect.offset(size.left, size.top);

if (style & CSlider::kHorizontal)
if (style & kHorizontal)
trect.offset(2, 5);
else
trect.offset(2, 2);
Expand All @@ -176,7 +176,7 @@ void CSurgeSlider::draw(CDrawContext* dc)
alpha = 0x80;
}

if (style & CSlider::kHorizontal)
if (style & kHorizontal)
pTray->draw(dc, trect, CPoint(133 * typex, 14 * typey), alpha);
else
pTray->draw(dc, trect, CPoint(16 * typex, 75 * typey), alpha);
Expand All @@ -185,12 +185,12 @@ void CSurgeSlider::draw(CDrawContext* dc)
return;

CRect headrect;
if (style & CSlider::kHorizontal)
if (style & kHorizontal)
headrect = CRect(0, 0, 28, 24);
else
headrect = CRect(0, 0, 24, 28);

if (label[0] && (style & CSlider::kHorizontal))
if (label[0] && (style & kHorizontal))
{
CRect trect(0, 0, 111, 13);
trect.offset(size.left, size.top);
Expand All @@ -217,15 +217,15 @@ void CSurgeSlider::draw(CDrawContext* dc)
CRect hrect(headrect);
handle_rect = handle_rect_orig;
hrect.offset(size.left, size.top);
if (style & CSlider::kHorizontal)
if (style & kHorizontal)
hrect.offset(0, 3);

float dispv = limit_range(qdvalue, 0.f, 1.f);
if (style & CSlider::kRight || style & CSlider::kBottom)
if (style & kRight || style & kBottom)
dispv = 1 - dispv;
dispv *= range;

if (style & CSlider::kHorizontal)
if (style & kHorizontal)
{
hrect.offset(dispv + 1, 0);
handle_rect.offset(dispv + 1, 0);
Expand All @@ -236,7 +236,7 @@ void CSurgeSlider::draw(CDrawContext* dc)
handle_rect.offset(1, dispv);
}

if (style & CSlider::kHorizontal)
if (style & kHorizontal)
pHandle->draw(dc, hrect, CPoint(0, 24 * typehy), modmode ? 0x7f : 0xff);
else
pHandle->draw(dc, hrect, CPoint(0, 28 * typehy), modmode ? 0x7f : 0xff);
Expand All @@ -248,7 +248,7 @@ void CSurgeSlider::draw(CDrawContext* dc)
CRect hrect(headrect);
handle_rect = handle_rect_orig;
hrect.offset(size.left, size.top);
if (style & CSlider::kHorizontal)
if (style & kHorizontal)
hrect.offset(0, 3);

float dispv;
Expand All @@ -257,11 +257,11 @@ void CSurgeSlider::draw(CDrawContext* dc)
else
dispv = limit_range(modval + value, 0.f, 1.f);

if (style & CSlider::kRight || style & CSlider::kBottom)
if (style & kRight || style & kBottom)
dispv = 1 - dispv;
dispv *= range;

if (style & CSlider::kHorizontal)
if (style & kHorizontal)
{
hrect.offset(dispv + 1, 0);
handle_rect.offset(dispv + 1, 0);
Expand All @@ -272,7 +272,7 @@ void CSurgeSlider::draw(CDrawContext* dc)
handle_rect.offset(1, dispv);
}

if (style & CSlider::kHorizontal)
if (style & kHorizontal)
pHandle->draw(dc, hrect, CPoint(28, 24 * typehy), 0xff);
else
pHandle->draw(dc, hrect, CPoint(24, 28 * typehy), 0xff);
Expand Down Expand Up @@ -384,12 +384,12 @@ void CSurgeSlider::onMouseMoveDelta(CPoint& where,
CPoint p;

double diff;
if (style & CSlider::kHorizontal)
if (style & kHorizontal)
diff = dx;
else
diff = dy;

if (style & CSlider::kRight || style & CSlider::kBottom)
if (style & kRight || style & kBottom)
diff = -diff;

*edit_value += diff / (float)range;
Expand Down
8 changes: 4 additions & 4 deletions src/common/gui/SurgeGUIEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ int32_t SurgeGUIEditor::controlModifierClicked(CControl* control, CButtonState b
frame->localToFrame(where);
menuRect.offset(where.x, where.y);

COptionMenu* contextMenu = new COptionMenu(menuRect, 0, 0, 0, 0, CParamDisplay::kNoDrawStyle);
COptionMenu* contextMenu = new COptionMenu(menuRect, 0, 0, 0, 0, kNoDrawStyle);
int eid = 0;
int id_copy = -1, id_copymod = -1, id_paste = -1;
char txt[256];
Expand Down Expand Up @@ -1303,7 +1303,7 @@ int32_t SurgeGUIEditor::controlModifierClicked(CControl* control, CButtonState b
int a = limit_range((int)((2 * (where.x - r.left)) / r.getWidth()), 0, 2);
frame->localToFrame(where);
menuRect.offset(where.x, where.y);
COptionMenu* contextMenu = new COptionMenu(menuRect, 0, 0, 0, 0, CParamDisplay::kNoDrawStyle);
COptionMenu* contextMenu = new COptionMenu(menuRect, 0, 0, 0, 0, kNoDrawStyle);
int eid = 0;
int id_copy = -1, id_paste = -1;
char txt[256];
Expand Down Expand Up @@ -1352,7 +1352,7 @@ int32_t SurgeGUIEditor::controlModifierClicked(CControl* control, CButtonState b
frame->localToFrame(where);
menuRect.offset(where.x, where.y);
COptionMenu* contextMenu =
new COptionMenu(menuRect, 0, 0, 0, 0, CParamDisplay::kNoDrawStyle | COptionMenu::kMultipleCheckStyle);
new COptionMenu(menuRect, 0, 0, 0, 0, kNoDrawStyle | kMultipleCheckStyle);
int eid = 0;
int id_clearallmr = -1, id_learnctrl = -1, id_clearctrl = -1, id_bipolar = -1,
id_copy = -1, id_paste = -1, id_rename = -1;
Expand Down Expand Up @@ -1545,7 +1545,7 @@ int32_t SurgeGUIEditor::controlModifierClicked(CControl* control, CButtonState b
menuRect.offset(where.x, where.y);
frame->localToFrame(where);
COptionMenu* contextMenu =
new COptionMenu(menuRect, 0, 0, 0, 0, CParamDisplay::kNoDrawStyle | COptionMenu::kMultipleCheckStyle);
new COptionMenu(menuRect, 0, 0, 0, 0, kNoDrawStyle | kMultipleCheckStyle);
int eid = 0;
int id_temposync = -1, id_clearallmr = -1, id_extendrange = -1, id_learnctrl = -1,
id_clearctrl = -1, id_absolute = -1;
Expand Down

0 comments on commit 29418f2

Please sign in to comment.