Preset subdirs (#385)

Scanning textures/presets dirs for textures and scanning preset dir for presets.
Scanning is now done recursively, so presets and textures can be organized into subdirectories instead of needing to be flattened into a single directory.

On POSIX systems makes use of [ftw](https://linux.die.net/man/3/ftw) which should be relatively efficient. Otherwise falls back to recursing with `dirent` (for windows).

Probably should have made an autoconf check for `ftw` instead of doing `#ifdef WIN32`. 

* Scan subdirectories in presets directory

* remove preset subdir config

* Recursively scan for textures too, add c++-17 compatibility

* Refactor directory scanning code so it's reused by texture loader and preset loader. Make cross-platform (maybe)

* filescanner in makefile

* extension filter for file loader

* make extensions match up'

* need string.h

* Add FileScanner.cpp to win build (maybe)

* scan all dirs

* #ifndef #ifdef is def fun

* bogus comment

* bleh

* bleh

* itunes plugin with c++17

* EyeTunes needs to know about the FileScanner

Co-authored-by: milkdropper.com <milkdropper.com@gmail.com>
Co-authored-by: milkdropper <59471060+milkdropper@users.noreply.github.com>
This commit is contained in:
Mischa Spiegelmock
2020-07-28 22:01:56 +03:00
committed by GitHub
parent e51b2c7d63
commit e49720ecfa
27 changed files with 379 additions and 330 deletions

View File

@ -49,6 +49,8 @@ class PresetFactoryManager {
/// \returns true if a factory exists, false otherwise
bool extensionHandled(const std::string & extension) const;
std::unique_ptr<Preset> allocate(const std::string & url, const std::string & name);
std::vector<std::string> extensionsHandled() const;
private:
int _gx, _gy;