Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VST state file search #532

Merged
merged 11 commits into from
Nov 1, 2020
Merged

VST state file search #532

merged 11 commits into from
Nov 1, 2020

Conversation

jpcima
Copy link
Collaborator

@jpcima jpcima commented Oct 30, 2020

This adds a mechanism lo let VST find files on a different environment, after the session has been shared/moved/etc.
It will establish a list of directories where SFZ files are expected to be stored.

When a file is missing after state loading, the plugin is going to run a background scan, synchronously but shared between multiple instances.
This will collect the paths into a map [filename]->[list of paths] with lower-cased keys.

On scan completion, the file path is looked up into the index, yielding a list of candidates.
Then, we study the absolute path by comparing directory components in reverse order with the candidate, yielding a score according to the number of matched components.

This process applies to sfz files as well as tuning files.

@jpcima
Copy link
Collaborator Author

jpcima commented Oct 30, 2020

There is other potential for optimization from here.

  • speed: from experience fts.h is much faster for recursive file scanning on non-Windows, but the comparison was to boost::filesystem, not ghc
  • memory: use a hierarchical file-trie structure such that directory components of absolute paths are not duplicated when stored

@jpcima jpcima marked this pull request as ready for review October 30, 2020 06:52
@jpcima jpcima requested a review from paulfd October 30, 2020 07:09
@jpcima jpcima merged commit 0cff698 into sfztools:develop Nov 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants