1 |
/* |
2 |
* audio_defs.h - Definitions for MacOS audio components |
3 |
* |
4 |
* Basilisk II (C) 1997-2001 Christian Bauer |
5 |
* |
6 |
* This program is free software; you can redistribute it and/or modify |
7 |
* it under the terms of the GNU General Public License as published by |
8 |
* the Free Software Foundation; either version 2 of the License, or |
9 |
* (at your option) any later version. |
10 |
* |
11 |
* This program is distributed in the hope that it will be useful, |
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
* GNU General Public License for more details. |
15 |
* |
16 |
* You should have received a copy of the GNU General Public License |
17 |
* along with this program; if not, write to the Free Software |
18 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 |
*/ |
20 |
|
21 |
#ifndef AUDIO_DEFS_H |
22 |
#define AUDIO_DEFS_H |
23 |
|
24 |
#include "macos_util.h" |
25 |
|
26 |
|
27 |
// Error codes |
28 |
enum { |
29 |
badComponentSelector = (int32)0x80008002, |
30 |
noHardwareErr = -200, |
31 |
badChannel = -205, |
32 |
siInvalidSampleRate = -225, |
33 |
siInvalidSampleSize = -226, |
34 |
siDeviceBusyErr = -227 |
35 |
}; |
36 |
|
37 |
// General component dispatch selector codes |
38 |
enum { |
39 |
kComponentOpenSelect = -1, |
40 |
kComponentCloseSelect = -2, |
41 |
kComponentCanDoSelect = -3, |
42 |
kComponentVersionSelect = -4, |
43 |
kComponentRegisterSelect = -5 |
44 |
}; |
45 |
|
46 |
// Sound component dispatch selector codes |
47 |
enum { |
48 |
kSoundComponentInitOutputDeviceSelect = 1, |
49 |
kSoundComponentSetSourceSelect = 2, |
50 |
kSoundComponentGetSourceSelect = 3, |
51 |
kSoundComponentGetSourceDataSelect = 4, |
52 |
kSoundComponentSetOutputSelect = 5, |
53 |
kDelegatedSoundComponentSelectors = 0x0100, |
54 |
kSoundComponentAddSourceSelect = kDelegatedSoundComponentSelectors + 1, |
55 |
kSoundComponentRemoveSourceSelect = kDelegatedSoundComponentSelectors + 2, |
56 |
kSoundComponentGetInfoSelect = kDelegatedSoundComponentSelectors + 3, |
57 |
kSoundComponentSetInfoSelect = kDelegatedSoundComponentSelectors + 4, |
58 |
kSoundComponentStartSourceSelect = kDelegatedSoundComponentSelectors + 5, |
59 |
kSoundComponentStopSourceSelect = kDelegatedSoundComponentSelectors + 6, |
60 |
kSoundComponentPauseSourceSelect = kDelegatedSoundComponentSelectors + 7, |
61 |
kSoundComponentPlaySourceBufferSelect = kDelegatedSoundComponentSelectors + 8 |
62 |
}; |
63 |
|
64 |
// Sound information selectors |
65 |
const uint32 siNumberChannels = FOURCC('c','h','a','n'); // current number of channels |
66 |
const uint32 siChannelAvailable = FOURCC('c','h','a','v'); // number of channels available |
67 |
const uint32 siSampleRate = FOURCC('s','r','a','t'); // current sample rate |
68 |
const uint32 siSampleRateAvailable = FOURCC('s','r','a','v'); // sample rates available |
69 |
const uint32 siSampleSize = FOURCC('s','s','i','z'); // current sample size |
70 |
const uint32 siSampleSizeAvailable = FOURCC('s','s','a','v'); // sample sizes available |
71 |
const uint32 siHardwareMute = FOURCC('h','m','u','t'); // mute state of all hardware |
72 |
const uint32 siHardwareVolume = FOURCC('h','v','o','l'); // volume level of all hardware |
73 |
const uint32 siHardwareVolumeSteps = FOURCC('h','s','t','p'); // number of volume steps for hardware |
74 |
const uint32 siHardwareBusy = FOURCC('h','w','b','s'); // sound hardware is in use |
75 |
const uint32 siHeadphoneMute = FOURCC('p','m','u','t'); // mute state of headphone |
76 |
const uint32 siHeadphoneVolume = FOURCC('p','v','o','l'); // volume level of headphone |
77 |
const uint32 siHeadphoneVolumeSteps = FOURCC('h','d','s','t'); // number of volume steps for headphone |
78 |
const uint32 siSpeakerMute = FOURCC('s','m','u','t'); // mute state of all built-in speakers |
79 |
const uint32 siSpeakerVolume = FOURCC('s','v','o','l'); // volume level of built-in speaker |
80 |
const uint32 siDeviceName = FOURCC('n','a','m','e'); |
81 |
const uint32 siDeviceIcon = FOURCC('i','c','o','n'); |
82 |
|
83 |
enum { // ComponentResource struct |
84 |
componentType = 0, |
85 |
componentSubType = 4, |
86 |
componentManufacturer = 8, |
87 |
componentFlags = 12, |
88 |
componentFlagsMask = 16, |
89 |
componentResType = 20, |
90 |
componentResID = 24, |
91 |
componentNameType = 26, |
92 |
componentNameID = 30, |
93 |
componentInfoType = 32, |
94 |
componentInfoID = 36, |
95 |
componentIconType = 38, |
96 |
componentIconID = 42, |
97 |
componentVersion = 44, |
98 |
componentRegisterFlags = 48, |
99 |
componentIconFamily = 52, |
100 |
componentPFCount = 54, |
101 |
componentPFFlags = 58, |
102 |
componentPFResType = 62, |
103 |
componentPFResID = 66, |
104 |
componentPFPlatform = 68 |
105 |
}; |
106 |
|
107 |
// Component feature flags |
108 |
enum { |
109 |
k8BitRawIn = (1 << 0), |
110 |
k8BitTwosIn = (1 << 1), |
111 |
k16BitIn = (1 << 2), |
112 |
kStereoIn = (1 << 3), |
113 |
k8BitRawOut = (1 << 8), |
114 |
k8BitTwosOut = (1 << 9), |
115 |
k16BitOut = (1 << 10), |
116 |
kStereoOut = (1 << 11), |
117 |
kReverse = (1L << 16), |
118 |
kRateConvert = (1L << 17), |
119 |
kCreateSoundSource = (1L << 18), |
120 |
kHighQuality = (1L << 22), |
121 |
kNonRealTime = (1L << 23), |
122 |
cmpWantsRegisterMessage = (1L << 31) |
123 |
}; |
124 |
|
125 |
enum { // ComponentParameters struct |
126 |
cp_flags = 0, // call modifiers: sync/async, deferred, immed, etc |
127 |
cp_paramSize = 1, // size in bytes of actual parameters passed to this call |
128 |
cp_what = 2, // routine selector, negative for Component management calls |
129 |
cp_params = 4 // actual parameters for the indicated routine |
130 |
}; |
131 |
|
132 |
enum { // SoundComponentData struct |
133 |
scd_flags = 0, |
134 |
scd_format = 4, |
135 |
scd_numChannels = 8, |
136 |
scd_sampleSize = 10, |
137 |
scd_sampleRate = 12, |
138 |
scd_sampleCount = 16, |
139 |
scd_buffer = 20, |
140 |
scd_reserved = 24, |
141 |
SIZEOF_scd = 28 |
142 |
}; |
143 |
|
144 |
enum { // SoundInfoList struct |
145 |
sil_count = 0, |
146 |
sil_infoHandle = 2 |
147 |
}; |
148 |
|
149 |
#endif |