41 lines
1.1 KiB
C++
41 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <JuceHeader.h>
|
|
#include "Params.h"
|
|
|
|
namespace serum
|
|
{
|
|
|
|
// ===========================================================================
|
|
// One assignable destination for a macro knob.
|
|
// ===========================================================================
|
|
struct MacroAssignment
|
|
{
|
|
ModTarget target = ModTarget::None;
|
|
float depth = 0.0f;
|
|
};
|
|
|
|
// ===========================================================================
|
|
// Four macros (Energy, Width, Drive, Atmosphere). Macro *values* are APVTS
|
|
// parameters; this class stores the assignable destinations and serialises
|
|
// them with the preset.
|
|
// ===========================================================================
|
|
class MacroControls
|
|
{
|
|
public:
|
|
static constexpr int kMaxAssignments = 8;
|
|
|
|
std::array<std::vector<MacroAssignment>, kNumMacros> assignments;
|
|
|
|
bool addAssignment (int macro, ModTarget target, float depth);
|
|
void removeAssignment (int macro, int index);
|
|
void clear();
|
|
|
|
juce::ValueTree toValueTree() const;
|
|
void fromValueTree (const juce::ValueTree& tree);
|
|
|
|
static juce::String macroName (int index);
|
|
};
|
|
|
|
} // namespace serum
|