13#include "platforms/ui_defs.h"
15#ifndef FASTLED_HAS_UI_SLIDER
16#define FASTLED_HAS_UI_SLIDER 0
19#ifndef FASTLED_HAS_UI_BUTTON
20#define FASTLED_HAS_UI_BUTTON 0
23#ifndef FASTLED_HAS_UI_CHECKBOX
24#define FASTLED_HAS_UI_CHECKBOX 0
27#ifndef FASTLED_HAS_UI_NUMBER_FIELD
28#define FASTLED_HAS_UI_NUMBER_FIELD 0
31#ifndef FASTLED_HAS_UI_TITLE
32#define FASTLED_HAS_UI_TITLE 0
35#ifndef FASTLED_HAS_UI_DESCRIPTION
36#define FASTLED_HAS_UI_DESCRIPTION 0
39#ifndef FASTLED_HAS_UI_AUDIO
40#define FASTLED_HAS_UI_AUDIO 0
43#ifndef FASTLED_HAS_UI_DROPDOWN
44#define FASTLED_HAS_UI_DROPDOWN 0
51#if !FASTLED_HAS_UI_SLIDER
57 float max = 255,
float step = -1.f)
73 operator float()
const {
return mValue; }
75 operator u16()
const {
return static_cast<u16
>(
mValue); }
76 operator int()
const {
return static_cast<int>(
mValue); }
77 template <
typename T> T
as()
const {
return static_cast<T
>(
mValue); }
103#if !FASTLED_HAS_UI_BUTTON
112 operator bool()
const {
return false; }
125#if !FASTLED_HAS_UI_CHECKBOX
134 explicit operator int()
const {
return mValue ? 1 : 0; }
155#if !FASTLED_HAS_UI_NUMBER_FIELD
167 operator double()
const {
return mValue; }
168 operator int()
const {
return static_cast<int>(
mValue); }
189#if !FASTLED_HAS_UI_TITLE
202#if !FASTLED_HAS_UI_DESCRIPTION
215#if !FASTLED_HAS_UI_HELP
233#if !FASTLED_HAS_UI_AUDIO
254#if !FASTLED_HAS_UI_DROPDOWN
266 for (fl::size i = 0; i < options.
size(); ++i) {
274 template<
typename Iterator>
278 for (Iterator it =
begin; it !=
end; ++it) {
290 for (fl::size i = 0; i < options.
size(); ++i) {
302 for (
const auto& option : options) {
322 if (index >= 0 && index <
static_cast<int>(
mOptions.size())) {
343 for (fl::size i = 0; i < count; ++i) {
356#ifndef FASTLED_HAS_UI_GROUP
357#define FASTLED_HAS_UI_GROUP 0
360#if !FASTLED_HAS_UI_GROUP
void setGroup(const fl::string &groupName)
UIAudioImpl(const char *name)
void setValue(bool value)
UICheckboxImpl & operator=(int value)
void setGroup(const fl::string &groupName)
UICheckboxImpl(const char *name, bool value=false)
UICheckboxImpl & operator=(bool value)
UIDescriptionImpl(const char *name)
void setGroup(const fl::string &groupName)
UIDropdownImpl(const fl::string &name, const fl::string *options, fl::size count)
UIDropdownImpl(const fl::string &name, fl::initializer_list< fl::string > options)
void setSelectedIndex(int index)
UIDropdownImpl(const fl::string &name, const fl::vector< fl::string > &options)
UIDropdownImpl(const fl::string &name, fl::span< fl::string > options)
void setGroup(const fl::string &groupName)
fl::size getOptionCount() const
UIDropdownImpl(const fl::string &name, Iterator begin, Iterator end)
fl::vector< fl::string > mOptions
UIDropdownImpl(const fl::string &name, const fl::string(&options)[N])
fl::string getOption(fl::size index) const
UIGroupImpl(const char *name)
void setGroup(const fl::string &groupName)
const fl::string & markdownContent() const
UIHelpImpl(const char *markdownContent)
UINumberFieldImpl & operator=(int value)
UINumberFieldImpl & operator=(double value)
void setGroup(const fl::string &groupName)
UINumberFieldImpl(const char *name, double value, double min=0, double max=100)
void setValue(double value)
UISliderImpl & operator=(int value)
void setValue(float value)
UISliderImpl & operator=(float value)
UISliderImpl(const char *name, float value=128.0f, float min=1, float max=255, float step=-1.f)
void setGroup(const fl::string &groupName)
UITitleImpl(const char *name)
void setGroup(const fl::string &groupName)
Implements the FastLED namespace macros.
constexpr T * begin(T(&array)[N]) noexcept
constexpr T * end(T(&array)[N]) noexcept
HeapVector< T, Allocator > vector
#define FASTLED_UNUSED(x)