Cabbage Logo
Back to Cabbage Site

Dropdown Dropdown?

Aah, alright. Does that mean UI is rendered with the gpu instead of cpu?

In this instance no, but it is possible to offload to the GPU. For the simple widgets that Cabbage shows however there is very little gained in doing this. In my tests I saw no noticeable difference at all in performance.

@rorywalsh - a couple questions on this:

Would numerical idicies work if:

#define $LPF items:1(ā€œButterLPā€, ā€œToneā€,ā€œLPF 18ā€, ā€œK35ā€, etc)
#define $HPF items:2(ā€œButterHPā€, ā€œAtoneā€, ā€œK35ā€, etc)
#define $BPF items:3(ā€œButterBPā€, etc)
#define $BRF items:4(ā€œButterBRā€, etc) 

But you only used $BRF (text:4)? In other words, I assume it takes the index from the items declaration and not is location in the menu?

Similarly, if you used $HPF and then $LPF in that order, would they reorder numerically or appear in the order they were called? (just curious, not sure what Iā€™d prefer on that honestlyā€¦ will have to think about it)

Would that problem be negated by the key pair idea, since each entry would have itā€™s final value paired and no ā€œcalculatingā€ the index is needed? The more I think about it, the more I feel like this is the right direction to go for making a more complex submenu systemā€¦

But I need to keep thinking on itā€¦ itā€™s been a weird few days and I havenā€™t really had much focus on code.

So I nearly have this implemented to use strings or numbers. In the end it doesnā€™t really matter what we use, because Cabbage will build the menu depending on where the text:ā€¦() appears in the declaration.

I agree, but I think if we were to do this we would probably need to move away from the simple syntax of Cabbage and start using JSON/XML instead. Itā€™s just too awkward with the current syntax. And I would rather not make it any more complex. In JSON things would be neater, but your Cabbage section would suddenly become 100s if not 1000s of lines long. But just for demo purposes, a simple multi-menu demo could be built doing something like this:

{
    "form": {
        "title": "example",
        "size": [400, 300]
    },
    "rslider" : {
        "bounds": [0, 0, 200, 200],
        "channel": "frequency"
        "range": [0, 1, 0, 1, .01] 
    },
    "combobox" : {
        "channel" : "newMenu",
        "items": {
            "Waves" : [[1, "Sine"], [2, "Square"], [3,"Tri"]]
            "Sounds" : [[10, "Awesome"], [11, "Mediocre"], [12, "Outstanding"]]
        }
    }
}

Thatā€™s awesome! Do you think youā€™ll go the route of numbers, text, or either? I still prefer text because it allows the upper ā€œindexā€ to be descriptive and related to itā€™s contents. For example, with calling them, especially if the entries are defined as a macro in an included file, itā€™s much easier to remember items:lpf is the one iā€™m looking for vs items:3. I think either would work fine for me tho, just a loose preference.

Ooof. No thanks on the JSON for the whole cabbage section. That looks like a major headache. The only way I could see that being realistic is if a new menu widget was created that uses/imports JSON files. Probably not gonna happen either, but just a thought.

So I guess now I just need to settle on a good way to convert the dynamic index place from the generated combobox into a correlated constant that matches everywhere in the codeā€¦

Iā€™ll give it some more thought tomorrowā€¦ my brain is still on holiday for some reason. :exploding_head:

Hmm, the XML/JSON kinda reminds me of css. Maybe we could structure it like that?

Drop-down {
Bounds: 35, 32, 53, 30;
Items: item1, item2, item3; {
Item1: subitem 1, subitem 2;
Item3: subitem 1, subitem 2;
}
Colour: #3599db;
}

Edit: Iā€™m on mobile so sorry for bad formatting. Maybe we could import code like that one adsr example?

My point about JSON/XML is that is gives much greater scope for complex configurations. But I wouldnā€™t add it for one widget. That would be a nightmare.

I donā€™t follow. Can the indices not simply be assigned according to where the item:() identifiers appear in the combobox declaration? For me this is the simplest solution, and users can then use number or strings.

What I meant was this:
items:lpf() on itā€™s own yields items starting at 1.

But in another instrument I might have items:hpf() before items:lpf(), so now lpf starts at something unknown, other than 1.

Like I said tho, itā€™s probably pretty trivial once my headā€™s wrapped around itā€¦ Iā€™ve just been not having a good week or so when it comes to coding, my brain took an unexpected vacation without me. :wink:

Also @AveAcsent keep in mind that JUCE Comboboxes ā€œblinksā€ in LMMS when you try to click on them, thatā€™s why I added some ā€œhandlesā€ (just knobs links to the index of the Comboboxes) for LMMS user to be able to select waveforms, filters, etcā€¦ in ToneZ in LMMS

I have this implemented now. The index of each item is determined by when it is added to the combobox.

2 Likes

Wowā€¦ i dont even know what to say except thank you. its crazy that i only found cabbage in march, and some of my suggestions have already been put into cabbageā€¦ Thank you so much for adding this!

2 Likes

It was a good suggestion :wink: It only works with numerical indices, which is Ok with me, because thatā€™s what the host will get anyway in terms of parameter values.

2 Likes

This looks awesome, canā€™t wait to try it out. Not quite sure how Iā€™ll implement it yetā€¦ but it will definitely get used soon! Iā€™m going to try overcomplicating it firstā€¦ should really help clean up my ~40 entry menu for filtersā€¦ :rofl:

Is this available in the beta builds already?

Should be in the latest beta build :slightly_smiling_face:

am i doing this right?

What version of Cabbage is this? I merged some pull requests in the last week or so, perhaps my changes were lost. Iā€™ll take a look later, your code looks fine to me.

Itā€™s working fine for me here? :thinking: Can you try this build.

according to the output console, im using 2.3.50. wtf. Im installing newest beta rn so ill let you know

theres no windows installer

Sorry, just trying new build now. The Windows build keeps getting stuck on something. Not sure what. Itā€™s something to do with Azure.