The preset dropdown reset any time the value is changed, which includes on parameter loads from the radio. It should only reset on user input, but it's not worth finding out how right now.
38 lines
703 B
C++
38 lines
703 B
C++
#pragma once
|
|
|
|
#include <tt_hal_radio.h>
|
|
|
|
#include "Str.h"
|
|
#include "LinkedList.h"
|
|
|
|
class Preset {
|
|
public:
|
|
struct PresetItem {
|
|
RadioParameter parameter;
|
|
float value;
|
|
};
|
|
|
|
Str name;
|
|
Modulation modulation;
|
|
LinkedList<PresetItem> items;
|
|
|
|
Preset(const char* const name, Modulation modulation)
|
|
: name(name)
|
|
, modulation(modulation)
|
|
{}
|
|
|
|
virtual ~Preset() = default;
|
|
|
|
void addParameter(RadioParameter parameter, float value) {
|
|
items.pushBack({parameter, value});
|
|
}
|
|
|
|
LinkedList<PresetItem>::Iterator begin() {
|
|
return items.begin();
|
|
}
|
|
|
|
LinkedList<PresetItem>::Iterator end() {
|
|
return items.end();
|
|
}
|
|
};
|