Combox: how can I fill the list programmatically

A place for developers to share ideas and assist each other in solving problems.

Moderators: valis, garyb

Post Reply
DragonSF
Posts: 405
Joined: Sun Nov 08, 2015 4:28 pm

Combox: how can I fill the list programmatically

Post by DragonSF »

I'm designing an external MIDI-In module and I want to be able to select any available MIDI-Ins from the ComboBox. In order to do that, I need to fill the ComboBox with available MIDI-In devices. Anyone knows, how to accomplish that?
DragonSF
Posts: 405
Joined: Sun Nov 08, 2015 4:28 pm

Re: Combox: how can I fill the list programmatically

Post by DragonSF »

I'm giving up, because the interface from pep to scopefx is here not campatible.
w_ellis
Posts: 554
Joined: Wed Nov 07, 2001 4:00 pm
Location: London, U.K.

Re: Combox: how can I fill the list programmatically

Post by w_ellis »

When I was mulling something similar before, my plan was to build the UI outside of Scope (using Juce) and then just launching it from within Scope (similar to how ScopeSync works)
DragonSF
Posts: 405
Joined: Sun Nov 08, 2015 4:28 pm

Re: Combox: how can I fill the list programmatically

Post by DragonSF »

ext midi.png
ext midi.png (10.92 KiB) Viewed 6905 times
That was my first approach, but it can't be used as surface. I found a way to work around this. If you want to know, just send me the usual email.
User avatar
sunmachine
Posts: 471
Joined: Mon Mar 01, 2010 12:37 am

Re: Combox: how can I fill the list programmatically

Post by sunmachine »

It would be great if you could post your workaround here and/or in the SDK Wiki.
Might come in handy one day. :)
DragonSF
Posts: 405
Joined: Sun Nov 08, 2015 4:28 pm

Re: Combox: how can I fill the list programmatically

Post by DragonSF »

Here you are:
1. Add to your module, which includes 1 or more ComboBoxes (CB), 3 pads for each CB: input 'index' and outputs 'max' and 'selected string'.
2. Add a 'SingleLineText' from Design/Surfaces and connect the 'Str'-Pad to 'selected string'
3. Add a TextFader from Design/surface/controls. In the pad list go to vars and create pad for 'max'. Connect 'value' to 'index' and 'max' to 'max'.

If proper programmed, you can select by using the taxt fader (move pressed mosue left/right within the field).

Proper program can look like:

int sel = asyncIn[INPAD_INDEX]->itg;
if (sel < extMidiGUI->midiOutputList->getNumItems())
{
extMidiGUI->midiOutputList->setSelectedItemIndex(sel, true);
extMidiGUI->setMidiOutput(sel);
}
String::CharPointerType item = extMidiGUI->midiOutputList->getItemText(extMidiGUI->midiOutputList->getSelectedItemIndex()).getCharPointer();
asyncOut[OUTPAD_SELECTION].str = (char *)item.getAddress();
asyncOut[OUTPAD_MAX].itg = extMidiGUI->midiOutputList->getNumItems();
User avatar
sunmachine
Posts: 471
Joined: Mon Mar 01, 2010 12:37 am

Re: Combox: how can I fill the list programmatically

Post by sunmachine »

Thanks, DragonSF!
Post Reply