# The instrument's control surface.
#
# A component of its own rather than code inside components/ui/generated/ui.c:
# tools/squareline_sync.ps1 replaces that file wholesale from the SquareLine
# Studio export, so anything built in there is destroyed by the next export.
# main.c's header describes exactly this case — "a dedicated component of its
# own".

idf_component_register(
    SRCS
        "src/synth_ui.c"
        # The turning picture's geometry. A file of its own because it is a pure
        # function of a parameter and a mask — no LVGL, no state — and because
        # synth_ui.c is already the size it is.
        "src/synth_ui_preview.c"
        # Generated by tools/gen_lvgl_font.py; see that script for the format.
        # LVGL's own converter is a Node package and this environment has
        # node.exe without npm, so the fonts are produced directly.
        #
        # The project's own two faces, 14 px for captions and 20 px for values and
        # headings. They are the only fonts in the tree — see the note over
        # LV_FONT_DECLARE in synth_ui.c.
        "src/fonts/lv_font_anbscreen_14.c"
        "src/fonts/lv_font_anbscreen_20.c"
        INCLUDE_DIRS
        "include"
    REQUIRES
        lvgl
        bsp_jc3636k718c
        ui
        synth_app
        # Screen brightness, ring brightness and mode, the sequencer realignment,
        # the remembered sound, and the presets the PRESET page lists.
        app_settings
        # midi_in_set_enabled(), for the MIDI IN switch on OPTIONS: app_settings
        # cannot make that call itself without a cycle, so the page owns it.
        midi
        # synth_layer_pan() and synth_layer_env(), for the orbit and reactive ring
        # displays.
        synth_dsp
    PRIV_REQUIRES
        # esp_app_get_description(), for the version the splash prints. It was the
        # build stamp on the status page before there was a splash; the page is gone
        # and the call moved with it. IDF does not infer this dependency, so it has
        # to be named.
        esp_app_format
)
