|
| void | log (LogLevel level, const char *message) |
| | Log a message to the device Log Monitor.
|
| void | log (LogLevel level, const char *label, int32_t value) |
| | Log a labeled integer.
|
| void | log (LogLevel level, const char *label, int32_t value, uint8_t decimals) |
| | Log a labeled fixed-point number.
|
| int32_t | write_file (const char *path, const uint8_t *buf, uint32_t size) |
| | Save a buffer as one of the mode's own files.
|
Root namespace for the Operator SDK.
| void op::log |
( |
LogLevel | level, |
|
|
const char * | label, |
|
|
int32_t | value, |
|
|
uint8_t | decimals ) |
|
inline |
Log a labeled fixed-point number.
value carries decimals fractional digits, the same fixed-point convention as a Numeric param's decimal_places, so log(LogLevel::Info, "rate", 1250, 2) shows rate: 12.50.
| int32_t op::write_file |
( |
const char * | path, |
|
|
const uint8_t * | buf, |
|
|
uint32_t | size ) |
|
inline |
Save a buffer as one of the mode's own files.
Creates path, or replaces what is already there, writes size bytes and closes the file. Returns the bytes written on success. A negative return is -1 on an error, kStorageBusy while storage is busy, or kStorageNoSpace when there is no room left, and -1 before the mode is fully loaded (while op::api is null).
- Parameters
-
| path | Relative file name under the mode's storage area. |
| buf | Source bytes. |
| size | Number of bytes to write. |
- Returns
- Bytes written, or a negative storage result.
Mode's handle to the device.
Everything a mode can do goes through this pointer: sending MIDI, reading timing and parameters, drawing to the display, and reading storage. OP_MODE_REGISTER binds it from the pointer the firmware hands mode_init, before your init runs, and it stays valid for the life of the mode. It is null before the mode is loaded and again once mode_destroy has returned, so helpers that might run outside that window check it first.
Never define op::api yourself. Its definition is emitted into each mode's translation unit by OP_MODE_PARAMS or OP_MODE_NO_PARAMS. You just call through it, for example op::api->send_midi(...).