Cabbage Logo
Back to Cabbage Site

Plugin resizing (scroll down for latest solution)

Or maybe it’s best to automatically add the sizes when a user make mode(“resize”)? So in the end the user only has to set the style and position of the combobox?, i.e,

combobox bounds(10, 180, 80, 20), mode("resize")

Yes much better. 75% is used a lot and it is very comfortable to use that 25.

Ok. Leave it with me. I’ll go from 25% up to 200% in steps of 25% :+1:

Anyway, both ideas are good and could be tested.

This is how I did it (25% increments).

instr 7

kMenuTrigger chnget "MenuTrigger"
kWidth = 700
kHeight = 500

if changed:k(kMenuTrigger) == 1 then  
    if (kMenuTrigger == 1) then
        SMessage sprintfk "scale(%f)", 0.75
        chnset SMessage, "formIdent"
    endif
    if (kMenuTrigger == 2) then
        SMessage sprintfk "scale(%f)", 1
        chnset SMessage, "formIdent"
    endif
    if (kMenuTrigger == 3) then
        SMessage sprintfk "scale(%f)", 1.25
        chnset SMessage, "formIdent"
    endif
    if (kMenuTrigger == 4) then
        SMessage sprintfk "scale(%f)", 1.5
        chnset SMessage, "formIdent"
    endif

endif   

endin

Not the most efficient way maybe, but it works fine, also resizes all my widgets and the .png background

I’ve changed this so that it no longer using any channels, as these were preventing it from working in Logic if you hadn’t pressed play. I’ve also updated the example. It’s much simpler now, just use the following code:

combobox bounds(10, 180, 80, 20), mode("resize"), value(3)

value(3) is 100%. You can still style the combobox, but it will automatically add its own sizes from 75% to 200%. Its size is also saved across sessions, and whenever you open or close the plugin.

Let me know how it goes.

Logic and Cubase without audio track running, when closing and opening the plugin they return to 100%

To activate it you need to make the percentage selection with the track moving.
(once activated, it works correctly without the need for audio reading)

Reaper and Live, behave correctly without audio track.
Session save is correct in all.

Thanks for testing! I’ll sort that when I get a chance.

Okay,
It is a great detail on your part, to be in depth on this matter.
Thanks :wink:

Hi @Gerbo, I have this working now BUT, it depends on the new system of updating widgets. Are you setting the value of any widgets using chnset? Or are you using identchannels() If not then all you need to do is add guimode("queue) to your form definition and you should be good to go.

Good morning @rory,
The example with guimode (“queue”) works well, what happens is that as you have told me, all the code based on “chnset” and “identchannels ()” at the graphics level disappears.
It is curious, how inserting the plugin “Test Oscillator (even if it is inactive)” activates any plugin that is inserted after it. It’s a very old trick in Logic.
More than a plugin, I suppose it is an application.

Yes, but it can easily be replaced with better more efficient options.

I have been taking a look at the new codes, and they look very interesting, especially because of the low CPU consumption that you mention. Now I am updating some plugins, and if I apply these new codes, the user sessions will not work.
Soon and with the new projects, I will apply them of course.

  • cabbageSet
  • cabbageGet
  • cabbageCreate
    This all looks great :wink:

Yes, these are best kept for newer plugins. For now the old behaviour and identchannel()'s are still the default. I don’t plan on changing that as it would break people’s code which we don’t ever want to happen!

Have a little issue with this. I removed the original code for resizing to implement this, but this happens when I run the code (have removed all previous resizing code)

Do you still have an identifier channel attached to the form? Maybe you can PM me your file?

I fixed the first issue, but I’m now looking into why the resize combobox isn’t set to 100% when the instrument first opens. I think there is something in the snaps file that is messing it up…

[edit] I think I spotted the problem. I think it uses a default channel name, like combo1, which is messing with some other things saved in the presets file… I’m just looking for a fix now…

I thought about something related. Would it be favorable for the .snaps file to somehow ignore the resizing-combobox value? With the way I had it set up before, if you set the resize value to 125%, and then switched preset, it would change back to 100% because the .snaps file had stored that value.

I don’t think the snaps file should save the sizes, I think the host should save those. This is a tricky one. I’m still trying to find the real cause of it…

Just pushed a fix for that now. It turns out that both the resize combo and the presets combo were using the same default channel name :see_no_evil: Let me know if this works better. It runs fine for me here.