-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathchannel_id.go
112 lines (99 loc) · 5.19 KB
/
channel_id.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/*
* Copyright (c) 2019 Zenichi Amano
*
* This file is part of libsoundio, which is MIT licensed.
* See http://opensource.org/licenses/MIT
*/
package soundio
/*
#include <soundio/soundio.h>
#include <stdlib.h>
*/
import "C"
import "unsafe"
// ChannelID is channel id.
type ChannelID uint32
// ChannelID enumeration.
const (
ChannelIDInvalid = ChannelID(C.SoundIoChannelIdInvalid)
ChannelIDFrontLeft = ChannelID(C.SoundIoChannelIdFrontLeft)
ChannelIDFrontRight = ChannelID(C.SoundIoChannelIdFrontRight)
ChannelIDFrontCenter = ChannelID(C.SoundIoChannelIdFrontCenter)
ChannelIDLfe = ChannelID(C.SoundIoChannelIdLfe)
ChannelIDBackLeft = ChannelID(C.SoundIoChannelIdBackLeft)
ChannelIDBackRight = ChannelID(C.SoundIoChannelIdBackRight)
ChannelIDFrontLeftCenter = ChannelID(C.SoundIoChannelIdFrontLeftCenter)
ChannelIDFrontRightCenter = ChannelID(C.SoundIoChannelIdFrontRightCenter)
ChannelIDBackCenter = ChannelID(C.SoundIoChannelIdBackCenter)
ChannelIDSideLeft = ChannelID(C.SoundIoChannelIdSideLeft)
ChannelIDSideRight = ChannelID(C.SoundIoChannelIdSideRight)
ChannelIDTopCenter = ChannelID(C.SoundIoChannelIdTopCenter)
ChannelIDTopFrontLeft = ChannelID(C.SoundIoChannelIdTopFrontLeft)
ChannelIDTopFrontCenter = ChannelID(C.SoundIoChannelIdTopFrontCenter)
ChannelIDTopFrontRight = ChannelID(C.SoundIoChannelIdTopFrontRight)
ChannelIDTopBackLeft = ChannelID(C.SoundIoChannelIdTopBackLeft)
ChannelIDTopBackCenter = ChannelID(C.SoundIoChannelIdTopBackCenter)
ChannelIDTopBackRight = ChannelID(C.SoundIoChannelIdTopBackRight)
ChannelIDBackLeftCenter = ChannelID(C.SoundIoChannelIdBackLeftCenter)
ChannelIDBackRightCenter = ChannelID(C.SoundIoChannelIdBackRightCenter)
ChannelIDFrontLeftWide = ChannelID(C.SoundIoChannelIdFrontLeftWide)
ChannelIDFrontRightWide = ChannelID(C.SoundIoChannelIdFrontRightWide)
ChannelIDFrontLeftHigh = ChannelID(C.SoundIoChannelIdFrontLeftHigh)
ChannelIDFrontCenterHigh = ChannelID(C.SoundIoChannelIdFrontCenterHigh)
ChannelIDFrontRightHigh = ChannelID(C.SoundIoChannelIdFrontRightHigh)
ChannelIDTopFrontLeftCenter = ChannelID(C.SoundIoChannelIdTopFrontLeftCenter)
ChannelIDTopFrontRightCenter = ChannelID(C.SoundIoChannelIdTopFrontRightCenter)
ChannelIDTopSideLeft = ChannelID(C.SoundIoChannelIdTopSideLeft)
ChannelIDTopSideRight = ChannelID(C.SoundIoChannelIdTopSideRight)
ChannelIDLeftLfe = ChannelID(C.SoundIoChannelIdLeftLfe)
ChannelIDRightLfe = ChannelID(C.SoundIoChannelIdRightLfe)
ChannelIDLfe2 = ChannelID(C.SoundIoChannelIdLfe2)
ChannelIDBottomCenter = ChannelID(C.SoundIoChannelIdBottomCenter)
ChannelIDBottomLeftCenter = ChannelID(C.SoundIoChannelIdBottomLeftCenter)
ChannelIDBottomRightCenter = ChannelID(C.SoundIoChannelIdBottomRightCenter)
ChannelIDMsMid = ChannelID(C.SoundIoChannelIdMsMid) // Mid recording
ChannelIDMsSide = ChannelID(C.SoundIoChannelIdMsSide) // Side recording
ChannelIDAmbisonicW = ChannelID(C.SoundIoChannelIdAmbisonicW)
ChannelIDAmbisonicX = ChannelID(C.SoundIoChannelIdAmbisonicX)
ChannelIDAmbisonicY = ChannelID(C.SoundIoChannelIdAmbisonicY)
ChannelIDAmbisonicZ = ChannelID(C.SoundIoChannelIdAmbisonicZ)
// ChannelIDXyX is X of X-Y Recording
ChannelIDXyX = ChannelID(C.SoundIoChannelIdXyX)
// ChannelIDXyY is Y of X-Y Recording
ChannelIDXyY = ChannelID(C.SoundIoChannelIdXyY)
ChannelIDHeadphonesLeft = ChannelID(C.SoundIoChannelIdHeadphonesLeft)
ChannelIDHeadphonesRight = ChannelID(C.SoundIoChannelIdHeadphonesRight)
ChannelIDClickTrack = ChannelID(C.SoundIoChannelIdClickTrack)
ChannelIDForeignLanguage = ChannelID(C.SoundIoChannelIdForeignLanguage)
ChannelIDHearingImpaired = ChannelID(C.SoundIoChannelIdHearingImpaired)
ChannelIDNarration = ChannelID(C.SoundIoChannelIdNarration)
ChannelIDHaptic = ChannelID(C.SoundIoChannelIdHaptic)
ChannelIDDialogCentricMix = ChannelID(C.SoundIoChannelIdDialogCentricMix)
ChannelIDAux = ChannelID(C.SoundIoChannelIdAux)
ChannelIDAux0 = ChannelID(C.SoundIoChannelIdAux0)
ChannelIDAux1 = ChannelID(C.SoundIoChannelIdAux1)
ChannelIDAux2 = ChannelID(C.SoundIoChannelIdAux2)
ChannelIDAux3 = ChannelID(C.SoundIoChannelIdAux3)
ChannelIDAux4 = ChannelID(C.SoundIoChannelIdAux4)
ChannelIDAux5 = ChannelID(C.SoundIoChannelIdAux5)
ChannelIDAux6 = ChannelID(C.SoundIoChannelIdAux6)
ChannelIDAux7 = ChannelID(C.SoundIoChannelIdAux7)
ChannelIDAux8 = ChannelID(C.SoundIoChannelIdAux8)
ChannelIDAux9 = ChannelID(C.SoundIoChannelIdAux9)
ChannelIDAux10 = ChannelID(C.SoundIoChannelIdAux10)
ChannelIDAux11 = ChannelID(C.SoundIoChannelIdAux11)
ChannelIDAux12 = ChannelID(C.SoundIoChannelIdAux12)
ChannelIDAux13 = ChannelID(C.SoundIoChannelIdAux13)
ChannelIDAux14 = ChannelID(C.SoundIoChannelIdAux14)
ChannelIDAux15 = ChannelID(C.SoundIoChannelIdAux15)
)
func (c ChannelID) String() string {
return C.GoString(C.soundio_get_channel_name(uint32(c)))
}
// functions
// ParseChannelID returns ChannelID from string.
func ParseChannelID(str string) ChannelID {
cstr := C.CString(str)
defer C.free(unsafe.Pointer(cstr))
return ChannelID(uint32(C.soundio_parse_channel_id(cstr, C.int(len(str)))))
}