aboutsummaryrefslogtreecommitdiff
path: root/externals/gridflow/devices4ruby/SoundMixer.rb
blob: 0ae50b6057e2984d1f14664198843f78e9215600 (plain)
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
require "linux/ioctl"

module Linux; module SoundMixer
	extend IoctlClass

	MIXER_NRDEVICES    = 0x00000019
	MIXER_VOLUME       = 0x00000000
	MIXER_BASS         = 0x00000001
	MIXER_TREBLE       = 0x00000002
	MIXER_SYNTH        = 0x00000003
	MIXER_PCM          = 0x00000004
	MIXER_SPEAKER      = 0x00000005
	MIXER_LINE         = 0x00000006
	MIXER_MIC          = 0x00000007
	MIXER_CD           = 0x00000008
	MIXER_IMIX         = 0x00000009
	MIXER_ALTPCM       = 0x0000000a
	MIXER_RECLEV       = 0x0000000b
	MIXER_IGAIN        = 0x0000000c
	MIXER_OGAIN        = 0x0000000d
	MIXER_LINE1        = 0x0000000e
	MIXER_LINE2        = 0x0000000f
	MIXER_LINE3        = 0x00000010
	MIXER_DIGITAL1     = 0x00000011
	MIXER_DIGITAL2     = 0x00000012
	MIXER_DIGITAL3     = 0x00000013
	MIXER_PHONEIN      = 0x00000014
	MIXER_PHONEOUT     = 0x00000015
	MIXER_VIDEO        = 0x00000016
	MIXER_RADIO        = 0x00000017
	MIXER_MONITOR      = 0x00000018
	ONOFF_MIN          = 0x0000001c
	ONOFF_MAX          = 0x0000001e
	MIXER_NONE         = 0x0000001f
	MIXER_ENHANCE      = 0x0000001f
	MIXER_MUTE         = 0x0000001f
	MIXER_LOUD         = 0x0000001f
	MIXER_RECSRC       = 0x000000ff
	MIXER_DEVMASK      = 0x000000fe
	MIXER_RECMASK      = 0x000000fd
	MIXER_CAPS         = 0x000000fc
	MIXER_STEREODEVS   = 0x000000fb
	MIXER_OUTSRC       = 0x000000fa
	MIXER_OUTMASK      = 0x000000f9
	MASK_VOLUME        = 0x00000001
	MASK_BASS          = 0x00000002
	MASK_TREBLE        = 0x00000004
	MASK_SYNTH         = 0x00000008
	MASK_PCM           = 0x00000010
	MASK_SPEAKER       = 0x00000020
	MASK_LINE          = 0x00000040
	MASK_MIC           = 0x00000080
	MASK_CD            = 0x00000100
	MASK_IMIX          = 0x00000200
	MASK_ALTPCM        = 0x00000400
	MASK_RECLEV        = 0x00000800
	MASK_IGAIN         = 0x00001000
	MASK_OGAIN         = 0x00002000
	MASK_LINE1         = 0x00004000
	MASK_LINE2         = 0x00008000
	MASK_LINE3         = 0x00010000
	MASK_DIGITAL1      = 0x00020000
	MASK_DIGITAL2      = 0x00040000
	MASK_DIGITAL3      = 0x00080000
	MASK_PHONEIN       = 0x00100000
	MASK_PHONEOUT      = 0x00200000
	MASK_RADIO         = 0x00800000
	MASK_VIDEO         = 0x00400000
	MASK_MONITOR       = 0x01000000
	MASK_MUTE          = 0x80000000
	MASK_ENHANCE       = 0x80000000
	MASK_LOUD          = 0x80000000
	MIXER_READ_VOLUME  = 0x80044d00
	MIXER_READ_BASS    = 0x80044d01
	MIXER_READ_TREBLE  = 0x80044d02
	MIXER_READ_SYNTH   = 0x80044d03
	MIXER_READ_PCM     = 0x80044d04
	MIXER_READ_SPEAKER = 0x80044d05
	MIXER_READ_LINE    = 0x80044d06
	MIXER_READ_MIC     = 0x80044d07
	MIXER_READ_CD      = 0x80044d08
	MIXER_READ_IMIX    = 0x80044d09
	MIXER_READ_ALTPCM  = 0x80044d0a
	MIXER_READ_RECLEV  = 0x80044d0b
	MIXER_READ_IGAIN   = 0x80044d0c
	MIXER_READ_OGAIN   = 0x80044d0d
	MIXER_READ_LINE1   = 0x80044d0e
	MIXER_READ_LINE2   = 0x80044d0f
	MIXER_READ_LINE3   = 0x80044d10
	MIXER_READ_MUTE    = 0x80044d1f
	MIXER_READ_ENHANCE = 0x80044d1f
	MIXER_READ_LOUD    = 0x80044d1f
	MIXER_READ_RECSRC  = 0x80044dff
	MIXER_READ_DEVMASK = 0x80044dfe
	MIXER_READ_RECMASK = 0x80044dfd
	MIXER_READ_STEREODEVS = 0x80044dfb
	MIXER_READ_CAPS    = 0x80044dfc
	MIXER_WRITE_VOLUME = 0xc0044d00
	MIXER_WRITE_BASS   = 0xc0044d01
	MIXER_WRITE_TREBLE = 0xc0044d02
	MIXER_WRITE_SYNTH  = 0xc0044d03
	MIXER_WRITE_PCM    = 0xc0044d04
	MIXER_WRITE_SPEAKER = 0xc0044d05
	MIXER_WRITE_LINE   = 0xc0044d06
	MIXER_WRITE_MIC    = 0xc0044d07
	MIXER_WRITE_CD     = 0xc0044d08
	MIXER_WRITE_IMIX   = 0xc0044d09
	MIXER_WRITE_ALTPCM = 0xc0044d0a
	MIXER_WRITE_RECLEV = 0xc0044d0b
	MIXER_WRITE_IGAIN  = 0xc0044d0c
	MIXER_WRITE_OGAIN  = 0xc0044d0d
	MIXER_WRITE_LINE1  = 0xc0044d0e
	MIXER_WRITE_LINE2  = 0xc0044d0f
	MIXER_WRITE_LINE3  = 0xc0044d10
	MIXER_WRITE_MUTE   = 0xc0044d1f
	MIXER_WRITE_ENHANCE = 0xc0044d1f
	MIXER_WRITE_LOUD   = 0xc0044d1f
	MIXER_WRITE_RECSRC = 0xc0044dff
	MIXER_INFO         = 0x805c4d65
	MIXER_ACCESS       = 0xc0804d66
	MIXER_AGC          = 0xc0044d67
	MIXER_3DSE         = 0xc0044d68
	MIXER_PRIVATE1     = 0xc0044d6f
	MIXER_PRIVATE2     = 0xc0044d70
	MIXER_PRIVATE3     = 0xc0044d71
	MIXER_PRIVATE4     = 0xc0044d72
	MIXER_PRIVATE5     = 0xc0044d73
	MIXER_GETLEVELS    = 0xc0a44d74
	MIXER_SETLEVELS    = 0xc0a44d75

	DEVICE_LABELS = [
		"Vol ", "Bass ", "Trebl", "Synth", "Pcm ",
		"Spkr ","Line ", "Mic ",  "CD ",   "Mix ",
		"Pcm2 ","Rec ",  "IGain", "OGain",
		"Line1", "Line2", "Line3", "Digital1", "Digital2", "Digital3",
		"PhoneIn", "PhoneOut", "Video", "Radio", "Monitor"
	]

	DEVICE_NAMES = [
		"vol", "bass", "treble", "synth", "pcm", "speaker", "line",
		"mic", "cd", "mix", "pcm2", "rec", "igain", "ogain",
		"line1", "line2", "line3", "dig1", "dig2", "dig3",
		"phin", "phout", "video", "radio", "monitor"
	]

	DEVICE_NAMES.each_with_index {|name,i|
		ioctl_accessor name,
			MIXER_READ_VOLUME+i,
			MIXER_WRITE_VOLUME+i
	}

end end