From 29418f2b0e5394c10343e476297b509f3ca105b0 Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Wed, 28 Nov 2018 17:26:13 +0100 Subject: [PATCH] Revert "Merge pull request #20 from kmatheussen/master" This reverts commit 23ce7daa691cdc2f3a288cc0b6c199fd61c05e7a, reversing changes made to 48b82a9d78c21b54dbf153036dcba6d40618dfb1. --- premake5.lua | 14 ++- src/common/SurgePatch.cpp | 126 +++++++++++++------------- src/common/gui/COscillatorDisplay.cpp | 6 +- src/common/gui/CPatchBrowser.cpp | 6 +- src/common/gui/CSnapshotMenu.cpp | 4 +- src/common/gui/CSurgeSlider.cpp | 38 ++++---- src/common/gui/SurgeGUIEditor.cpp | 8 +- 7 files changed, 100 insertions(+), 102 deletions(-) diff --git a/premake5.lua b/premake5.lua index 130ea8582d1..af12f8f5639 100644 --- a/premake5.lua +++ b/premake5.lua @@ -10,7 +10,7 @@ VSTGUI = "vst3sdk/vstgui4/vstgui/"; defines { - "VSTGUI_ENABLE_DEPRECATED_METHODS=1" + "VSTGUI_ENABLE_DEPRECATED_METHODS=0" } floatingpoint "Fast" @@ -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" } @@ -216,6 +211,8 @@ function plugincommon() buildoptions { "-Wno-unused-variable", + "`pkg-config gtkmm-3.0 --cflags`", + "-std=c++14" } files @@ -246,6 +243,7 @@ function plugincommon() } linkoptions { + "`pkg-config gtkmm-3.0 --libs`", } elseif (os.istarget("windows")) then diff --git a/src/common/SurgePatch.cpp b/src/common/SurgePatch.cpp index 4f430417dda..81ff0891ef6 100644 --- a/src/common/SurgePatch.cpp +++ b/src/common/SurgePatch.cpp @@ -58,39 +58,39 @@ SurgePatch::SurgePatch(SurgeStorage* storage) param_ptr.push_back(fx[4].return_level.assign(p_id++, 0, "volume_FX1", "FX1 Return", ct_amplitude, px, py, 0, cg_GLOBAL, 0, true, - CSlider::kHorizontal)); + kHorizontal)); py += gui_hfader_dist; param_ptr.push_back(fx[5].return_level.assign(p_id++, 0, "volume_FX2", "FX2 Return", ct_amplitude, px, py, 0, cg_GLOBAL, 0, true, - CSlider::kHorizontal)); + kHorizontal)); py += gui_hfader_dist; // TODO don't store in the patch ? param_ptr.push_back(volume.assign( p_id++, 0, "volume", "Master Volume", ct_decibel_attenuation, hmargin + gui_sec_width * 5, - gui_mid_topbar_y + 12, 0, cg_GLOBAL, 0, true, CSlider::kHorizontal | kEasy)); + gui_mid_topbar_y + 12, 0, cg_GLOBAL, 0, true, kHorizontal | kEasy)); } param_ptr.push_back(scene_active.assign(p_id++, 0, "scene_active", "Active Scene", ct_scenesel, 7, gui_mid_topbar_y - 2, 0, cg_GLOBAL, 0, false, - CSlider::kHorizontal)); + kHorizontal)); param_ptr.push_back(scenemode.assign(p_id++, 0, "scenemode", "Scene Mode", ct_scenemode, 8 + 51 + 3, gui_mid_topbar_y - 2, 0, cg_GLOBAL, 0, false, - CSlider::kHorizontal | kNoPopup)); - // param_ptr.push_back(scenemorph.assign(p_id++,0,"scenemorph","scenemorph",ct_percent,hmargin+gui_sec_width,gui_mid_topbar_y,0,0,0,false,CSlider::kHorizontal)); + kHorizontal | kNoPopup)); + // param_ptr.push_back(scenemorph.assign(p_id++,0,"scenemorph","scenemorph",ct_percent,hmargin+gui_sec_width,gui_mid_topbar_y,0,0,0,false,kHorizontal)); param_ptr.push_back(splitkey.assign(p_id++, 0, "splitkey", "Split Key", ct_midikey, 8 + 91, gui_mid_topbar_y - 3, 0, cg_GLOBAL, 0, false, - CSlider::kHorizontal | kNoPopup)); + kHorizontal | kNoPopup)); param_ptr.push_back(fx_disable.assign(p_id++, 0, "fx_disable", "FX Disable", ct_none, 0, 0, 0, cg_GLOBAL, 0, false)); // shouldnt't be stored in the patch param_ptr.push_back(polylimit.assign(p_id++, 0, "polylimit", "Poly Limit", ct_polylimit, 8 + 91, gui_mid_topbar_y + 13, 0, cg_GLOBAL, 0, false, - CSlider::kHorizontal | kNoPopup)); + kHorizontal | kNoPopup)); param_ptr.push_back(fx_bypass.assign(p_id++, 0, "fx_bypass", "FX Bypass", ct_fxbypass, 607, gui_mid_topbar_y - 6, 0, cg_GLOBAL, 0, false, - CSlider::kHorizontal | kNoPopup)); + kHorizontal | kNoPopup)); polylimit.val.i = 8; splitkey.val.i = 60; @@ -101,7 +101,7 @@ SurgePatch::SurgePatch(SurgeStorage* storage) int px = gui_col6_x, py = gui_sendfx_y + 20 * 3; param_ptr.push_back(this->fx[fx].type.assign(p_id++, 0, "type", "FX type", ct_fxtype, px, - py - 2, 0, cg_FX, fx, false, CSlider::kHorizontal)); + py - 2, 0, cg_FX, fx, false, kHorizontal)); py += 20; for (int p = 0; p < n_fx_params; p++) { @@ -109,7 +109,7 @@ SurgePatch::SurgePatch(SurgeStorage* storage) sprintf(label, "p%i", p); param_ptr.push_back( this->fx[fx].p[p].assign(p_id++, 0, label, "param", ct_none, px, py, 0, cg_FX, fx, - true, CSlider::kHorizontal | kHide | ((fx == 0) ? kEasy : 0))); + true, kHorizontal | kHide | ((fx == 0) ? kEasy : 0))); py += 20; } } @@ -134,15 +134,15 @@ SurgePatch::SurgePatch(SurgeStorage* storage) py = gui_mainsec_y; a->push_back(scene[sc].octave.assign(p_id++, id_s++, "octave", "Octave", ct_pitch_octave, px + 46, py + 1, sc_id, cg_GLOBAL, 0, false, - CSlider::kHorizontal | kNoPopup)); + kHorizontal | kNoPopup)); py = gui_mainsec_slider_y; a->push_back(scene[sc].pitch.assign(p_id++, id_s++, "pitch", "Pitch", ct_pitch_semi7bp, px, py, sc_id, cg_GLOBAL, 0, true, - CSlider::kHorizontal | kSemitone | sceasy)); + kHorizontal | kSemitone | sceasy)); py += gui_hfader_dist; a->push_back(scene[sc].portamento.assign(p_id++, id_s++, "portamento", "Portamento", ct_portatime, px, py, sc_id, cg_GLOBAL, 0, true, - CSlider::kHorizontal | sceasy)); + kHorizontal | sceasy)); py += gui_hfader_dist; for (int osc = 0; osc < n_oscs; osc++) { @@ -153,11 +153,11 @@ SurgePatch::SurgePatch(SurgeStorage* storage) px + 3, py + 1, sc_id, cg_OSC, osc, false)); a->push_back(scene[sc].osc[osc].octave.assign(p_id++, id_s++, "octave", "Octave", ct_pitch_octave, px - 3, py + 1, sc_id, - cg_OSC, osc, false, CSlider::kHorizontal | kNoPopup)); + cg_OSC, osc, false, kHorizontal | kNoPopup)); py = gui_mainsec_slider_y; a->push_back(scene[sc].osc[osc].pitch.assign(p_id++, id_s++, "pitch", "Pitch", ct_pitch_semi7bp, px, py, sc_id, cg_OSC, osc, - true, CSlider::kHorizontal | kSemitone | sceasy)); + true, kHorizontal | kSemitone | sceasy)); py += gui_hfader_dist; for (int i = 0; i < n_osc_params; i++) { @@ -165,16 +165,16 @@ SurgePatch::SurgePatch(SurgeStorage* storage) sprintf(label, "param%i", i); a->push_back(scene[sc].osc[osc].p[i].assign(p_id++, id_s++, label, "-", ct_none, px, py, sc_id, cg_OSC, osc, true, - CSlider::kHorizontal | ((i < 6) ? sceasy : 0))); + kHorizontal | ((i < 6) ? sceasy : 0))); py += gui_hfader_dist; } py = gui_mainsec_y - 7; a->push_back(scene[sc].osc[osc].keytrack.assign(p_id++, id_s++, "keytrack", "Keytrack", ct_bool_keytrack, px + 2, py, sc_id, - cg_OSC, osc, false, CSlider::kHorizontal)); + cg_OSC, osc, false, kHorizontal)); a->push_back(scene[sc].osc[osc].retrigger.assign(p_id++, id_s++, "retrigger", "Retrigger", ct_bool_retrigger, px + 50, py, sc_id, - cg_OSC, osc, false, CSlider::kHorizontal)); + cg_OSC, osc, false, kHorizontal)); // a->push_back(scene[sc].osc[osc].startphase.assign(p_id++,id_s++,"startphase","start // phase",ct_none,0,0,sc_id,2,osc,false)); @@ -189,22 +189,22 @@ SurgePatch::SurgePatch(SurgeStorage* storage) } a->push_back(scene[sc].polymode.assign(p_id++, id_s++, "polymode", "Polymode", ct_polymode, gui_col2_x + 83, gui_uppersec_y + 9, sc_id, cg_GLOBAL, - 0, false, CSlider::kVertical | kWhite | kNoPopup)); + 0, false, kVertical | kWhite | kNoPopup)); a->push_back(scene[sc].fm_switch.assign(p_id++, id_s++, "fm_switch", "FM Routing", ct_fmconfig, gui_col3_x + 3, gui_topbar + 25, sc_id, cg_GLOBAL, 0, false)); a->push_back(scene[sc].fm_depth.assign(p_id++, id_s++, "fm_depth", "FM Depth", ct_decibel_fmdepth, gui_col3_x, gui_uppersec_y + gui_hfader_dist * 4, sc_id, cg_GLOBAL, - 0, true, CSlider::kHorizontal | kWhite | sceasy)); + 0, true, kHorizontal | kWhite | sceasy)); a->push_back(scene[sc].drift.assign(p_id++, id_s++, "drift", "Osc Drift", ct_percent, gui_col2_x, gui_uppersec_y + gui_hfader_dist * 3, sc_id, - cg_GLOBAL, 0, true, CSlider::kHorizontal | kWhite)); + cg_GLOBAL, 0, true, kHorizontal | kWhite)); a->push_back(scene[sc].noise_colour.assign( p_id++, id_s++, "noisecol", "Noise Color", ct_percent_bidirectional, gui_col2_x, gui_uppersec_y + gui_hfader_dist * 4, sc_id, cg_GLOBAL, 0, true, - CSlider::kHorizontal | kWhite | sceasy)); + kHorizontal | kWhite | sceasy)); a->push_back(scene[sc].keytrack_root.assign(p_id++, id_s++, "ktrkroot", "Keytrack Root Key", ct_midikey, 180 + 127, gui_topbar + 78 + 106 + 24, sc_id, cg_GLOBAL, 0, false)); @@ -215,23 +215,23 @@ SurgePatch::SurgePatch(SurgeStorage* storage) py = gui_uppersec_y; a->push_back(scene[sc].volume.assign(p_id++, id_s++, "volume", "Volume", ct_amplitude, px, py, sc_id, cg_GLOBAL, 0, true, - CSlider::kHorizontal | kWhite | sceasy)); + kHorizontal | kWhite | sceasy)); py += gui_hfader_dist; a->push_back(scene[sc].pan.assign(p_id++, id_s++, "pan", "Pan", ct_percent_bidirectional, px, py, sc_id, cg_GLOBAL, 0, true, - CSlider::kHorizontal | kWhite | sceasy)); + kHorizontal | kWhite | sceasy)); py += gui_hfader_dist; a->push_back(scene[sc].width.assign(p_id++, id_s++, "pan2", "Width", ct_percent_bidirectional, px, py, sc_id, cg_GLOBAL, 0, true, - CSlider::kHorizontal | kWhite | sceasy)); + kHorizontal | kWhite | sceasy)); py += gui_hfader_dist; a->push_back(scene[sc].send_level[0].assign(p_id++, id_s++, "send_fx_1", "FX1 Send", ct_amplitude, px, py, sc_id, cg_GLOBAL, 0, true, - CSlider::kHorizontal | kWhite | sceasy)); + kHorizontal | kWhite | sceasy)); py += gui_hfader_dist; a->push_back(scene[sc].send_level[1].assign(p_id++, id_s++, "send_fx_2", "FX2 Send", ct_amplitude, px, py, sc_id, cg_GLOBAL, 0, true, - CSlider::kHorizontal | kWhite | sceasy)); + kHorizontal | kWhite | sceasy)); scene[sc].send_level[0].val_max.f = 1.5874f; scene[sc].send_level[1].val_max.f = 1.5874f; @@ -240,7 +240,7 @@ SurgePatch::SurgePatch(SurgeStorage* storage) int mof = -36, sof = mof + 10, rof = mof + 20; a->push_back(scene[sc].level_o1.assign(p_id++, id_s++, "level_o1", "Osc1 Level", ct_amplitude, px, py, sc_id, cg_MIX, 0, true, - CSlider::kVertical | kWhite | sceasy)); + kVertical | kWhite | sceasy)); a->push_back(scene[sc].mute_o1.assign(p_id++, id_s++, "mute_o1", "Osc1 Mute", ct_bool_mute, px, py + mof, sc_id, cg_MIX, 0, false)); a->push_back(scene[sc].solo_o1.assign(p_id++, id_s++, "solo_o1", "Osc1 Solo", ct_bool_solo, @@ -250,7 +250,7 @@ SurgePatch::SurgePatch(SurgeStorage* storage) px += gui_vfader_dist; a->push_back(scene[sc].level_o2.assign(p_id++, id_s++, "level_o2", "Osc2 Level", ct_amplitude, px, py, sc_id, cg_MIX, 0, true, - CSlider::kVertical | kWhite | sceasy)); + kVertical | kWhite | sceasy)); a->push_back(scene[sc].mute_o2.assign(p_id++, id_s++, "mute_o2", "Osc2 Mute", ct_bool_mute, px, py + mof, sc_id, cg_MIX, 0, false)); a->push_back(scene[sc].solo_o2.assign(p_id++, id_s++, "solo_o2", "Osc2 Solo", ct_bool_solo, @@ -260,7 +260,7 @@ SurgePatch::SurgePatch(SurgeStorage* storage) px += gui_vfader_dist; a->push_back(scene[sc].level_o3.assign(p_id++, id_s++, "level_o3", "Osc3 Level", ct_amplitude, px, py, sc_id, cg_MIX, 0, true, - CSlider::kVertical | kWhite | sceasy)); + kVertical | kWhite | sceasy)); a->push_back(scene[sc].mute_o3.assign(p_id++, id_s++, "mute_o3", "Osc3 Mute", ct_bool_mute, px, py + mof, sc_id, cg_MIX, 0, false)); a->push_back(scene[sc].solo_o3.assign(p_id++, id_s++, "solo_o3", "Osc3 Solo", ct_bool_solo, @@ -270,7 +270,7 @@ SurgePatch::SurgePatch(SurgeStorage* storage) px += gui_vfader_dist; a->push_back(scene[sc].level_ring_12.assign(p_id++, id_s++, "level_ring12", "Ring Level 1x2", ct_amplitude, px, py, sc_id, cg_MIX, 0, true, - CSlider::kVertical | kWhite | sceasy)); + kVertical | kWhite | sceasy)); a->push_back(scene[sc].mute_ring_12.assign(p_id++, id_s++, "mute_ring12", "Ring Mute 1x2", ct_bool_mute, px, py + mof, sc_id, cg_MIX, 0, false)); @@ -283,7 +283,7 @@ SurgePatch::SurgePatch(SurgeStorage* storage) px += gui_vfader_dist; a->push_back(scene[sc].level_ring_23.assign(p_id++, id_s++, "level_ring23", "Ring Level 2x3", ct_amplitude, px, py, sc_id, cg_MIX, 0, true, - CSlider::kVertical | kWhite | sceasy)); + kVertical | kWhite | sceasy)); a->push_back(scene[sc].mute_ring_23.assign(p_id++, id_s++, "mute_ring23", "Ring Mute 2x3", ct_bool_mute, px, py + mof, sc_id, cg_MIX, 0, false)); @@ -296,7 +296,7 @@ SurgePatch::SurgePatch(SurgeStorage* storage) px += gui_vfader_dist; a->push_back(scene[sc].level_noise.assign(p_id++, id_s++, "level_noise", "Noise Level", ct_amplitude, px, py, sc_id, cg_MIX, 0, true, - CSlider::kVertical | kWhite | sceasy)); + kVertical | kWhite | sceasy)); a->push_back(scene[sc].mute_noise.assign(p_id++, id_s++, "mute_noise", "Noise Mute", ct_bool_mute, px, py + mof, sc_id, cg_MIX, 0, false)); @@ -309,7 +309,7 @@ SurgePatch::SurgePatch(SurgeStorage* storage) px += gui_vfader_dist; a->push_back(scene[sc].level_pfg.assign(p_id++, id_s++, "level_pfg", "Pre-Filter Gain", ct_decibel, px, py, sc_id, cg_MIX, 0, true, - CSlider::kVertical | kWhite | sceasy)); + kVertical | kWhite | sceasy)); px += gui_vfader_dist; int pbx = 164, pby = 112; @@ -324,30 +324,30 @@ SurgePatch::SurgePatch(SurgeStorage* storage) py = gui_envsec_y; a->push_back(scene[sc].vca_level.assign(p_id++, id_s++, "vca_level", "Gain", ct_decibel, px, py, sc_id, cg_GLOBAL, 0, true, - CSlider::kVertical | kWhite | sceasy)); + kVertical | kWhite | sceasy)); px += gui_vfader_dist; a->push_back(scene[sc].vca_velsense.assign(p_id++, id_s++, "vca_velsense", "Velocity > Gain", ct_decibel_attenuation, px, py, sc_id, cg_GLOBAL, - 0, false, CSlider::kVertical | kWhite)); + 0, false, kVertical | kWhite)); px += gui_vfader_dist; px = gui_col3_x + gui_sec_width + 1; py = gui_uppersec_y + gui_hfader_dist * 4; a->push_back(scene[sc].feedback.assign(p_id++, id_s++, "feedback", "Feedback", ct_percent_bidirectional, px, py, sc_id, cg_GLOBAL, 0, - true, CSlider::kHorizontal | kWhite | sceasy)); + true, kHorizontal | kWhite | sceasy)); py += gui_hfader_dist; a->push_back(scene[sc].filterblock_configuration.assign( p_id++, id_s++, "fb_config", "Filter Configuration", ct_fbconfig, gui_col4_x - 1, - gui_topbar + 25, sc_id, cg_GLOBAL, 0, false, CSlider::kHorizontal)); + gui_topbar + 25, sc_id, cg_GLOBAL, 0, false, kHorizontal)); a->push_back(scene[sc].filter_balance.assign( p_id++, id_s++, "f_balance", "Filter Balance", ct_percent_bidirectional, gui_col4_x, - gui_mainsec_slider_y + 11, sc_id, cg_GLOBAL, 0, true, CSlider::kHorizontal | sceasy)); + gui_mainsec_slider_y + 11, sc_id, cg_GLOBAL, 0, true, kHorizontal | sceasy)); a->push_back(scene[sc].lowcut.assign(p_id++, id_s++, "lowcut", "High Pass", ct_freq_hpf, gui_envsec_x + gui_vfader_dist * 2 + 5, gui_envsec_y, - sc_id, cg_GLOBAL, 0, true, CSlider::kVertical | kWhite | sceasy)); + sc_id, cg_GLOBAL, 0, true, kVertical | kWhite | sceasy)); a->push_back(scene[sc].wsunit.type.assign(p_id++, id_s++, "ws_type", "Waveshaper Type", ct_wstype, gui_envsec_x + gui_vfader_dist * 4 - 1, @@ -356,7 +356,7 @@ SurgePatch::SurgePatch(SurgeStorage* storage) a->push_back(scene[sc].wsunit.drive.assign( p_id++, id_s++, "ws_drive", "Waveshaper Drive", ct_decibel_narrow, gui_envsec_x + gui_vfader_dist * 5 + 10, gui_envsec_y, sc_id, cg_GLOBAL, 0, true, - CSlider::kVertical | kWhite | sceasy)); + kVertical | kWhite | sceasy)); for (int f = 0; f < 2; f++) { @@ -365,14 +365,14 @@ SurgePatch::SurgePatch(SurgeStorage* storage) a->push_back(scene[sc].filterunit[f].type.assign(p_id++, id_s++, "type", "Filter Type", ct_filtertype, px - 2, py + 1, sc_id, - cg_FILTER, f, false, CSlider::kHorizontal)); + cg_FILTER, f, false, kHorizontal)); a->push_back(scene[sc].filterunit[f].subtype.assign( p_id++, id_s++, "subtype", "Filter Subtype", ct_filtersubtype, px - 3, py + 1, sc_id, - cg_FILTER, f, false, CSlider::kHorizontal)); + cg_FILTER, f, false, kHorizontal)); py = gui_mainsec_slider_y; a->push_back(scene[sc].filterunit[f].cutoff.assign( p_id++, id_s++, "cutoff", "Cutoff", ct_freq_audible, px, py, sc_id, cg_FILTER, f, true, - CSlider::kHorizontal | sceasy)); + kHorizontal | sceasy)); if (f == 1) a->push_back(scene[sc].f2_cutoff_is_offset.assign( p_id++, id_s++, "f2_cf_is_offset", "Is Offset to F1", ct_bool_relative_switch, px, @@ -380,7 +380,7 @@ SurgePatch::SurgePatch(SurgeStorage* storage) py += gui_hfader_dist; a->push_back(scene[sc].filterunit[f].resonance.assign( p_id++, id_s++, "resonance", "Resonance", ct_percent, px, py, sc_id, cg_FILTER, f, - true, CSlider::kHorizontal | sceasy)); + true, kHorizontal | sceasy)); if (f == 1) a->push_back(scene[sc].f2_link_resonance.assign( p_id++, id_s++, "f2_link_resonance", "Link Resonance", ct_bool_link_switch, px, py, @@ -392,11 +392,11 @@ SurgePatch::SurgePatch(SurgeStorage* storage) py = gui_envsec_y; a->push_back(scene[sc].filterunit[f].envmod.assign( p_id++, id_s++, "envmod", "Envmod", ct_freq_mod, px + gui_sec_width, py, sc_id, - cg_FILTER, f, true, CSlider::kVertical | kWhite | sceasy)); + cg_FILTER, f, true, kVertical | kWhite | sceasy)); px += 3 * gui_vfader_dist - gui_sec_width; a->push_back(scene[sc].filterunit[f].keytrack.assign( p_id++, id_s++, "keytrack", "Keytrack", ct_percent_bidirectional, px, py, sc_id, - cg_FILTER, f, true, CSlider::kVertical | kWhite)); + cg_FILTER, f, true, kVertical | kWhite)); } // scene[sc].filterunit[0].type.val.i = 1; @@ -407,7 +407,7 @@ SurgePatch::SurgePatch(SurgeStorage* storage) const int so = -30; a->push_back(scene[sc].adsr[e].a.assign(p_id++, id_s++, "attack", "Attack", ct_envtime, px, py, sc_id, cg_ENV, e, true, - CSlider::kVertical | kWhite | sceasy)); + kVertical | kWhite | sceasy)); a->push_back(scene[sc].adsr[e].a_s.assign(p_id++, id_s++, "attack_shape", "Attack Shape", ct_envshape, px, py + so, sc_id, cg_ENV, e, false, kNoPopup)); @@ -415,7 +415,7 @@ SurgePatch::SurgePatch(SurgeStorage* storage) a->push_back(scene[sc].adsr[e].d.assign(p_id++, id_s++, "decay", "Decay", ct_envtime, px, py, sc_id, cg_ENV, e, true, - CSlider::kVertical | kWhite | sceasy)); + kVertical | kWhite | sceasy)); a->push_back(scene[sc].adsr[e].d_s.assign(p_id++, id_s++, "decay_shape", "Decay Shape", ct_envshape, px, py + so, sc_id, cg_ENV, e, false, kNoPopup)); @@ -423,12 +423,12 @@ SurgePatch::SurgePatch(SurgeStorage* storage) a->push_back(scene[sc].adsr[e].s.assign(p_id++, id_s++, "sustain", "Sustain", ct_percent, px, py, sc_id, cg_ENV, e, true, - CSlider::kVertical | kWhite | sceasy)); + kVertical | kWhite | sceasy)); px += gui_vfader_dist; a->push_back(scene[sc].adsr[e].r.assign(p_id++, id_s++, "release", "Release", ct_envtime, px, py, sc_id, cg_ENV, e, true, - CSlider::kVertical | kWhite | sceasy)); + kVertical | kWhite | sceasy)); a->push_back(scene[sc].adsr[e].r_s.assign(p_id++, id_s++, "release_shape", "Release Shape", ct_envshape, px, py + so, sc_id, cg_ENV, e, false, kNoPopup)); @@ -448,7 +448,7 @@ SurgePatch::SurgePatch(SurgeStorage* storage) sprintf(label, "lfo%i_shape", l); a->push_back(scene[sc].lfo[l].shape.assign(p_id++, id_s++, label, "Shape", ct_lfoshape, px, py, sc_id, cg_LFO, ms_lfo1 + l, true, - CSlider::kHorizontal)); + kHorizontal)); px = gui_modsec_x; py = gui_modsec_y - 10; @@ -456,22 +456,22 @@ SurgePatch::SurgePatch(SurgeStorage* storage) sprintf(label, "lfo%i_rate", l); a->push_back(scene[sc].lfo[l].rate.assign(p_id++, id_s++, label, "Rate", ct_lforate, px, py, sc_id, cg_LFO, ms_lfo1 + l, true, - CSlider::kHorizontal | sceasy)); + kHorizontal | sceasy)); py += gui_hfader_dist; sprintf(label, "lfo%i_phase", l); a->push_back(scene[sc].lfo[l].start_phase.assign(p_id++, id_s++, label, "Phase / Shuffle", ct_percent, px, py, sc_id, cg_LFO, - ms_lfo1 + l, true, CSlider::kHorizontal)); + ms_lfo1 + l, true, kHorizontal)); py += gui_hfader_dist; sprintf(label, "lfo%i_magnitude", l); a->push_back(scene[sc].lfo[l].magnitude.assign(p_id++, id_s++, label, "Magnitude", ct_percent, px, py, sc_id, cg_LFO, - ms_lfo1 + l, true, CSlider::kHorizontal | sceasy)); + ms_lfo1 + l, true, kHorizontal | sceasy)); py += gui_hfader_dist; sprintf(label, "lfo%i_deform", l); a->push_back(scene[sc].lfo[l].deform.assign(p_id++, id_s++, label, "Deform", ct_percent_bidirectional, px, py, sc_id, - cg_LFO, ms_lfo1 + l, true, CSlider::kHorizontal)); + cg_LFO, ms_lfo1 + l, true, kHorizontal)); px += gui_sec_width; py = gui_modsec_y; @@ -490,32 +490,32 @@ SurgePatch::SurgePatch(SurgeStorage* storage) sprintf(label, "lfo%i_delay", l); a->push_back(scene[sc].lfo[l].delay.assign(p_id++, id_s++, label, "Delay", ct_envtime, px, py, sc_id, cg_LFO, ms_lfo1 + l, true, - CSlider::kVertical | kMini)); + kVertical | kMini)); px += gui_vfader_dist; sprintf(label, "lfo%i_attack", l); a->push_back(scene[sc].lfo[l].attack.assign(p_id++, id_s++, label, "Attack", ct_envtime, px, py, sc_id, cg_LFO, ms_lfo1 + l, true, - CSlider::kVertical | kMini)); + kVertical | kMini)); px += gui_vfader_dist; sprintf(label, "lfo%i_hold", l); a->push_back(scene[sc].lfo[l].hold.assign(p_id++, id_s++, label, "Hold", ct_envtime, px, py, sc_id, cg_LFO, ms_lfo1 + l, true, - CSlider::kVertical | kMini)); + kVertical | kMini)); px += gui_vfader_dist; sprintf(label, "lfo%i_decay", l); a->push_back(scene[sc].lfo[l].decay.assign(p_id++, id_s++, label, "Decay", ct_envtime, px, py, sc_id, cg_LFO, ms_lfo1 + l, true, - CSlider::kVertical | kMini)); + kVertical | kMini)); px += gui_vfader_dist; sprintf(label, "lfo%i_sustain", l); a->push_back(scene[sc].lfo[l].sustain.assign(p_id++, id_s++, label, "Sustain", ct_percent, px, py, sc_id, cg_LFO, ms_lfo1 + l, true, - CSlider::kVertical | kMini)); + kVertical | kMini)); px += gui_vfader_dist; sprintf(label, "lfo%i_release", l); a->push_back(scene[sc].lfo[l].release.assign(p_id++, id_s++, label, "Release", ct_envtime_lfodecay, px, py, sc_id, cg_LFO, - ms_lfo1 + l, true, CSlider::kVertical | kMini)); + ms_lfo1 + l, true, kVertical | kMini)); px += gui_vfader_dist; } } diff --git a/src/common/gui/COscillatorDisplay.cpp b/src/common/gui/COscillatorDisplay.cpp index 3ef6b47b8c5..0a4ec22511c 100644 --- a/src/common/gui/COscillatorDisplay.cpp +++ b/src/common/gui/COscillatorDisplay.cpp @@ -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; @@ -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); diff --git a/src/common/gui/CPatchBrowser.cpp b/src/common/gui/CPatchBrowser.cpp index 3d8aed36611..edab1a74c03 100644 --- a/src/common/gui/CPatchBrowser.cpp +++ b/src/common/gui/CPatchBrowser.cpp @@ -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 @@ -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); } @@ -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); diff --git a/src/common/gui/CSnapshotMenu.cpp b/src/common/gui/CSnapshotMenu.cpp index b707200b5d4..23a046e2663 100644 --- a/src/common/gui/CSnapshotMenu.cpp +++ b/src/common/gui/CSnapshotMenu.cpp @@ -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); }; @@ -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); }; diff --git a/src/common/gui/CSurgeSlider.cpp b/src/common/gui/CSurgeSlider.cpp index 342247cee73..3805232fb9b 100644 --- a/src/common/gui/CSurgeSlider.cpp +++ b/src/common/gui/CSurgeSlider.cpp @@ -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); @@ -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); @@ -128,7 +128,7 @@ void CSurgeSlider::draw(CDrawContext* dc) CRect size = getViewSize(); - if (style & CSlider::kHorizontal) + if (style & kHorizontal) { if (style & kSemitone) typey = 2; @@ -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); @@ -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); @@ -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); @@ -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); @@ -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); @@ -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; @@ -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); @@ -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); @@ -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; diff --git a/src/common/gui/SurgeGUIEditor.cpp b/src/common/gui/SurgeGUIEditor.cpp index 07cef87e00a..3566bda70ca 100644 --- a/src/common/gui/SurgeGUIEditor.cpp +++ b/src/common/gui/SurgeGUIEditor.cpp @@ -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]; @@ -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]; @@ -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; @@ -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;