It highlights the correct value but the value isn’t sent back to cabbage. For instance, here, the print value doesn’t reflect what is dynamically selected with cabbageSet. Any suggestions?
there’s a .snaps file in that folder but cabbage still loads the default location there the .csd is.
If I change the filetype to something else (i.e. “*.txt”) it works correctly, populating the txt files in the specified folder.
I think it makes sense - let’s say I have a bank of 50 Synth snapshots and another for Bass etc… It would be too many to have in a single dropdown menu. I wonder if there’s some sort of workaround…
Hmmm - not happening for me here for some reason- even with a direct file ref…
<Cabbage>
form caption("Untitled") size(400, 300), guiMode("queue"), pluginId("def1")
image bounds(0, 0, 400, 300), channel("wallpaper"), file("test")
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 -m0d --midi-key-cps=4 --midi-velocity-amp=5
</CsOptions>
<CsInstruments>
; Initialize the global variables.
ksmps = 32
nchnls = 2
0dbfs = 1
;instrument will be triggered by keyboard widget
instr 1
cabbageSet "wallpaper", "file(\"PATH TO IMAGE\")"
endin
</CsInstruments>
<CsScore>
;causes Csound to run for about 7000 years...
i1 0 500
</CsScore>
</CsoundSynthesizer>
Just to clarify - I’m simply suggesting the capability of loading individual .snaps files - not multiple concurrently. Of course I see the caveat there with accidentally loading a snaps file that doesn’t correspond with the controls - but I assume there’s others too…
it works if it is pointing to a directory within the current dir, but it doesn’t seem to work when you wish to go back out of the current dir. This is a bug. It should work. I’ll get that sorted.
Got it - it’s working well! however, the loaded .snaps file renders the combobox empty until something is selected from the dropdown. Is it possible for it to automatically load the first snap?
Any chance you could prepare a simple example for me? I hacked the PresetNamed.csd example in the Misc folder to load a named preset and it loads fine. Is that example working Ok for you?
I think I understand what you’re looking for now. Note that the preset combobox should display the first items if it opens for the first time, although it won’t update any widgets. If the user saves a session with the first snapshot selected, then the next time they open the session that preset will be loaded. If you have a default state, that should be coded into the widget’s value identifier.
The best solution here would be to create a protectedItems() preset that matches tabula rasa for the plugin. When the plugin loads for the first time all widgets will be set to default, which also matches the first preset, which users can’t overwrite. At any point during a session users can return to this state via the preset combobox. @hdale does this in his Graindrop plugin and it works very well.
Yes, this is what I usually do for default loading - set the default widget val is the same as the 1st snap… however I think we are talking about something different here - unless I’m not understanding… the 1st snap isn’t loading at all when .snaps are dynamically replaced: https://recordit.co/3NTJMVckCb
I have to manually select it from the dropdown menu otherwise it’s empty.
Sure. A simple .csd is attached
See here. I choose - “snap1” and the snap1.snaps is loaded but it doesn’t load the first snap. Same with “snap2” https://recordit.co/AaafDg2KSn