Panel - Send Value on Drag
-
@d-healey because it's more flexible and can do anything a button or slider can do? In any case I rarely use panels but I am doing so now for a certain purpose.
-
@DanH said in Panel - Send Value on Drag:
and can do anything a button or slider can do
Right, but a button or slider will do it better
What's your use case?
I think the mouse callback drag event already gives you the send value on drag behaviour.
-
@d-healey I'm setting loop points for a sampler.
I wanted to be able to move the loop section as a whole - so the user sets the loop duration, then auditions that loop section at different areas of the sample.
A Panel works well for it. But it continually changes the loop points of the sample map which looks a little janky on the ui and requires reloading of the sample map every time new values are set.
A Cleaner method would just be to update the sample loop points when the mouse button is released (i.e when the user has 'set' the position). I guess I can use some form of 'clicked'...
-
@DanH Have you seen the custom sample import demo project? It uses a panel to set loop points, no reloading required.
-
@d-healey Of course. Been using it for years, but I wanted a better ui for it. Possibly it didn't save the loop points in presets either which is also why I was using sliders to control start / end / xfade - I can't remember now.
-
@DanH said in Panel - Send Value on Drag:
Possibly it didn't save the loop points in presets
I think you can resave the sample map which will save the loop points, or if you want it specifically in the preset you could set the panel to saveInPreset - but then again I think it will always take on the value from the sample map.
-
@d-healey I seem to remember that being the case, yes.
So here's something I hadn't bargained for.... I've got panels that I'm dragging around and some will overlap. I've arranged them so the overlapping ones are 'on top' - I assumed this would mean that I could always access them with the mouse but if the panel at the 'bottom' is dragged it then seems to sit above the other panels and I can't click them....
-
@DanH I remember I ran into a similar issue on a project I was working on a while back. I instead made it so I had different "lanes" for different actions. In this gif I have a loop lane above the waveform, and a notes lane below.
-
@d-healey Yes I made lanes too originally. Now my 'move the loop' panel sits on top of everything
Its the most intuitive way so I'll keep at it for a bit. I need to perhaps find a way of reducing the width of the panel.
Is there a way to define the 'clickable' area of a panel?
-
@DanH Not directly but within the mouse callback you can check the position of the cursor and ignore clicks outside of the boundary you want to set.