"one of many" choice button group + grouping parameters in widget

For a module similar to a mixer (see below) I try to

  1. define a group of buttons (one button per channel, row ‘E’ in the screenshot) that allows the user to select the channel for which parameters are shown/edited (in the gray box). Obviously only one channel can be in ‘edit mode’ at a time.
  2. define a widget (the gray box) that contains the parameters of a channel (instead of adding them to the module widget). The idea is to create one instance per channel and control visibility via the E buttons.

My attempts so far (like creating parameter controls in the constructor of my own widget) were not really elegant and/or resulted in crashes. Is there a ‘best practice’ for what I am trying to do? Thanks!

EDIT

Looks like I found a solution to problem #2.

struct EditorWidget : OpaqueWidget
{
	LabSeven_R128Widget *module;
	void addParam(ParamWidget *pw)
	{
		module->params.push_back(pw);
		this->addChild(pw);
	}
	EditorWidget(LabSeven_R128Widget *module)
	{
		this->module = module;
		addParam(ParamWidget::create<LSR3EditSwitch>(Vec(15,25), module->module, LabSeven_R128::MAP0101  , 0.0f, 1.0f, 1.0f));
	}
};

Don’t know how much help this is but problem one is called a Radio button.

2 Likes

I know radio buttons from VCL, Qt etc. but I have not seen them in Rack (so far). I guess I will implement this myself.

1 Like

There will be radio buttons in Rack v. 1

https://vcvrack.com/docs/structrack_1_1ui_1_1RadioButton.html

So it is probably not a good idea to have a redundant implementation. I’ll use a fader and replace it later by a radio button.

Was that ever implemented, the radio button?

The link is dead.

Been trying a few things today, but if there is one already implemented, I think I could use one :slight_smile:

Another name for Radio/Option buttons is a Switch (select an item from a set of mutually exclusive items). Easy to design the frames for your custom switch to look like radio buttons, if that’s what you want.

In a physical module, you’d have a different design to minimize the number of moving parts: A single knob or a single momentary pushbutton that cycles through the active items, and leds indicating the selected item.

1 Like

I agree, a switch is the way I would do this.

EDIT: Actually I used a set of momentary buttons and an integer to remember the last one selected to do radio button functionality in my random access switches.

I always use drop down combo boxes. They take less clicks. I don’t care that physical euro racks don’t have them.

I ended up using the example from here, the momentary version. That gave me inspiration to move on and try to make something similar. Works fine and recalls perfectly when setup with JSon:

1 Like

Yeah, going to use that for a different purpose, on something else today.

But for the purpose I asked for the switch for, I would like instant access to each setting. It’s a preset controller that is kind of a “master controller” for other modules with presets. Those modules has simpler solution, with a knob, which works fine, but I needed something more “easy to acces” for the master controller.

I don’t care either.

I don’t think adding such limitations makes sense in a digital environment :slight_smile:

To be more clear - the one solution I really don’t like is one button that toggles you through a bunch of options. For me this is the one thing I don’t like about the excellent Bogaudio modules.

Other than that, I guess it’s up to the module/panel designer to make something that works. For a reasonably small number of choice radio buttons make a lot of sense. If there are a lot of choices I feel they take up too much space. And they force a re layout of the panel if more options are added. But if they work out, fine.

I don’t know that I’ve seen any great solutions for how to pick from a bunch of options. Both of my new modules have this dilemma. For me, the combo box is a good solution, but I can appreciate that some people don’t like them.

1 Like