"""
MIDI messages for the Launchpad Mini MK3.
"""


class SysExMessages:
    DEVICE_INQUIRY = [0xf0, 0x7e, 0xe7, 0xf0, 0x06, 0x01, 0xf7]

    class Interfaces:
        DAW = [0xf0, 0x00, 0x20, 0x29, 0x02, 0x0d, 0x10, 0x00, 0xf7]
        MIDI = [0xf0, 0x00, 0x20, 0x29, 0x02, 0x0d, 0x10, 0x01, 0xf7]
        READBACK = [0xf0, 0x00, 0x20, 0x29, 0x02, 0x0d, 0x10, 0xf7]

    class Layouts:
        SESSION = [0xf0, 0x00, 0x20, 0x29, 0x02, 0x0d, 0x00, 0x00, 0xf7]
        CUSTOM_1 = [0xf0, 0x00, 0x20, 0x29, 0x02, 0x0d, 0x00, 0x04, 0xf7]
        CUSTOM_2 = [0xf0, 0x00, 0x20, 0x29, 0x02, 0x0d, 0x00, 0x05, 0xf7]
        CUSTOM_3 = [0xf0, 0x00, 0x20, 0x29, 0x02, 0x0d, 0x00, 0x06, 0xf7]
        DAW_FADERS = [0xf0, 0x00, 0x20, 0x29, 0x02, 0x0d, 0x00, 0x0d, 0xf7]
        PROG = [0xf0, 0x00, 0x20, 0x29, 0x02, 0x0d, 0x00, 0x7f, 0xf7]
        READBACK = [0xf0, 0x00, 0x20, 0x29, 0x02, 0x0d, 0x00, 0xf7]

    class Modes:
        LIVE = [0xf0, 0x00, 0x20, 0x29, 0x02, 0x0d, 0x0e, 0x00, 0xf7]
        PROG = [0xf0, 0x00, 0x20, 0x29, 0x02, 0x0d, 0x0e, 0x01, 0xf7]
        READBACK = [0xf0, 0x00, 0x20, 0x29, 0x02, 0x0d, 0x0e, 0xf7]

    @staticmethod
    def colorspec_message(lighting_type, led_index, *lighting_data):
        return [0xf0, 0x00, 0x20, 0x29, 0x02, 0x0d, 0x03,
                lighting_type, led_index] + list(lighting_data) + [0xf7]

    @staticmethod
    def lighting_message(lighting_mode, midi_value, color_id):
        return [lighting_mode, midi_value, color_id]
