Krotos Modules 3
Loading...
Searching...
No Matches
AssetManager.cpp
Go to the documentation of this file.
1namespace krotos
2{
3 const String AssetManager::SupportedAudioTypes("wav;aif;aiff;flac;ogg;kaf");
4
6 {
7// do not try to init resources/directories when running unit tests!
8#ifndef UNIT_TEST
9 PluginHostType host;
10
11 if (!host.isPluginval()) // pluginval currently not compatible with state loading
12 {
13 try
14 {
16 }
17 catch (AssetException& ex)
18 {
19 std::cout << ex.what() << std::endl;
20 }
21 }
22#endif
23 }
24
26 {
27 // TODO: Wes port over custom asset paths to settingsFile
28 auto samplesPathDotTxt = getSamplesPathDotTxt();
29 auto factoryAssetPath = readFactorySamplesPath();
30
31 auto dragAndDropPathSetting = KwidgetAudioProcessor::settingsFile.getSetting("drag_and_drop_path").toString();
32 auto dragAndDropPath = readDragAndDropPath(); // Kwidget_Recorder dragged dir
33
34 if (samplesPathDotTxt.exists() != true) // does samplesPath.txt exist?
35 {
36 if (samplesPathDotTxt.create() == Result::ok()) // if not create it
37 {
38 // write default path to it, but don't move any assets!
39 editFactorySamplesPath(factoryAssetPath,
40 false); // there are exceptions that would be thrown if writing fails here...
41 }
42 else
43 {
44 // if we can't create a samplesPath.txt, throw
45 throw AssetException(/*what*/ "Error: Cannot create missing samplesPath.txt",
46 /*when*/ "On init of AssetManager");
47 }
48 }
49
50 // let's double check the factory asset path exists on startup
51 if (File(factoryAssetPath).isDirectory() != true)
52 {
53 // no factory asset folder, critical failure, no factory presets can be loaded
54 throw AssetException(/*what*/ "Error: Factory asset folder does not exist",
55 /*when*/ "On init of factory asset dir");
56 }
57
58 if (!File(dragAndDropPathSetting).isDirectory()) // does the set drag and drop path exist
59 {
60 // write default path to it, but don't move any assets!
61 editDragAndDropPath(dragAndDropPath); // there are exceptions that would be thrown if writing fails here...
62 }
63
64 // let's double check the recorder asset path exists on startup
65 if (File(dragAndDropPath).isDirectory() != true)
66 {
67 if (File(dragAndDropPath).createDirectory() != Result::ok())
68 {
69 throw AssetException(/*what*/ "Error: Cannot find or create Kwidget_Recorder directory",
70 /*when*/ "On init of AssetManager dirs");
71 }
72 }
73 }
74
76 {
77#ifdef JUCE_MAC
78 return File::getSpecialLocation(File::commonApplicationDataDirectory).getFullPathName() +
79 "/Application Support/Krotos/" + JucePlugin_Name + "/CPM_Manifests";
80#else
81 return File("C:\\ProgramData\\Krotos\\" JucePlugin_Name "\\CPM_Manifests");
82#endif
83 }
84
86 {
87#ifdef JUCE_MAC
88 return File::getSpecialLocation(File::commonApplicationDataDirectory).getFullPathName() +
89 "/Application Support/Krotos/" + JucePlugin_Name + "/samplesPath.txt";
90#else
91 return File("C:\\ProgramData\\Krotos\\" JucePlugin_Name "\\samplesPath.txt");
92#endif
93 }
94
95 bool AssetManager::isFactoryContentInstalled(const String& dirPath, const int expectedDirCount)
96 {
97 const auto factoryAssetsDir = AssetManager::readFactorySamplesPath();
98 const auto path = utils::StringsIntoPath(factoryAssetsDir, "Factory Assets", dirPath);
99 const File dir = File(path);
100
101 if (!dir.exists())
102 {
103 return false;
104 }
105
106 Array<File> subDirectories;
107 dir.findChildFiles(subDirectories, File::findDirectories, false);
108
109 return subDirectories.size() > expectedDirCount;
110 }
111
113 {
114 auto samplesPathDotTxt = getSamplesPathDotTxt();
115
116 if (samplesPathDotTxt.exists())
117 {
118 return samplesPathDotTxt.loadFileAsString();
119 }
120 else // return default path if samplesPath.txt doesn't exist, just in case! ...might be safer to just fail here?
121 {
122 return getPluginDirectory().getFullPathName();
123 }
124 }
125
126 bool AssetManager::editFactorySamplesPath(const String& newFactorySamplesPath, bool moveFiles)
127 {
128 auto samplesPathDotTxt = getSamplesPathDotTxt(); // samplesPath.txt
129 auto currentFactorySamplesPath = readFactorySamplesPath(); // samplesPath.txt contents
130
131 if (samplesPathDotTxt.exists() && samplesPathDotTxt.hasWriteAccess()) // make sure we can edit samplesPath.txt
132 {
133 if (moveFiles) // if we want to move our factory assets...
134 {
135 if (File(currentFactorySamplesPath).isDirectory() // ..and the assets exist at their present location
136 && File(newFactorySamplesPath).isDirectory()) // ..and the new location can allow for that
137 {
138 // first we do a test 'move', before committing to starting the move operation
139 auto testSuccessful = testFactoryAssetsRelocation(currentFactorySamplesPath, newFactorySamplesPath);
140
141 if (!testSuccessful) // should have failed before here
142 {
143 throw AssetException(/*what*/ "Error: Test move failed, aborting asset relocation",
144 /*when*/ "Test move factory assets");
145 }
146
147 // let's do the actual moving now...
148 auto copySuccessful =
149 copyFactoryAssets(currentFactorySamplesPath, newFactorySamplesPath); // do the actual move
150
151 if (!copySuccessful) // move failed, should have failed before here
152 {
153 // if move failed we dont want to try the write
154 throw AssetException(/*what*/ "Error: Moving factory assets failed!",
155 /*when*/ "Try to moveFactoryAssets");
156 }
157
158 auto writePathSuccessful = samplesPathDotTxt.replaceWithText(newFactorySamplesPath);
159
160 if (!writePathSuccessful) // write failed
161 {
162 throw AssetException(/*what*/ "Error: Writing new asset path failed!",
163 /*when*/ "Try to moveFactoryAssets");
164 }
165
166 // only delete old assets folder after write is successful
167 auto cleanUpSuccessful = cleanUpFactoryAssetsRelocation(currentFactorySamplesPath);
168
169 if (!cleanUpSuccessful) // cleanup failed, should have failed before here
170 {
171 throw AssetException(/*what*/ "Error: Deleting old factory assets dir failed!",
172 /*when*/ "Try to moveFactoryAssets");
173 }
174
175 return true; // it worked!
176 }
177 else // if either dirs doesn't exist (should be impossible!)
178 {
179 throw AssetException(/*what*/ "Error: Missing source or destination asset directory",
180 /*when*/ "Try to moveFactoryAssets");
181 }
182 }
183 else
184 {
185 const String assetsDirectory = "Factory Assets";
186
187 String finalPath = newFactorySamplesPath;
188
189 // if a user selects the factory assets folder instead of the parent, correct to the path we want to
190 // write to samplesPath.txt
191 if (newFactorySamplesPath.contains(assetsDirectory))
192 {
193 finalPath = newFactorySamplesPath.upToFirstOccurrenceOf(assetsDirectory, false, true);
194 }
195
196 // since we don't need to move, just write the path!
197 auto writePathSuccessful = samplesPathDotTxt.replaceWithText(finalPath);
198
199 if (!writePathSuccessful)
200 {
201 throw AssetException(/*what*/ "Error: Writing new asset path failed",
202 /*when*/ "Try to write new factory assets path");
203 }
204
205 return true; // our write-only operation was successful!
206 }
207 }
208 else // missing samplesPath.txt, so can't write! how did we get here?!
209 {
210 throw AssetException(/*what*/ "Error: Missing samplesPath.txt,\nplease restart the plugin",
211 /*when*/ "Try to moveFactoryAssets");
212 }
213 }
214
215 bool AssetManager::testFactoryAssetsRelocation(const String& currentFactorySamplesPath,
216 const String& newFactorySamplesPath)
217 {
218#ifdef JUCE_MAC
219 const String testFile = "/Factory Assets/samplesPath.test";
220#else
221 const String testFile = "\\Factory Assets\\samplesPath.test";
222#endif
223
224 // test create and delete in current factory samples path
225 auto oldPathTestCreate = File(currentFactorySamplesPath + testFile).create();
226 auto oldPathTestDelete = File(currentFactorySamplesPath + testFile).deleteRecursively();
227
228 if (!oldPathTestCreate || !oldPathTestDelete)
229 {
230 throw AssetException(/*what*/ "Error: Test move failed due to access issue with current asset path",
231 /*when*/ "Test move factory assets");
232 }
233
234 // test create and delete in destination factory samples path
235 auto newPathTestCreate = File(newFactorySamplesPath + testFile).create();
236 auto newPathTestDelete = File(newFactorySamplesPath + testFile).deleteRecursively();
237
238 if (!newPathTestCreate || !newPathTestDelete)
239 {
240 throw AssetException(/*what*/ "Error: Test move failed due to access issue with desired asset path",
241 /*when*/ "Test move factory assets");
242 }
243
244 return true; // test move was successful
245 }
246
247 bool AssetManager::copyFactoryAssets(const String& currentFactorySamplesPath, const String& newFactorySamplesPath)
248 {
249#ifdef JUCE_MAC
250 auto copySucessful = File(currentFactorySamplesPath + "/Factory Assets")
251 .copyDirectoryTo(newFactorySamplesPath + "/Factory Assets");
252#else // windows
253 auto copySucessful = File(currentFactorySamplesPath + "\\Factory Assets")
254 .copyDirectoryTo(newFactorySamplesPath + "\\Factory Assets");
255#endif
256 if (!copySucessful)
257 {
258 throw AssetException(/*what*/ "Error: Moving assets failed due to issue copying to new location.\nCheck "
259 "permissions on destination folder.",
260 /*when*/ "Try to moveFactoryAssets");
261 }
262
263 return true; // we did it!
264 }
265
266 bool AssetManager::cleanUpFactoryAssetsRelocation(const String& currentFactorySamplesPath)
267 {
268#ifdef JUCE_MAC
269 auto deleteSuccessful = File(currentFactorySamplesPath + "/Factory Assets").deleteRecursively();
270#else
271 auto deleteSuccessful = File(currentFactorySamplesPath + "\\Factory Assets").deleteRecursively();
272#endif
273 if (!deleteSuccessful)
274 {
275 throw AssetException(
276 /*what*/ "Error: Deleting old asset path failed.\nMove was successful, please try manual deletion.",
277 /*when*/ "Try to moveFactoryAssets"); // delete failed if the copy failed!
278 }
279
280 return true; // clean up was fully successful
281 }
282
284 {
285 auto tempDirPath = getSystemTempDirectory(); // Kwidget_Recorder temp dir(s)
286
287 // delete ALL recorder temp dirs
288 if (tempDirPath.isDirectory())
289 {
290 if (!tempDirPath.deleteRecursively())
291 {
292 throw AssetException(/*what*/ "Error: Cannot delete recorder temp directories",
293 /*when*/ "On call of dev destroy function");
294 }
295 }
296 }
297
299 {
300 auto deleteSuccessful = File(utils::StringsIntoPath(AssetManager::getPluginDirectory().getFullPathName(),
301 "ttpResources", ".ttfEmbCache"))
302 .deleteFile();
303 if (!deleteSuccessful)
304 {
305 throw AssetException(
306 /*what*/ "Error: Cannot delete embeddings cache file",
307 /*when*/ "On call of dev delete cache function");
308 }
309 }
310
312 {
313 auto deleteSuccessful = File(utils::StringsIntoPath(AssetManager::getPluginDirectory().getFullPathName(),
314 "ttpResources", ".ttfStatus"))
315 .deleteFile();
316 if (!deleteSuccessful)
317 {
318 throw AssetException(
319 /*what*/ "Error: Cannot delete embeddings status file",
320 /*when*/ "On call of dev delete status function");
321 }
322 }
323
325 {
326#ifdef JUCE_MAC
327 return File::getSpecialLocation(File::tempDirectory).getFullPathName();
328#else
329 return File::getSpecialLocation(File::tempDirectory).getFullPathName() + "\\Krotos\\" + JucePlugin_Name;
330#endif
331 }
332
333 File AssetManager::newTempDirectory(const String& subDirectory)
334 {
335 File newTempDirectory = File::addTrailingSeparator(getSystemTempDirectory().getFullPathName()) + subDirectory;
336
337 if (newTempDirectory.createDirectory() != Result::ok())
338 {
339 jassertfalse; // could not create recorder temp dir
340 }
341
342 return newTempDirectory;
343 }
344
346 {
347#ifdef JUCE_MAC
348 return File::getSpecialLocation(File::commonApplicationDataDirectory).getFullPathName() +
349 "/Application Support/Krotos/" + JucePlugin_Name + "/Documentation/EULA/";
350#else
351 return File("C:\\ProgramData\\Krotos\\" JucePlugin_Name "\\Documentation\\EULA\\");
352#endif
353 }
354
356 {
357#ifdef JUCE_MAC
358 return File::getSpecialLocation(File::commonApplicationDataDirectory).getFullPathName() +
359 "/Application Support/Krotos/" + JucePlugin_Name + "/Documentation/Manual/";
360#else
361 return File("C:\\ProgramData\\Krotos\\" JucePlugin_Name "\\Documentation\\Manual\\");
362#endif
363 }
364
366 {
367#ifdef JUCE_MAC
368 return readFactorySamplesPath() + "/Factory Assets/DLC1";
369#else
370 return readFactorySamplesPath() + "\\Factory Assets\\DLC1";
371#endif
372 }
373
375 {
376#ifdef JUCE_MAC
377 return readFactorySamplesPath() + "/Factory Assets/CCFactory";
378#else
379 return readFactorySamplesPath() + "\\Factory Assets\\CCFactory";
380#endif
381 }
382
384 {
385#ifdef JUCE_MAC
386 return readFactorySamplesPath() + "/Factory Assets";
387#else
388 return readFactorySamplesPath() + "\\Factory Assets";
389#endif
390 }
391
393 {
394#ifdef JUCE_MAC
395 return File::getSpecialLocation(File::commonApplicationDataDirectory).getFullPathName() +
396 "/Application Support/Krotos/" + JucePlugin_Name;
397#else
398 return File("C:\\ProgramData\\Krotos\\" JucePlugin_Name);
399#endif
400 }
401
403 {
404#ifdef JUCE_MAC
405 return File::getSpecialLocation(File::userApplicationDataDirectory).getFullPathName() +
406 "/Application Support/Krotos/" + JucePlugin_Name;
407#else
408 return File::getSpecialLocation(File::userApplicationDataDirectory).getFullPathName() + "\\Krotos\\" +
409 JucePlugin_Name;
410#endif
411 }
412
414 {
415#ifdef JUCE_MAC
416 return File::getSpecialLocation(File::commonApplicationDataDirectory).getFullPathName() +
417 "/Application Support/Krotos/" + JucePlugin_Name + "/embeddings_full_paths.csv";
418#else
419 return File("C:\\ProgramData\\Krotos\\" JucePlugin_Name "\\embeddings_full_paths.csv");
420#endif
421 }
422
423 bool AssetManager::editDragAndDropPath(const String& newDragAndDropPath)
424 {
425 if (KwidgetAudioProcessor::settingsFile.existsAsFile()) // make sure we can edit the path
426 {
427 const String outputDirectory = "Output Assets";
428
429 String finalPath = newDragAndDropPath;
430
431 // if a user selects the factory assets folder instead of the parent, correct to the path we want to write
432 // to samplesPath.txt
433 if (newDragAndDropPath.contains(outputDirectory))
434 {
435 finalPath = newDragAndDropPath.upToFirstOccurrenceOf(outputDirectory, false, true);
436 }
437
438 // since we don't need to move, just write the path!
439 KwidgetAudioProcessor::settingsFile.setSetting("drag_and_drop_path", finalPath);
440
441 return true; // our write-only operation was successful!
442 }
443 else // missing dragAndDropPath.txt, so can't write! how did we get here?!
444 {
445 throw AssetException(/*what*/ "Error: Missing settings.json file,\nplease restart the plugin",
446 /*when*/ "Try to editDragAndDropPath");
447 }
448 }
449
451 {
452 auto dragAndDropPath = KwidgetAudioProcessor::settingsFile.getSetting("drag_and_drop_path").toString();
453
454 if (File(dragAndDropPath).isDirectory())
455 {
456 return dragAndDropPath;
457 }
458 else // return default path if settings can't be found or settings.json doesn't exist
459 {
460 return getDefaultDragAndDropPath().getFullPathName();
461 }
462 }
463
465 {
466#ifdef JUCE_MAC
467 return File::getSpecialLocation(File::userApplicationDataDirectory).getFullPathName() +
468 "/Application Support/Krotos/" + JucePlugin_Name + "/OutputAssets/";
469#else
470 return File::getSpecialLocation(File::userApplicationDataDirectory).getFullPathName() + "\\Krotos\\" +
471 JucePlugin_Name + "\\OutputAssets\\";
472#endif
473 }
474
475 Array<File> AssetManager::loadFiles(const StringArray& files, bool convertPaths, bool willLoadSpecificFiles)
476 {
477 const String assetsDirectory = "Factory Assets";
478
479 Array<File> filesToLoad;
480
481 for (auto& file : files)
482 {
483 // file which will combine relative path with actual factory asset location
484 File locatedFile;
485 String dynamicPath;
486 File finalPath;
487
488 if (file.contains(assetsDirectory)) // its a factory asset path
489 {
490 if (convertPaths)
491 {
492 locatedFile = convertFilePath(file); // convert between mac and windows file system
493 dynamicPath = locatedFile.getFullPathName().fromFirstOccurrenceOf(assetsDirectory, true, true);
494 finalPath = File::addTrailingSeparator(readFactorySamplesPath()) +
495 dynamicPath; // take the part after Factory assets and combine with root
496 }
497 else
498 {
499 locatedFile = file;
500 dynamicPath = locatedFile.getFullPathName().fromFirstOccurrenceOf(assetsDirectory, true, true);
501 finalPath = File::addTrailingSeparator(readFactorySamplesPath()) + dynamicPath;
502 }
503 }
504 else // user asset path must be loaded in the traditional way
505 {
506 if (convertPaths)
507 {
508 finalPath = convertFilePath(file); // convert between mac and windows file system
509 }
510 else
511 {
512 finalPath = file;
513 }
514 }
515
516 // file allocation/management
517 if (finalPath.existsAsFile())
518 {
519 if (finalPath.hasFileExtension(kafFileExtension)) // it's a kaf file to begin with
520 {
521 if (willLoadSpecificFiles) // kaf file reading is enabled
522 {
523 filesToLoad.add(finalPath);
524 }
525 else
526 {
527 throw EncryptedAssetException(/*what*/ "Error: Non authorised user loading .kaf files",
528 /*when*/ "During loadFiles function");
529 }
530 }
531 else
532 {
533 // is a .wav file that exists already, just load it
534 filesToLoad.add(finalPath);
535 }
536 }
537 else if (finalPath.withFileExtension(kafFileExtension).existsAsFile()) // is a .kaf file that exists
538 {
539 // check sub
540 if (willLoadSpecificFiles)
541 {
542 filesToLoad.add(finalPath.withFileExtension(kafFileExtension));
543 }
544 else
545 {
546 throw EncryptedAssetException(/*what*/ "Error: Non authorised user loading .kaf files",
547 /*when*/ "During loadFiles function");
548 }
549 }
550 else if (finalPath.isDirectory()) // exists as a directory
551 {
552 const auto kafFiles = finalPath.findChildFiles(File::TypesOfFileToFind::findFiles, true, "*.kaf");
553
554 const auto wavFiles = finalPath.findChildFiles(File::TypesOfFileToFind::findFiles, true, "*.wav");
555
556 if (!wavFiles.isEmpty() && kafFiles.isEmpty()) // dir contains ONLY .wav files, just load it
557 {
558 filesToLoad.add(finalPath);
559 }
560 else if ((!wavFiles.isEmpty() &&
561 !kafFiles.isEmpty()) // mixture of .wav AND .kaf files in the same directory
562 || (wavFiles.isEmpty() && !kafFiles.isEmpty())) // dir contains ONLY .kaf files
563 {
564 if (willLoadSpecificFiles) // check sub
565 {
566 filesToLoad.add(finalPath);
567 }
568 else
569 {
570 throw EncryptedAssetException(/*what*/ "Error: Non authorised user loading .kaf files",
571 /*when*/ "During loadFiles function");
572 }
573 }
574 }
575 else
576 {
577 DBG("File not found: " << finalPath.getFileNameWithoutExtension());
578 }
579 }
580 return filesToLoad;
581 }
582
583 String AssetManager::convertFilePathString(const String& path)
584 {
585 const String winRoot = "C:\\ProgramData\\Krotos";
586 const String macRoot = "/Library/Application Support/Krotos";
587
588#ifdef JUCE_WINDOWS
589 auto convertedPath = path.replaceFirstOccurrenceOf(macRoot, winRoot).replaceCharacter('/', '\\');
590#else
591 auto convertedPath = path.replaceFirstOccurrenceOf(winRoot, macRoot).replaceCharacter('\\', '/');
592#endif
593 return convertedPath;
594 }
595
596 String AssetManager::convertFilePathToOSX(const String& path)
597 {
598 const String winRoot = "C:\\ProgramData\\Krotos";
599 const String macRoot = "/Library/Application Support/Krotos";
600 auto convertedPath = path.replaceFirstOccurrenceOf(winRoot, macRoot).replaceCharacter('\\', '/');
601 return convertedPath;
602 }
603
604 File AssetManager::convertFilePath(const String& path) { return File(convertFilePathString(path)); }
605
606 String AssetManager::checkSamplePaths(const File& presetFile)
607 {
608 jassert(presetFile.hasFileExtension("ksp")); // is valid preset
609
610 String missingFiles;
611
612 auto incomingPreset = PresetManager::getPresetFromFile(presetFile);
613 auto valueTree = PresetManager::getValueTreeFromFile(incomingPreset.path);
614
615 auto kwidgets = valueTree.getChildWithName(XmlType::Tag::kwidgets);
616
617 for (const auto& kwidget : kwidgets)
618 {
619 if (kwidget.getProperty(XmlType::Property::type).equals("CoreEngine"))
620 {
621 auto customParams = kwidget.getChildWithName(XmlType::Tag::customParams);
622 auto samplePaths = customParams.getChildWithProperty(XmlType::Property::id, "SamplePaths");
623 auto pathsValue = samplePaths.getProperty(XmlType::Property::value);
624 StringArray cleanPaths = StringArray::fromLines(pathsValue.toString());
625
626 for (auto& path : cleanPaths)
627 {
628 File locatedFile;
629 String dynamicPath;
630 File finalPath;
631
632 if (path.contains("Factory Assets")) // its a factory asset path
633 {
634 locatedFile = convertFilePath(path); // convert between mac and windows file system if needed
635 dynamicPath = locatedFile.getFullPathName().fromFirstOccurrenceOf("Factory Assets", true, true);
636 finalPath = File::addTrailingSeparator(readFactorySamplesPath()) +
637 dynamicPath; // take the part after Factory assets and combine with root
638
639 if (!finalPath.isDirectory() && !finalPath.existsAsFile() &&
640 !finalPath.withFileExtension(kafFileExtension).existsAsFile())
641 {
642 missingFiles += finalPath.getFullPathName() + "\n";
643 }
644 }
645 else // checking for missing samples in user preset
646 {
647 path = convertFilePath(path).getFullPathName();
648
649 if (File(path).isDirectory() != true && File(path).exists() != true)
650 {
651 missingFiles += path + "\n";
652 }
653 }
654 }
655 }
656 }
657 return missingFiles;
658 }
659
660 char const* AssetException::what() const noexcept { return runtime_error::what(); }
661
662 String AssetException::when() const { return m_whenDidItHappen; }
663
664 char const* EncryptedAssetException::what() const noexcept { return runtime_error::what(); }
665
667} // namespace krotos
An exception for asset manager.
Definition AssetManager.h:143
String m_whenDidItHappen
Definition AssetManager.h:156
String when() const
Definition AssetManager.cpp:662
char const * what() const noexcept override
Definition AssetManager.cpp:660
static Array< File > loadFiles(const StringArray &, const bool, const bool willLoadSpecificFiles)
Definition AssetManager.cpp:475
static File getManifestDirectory()
Definition AssetManager.cpp:75
static File getEULADirectory()
Definition AssetManager.cpp:345
static bool cleanUpFactoryAssetsRelocation(const String &)
Definition AssetManager.cpp:266
static void destroyTempDirs()
Definition AssetManager.cpp:283
static String readDragAndDropPath()
Definition AssetManager.cpp:450
static String convertFilePathToOSX(const String &path)
Definition AssetManager.cpp:596
static File getPluginDirectory()
Definition AssetManager.cpp:392
static File getMLEmbeddingsFile()
Definition AssetManager.cpp:413
static File convertFilePath(const String &)
Definition AssetManager.cpp:604
static File getSubscriberAssetDirectory()
Definition AssetManager.cpp:374
static String convertFilePathString(const String &)
Definition AssetManager.cpp:583
static File getUserDataDirectory()
Returns the user data directory, this will be a named manufacturer / plugin subfolder under the File:...
Definition AssetManager.cpp:402
static bool copyFactoryAssets(const String &, const String &)
Definition AssetManager.cpp:247
static File getManualDirectory()
Definition AssetManager.cpp:355
static File getDefaultDragAndDropPath()
Definition AssetManager.cpp:464
static File getDLC1AssetDirectory()
Definition AssetManager.cpp:365
static bool editDragAndDropPath(const String &)
Definition AssetManager.cpp:423
static bool editFactorySamplesPath(const String &, const bool)
Definition AssetManager.cpp:126
void initializeAssetResources()
Definition AssetManager.cpp:25
static File newTempDirectory(const String &)
Definition AssetManager.cpp:333
static const String SupportedAudioTypes
Definition AssetManager.h:112
static void deleteEmbeddingsCacheFile()
Definition AssetManager.cpp:298
static void deleteEmbeddingsStatusFile()
Definition AssetManager.cpp:311
AssetManager()
Definition AssetManager.cpp:5
static bool testFactoryAssetsRelocation(const String &, const String &)
Definition AssetManager.cpp:215
static File getSystemTempDirectory()
Definition AssetManager.cpp:324
static File getAssetDirectory()
Definition AssetManager.cpp:383
static String checkSamplePaths(const File &)
Definition AssetManager.cpp:606
static String readFactorySamplesPath()
Definition AssetManager.cpp:112
static File getSamplesPathDotTxt()
Definition AssetManager.cpp:85
static bool isFactoryContentInstalled(const String &dirPath, const int expectedDirCount)
Check if specific factory content is installed.
Definition AssetManager.cpp:95
An exception for asset manager, specifc to encrypted assets.
Definition AssetManager.h:167
String when() const
Definition AssetManager.cpp:666
String m_whenDidItHappen
Definition AssetManager.h:180
char const * what() const noexcept override
Definition AssetManager.cpp:664
static SettingsFile settingsFile
Definition KwidgetAudioProcessor.h:221
static ValueTree getValueTreeFromFile(const File &presetFile)
Definition PresetManager.cpp:154
static Preset getPresetFromFile(const File &file)
Definition PresetManager.cpp:171
void setSetting(const Identifier &key, const var &value)
Sets the value associated with a given key in the settings.
Definition SettingsFile.cpp:33
var getSetting(const Identifier &key)
Retrieves the value associated with a given key.
Definition SettingsFile.cpp:11
String StringsIntoPath(Args... args)
Joins multiple string arguments into a path string.
Definition helpers.h:25
Definition AirAbsorptionFilter.cpp:2
const String kafFileExtension("kaf")
static const Identifier id
Definition XmlType.h:41
static const Identifier value
Definition XmlType.h:42
static const Identifier type
Definition XmlType.h:43
static const Identifier kwidgets
Definition XmlType.h:22
static const Identifier customParams
Definition XmlType.h:20