Isomet Modular Synthesiser (iMS) API
v1.4.2
iMS API
|
Provides user management operations for working with Synthesiser FileSystems. More...
#include <include\FileSystem.h>
Public Member Functions | |
Constructor & Destructor | |
FileSystemManager (IMSSystem &ims) | |
Constructor for FileSystemManager Object. More... | |
~FileSystemManager () | |
Destructor for FileSystemManager object. | |
File System Operations | |
bool | Delete (FileSystemIndex index) |
Removes the Entry indicated by the provided index from the FileSystemTable. More... | |
bool | Delete (const std::string &FileName) |
bool | SetDefault (FileSystemIndex index) |
Tags a File for execution at Synthesiser startup. More... | |
bool | SetDefault (const std::string &FileName) |
bool | ClearDefault (FileSystemIndex index) |
Removes the Default Flag assigned to a FileSystemTableEntry. More... | |
bool | ClearDefault (const std::string &FileName) |
bool | Sanitize () |
Reorganises the FileSystemTable and ensures it contains valid contents. More... | |
Miscellaneous Functions | |
bool | FindSpace (std::uint32_t &addr, const std::vector< std::uint8_t > &data) const |
Locates an area in the FileSystem memory large enough to store the provided contents. More... | |
bool | Execute (FileSystemIndex index) |
Causes the Synthesiser to access the FileSystem data represented by the index and execute it. More... | |
bool | Execute (const std::string &FileName) |
Provides user management operations for working with Synthesiser FileSystems.
iMS::FileSystemManager::FileSystemManager | ( | IMSSystem & | ims | ) |
Constructor for FileSystemManager Object.
The FileSystemManager object requires an IMSSystem object, which will have had its FileSystemTable read back during initialisation. It must therefore exist before the FileSystemManager object, and must remain valid (not destroyed) until the FileSystemManager object itself is destroyed.
Once constructed, the object can neither be copied or assigned to another instance.
[in] | ims | A const reference to the iMS System whose FileSystemTable is to be operated upon. |
bool iMS::FileSystemManager::ClearDefault | ( | FileSystemIndex | index | ) |
Removes the Default Flag assigned to a FileSystemTableEntry.
[in] | index | the Entry in the FST to unset as default (from 0 to MAX_FST_ENTRIES-1). |
bool iMS::FileSystemManager::ClearDefault | ( | const std::string & | FileName | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Removes the tag indicating a file should be executed at startup referencing it by its allocated filename
[in] | FileName | a string representing the name of the file to unset as default |
bool iMS::FileSystemManager::Delete | ( | FileSystemIndex | index | ) |
Removes the Entry indicated by the provided index from the FileSystemTable.
The Entry is removed from the FST. The file data itself is not overwritten but once the entry has been deleted, it is impractival to recover the FileSystem data subsequently. The space 'freed up' by the deletion will become available for future file downloads and the release FST entry may be reused.
[in] | index | the Entry in the FST to delete (from 0 to MAX_FST_ENTRIES-1). |
bool iMS::FileSystemManager::Delete | ( | const std::string & | FileName | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Deletes a file from the FileSystemTable referencing it by its allocated filename
[in] | FileName | a string representing the name of the file to delete |
bool iMS::FileSystemManager::Execute | ( | FileSystemIndex | index | ) |
Causes the Synthesiser to access the FileSystem data represented by the index and execute it.
The execution of the FileSystem contents is defined in a FileSystemTypes specific way:
[in] | index | the Entry in the FileSystemTable to operate on |
bool iMS::FileSystemManager::Execute | ( | const std::string & | FileName | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
[in] | FileName | a string representing the name of the file to operate on |
bool iMS::FileSystemManager::FindSpace | ( | std::uint32_t & | addr, |
const std::vector< std::uint8_t > & | data | ||
) | const |
Locates an area in the FileSystem memory large enough to store the provided contents.
Given a const reference to a byte array containing the data which the caller wants to place in FileSystem memory, this function operates an algorithm that will search through the FileSystemTable iteratively searching for the lowest possible address in memory that will fit the data in a contiguous block (since the FileSystem does not support distributed storage).
[out] | addr | The location in memory where the data may be safely stored |
[in] | data | a reference to a byte array representing the data which is to be stored |
bool iMS::FileSystemManager::Sanitize | ( | ) |
Reorganises the FileSystemTable and ensures it contains valid contents.
The Sanitize process will do the following:
bool iMS::FileSystemManager::SetDefault | ( | FileSystemIndex | index | ) |
Tags a File for execution at Synthesiser startup.
A single file of each file type may be marked as being the 'default' of its type. If tagged as such, the Synthesiser will attempt to execute the file during its initialisation process. All file types except USER_DATA may have a default entry.
If multiple files are marked as default, the entry with the lowest index number will take precedence. Any subsequent files marked as default will have their flags cleared during initialisation.
[in] | index | the Entry in the FST to mark as default (from 0 to MAX_FST_ENTRIES-1). |
bool iMS::FileSystemManager::SetDefault | ( | const std::string & | FileName | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Tags a File for execution at Synthesiser startup referencing it by its allocated filename
[in] | FileName | a string representing the name of the file to mark default |