ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/include/audio_defs.h
Revision: 1.1
Committed: 1999-10-03T14:16:26Z (25 years, 1 month ago) by cebix
Content type: text/plain
Branch: MAIN
Branch point for: cebix
Log Message:
Initial revision

File Contents

# Content
1 /*
2 * audio_defs.h - Definitions for MacOS audio components
3 *
4 * Basilisk II (C) 1997-1999 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 // Error codes
25 enum {
26 badComponentSelector = (int32)0x80008002,
27 noHardwareErr = -200,
28 badChannel = -205,
29 siInvalidSampleRate = -225,
30 siInvalidSampleSize = -226,
31 siDeviceBusyErr = -227
32 };
33
34 // General component dispatch selector codes
35 enum {
36 kComponentOpenSelect = -1,
37 kComponentCloseSelect = -2,
38 kComponentCanDoSelect = -3,
39 kComponentVersionSelect = -4,
40 kComponentRegisterSelect = -5
41 };
42
43 // Sound component dispatch selector codes
44 enum {
45 kSoundComponentInitOutputDeviceSelect = 1,
46 kSoundComponentSetSourceSelect = 2,
47 kSoundComponentGetSourceSelect = 3,
48 kSoundComponentGetSourceDataSelect = 4,
49 kSoundComponentSetOutputSelect = 5,
50 kDelegatedSoundComponentSelectors = 0x0100,
51 kSoundComponentAddSourceSelect = kDelegatedSoundComponentSelectors + 1,
52 kSoundComponentRemoveSourceSelect = kDelegatedSoundComponentSelectors + 2,
53 kSoundComponentGetInfoSelect = kDelegatedSoundComponentSelectors + 3,
54 kSoundComponentSetInfoSelect = kDelegatedSoundComponentSelectors + 4,
55 kSoundComponentStartSourceSelect = kDelegatedSoundComponentSelectors + 5,
56 kSoundComponentStopSourceSelect = kDelegatedSoundComponentSelectors + 6,
57 kSoundComponentPauseSourceSelect = kDelegatedSoundComponentSelectors + 7,
58 kSoundComponentPlaySourceBufferSelect = kDelegatedSoundComponentSelectors + 8
59 };
60
61 // Sound information selectors
62 enum {
63 siSampleRate = 'srat', // current sample rate
64 siSampleRateAvailable = 'srav', // sample rates available
65 siSampleSize = 'ssiz', // current sample size
66 siSampleSizeAvailable = 'ssav', // sample sizes available
67 siNumberChannels = 'chan', // current number of channels
68 siChannelAvailable = 'chav', // number of channels available
69 siSpeakerMute = 'smut', // mute state of all built-in speaker
70 siSpeakerVolume = 'svol', // volume level of built-in speaker
71 siHardwareMute = 'hmut', // mute state of all hardware
72 siHardwareVolume = 'hvol', // volume level of all hardware
73 siHardwareVolumeSteps = 'hstp', // number of volume steps for hardware
74 siHardwareBusy = 'hwbs' // sound hardware is in use
75 };
76
77 enum { // ComponentResource struct
78 componentType = 0,
79 componentSubType = 4,
80 componentManufacturer = 8,
81 componentFlags = 12,
82 componentFlagsMask = 16,
83 componentResType = 20,
84 componentResID = 24,
85 componentNameType = 26,
86 componentNameID = 30,
87 componentInfoType = 32,
88 componentInfoID = 36,
89 componentIconType = 38,
90 componentIconID = 42,
91 componentVersion = 44,
92 componentRegisterFlags = 48,
93 componentIconFamily = 52
94 };
95
96 // Component feature flags
97 enum {
98 k8BitRawIn = (1 << 0),
99 k8BitTwosIn = (1 << 1),
100 k16BitIn = (1 << 2),
101 kStereoIn = (1 << 3),
102 k8BitRawOut = (1 << 8),
103 k8BitTwosOut = (1 << 9),
104 k16BitOut = (1 << 10),
105 kStereoOut = (1 << 11),
106 kReverse = (1L << 16),
107 kRateConvert = (1L << 17),
108 kCreateSoundSource = (1L << 18),
109 kHighQuality = (1L << 22),
110 kNonRealTime = (1L << 23),
111 cmpWantsRegisterMessage = (1L << 31)
112 };
113
114 enum { // ComponentParameters struct
115 cp_flags = 0, // call modifiers: sync/async, deferred, immed, etc
116 cp_paramSize = 1, // size in bytes of actual parameters passed to this call
117 cp_what = 2, // routine selector, negative for Component management calls
118 cp_params = 4 // actual parameters for the indicated routine
119 };
120
121 enum { // SoundComponentData struct
122 scd_flags = 0,
123 scd_format = 4,
124 scd_numChannels = 8,
125 scd_sampleSize = 10,
126 scd_sampleRate = 12,
127 scd_sampleCount = 16,
128 scd_buffer = 20,
129 scd_reserved = 24,
130 SIZEOF_scd = 28
131 };
132
133 enum { // SoundInfoList struct
134 sil_count = 0,
135 sil_infoHandle = 2
136 };
137
138 #endif