DEV 7 stars v1.0.0

MPC Sample UI Toolkit

A C library for drawing MPC Sample interfaces, with text, shapes, buttons and layout helpers for the device's 320×240 display.

About

A small C library for drawing on the Akai MPC Sample. The panel is always 320×240. Colors are uint32_t values, 0xRRGGBB. Position and size are pixels, origin at the top left. Nothing is drawn unless the call asks for it.

zig cc in the Makefile is only the cross-compiler, the same way the firmware makefile uses it. The source is C.

Draw

ui_clear(ui, 0x1a2744);
ui_box(ui, x, y, w, h, (struct ui_paint){
    .fill_set = 1, .fill = 0x2244aa,
    .border_set = 1, .border = 0xf0f0f0, .border_px = 3,
});
ui_text(ui, x, y, "clear", 0xe8e8e8, 1);          /* scale 1 is 6x12 */
ui_text(ui, x, y, "Two", 0xe8e8e8, 2);            /* scale 2 is 8x16 at 2x */
ui_highlight(ui, x, y, w, h, 0xff44aa, 3);

struct ui_button st = {
    .fill = 0x303840, .text = 0xe8e8e8,
    .border_set = 1, .border = 0x505868, .border_px = 1,
    .highlighted = focused, .highlight = 0xffb000, .highlight_px = 3,
};
if (ui_button(ui, x, y, w, h, "Off", st, in)) { /* encoder press on the highlighted button */ }

Recent releases

  • Release notes

    Static aarch64 Linux binaries. Unzip and load one from bin/ with mpc-boot-thingy.

Something wrong or missing on this page?

Opens GitHub's editor; your change becomes a pull request and you're credited as a contributor.