ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/include/audio_defs.h
Revision: 1.5
Committed: 2000-07-25T15:19:42Z (23 years, 11 months ago) by cebix
Content type: text/plain
Branch: MAIN
Changes since 1.4: +6 -1 lines
Log Message:
- more cleanups
- splitted prefs.cpp into prefs.cpp and prefs_items.cpp to make prefs.cpp
  reusable for other projects

File Contents

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