mirror of
https://codeberg.org/armin/ambivalence.git
synced 2026-09-01 04:10:48 +02:00
UI changes, layout redefinition
This commit is contained in:
parent
42cf8432bf
commit
1d9ba772fe
12 changed files with 536 additions and 528 deletions
|
|
@ -1,12 +1,37 @@
|
|||
#include "PresetManager.h"
|
||||
#include "PluginProcessor.h"
|
||||
#include "FactoryPresets.h"
|
||||
|
||||
PresetManager::PresetManager(FDNReverbAudioProcessor& p)
|
||||
: processor(p)
|
||||
{
|
||||
seedFactoryPresets();
|
||||
refreshPresetList();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// factory presets
|
||||
// -----------------------------------------------------------------------------
|
||||
// embeds Presets/*.ambpreset into the binary, then copies any that are
|
||||
// missing into the user folder, so the factory set survives fresh installs.
|
||||
// -----------------------------------------------------------------------------
|
||||
void PresetManager::seedFactoryPresets()
|
||||
{
|
||||
auto folder = getPresetsFolder();
|
||||
|
||||
for (int i = 0; i < FactoryPresets::namedResourceListSize; ++i)
|
||||
{
|
||||
const auto filename = juce::String::fromUTF8(FactoryPresets::originalFilenames[i]);
|
||||
auto dest = folder.getChildFile(filename);
|
||||
if (dest.exists())
|
||||
continue;
|
||||
|
||||
int size = 0;
|
||||
if (auto* data = FactoryPresets::getNamedResource(FactoryPresets::namedResourceList[i], size))
|
||||
dest.replaceWithData(data, size);
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// filesystem
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue