Krotos Modules 3
Loading...
Searching...
No Matches
krotos::AssetManager Class Referencefinal

Helper class for handling audio files. More...

#include <AssetManager.h>

Public Member Functions

 AssetManager ()
 

Static Public Member Functions

static bool isFactoryContentInstalled (const String &dirPath, const int expectedDirCount)
 Check if specific factory content is installed.
 
static File getManifestDirectory ()
 
static String readFactorySamplesPath ()
 
static bool editFactorySamplesPath (const String &, const bool)
 
static File getSystemTempDirectory ()
 
static File newTempDirectory (const String &)
 
static File getEULADirectory ()
 
static File getManualDirectory ()
 
static File getDragAndDropPathDotTxt ()
 
static bool editDragAndDropPath (const String &)
 
static String readDragAndDropPath ()
 
static File getDefaultDragAndDropPath ()
 
static File getDLC1AssetDirectory ()
 
static File getSubscriberAssetDirectory ()
 
static File getAssetDirectory ()
 
static File getPluginDirectory ()
 
static File getUserDataDirectory ()
 Returns the user data directory, this will be a named manufacturer / plugin subfolder under the File::userApplicationDirectory specialLocationType.
 
static String checkSamplePaths (const File &)
 
static Array< File > loadFiles (const StringArray &, const bool, const bool willLoadSpecificFiles)
 
static String convertFilePathString (const String &)
 
static File convertFilePath (const String &)
 
static String convertFilePathToOSX (const String &path)
 
static void destroyTempDirs ()
 
static void deleteEmbeddingsCacheFile ()
 
static void deleteEmbeddingsStatusFile ()
 
static File getMLEmbeddingsFile ()
 

Static Public Attributes

static const String SupportedAudioTypes
 

Private Member Functions

void initializeAssetResources ()
 

Static Private Member Functions

static bool testFactoryAssetsRelocation (const String &, const String &)
 
static bool copyFactoryAssets (const String &, const String &)
 
static bool cleanUpFactoryAssetsRelocation (const String &)
 
static File getSamplesPathDotTxt ()
 

Detailed Description

Helper class for handling audio files.

This class contains functions for file handling for new imports and within presets.

Audio asset processing and handling should be done with functions within this class before passing to Kwidgets which utilise audio file import.

Constructor & Destructor Documentation

◆ AssetManager()

krotos::AssetManager::AssetManager ( )

Constructor.

Member Function Documentation

◆ checkSamplePaths()

String krotos::AssetManager::checkSamplePaths ( const File & presetFile)
static

Check incoming sample paths for missing files.

◆ cleanUpFactoryAssetsRelocation()

bool krotos::AssetManager::cleanUpFactoryAssetsRelocation ( const String & currentFactorySamplesPath)
staticprivate

Delete old Factory Assets dir, never call this outside of wrapper function editFactorySamplesPath

◆ convertFilePath()

File krotos::AssetManager::convertFilePath ( const String & path)
static

◆ convertFilePathString()

String krotos::AssetManager::convertFilePathString ( const String & path)
static

Check incoming sample paths and convert to relevant OS file system.

◆ convertFilePathToOSX()

String krotos::AssetManager::convertFilePathToOSX ( const String & path)
static

Converts path to OSX, even if its a windows build

◆ copyFactoryAssets()

bool krotos::AssetManager::copyFactoryAssets ( const String & currentFactorySamplesPath,
const String & newFactorySamplesPath )
staticprivate

Copy Factory Assets dir to new samplesPath.txt path, never call this outside of wrapper function editFactorySamplesPath

◆ deleteEmbeddingsCacheFile()

void krotos::AssetManager::deleteEmbeddingsCacheFile ( )
static

Delete embeddings cache used by TextToPreset NOT FOR PUBLIC BUILDS!

◆ deleteEmbeddingsStatusFile()

void krotos::AssetManager::deleteEmbeddingsStatusFile ( )
static

Delete embeddings status used by TextToPreset NOT FOR PUBLIC BUILDS!

◆ destroyTempDirs()

void krotos::AssetManager::destroyTempDirs ( )
static

Destroy ALL temp directories NOT FOR PUBLIC BUILDS!

◆ editDragAndDropPath()

bool krotos::AssetManager::editDragAndDropPath ( const String & newDragAndDropPath)
static

Changes custom location for DragAndDrop output dir

◆ editFactorySamplesPath()

bool krotos::AssetManager::editFactorySamplesPath ( const String & newFactorySamplesPath,
const bool moveFiles )
static

Changes custom location for Factory Assets dir

◆ getAssetDirectory()

File krotos::AssetManager::getAssetDirectory ( )
static

Get the system-specific factory asset directory.

◆ getDefaultDragAndDropPath()

File krotos::AssetManager::getDefaultDragAndDropPath ( )
static

Get the Kwidget_Recorder output directory

◆ getDLC1AssetDirectory()

File krotos::AssetManager::getDLC1AssetDirectory ( )
static

Get the system-specific factory asset DLC1 directory.

◆ getDragAndDropPathDotTxt()

static File krotos::AssetManager::getDragAndDropPathDotTxt ( )
static

Returns dragAndDropPath.txt, holds custom asset path root dir - should only be used in AssetManager, use readDragAndDropOutputPath if you need the path

◆ getEULADirectory()

File krotos::AssetManager::getEULADirectory ( )
static

Get the directory for EULA resource

◆ getManifestDirectory()

File krotos::AssetManager::getManifestDirectory ( )
static

Get the directory for manifest storage

◆ getManualDirectory()

File krotos::AssetManager::getManualDirectory ( )
static

Get the directory for manual resource

◆ getMLEmbeddingsFile()

File krotos::AssetManager::getMLEmbeddingsFile ( )
static

Get the full path for the Machine Learning embeddings file

◆ getPluginDirectory()

File krotos::AssetManager::getPluginDirectory ( )
static

Get the Deafult/legacy factory asset directory.

◆ getSamplesPathDotTxt()

File krotos::AssetManager::getSamplesPathDotTxt ( )
staticprivate

Returns samplesPath.txt, holds custom asset path root dir - should only be used in AssetManager, use readFactorySamplesPath if you need the path

◆ getSubscriberAssetDirectory()

File krotos::AssetManager::getSubscriberAssetDirectory ( )
static

Get the system-specific subscriber factory asset directory.

◆ getSystemTempDirectory()

File krotos::AssetManager::getSystemTempDirectory ( )
static

Returns temp directory for this km3 plugin

◆ getUserDataDirectory()

File krotos::AssetManager::getUserDataDirectory ( )
static

Returns the user data directory, this will be a named manufacturer / plugin subfolder under the File::userApplicationDirectory specialLocationType.

◆ initializeAssetResources()

void krotos::AssetManager::initializeAssetResources ( )
private

Initialise AssetManager directories, disabled for unit testing

◆ isFactoryContentInstalled()

bool krotos::AssetManager::isFactoryContentInstalled ( const String & dirPath,
const int expectedDirCount )
static

Check if specific factory content is installed.

Parameters
dirPathThe directory path to check for factory content.
expectedDirCountThe expected number of directories that should be present.
Returns
True if the expected content is installed, false otherwise.

◆ loadFiles()

Array< File > krotos::AssetManager::loadFiles ( const StringArray & files,
const bool convertPaths,
const bool willLoadSpecificFiles )
static

Attempts to load a list of sounds from the paths in StringArray& files Returns the number of files successfully loaded

◆ newTempDirectory()

File krotos::AssetManager::newTempDirectory ( const String & subDirectory)
static

Returns a new temp directory

◆ readDragAndDropPath()

String krotos::AssetManager::readDragAndDropPath ( )
static

Returns custom location for DragAndDrop recordings from dragAndDropPath.txt

◆ readFactorySamplesPath()

String krotos::AssetManager::readFactorySamplesPath ( )
static

Returns custom location for Factory Assets dir from samplesPath.txt

◆ testFactoryAssetsRelocation()

bool krotos::AssetManager::testFactoryAssetsRelocation ( const String & currentFactorySamplesPath,
const String & newFactorySamplesPath )
staticprivate

Test Factory Assets dir relocation, never call this outside of wrapper function editFactorySamplesPath

Member Data Documentation

◆ SupportedAudioTypes

const String krotos::AssetManager::SupportedAudioTypes
static

File extensions include wav, aif, aiff, flac, ogg, kaf


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