Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

relative paths

For general discussion related FlowStone

relative paths

Postby tester » Fri Feb 22, 2013 8:25 pm

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?
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: relative paths

Postby trogluddite » Fri Feb 22, 2013 10:10 pm

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.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: relative paths

Postby tester » Fri Feb 22, 2013 11:16 pm

Okay, thanks for explaining a bit.
Guess in a few days or weeks I start to check it.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet


Return to General

Who is online

Users browsing this forum: No registered users and 61 guests