# vim:ts=4:sts=4:sw=4:expandtab

import numpy as np

#pa_sample_t
SAMPLE_U8 = 0
SAMPLE_ALAW = 1
SAMPLE_ULAW = 2
SAMPLE_S16LE = 3
SAMPLE_S16BE = 4
SAMPLE_FLOAT32LE = 5
SAMPLE_FLOAT32BE = 6
SAMPLE_S32LE = 7
SAMPLE_S32BE = 8
SAMPLE_S24LE = 9
SAMPLE_S24BE = 10
SAMPLE_S24_32LE = 11
SAMPLE_S24_32BE = 12
SAMPLE_MAX = 13

SAMPLE_WIDTH = {
    SAMPLE_U8 : 1,
    SAMPLE_ALAW : 1,
    SAMPLE_ULAW : 1,
    SAMPLE_S16LE : 2,
    SAMPLE_S16BE : 2,
    SAMPLE_FLOAT32LE : 4,
    SAMPLE_FLOAT32BE : 4,
    SAMPLE_S32LE : 4,
    SAMPLE_S32BE : 4,
    SAMPLE_S24LE : 3,
    SAMPLE_S24BE : 3,
    SAMPLE_S24_32LE : 4,
    SAMPLE_S24_32BE : 4,
    SAMPLE_MAX : 4,
}

SAMPLE_TYPE = {
    SAMPLE_U8 : np.dtype('u8'),
    SAMPLE_ALAW : np.dtype('u8'),
    SAMPLE_ULAW : np.dtype('u8'),
    SAMPLE_S16LE : np.dtype('<i2'),
    SAMPLE_S16BE : np.dtype('>i2'),
    SAMPLE_FLOAT32LE : np.dtype('<f4'),
    SAMPLE_FLOAT32BE : np.dtype('>f4'),
    SAMPLE_S32LE : np.dtype('<i4'),
    SAMPLE_S32BE : np.dtype('>i4'),
#    SAMPLE_S24LE : np.dtype('>i3'),
#    SAMPLE_S24BE : np.dtype('<i3'),
    SAMPLE_S24_32LE : np.dtype('<i4'),
    SAMPLE_S24_32BE : np.dtype('>i4'),
    SAMPLE_MAX : np.dtype('i4'),
}


#pa_stream_direction_t
STREAM_NODIRECTION = 0
STREAM_PLAYBACK = 1
STREAM_RECORD = 2
STREAM_UPLOAD = 3

CHANNELS_MAX = 32

#pa_channel_position_t
CHANNEL_POSITION_MONO = 0
CHANNEL_POSITION_FRONT_LEFT = 1
CHANNEL_POSITION_LEFT = 1
CHANNEL_POSITION_FRONT_RIGHT = 2
CHANNEL_POSITION_RIGHT = 2
CHANNEL_POSITION_CENTER = 3
CHANNEL_POSITION_FRONT_CENTER = 3
CHANNEL_POSITION_REAR_CENTER = 4
CHANNEL_POSITION_REAR_LEFT = 5
CHANNEL_POSITION_REAR_RIGHT = 6
CHANNEL_POSITION_LFE = 7
CHANNEL_POSITION_SUBWOOFER = 7
CHANNEL_POSITION_FRONT_LEFT_OF_CENTER = 8
CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER = 9
CHANNEL_POSITION_SIDE_LEFT = 10
CHANNEL_POSITION_SIDE_RIGHT = 11
CHANNEL_POSITION_AUX0 = 12
CHANNEL_POSITION_AUX1 = 13
CHANNEL_POSITION_AUX2 = 14
CHANNEL_POSITION_AUX3 = 15
CHANNEL_POSITION_AUX4 = 16
CHANNEL_POSITION_AUX5 = 17
CHANNEL_POSITION_AUX6 = 18
CHANNEL_POSITION_AUX7 = 19
CHANNEL_POSITION_AUX8 = 20
CHANNEL_POSITION_AUX9 = 21
CHANNEL_POSITION_AUX10 = 22
CHANNEL_POSITION_AUX11 = 23
CHANNEL_POSITION_AUX12 = 24
CHANNEL_POSITION_AUX13 = 25
CHANNEL_POSITION_AUX14 = 26
CHANNEL_POSITION_AUX15 = 27
CHANNEL_POSITION_AUX16 = 28
CHANNEL_POSITION_AUX17 = 29
CHANNEL_POSITION_AUX18 = 30
CHANNEL_POSITION_AUX19 = 31
CHANNEL_POSITION_AUX20 = 32
CHANNEL_POSITION_AUX21 = 33
CHANNEL_POSITION_AUX22 = 34
CHANNEL_POSITION_AUX23 = 35
CHANNEL_POSITION_AUX24 = 36
CHANNEL_POSITION_AUX25 = 37
CHANNEL_POSITION_AUX26 = 38
CHANNEL_POSITION_AUX27 = 39
CHANNEL_POSITION_AUX28 = 40
CHANNEL_POSITION_AUX29 = 41
CHANNEL_POSITION_AUX30 = 42
CHANNEL_POSITION_AUX31 = 43
CHANNEL_POSITION_TOP_CENTER = 44
CHANNEL_POSITION_TOP_FRONT_LEFT = 45
CHANNEL_POSITION_TOP_FRONT_RIGHT = 46
CHANNEL_POSITION_TOP_FRONT_CENTER = 47
CHANNEL_POSITION_TOP_REAR_LEFT = 48
CHANNEL_POSITION_TOP_REAR_RIGHT = 49
CHANNEL_POSITION_TOP_REAR_CENTER = 50
CHANNEL_POSITION_MAX = 51
