ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/include/audio_defs.h
Revision: 1.4
Committed: 2000-07-22T16:07:22Z (24 years, 2 months ago) by cebix
Content type: text/plain
Branch: MAIN
Changes since 1.3: +18 -17 lines
Log Message:
- new FOURCC() macro in macos_util.h

File Contents

# User Rev Content
1 cebix 1.1 /*
2     * audio_defs.h - Definitions for MacOS audio components
3     *
4 cebix 1.3 * Basilisk II (C) 1997-2000 Christian Bauer
5 cebix 1.1 *
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 cebix 1.4 #include "macos_util.h"
25    
26    
27 cebix 1.1 // 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 cebix 1.4 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 cebix 1.1
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     };
99    
100     // Component feature flags
101     enum {
102     k8BitRawIn = (1 << 0),
103     k8BitTwosIn = (1 << 1),
104     k16BitIn = (1 << 2),
105     kStereoIn = (1 << 3),
106     k8BitRawOut = (1 << 8),
107     k8BitTwosOut = (1 << 9),
108     k16BitOut = (1 << 10),
109     kStereoOut = (1 << 11),
110     kReverse = (1L << 16),
111     kRateConvert = (1L << 17),
112     kCreateSoundSource = (1L << 18),
113     kHighQuality = (1L << 22),
114     kNonRealTime = (1L << 23),
115     cmpWantsRegisterMessage = (1L << 31)
116     };
117    
118     enum { // ComponentParameters struct
119     cp_flags = 0, // call modifiers: sync/async, deferred, immed, etc
120     cp_paramSize = 1, // size in bytes of actual parameters passed to this call
121     cp_what = 2, // routine selector, negative for Component management calls
122     cp_params = 4 // actual parameters for the indicated routine
123     };
124    
125     enum { // SoundComponentData struct
126     scd_flags = 0,
127     scd_format = 4,
128     scd_numChannels = 8,
129     scd_sampleSize = 10,
130     scd_sampleRate = 12,
131     scd_sampleCount = 16,
132     scd_buffer = 20,
133     scd_reserved = 24,
134     SIZEOF_scd = 28
135     };
136    
137     enum { // SoundInfoList struct
138     sil_count = 0,
139     sil_infoHandle = 2
140     };
141    
142     #endif