aboutsummaryrefslogtreecommitdiff
path: root/externals/gridflow/devices4ruby/SoundPCM.rb
blob: d1b971596dfc0ef9be51207dc1522641bf803d62 (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
# $Id: SoundPCM.rb,v 1.1 2005-10-04 02:02:14 matju Exp $
require "linux/ioctl"

module Linux

module SoundPCM
	extend IoctlClass

	# SNDCTL Kernel Procedure Numbers

	SEQ_RESET         = 0x00005100
	SEQ_SYNC          = 0x00005101
	SEQ_CTRLRATE      = 0xc0045103
	SEQ_GETOUTCOUNT   = 0x80045104
	SEQ_GETINCOUNT    = 0x80045105
	SEQ_PERCMODE      = 0x40045106
	SEQ_TESTMIDI      = 0x40045108
	SEQ_RESETSAMPLES  = 0x40045109
	SEQ_NRSYNTHS      = 0x8004510a
	SEQ_NRMIDIS       = 0x8004510b
	SEQ_THRESHOLD     = 0x4004510d
	SEQ_PANIC         = 0x00005111
	SEQ_OUTOFBAND     = 0x40085112
	SEQ_GETTIME       = 0x80045113

	SYNTH_INFO        = 0xc08c5102
	SYNTH_MEMAVL      = 0xc004510e
	SYNTH_ID          = 0xc08c5114
	SYNTH_CONTROL     = 0xcfa45115
	SYNTH_REMOVESAMPLE = 0xc00c5116

	FM_LOAD_INSTR     = 0x40285107
	FM_4OP_ENABLE     = 0x4004510f

	TMR_TIMEBASE      = 0xc0045401
	TMR_START         = 0x00005402
	TMR_STOP          = 0x00005403
	TMR_CONTINUE      = 0x00005404
	TMR_TEMPO         = 0xc0045405
	TMR_SOURCE        = 0xc0045406
	TMR_METRONOME     = 0x40045407
	TMR_SELECT        = 0x40045408

	MIDI_INFO         = 0xc074510c
	MIDI_PRETIME      = 0xc0046d00
	MIDI_MPUMODE      = 0xc0046d01
	MIDI_MPUCMD       = 0xc0216d02

	# DSP_* names are obsolete ?
	DSP_STEREO        = 0xc0045003
	DSP_GETBLKSIZE    = 0xc0045004
	DSP_SETDUPLEX     = 0x00005016
	DSP_GETODELAY     = 0x80045017
	DSP_PROFILE       = 0x40045017

	# what is this?
	COPR_RESET        = 0x00004300
	COPR_LOAD         = 0xcfb04301
	COPR_RDATA        = 0xc0144302
	COPR_RCODE        = 0xc0144303
	COPR_WDATA        = 0x40144304
	COPR_WCODE        = 0x40144305
	COPR_RUN          = 0xc0144306
	COPR_HALT         = 0xc0144307
	COPR_SENDMSG      = 0xcfa44308
	COPR_RCVMSG       = 0x8fa44309

	# SOUND_PCM Kernel Procedure Numbers

	PCM_READ_BITS     , PCM_WRITE_BITS     = 0x80045005, 0xc0045005
	PCM_READ_CHANNELS , PCM_WRITE_CHANNELS = 0x80045006, 0xc0045006
	PCM_READ_FILTER   , PCM_WRITE_FILTER   = 0x80045007, 0xc0045007
	PCM_READ_RATE     , PCM_WRITE_RATE     = 0x80045002, 0xc0045002

	PCM_RESET          = 0x00005000
	PCM_SYNC           = 0x00005001
	PCM_POST           = 0x00005008
	PCM_SUBDIVIDE      = 0xc0045009
	PCM_SETFRAGMENT    = 0xc004500a
	PCM_GETFMTS        = 0x8004500b
	PCM_SETFMT         = 0xc0045005
	PCM_GETOSPACE      = 0x8010500c
	PCM_GETISPACE      = 0x8010500d
	PCM_NONBLOCK       = 0x0000500e
	PCM_GETCAPS        = 0x8004500f
	PCM_GETTRIGGER    , PCM_SETTRIGGER     = 0x80045010, 0x40045010
	PCM_SETSYNCRO      = 0x00005015
	PCM_GETIPTR        = 0x800c5011
	PCM_GETOPTR        = 0x800c5012
	PCM_MAPINBUF       = 0x80085013
	PCM_MAPOUTBUF      = 0x80085014

	ioctl_accessor :bits    , :PCM_READ_BITS    , :PCM_WRITE_BITS
	ioctl_accessor :channels, :PCM_READ_CHANNELS, :PCM_WRITE_CHANNELS
	ioctl_accessor :filter  , :PCM_READ_FILTER  , :PCM_WRITE_FILTER
	ioctl_accessor :rate    , :PCM_READ_RATE    , :PCM_WRITE_RATE
end

# backward compatibility
SoundDSP = SoundPCM

end # Linux