DISTRHO / Cardinal

Virtual modular synthesizer plugin
https://cardinal.kx.studio/
GNU General Public License v3.0
2.22k stars 153 forks source link

Voxglitch Groovebox cannot load a folder containing several WAV files, Cardinal VST3 (main) 23.02, REAPER v6.79, Windows 11 #533

Open GBaige opened 1 year ago

GBaige commented 1 year ago

Once again Cardinal VST3 (main) 23.02, REAPER v6.79, Windows 11, issue is not present in VCV Rack 2

Right-clicking on the Voxglitch Groovebox module and clicking on "Load first 8 WAV files from a folder" opens a File Explorer window; however, rather than being able to select the desired folder, the File Explorer instead enters the folder. The user can attempt to load a file inside the folder, but nothing will happen.

this don't fuckin work

cosinekitty commented 1 year ago

@clone45 might want to take a look at this.

clone45 commented 1 year ago

Thanks! I'm a bit busy right now, but I'll try to address it soon!

dromer commented 1 week ago

@GBaige latest nightly builds have Voxglitch updated to latest version, can you test again?

[edit: actually I can confirm that it doesn't work ... @clone45 ? :D ]

It does work in VCV. It seems our filebrowser is not selecting folder location but a single file? filebrowser mode seems different. Perhaps something in our async-dialog configuration.

clone45 commented 1 week ago

@dromer Certainly, I'll put some time aside tomorrow to dig into this. I appreciate the heads-up.

dromer commented 1 week ago

Ok this fixes it for me:

diff --git a/src/GrooveBox/GrooveBoxWidget.hpp b/src/GrooveBox/GrooveBoxWidget.hpp
index 1aef45b..65e7a34 100644
--- a/src/GrooveBox/GrooveBoxWidget.hpp
+++ b/src/GrooveBox/GrooveBoxWidget.hpp
@@ -62,7 +62,8 @@ struct LoadSamplesFromFolderMenuItem : MenuItem
         async_dialog_filebrowser(false, NULL, module->samples_root_dir.c_str(), "Load folder", [module](char *path)
                                  {
                        if(path){
-                               pathSelected(module, std::string(path));
+                               std::string dir = system::getDirectory(path);^M
+                               pathSelected(module, dir);^M
                                free(path);
                        } });
 #else

This the step you meant from chat @falkTX ?

falkTX commented 1 week ago

yes, but that 2nd line can be simplified since "dir" is already a std::string type