how to implement context menu slider?

i’m working on a new plugin with another dev, and i thought of adding a slider to the right click menus of a couple of our modules, to control the value of a float. but it turns out neither of us has any experience implementing sliders in the context menu.

are there any basic examples out there of this that i can draw from? or could somebody explain how to do it?

There are multiple modules that use a context menu slider for color theme contrast control. Meander does this, but there are probably simpler modules to use as example. I forget where I learned how to do this.

1 Like

Impromptu Clocked is probably what I used as a slider model.

that’s what i was trying to look at but it seemed complicated to me. all the other context menu items i’ve added so far have been very very simple to do, but the examples i’ve found so far for this seem much more involved. each one i’ve seen so far involved creating structs and stuff, and i was hoping there was a simpler way. guess i’ll look closer, thanks :slight_smile:

1 Like

Yeah, I struggled to implement my slider. It is not a trivial implementation.

ah. that’s a bummer to hear. thanks for the responses :stuck_out_tongue:

1 Like

It does not look like I followed Impromptu’s lead, but I can’t remember whose lead I followed.

I use menu sliders in my Light Strip module but they are probably more complex than you need.

Have a look at how the sliders are done in the MindMeld MixMaster - the GainAdjustSlider implementation is quite simple. The GainAdjustSlider constructor accepts a pointer to the variable into which the slider value is to go. GainAdjustQuantity is used to describe the sliders behaviour.

4 Likes

thanks for this :smiley: i managed to figure it out pretty late last night, but i’ll look over all this to see if there’s any way i can improve what i have.

3 Likes

another example is in the Bogaudio LLFO module

3 Likes