跳到主要内容
版本:Matrix OS 4.0 🚧

C++ API Overview

Use this reference while building native Matrix OS applications. Start with the app guide, then jump into the API pages that match the behavior you are adding.

NeedStart Here
Read device inputInput
Draw LEDsLED
Send or receive MIDIMIDI
Save settingsNVS
Read or write filesFileSystem
Control app/system behaviorSystem
Work with USB, HID, or logsUSB, HID, Logging
Build on-screen menusUI Framework
Use shared value typesTypes
Use helper utilitiesUtilities

App Loop Pattern

Native apps should keep Loop() cooperative: drain input or MIDI events, update app state, draw only when needed, then return so Matrix OS can continue running other work.

void MyApp::Loop() {
InputEvent event;
while (MatrixOS::Input::Get(&event))
{
if (event.inputClass == InputClass::Keypad)
{
// Update app state from event.keypad.
}
}
}

For a complete minimal native app, start with Code Your Application (C++). If you are updating older native code, read Migration From 3.x to 4.x after you understand the current Input API.

Comments