Page 1 of 1

relative paths

Posted: Fri Feb 22, 2013 8:25 pm
by tester
I wonder if it's possible to do this (without ruby).

I noticed, that the standalone/exe app recognizes, at least to some degree - relative paths, i.e. if a required file follows the exe, then if preset manager uses only the filename (without path) - the file is loaded.

Now I'm thinking about something else. Combining dropdown list with a relative folders (with subfolders and subsubfolders and files), a relative structure that follows the app. So for example you have in your main directory:

app.exe
folder/subfolders/subsubfolders/files

then in the app - you always get (auto-loaded) the:

menu-items = subfolder-names
submenu-items = subsubfolder-names
subsubmenu-items = file-names
(multi-level menu in dropdown list works - tested).

Plus - if it could work if you move the man directory with your app wherever you want to. This is for user interface only, so no big deal of in vst activity only dll is duplicated somewhere else by the host.

Now - using dropdown list has one advantage over clicking to load an external file. No glitches in visual interface (whole screen flickers few times).

Anyone played with it?

Re: relative paths

Posted: Fri Feb 22, 2013 10:10 pm
by trogluddite
Yes, I think that could be done - though iterating through nested folders could be tricky.

To get started, you'll need the "Find Files" primitive, and the "Start Folder" primitive. Add to the end of the "Start Folder" string a search pattern using the standard wild-card characters. For example...
<start folder> + "\*.txt" -> Find Files; would find all text files in the folder
<start folde> + "\*" -> Find Files; would find everything in the same directory, including sub-folders.

This returns a string array of everything found. Sub-folders can usually be identified by checking for the '.' character, as folders have no extension. Then repeat the above using the sub-folder name as the starting point.

To retrieve all nested paths is much harder though - it's best done using a recursive function, which green components cannot emulate (yes, Ruby can - guess you knew I was going to say that!!).
I don't think it would be impossible in green - but there would be some pretty tricky trigger logic, as you can't know the length or nesting depth of the loops that you'd need in advance. It would be easier if you could restrict the amount of nesting to a known depth.

Re: relative paths

Posted: Fri Feb 22, 2013 11:16 pm
by tester
Okay, thanks for explaining a bit.
Guess in a few days or weeks I start to check it.