# Autogenerated constants for Sound Recorder with Playback service
from enum import IntEnum
from jacdac.constants import *
from jacdac.system.constants import *
JD_SERVICE_CLASS_SOUND_RECORDER_WITH_PLAYBACK = const(0x1b72bf50)


class SoundRecorderWithPlaybackStatus(IntEnum):
    IDLE = const(0x0)
    RECORDING = const(0x1)
    PLAYING = const(0x2)


JD_SOUND_RECORDER_WITH_PLAYBACK_CMD_PLAY = const(0x80)
JD_SOUND_RECORDER_WITH_PLAYBACK_CMD_RECORD = const(0x81)
JD_SOUND_RECORDER_WITH_PLAYBACK_CMD_CANCEL = const(0x82)
JD_SOUND_RECORDER_WITH_PLAYBACK_REG_STATUS = const(0x180)
JD_SOUND_RECORDER_WITH_PLAYBACK_REG_TIME = const(0x181)
JD_SOUND_RECORDER_WITH_PLAYBACK_REG_VOLUME = const(JD_REG_INTENSITY)
JD_SOUND_RECORDER_WITH_PLAYBACK_PACK_FORMATS = {
    JD_SOUND_RECORDER_WITH_PLAYBACK_CMD_RECORD: "u16",
    JD_SOUND_RECORDER_WITH_PLAYBACK_REG_STATUS: "u8",
    JD_SOUND_RECORDER_WITH_PLAYBACK_REG_TIME: "u16",
    JD_SOUND_RECORDER_WITH_PLAYBACK_REG_VOLUME: "u0.8"
}
