|
Allolib
1.0
C++ Components For Interactive Multimedia
|
The PresetMapper class allows archiving and recalling preset maps. More...
Public Member Functions | |
| PresetMapper (bool findAutomatically=true) | |
| PresetMapper & | registerPresetHandler (PresetHandler &handler) |
| bool | archive (std::string mapName="default", bool overwrite=true) |
| bool | load (std::string mapName) |
| bool | restore (std::string mapName="default", bool overwrite=true, bool autoCreate=false) |
| std::vector< std::string > | listAvailableMaps (bool listArchives=true) |
| PresetMapper & | operator<< (PresetHandler &handler) |
Protected Member Functions | |
| virtual bool | consumeMessage (osc::Message &m, std::string rootOSCPath) override |
| Returns true if message was consumed by this class. | |
The PresetMapper class allows archiving and recalling preset maps.
Preset maps are saved as a directory containing the presets as well as a preset map file that lists the presets in the map as well as assigning an index to each.
The preset map file is a text file, where each line looks like:
The index of the preset is separated by the preset name by a semi-colon. The preset name should correspond to a file on disk called "preset_name.preset". These files are located either within a preset map archive or a PresetHandler's root directory.
To archive a preset map, it's necessary to first register a PresetHandler with registerPresetHandler() and then call archive().
Definition at line 77 of file al_PresetMapper.hpp.
| std::vector<std::string> al::PresetMapper::listAvailableMaps | ( | bool | listArchives = true | ) |
Return a list with the name of availble preset maps for use in restore() or archive(). if listArchives is true, only archive directories are listed, otherwise only preset map files are.
| bool al::PresetMapper::restore | ( | std::string | mapName = "default", |
| bool | overwrite = true, |
||
| bool | autoCreate = false |
||
| ) |
Restore a preset map from a preset map archive directory This copies all the files back to the preset root directory If you don't want this copy use load()