4#include "BindUtils.hpp"
43 this->tag = tagIndex++;
90 changeCallback = callback;
93 void invokeCallback(int16_t valueIn)
95 this->value = valueIn;
96 if (changeCallback !=
nullptr)
98 changeCallback(valueIn);
114 strLength = strlen(str);
115 if (strLength > MAX_STRING_LENGTH_TERMINAL)
117 strLength = MAX_STRING_LENGTH_TERMINAL;
119 copyAndOffset(out, &offset, &objID,
sizeof(objID));
120 copyAndOffset(out, &offset, &
x,
sizeof(
x));
121 copyAndOffset(out, &offset, &
y,
sizeof(
y));
122 copyAndOffset(out, &offset, &tag,
sizeof(tag));
123 copyAndOffset(out, &offset, &
cmdId,
sizeof(
cmdId));
127 copyAndOffset(out, &offset, &
value,
sizeof(
value));
128 copyAndOffset(out, &offset, str, strLength);
133 uint8_t objID = BIND_ID_KNOB;
137 static int16_t tagIndex;
138 void (*changeCallback)(int16_t) =
nullptr;
The BindKnob class represents a knob UI element for use with BindCanvas.
Definition BindKnob.hpp:30
int16_t y
Y-coordinate position of the knob.
Definition BindKnob.hpp:56
void setlabel(const char *cstr)
Sets the label text for the knob.
Definition BindKnob.hpp:72
int16_t minValue
Minimum value of the knob's range.
Definition BindKnob.hpp:59
void setCallback(void(*callback)(int16_t))
Set the Callback function for the knob.
Definition BindKnob.hpp:88
uint16_t getBytes(uint8_t *out) override
Retrieves the bytes representing the knob for synchronization.
Definition BindKnob.hpp:111
int16_t dimSize
Dimensions or size of the knob.
Definition BindKnob.hpp:58
int16_t value
Current value of the knob.
Definition BindKnob.hpp:61
int16_t maxValue
Maximum value of the knob's range.
Definition BindKnob.hpp:60
int16_t x
X-coordinate position of the knob.
Definition BindKnob.hpp:55
uint8_t cmdId
Command ID for the knob. See the notes for possible cmdId values.
Definition BindKnob.hpp:57
BindKnob(const char *cstr)
Constructs a BindKnob with a custom label.
Definition BindKnob.hpp:41
BindKnob()
Constructs a BindKnob with a default label.
Definition BindKnob.hpp:53
Definition BindView.hpp:22