# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
    raise RuntimeError("Python 2.7 or later required")

# Import the low-level C/C++ module
if __package__ or "." in __name__:
    from . import _pyupm_wt5001
else:
    import _pyupm_wt5001

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)


def _swig_setattr_nondynamic_instance_variable(set):
    def set_instance_attr(self, name, value):
        if name == "thisown":
            self.this.own(value)
        elif name == "this":
            set(self, name, value)
        elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
            set(self, name, value)
        else:
            raise AttributeError("You cannot add instance attributes to %s" % self)
    return set_instance_attr


def _swig_setattr_nondynamic_class_variable(set):
    def set_class_attr(cls, name, value):
        if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
            set(cls, name, value)
        else:
            raise AttributeError("You cannot add class attributes to %s" % cls)
    return set_class_attr


def _swig_add_metaclass(metaclass):
    """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
    def wrapper(cls):
        return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
    return wrapper


class _SwigNonDynamicMeta(type):
    """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
    __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)



def getVersion():
    return _pyupm_wt5001.getVersion()
class uint8Array(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, nelements):
        _pyupm_wt5001.uint8Array_swiginit(self, _pyupm_wt5001.new_uint8Array(nelements))
    __swig_destroy__ = _pyupm_wt5001.delete_uint8Array

    def __getitem__(self, index):
        return _pyupm_wt5001.uint8Array___getitem__(self, index)

    def __setitem__(self, index, value):
        return _pyupm_wt5001.uint8Array___setitem__(self, index, value)

    def cast(self):
        return _pyupm_wt5001.uint8Array_cast(self)

    @staticmethod
    def frompointer(t):
        return _pyupm_wt5001.uint8Array_frompointer(t)

# Register uint8Array in _pyupm_wt5001:
_pyupm_wt5001.uint8Array_swigregister(uint8Array)

def uint8Array_frompointer(t):
    return _pyupm_wt5001.uint8Array_frompointer(t)

class uint16Array(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, nelements):
        _pyupm_wt5001.uint16Array_swiginit(self, _pyupm_wt5001.new_uint16Array(nelements))
    __swig_destroy__ = _pyupm_wt5001.delete_uint16Array

    def __getitem__(self, index):
        return _pyupm_wt5001.uint16Array___getitem__(self, index)

    def __setitem__(self, index, value):
        return _pyupm_wt5001.uint16Array___setitem__(self, index, value)

    def cast(self):
        return _pyupm_wt5001.uint16Array_cast(self)

    @staticmethod
    def frompointer(t):
        return _pyupm_wt5001.uint16Array_frompointer(t)

# Register uint16Array in _pyupm_wt5001:
_pyupm_wt5001.uint16Array_swigregister(uint16Array)

def uint16Array_frompointer(t):
    return _pyupm_wt5001.uint16Array_frompointer(t)

class WT5001(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    NONE = _pyupm_wt5001.WT5001_NONE
    PLAY_SD = _pyupm_wt5001.WT5001_PLAY_SD
    PLAY_SPI = _pyupm_wt5001.WT5001_PLAY_SPI
    PLAY_UDISK = _pyupm_wt5001.WT5001_PLAY_UDISK
    PAUSE = _pyupm_wt5001.WT5001_PAUSE
    STOP = _pyupm_wt5001.WT5001_STOP
    NEXT = _pyupm_wt5001.WT5001_NEXT
    PREVIOUS = _pyupm_wt5001.WT5001_PREVIOUS
    SET_VOLUME = _pyupm_wt5001.WT5001_SET_VOLUME
    QUEUE = _pyupm_wt5001.WT5001_QUEUE
    PLAY_MODE = _pyupm_wt5001.WT5001_PLAY_MODE
    COPY_SD2FLASH = _pyupm_wt5001.WT5001_COPY_SD2FLASH
    COPY_UDISK2FLASH = _pyupm_wt5001.WT5001_COPY_UDISK2FLASH
    INSERT_SONG = _pyupm_wt5001.WT5001_INSERT_SONG
    SET_DATE = _pyupm_wt5001.WT5001_SET_DATE
    SET_TIME = _pyupm_wt5001.WT5001_SET_TIME
    SET_ALARM = _pyupm_wt5001.WT5001_SET_ALARM
    SET_ALARM_DUR = _pyupm_wt5001.WT5001_SET_ALARM_DUR
    CLEAR_ALARM = _pyupm_wt5001.WT5001_CLEAR_ALARM
    CLEAR_ALARM_DUR = _pyupm_wt5001.WT5001_CLEAR_ALARM_DUR
    READ_VOLUME = _pyupm_wt5001.WT5001_READ_VOLUME
    READ_PLAY_STATE = _pyupm_wt5001.WT5001_READ_PLAY_STATE
    READ_SPI_NUMF = _pyupm_wt5001.WT5001_READ_SPI_NUMF
    READ_SD_NUMF = _pyupm_wt5001.WT5001_READ_SD_NUMF
    READ_UDISK_NUMF = _pyupm_wt5001.WT5001_READ_UDISK_NUMF
    READ_CUR_FNAME = _pyupm_wt5001.WT5001_READ_CUR_FNAME
    READ_CF_CHAR = _pyupm_wt5001.WT5001_READ_CF_CHAR
    READ_DATE = _pyupm_wt5001.WT5001_READ_DATE
    READ_TIME = _pyupm_wt5001.WT5001_READ_TIME
    NORMAL = _pyupm_wt5001.WT5001_NORMAL
    SINGLE_REPEAT = _pyupm_wt5001.WT5001_SINGLE_REPEAT
    ALL_REPEAT = _pyupm_wt5001.WT5001_ALL_REPEAT
    RANDOM = _pyupm_wt5001.WT5001_RANDOM
    SD = _pyupm_wt5001.WT5001_SD
    SPI = _pyupm_wt5001.WT5001_SPI
    UDISK = _pyupm_wt5001.WT5001_UDISK

    def __init__(self, uart):
        _pyupm_wt5001.WT5001_swiginit(self, _pyupm_wt5001.new_WT5001(uart))
    __swig_destroy__ = _pyupm_wt5001.delete_WT5001

    def dataAvailable(self, millis):
        return _pyupm_wt5001.WT5001_dataAvailable(self, millis)

    def readData(self, buffer, len):
        return _pyupm_wt5001.WT5001_readData(self, buffer, len)

    def writeData(self, buffer, len):
        return _pyupm_wt5001.WT5001_writeData(self, buffer, len)

    def setupTty(self, *args):
        return _pyupm_wt5001.WT5001_setupTty(self, *args)

    def checkResponse(self, opcode):
        return _pyupm_wt5001.WT5001_checkResponse(self, opcode)

    def play(self, psrc, index):
        return _pyupm_wt5001.WT5001_play(self, psrc, index)

    def stop(self):
        return _pyupm_wt5001.WT5001_stop(self)

    def pause(self):
        return _pyupm_wt5001.WT5001_pause(self)

    def next(self):
        return _pyupm_wt5001.WT5001_next(self)

    def previous(self):
        return _pyupm_wt5001.WT5001_previous(self)

    def setVolume(self, vol):
        return _pyupm_wt5001.WT5001_setVolume(self, vol)

    def queue(self, index):
        return _pyupm_wt5001.WT5001_queue(self, index)

    def setPlayMode(self, pm):
        return _pyupm_wt5001.WT5001_setPlayMode(self, pm)

    def insert(self, index):
        return _pyupm_wt5001.WT5001_insert(self, index)

    def setDate(self, year, month, day):
        return _pyupm_wt5001.WT5001_setDate(self, year, month, day)

    def setTime(self, hour, minute, second):
        return _pyupm_wt5001.WT5001_setTime(self, hour, minute, second)

    def setAlarm(self, hour, minute, second):
        return _pyupm_wt5001.WT5001_setAlarm(self, hour, minute, second)

    def clearAlarm(self):
        return _pyupm_wt5001.WT5001_clearAlarm(self)

    def getVolume(self, vol):
        return _pyupm_wt5001.WT5001_getVolume(self, vol)

    def getVolumeNoParam(self):
        return _pyupm_wt5001.WT5001_getVolumeNoParam(self)

    def getPlayState(self, ps):
        return _pyupm_wt5001.WT5001_getPlayState(self, ps)

    def getPlayStateNoParam(self):
        return _pyupm_wt5001.WT5001_getPlayStateNoParam(self)

    def getNumFiles(self, psrc, numf):
        return _pyupm_wt5001.WT5001_getNumFiles(self, psrc, numf)

    def getNumFilesOneParam(self, psrc):
        return _pyupm_wt5001.WT5001_getNumFilesOneParam(self, psrc)

    def getCurrentFile(self, curf):
        return _pyupm_wt5001.WT5001_getCurrentFile(self, curf)

    def getCurrentFileNoParam(self):
        return _pyupm_wt5001.WT5001_getCurrentFileNoParam(self)

    def getDate(self, year, month, day):
        return _pyupm_wt5001.WT5001_getDate(self, year, month, day)

    def getTime(self, hour, minute, second):
        return _pyupm_wt5001.WT5001_getTime(self, hour, minute, second)

# Register WT5001 in _pyupm_wt5001:
_pyupm_wt5001.WT5001_swigregister(WT5001)
cvar = _pyupm_wt5001.cvar
WT5001_DEFAULT_UART = cvar.WT5001_DEFAULT_UART
WT5001_MAX_VOLUME = cvar.WT5001_MAX_VOLUME
WT5001_START = cvar.WT5001_START
WT5001_END = cvar.WT5001_END



