Thread: AAX and knobs
View Single Post
Old 11-14-2017, 06:47 PM   #22
earlevel
Human being with feelings
 
Join Date: Dec 2015
Posts: 261
Default

Quote:
Originally Posted by bozmillar View Post
Hey Trunca,

What did you end up doing to fix this? This has always bugged me that I can't make stepped knobs Ints or Enums because mouse drag gets all screwy.
Hey, Boz, taking a guess at what you're experiencing, stop me if this sounds right...

If you make a knob with a few steps, mouse drags become unintuitive as you run through the steps to one limit and then back. Yes?

If so, I mentioned my fix for that in a reply to another thread: https://forum.cockos.com/showpost.ph...0&postcount=14

Essentially: few discrete steps, with pinned extremes, when used relative drags at each GUI update...doesn't behave right. I made mine relative to the initial mouse down.

I have a couple of controls that do this, one being a knob. But its easier to understand the issue if I explain the non-knob:

I have a control that is a note-value icon (8th, 16th...) on the UI. Mouse down on it, and it becomes a popup menu of horizontal choices. Picture side-by-side squares with different note values. When the menu pops up, its initial position is shifted left or right so that the current choice lands over the button—so that the mouse is sitting on it—and it's highlighted. After it's up, it doesn't move—the highlight changes to track the horizontal mouse position. Drag the mouse to the left, the highlight shift to the next box over (release the mouse, that's the new setting).

Of course, the user drag can overshoot the left or right side, and you want the furthest left or right choice to be highlighted, even when the mouse moves far away. (The same as when you over-drag a knob—you pin at min or max frame.)

Consider how my control would behave on over-drag if I used the standard tracking. Say I drag to the left so far I'm now four inches past the left edge of the control. The left-most choice is highlighted. Now, without releasing the mouse, I start dragging back to the right—it would switch to the next choice while the mouse is still more than three inches from the control. Yuck. Instead, I base all moves on the difference between the current mouse position and the initial mouse-down. Stepped knobs benefit similarly with a more logical feel.
earlevel is offline   Reply With Quote