feat: legible ReaSampler 9000 editor — bigger knobs, ms time constants, per-ring double-click reset, and an antialiased draw pass
This commit is contained in:
@@ -79,7 +79,10 @@ void ReaSamplerEditor::attachedToParent() {
|
||||
wc.hInstance = hInst;
|
||||
wc.lpszClassName = kChildClassName;
|
||||
wc.hCursor = LoadCursor(nullptr, IDC_ARROW);
|
||||
wc.style = CS_HREDRAW | CS_VREDRAW;
|
||||
// CS_DBLCLKS is what makes WM_LBUTTONDBLCLK arrive at all. It also REPLACES the second
|
||||
// WM_LBUTTONDOWN of a double-click, so every surface that counted two downs (Browse's
|
||||
// load accelerator) depends on the DBLCLK handler falling through to onMouseDown.
|
||||
wc.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS;
|
||||
RegisterClassW(&wc);
|
||||
classRegistered = true;
|
||||
}
|
||||
@@ -150,6 +153,17 @@ LRESULT CALLBACK ReaSamplerEditor::wndProc(HWND hwnd, UINT msg, WPARAM wParam,
|
||||
self->onMouseDown(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
|
||||
}
|
||||
return 0;
|
||||
case WM_LBUTTONDBLCLK:
|
||||
if (self) {
|
||||
SetCapture(hwnd);
|
||||
SetFocus(hwnd);
|
||||
const int mx = GET_X_LPARAM(lParam);
|
||||
const int my = GET_Y_LPARAM(lParam);
|
||||
// Knob reset first; anything it does not claim is the second click of the pair
|
||||
// this message stands in for (see the class-style note above).
|
||||
if (!self->onMouseDoubleClick(mx, my)) self->onMouseDown(mx, my);
|
||||
}
|
||||
return 0;
|
||||
case WM_MOUSEMOVE:
|
||||
if (self) {
|
||||
const int mx = GET_X_LPARAM(lParam);
|
||||
@@ -202,6 +216,11 @@ LRESULT CALLBACK ReaSamplerEditor::wndProc(HWND hwnd, UINT msg, WPARAM wParam,
|
||||
// explicitly (the child wndproc historically handled only left-button).
|
||||
if (self) self->onMouseRDown(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
|
||||
return 0;
|
||||
case WM_RBUTTONDBLCLK:
|
||||
// CS_DBLCLKS replaces the second RIGHT-button down too, so the spline surfaces'
|
||||
// repeat-delete needs this peer or a fast double right-click drops one delete.
|
||||
if (self) self->onMouseRDown(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
|
||||
return 0;
|
||||
case WM_RBUTTONUP:
|
||||
return 0; // claimed so the pair never reaches DefWindowProc (no context menu)
|
||||
case WM_CAPTURECHANGED:
|
||||
|
||||
Reference in New Issue
Block a user