All Classes Namespaces Functions Variables Enumerations Enumerator Modules Pages
Public Types | Public Member Functions | List of all members
SampleMap Class Reference
Inheritance diagram for SampleMap:
RestorableObject SafeChangeListener

Public Types

enum  SaveMode { Undefined = 0, MultipleFiles, Monolith, MonolithEncrypted }

Public Member Functions

void saveIfNeeded ()
void saveAllSoundsToSubdirectory ()
bool hasUnsavedChanges () const
File getFile () const
void load (const File &f)
void restoreFromValueTree (const ValueTree &v) override
ValueTree exportAsValueTree () const override
void save ()
String getSampleDirectory () const
void clear ()

Detailed Description

A SampleMap is a data structure that encapsulates all data loaded into an ModulatorSampler.

It saves / loads all sampler data (modulators, effects) as well as all loaded sound files.

It supports two saving modes (monolithic and file-system based). It only accesses the sampler data when saved or loaded, and uses a ChangeListener to check if a sound has changed.

Member Enumeration Documentation

enum SaveMode

A SamplerMap can be saved in multiple modes.


The default mode, until the map gets saved.


Saves all data using this file structure:

    - the sample map will be saved as .xml file
    - the thumbnail data will be saved as thumbnail.dat
    - the samples will be saved into a '/samples' subfolder and replaced by relative file references.
    - the sampler data (modulators) will be stored as preset file (*.hip) containing a reference to the samplerMap

Saves everything into a big file which contains all data.


Saves everything into a big file and encrypts the header data using a RSA Key which can be used to handle serial numbers

Member Function Documentation

void clear ( )

Clears the sample map.

ValueTree exportAsValueTree ( ) const

Exports the SampleMap as ValueTree.

If the relative mode is enabled, it writes the files to the subdirectory '/samples', if they don't exist yet.

Implements RestorableObject.

File getFile ( ) const

Returns the file on the disk.

String getSampleDirectory ( ) const

returns the default sample directory (the sample map directory + '/samples'.

bool hasUnsavedChanges ( ) const

Checks if any ModulatorSamplerSound was changed since the last save.

This feature is currently disabled. It does not check if any other ModulatorSampler Properties were changed.

void load ( const File &  f)

loads a XML file from disk.

It parses the file and calls restoreFromValue().

void restoreFromValueTree ( const ValueTree &  v)

Restores the samplemap from the ValueTree.

If the files are saved in relative mode, the references are replaced using the parent directory of the sample map before they are loaded. If the files are saved as monolith, it assumes the files are already loaded and simply adds references to this samplemap.

Implements RestorableObject.

void save ( )

Saves all data with the mode depending on the file extension.

void saveAllSoundsToSubdirectory ( )

writes all loaded samples into the '/samples' subdirectory.

void saveIfNeeded ( )

Checks if the samplemap was changed and deletes it.

©2017 HISE. This documentation is autogenerated from the HISE source code using Doxygen.