1 |
/* |
2 |
* audio_defs.h - Definitions for MacOS audio components |
3 |
* |
4 |
* Basilisk II (C) 1997-2005 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 |
const uint32 siHardwareFormat = FOURCC('h','w','f','m'); |
83 |
|
84 |
enum { // ComponentResource struct |
85 |
componentType = 0, |
86 |
componentSubType = 4, |
87 |
componentManufacturer = 8, |
88 |
componentFlags = 12, |
89 |
componentFlagsMask = 16, |
90 |
componentResType = 20, |
91 |
componentResID = 24, |
92 |
componentNameType = 26, |
93 |
componentNameID = 30, |
94 |
componentInfoType = 32, |
95 |
componentInfoID = 36, |
96 |
componentIconType = 38, |
97 |
componentIconID = 42, |
98 |
componentVersion = 44, |
99 |
componentRegisterFlags = 48, |
100 |
componentIconFamily = 52, |
101 |
componentPFCount = 54, |
102 |
componentPFFlags = 58, |
103 |
componentPFResType = 62, |
104 |
componentPFResID = 66, |
105 |
componentPFPlatform = 68 |
106 |
}; |
107 |
|
108 |
// Component feature flags |
109 |
enum { |
110 |
k8BitRawIn = (1 << 0), |
111 |
k8BitTwosIn = (1 << 1), |
112 |
k16BitIn = (1 << 2), |
113 |
kStereoIn = (1 << 3), |
114 |
k8BitRawOut = (1 << 8), |
115 |
k8BitTwosOut = (1 << 9), |
116 |
k16BitOut = (1 << 10), |
117 |
kStereoOut = (1 << 11), |
118 |
kReverse = (1L << 16), |
119 |
kRateConvert = (1L << 17), |
120 |
kCreateSoundSource = (1L << 18), |
121 |
kHighQuality = (1L << 22), |
122 |
kNonRealTime = (1L << 23), |
123 |
cmpWantsRegisterMessage = (1L << 31) |
124 |
}; |
125 |
|
126 |
enum { // ComponentParameters struct |
127 |
cp_flags = 0, // call modifiers: sync/async, deferred, immed, etc |
128 |
cp_paramSize = 1, // size in bytes of actual parameters passed to this call |
129 |
cp_what = 2, // routine selector, negative for Component management calls |
130 |
cp_params = 4 // actual parameters for the indicated routine |
131 |
}; |
132 |
|
133 |
enum { // SoundComponentData struct |
134 |
scd_flags = 0, |
135 |
scd_format = 4, |
136 |
scd_numChannels = 8, |
137 |
scd_sampleSize = 10, |
138 |
scd_sampleRate = 12, |
139 |
scd_sampleCount = 16, |
140 |
scd_buffer = 20, |
141 |
scd_reserved = 24, |
142 |
SIZEOF_scd = 28 |
143 |
}; |
144 |
|
145 |
enum { // SoundInfoList struct |
146 |
sil_count = 0, |
147 |
sil_infoHandle = 2 |
148 |
}; |
149 |
|
150 |
#endif |