Cabbage Logo
Back to Cabbage Site

Setting CabbageIDs::text for combobox

Hi Rory,

I was using a combobox with *.snaps and channeltype(“string”) to get the snapshot’s file name that is being loaded. I noticed that the size in the Array contained in ::text wasn’t being refreshed in refreshDiskReadingGUIControls. I made a patch (-p1 inside the cabbage directory). Do you think it’s Ok?

Also, is it possible to have filebuttons(*.snaps) trigger their channel like any unlatched button? That way you would know when saving took place. Other solution would be to have a SNAPSHOT_FILENAME channel. I tried that and it only takes 2 lines.

Do you plan on leaving texteditors as ‘layout’ or are they going to become ‘interactive’ now?

Finally, I noticed you tend to call setParameterNotifyingHost and then follow it with setParameter. Being that setParameterNotifyingHost calls SetParameter itself, aren’t you calling it twice?

Anyway, I had enough JUCE for today. I’m probably going to switch to beer for the rest of the evening. :beers:

Cheers.

SetTextwithArray.txt (1.0 KB)

Cool. The setParameter thing is there because at some point I was having an issue with hosts, but you’re right, it can probably be taken out. I’ll check out the patch when I get a moment, thanks for sending it. So-called interactive widgets can be controlled by a host. I should probably
stop using the term interactive as most Cabbage widgets actually are interactive in that they can have a two way conversation with Csound. But what I refer to in my source code as interactive widgets are the ones that can be controlled using a DAW. It’s makes little sense to add text widgets to that category as I’ve yet to see a DAW that can send text to a plugin!

Oh, I see what interactive means now. I was thinking about that because of how you’d do if you would want to save a snapshot of Texteditors. I haven’t seen a call to update() anywhere regarding them, so I assume (probably wrong) that the ::text attribute never gets updated.

I managed to save a snapshot of the current line by casting a pointer and using getText(), when the filebutton changes. Then I can read the string from the xml but unfortunately I can’t restore it using setText(). Anyway, it felt more like a hack than a real solution and I’m just starting to understand JUCE, its types, your code, etc.

I’ll keep trying!

Edit: I managed to make it work. As I said, it’s a hack only. The best would be to update the ::text attribute with the entire texteditor’s array, and then save/load that. I’m attaching the code for both functions (i.e. not a patch)

.aHackOnly.txt (3.6 KB)

This looks fine to me, but were you hoping to be able to retrieve the entire history of the text commands? I think this widget may still need a bit of work, it was a rather quick implementation for a user who was looking for it.

Retrieving the current line is fine for my oscillator bank.

I’m still trying to understand JUCE, but I think the attribute’s system in the filter should be always kept up-to-date to facilitate things in the future, am I wrong? A multi-line attribute could be also nice to have. Since it’s something already implemented in the JUCE component.

By the way, do you cross-compile in Linux for Mac OSX? Is it possible? I must apply those patches for using my code in our classes. Problem is I don’t have (nor want to buy) an Apple computer.

I simply recompile for OSX. Compiling in Linux for Windows seems to be possible, but I’ve never seen it done with OSX.

I pushed through those changes. But I’m going to now spend a little time on the texteditor so that it’s state is changed when a plugin editor is closed.