MCPcopy Create free account
hub / github.com/christophhart/HISE / getFile

Method getFile

hi_scripting/scripting/api/ScriptingApi.cpp:7337–7404  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7335
7336
7337juce::File ScriptingApi::FileSystem::getFile(SpecialLocations l)
7338{
7339 File f;
7340
7341 switch (l)
7342 {
7343 case Samples:
7344
7345 if(FullInstrumentExpansion::isEnabled(getMainController()))
7346 {
7347 if (auto e = getMainController()->getExpansionHandler().getCurrentExpansion())
7348 f = e->getSubDirectory(FileHandlerBase::Samples);
7349 }
7350 else
7351 {
7352 f = getMainController()->getCurrentFileHandler().getSubDirectory(FileHandlerBase::Samples);
7353 }
7354
7355 break;
7356 case Expansions: return getMainController()->getExpansionHandler().getExpansionFolder();
7357#if USE_BACKEND
7358 case AppData:
7359 {
7360 f = ProjectHandler::getAppDataRoot(getMainController());
7361
7362 auto company = GET_HISE_SETTING(getMainController()->getMainSynthChain(), HiseSettings::User::Company);
7363 auto project = GET_HISE_SETTING(getMainController()->getMainSynthChain(), HiseSettings::Project::Name);
7364
7365 f = f.getChildFile(company.toString()).getChildFile(project.toString());
7366
7367 if (!f.isDirectory())
7368 f.createDirectory();
7369
7370 break;
7371 }
7372#else
7373 case AppData: f = FrontendHandler::getAppDataDirectory();
7374 break;
7375#endif
7376 case UserPresets:
7377#if USE_BACKEND
7378 f = getMainController()->getCurrentFileHandler().getSubDirectory(FileHandlerBase::UserPresets);
7379#else
7380 f = FrontendHandler::getUserPresetDirectory();
7381#endif
7382 break;
7383 case UserHome: f = File::getSpecialLocation(File::userHomeDirectory); break;
7384 case Documents: f = File::getSpecialLocation(File::userDocumentsDirectory); break;
7385 case Desktop: f = File::getSpecialLocation(File::userDesktopDirectory); break;
7386 case Downloads: f = File::getSpecialLocation(File::userHomeDirectory).getChildFile("Downloads"); break;
7387 case Applications: f = File::getSpecialLocation(File::globalApplicationsDirectory); break;
7388 case Temp: f = File::getSpecialLocation(File::tempDirectory); break;
7389 case AudioFiles:
7390#if USE_BACKEND
7391 f = getMainController()->getCurrentFileHandler().getSubDirectory(FileHandlerBase::AudioFiles);
7392#else
7393#if !USE_RELATIVE_PATH_FOR_AUDIO_FILES
7394 // You need to set this flag if you want to load audio files from the folder

Callers 12

setFileResultMethod · 0.45
getWatchedFileMethod · 0.45
showPopupForFileMethod · 0.45
getInstanceIdMethod · 0.45
EntryMethod · 0.45
FaustDocumentMethod · 0.45
loadDataFileMethod · 0.45
encodeExpansionMethod · 0.45
importSamplesMethod · 0.45
fromReferenceStringMethod · 0.45

Calls 9

getCurrentFileHandlerMethod · 0.80
getExpansionFolderMethod · 0.80
getCurrentExpansionMethod · 0.45
getSubDirectoryMethod · 0.45
getMainSynthChainMethod · 0.45
getChildFileMethod · 0.45
toStringMethod · 0.45
isDirectoryMethod · 0.45
createDirectoryMethod · 0.45

Tested by

no test coverage detected