Allolib  1.0
C++ Components For Interactive Multimedia
al::PresetMapper Class Reference

The PresetMapper class allows archiving and recalling preset maps. More...

#include <C:/Users/Andres/source/repos/casm_viewer/external/tinc/external/allolib/include/al/ui/al_PresetMapper.hpp>

Inheritance diagram for al::PresetMapper:
al::osc::MessageConsumer

Public Member Functions

 PresetMapper (bool findAutomatically=true)
 
PresetMapperregisterPresetHandler (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)
 
PresetMapperoperator<< (PresetHandler &handler)
 

Protected Member Functions

virtual bool consumeMessage (osc::Message &m, std::string rootOSCPath) override
 Returns true if message was consumed by this class.
 

Detailed Description

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:

0:preset_name

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.

Member Function Documentation

◆ listAvailableMaps()

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.

◆ restore()

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()


The documentation for this class was generated from the following file: